/* ==========================================================================
   Northearts — policy pages (Privacy, Terms, Community Guidelines)
   Built on the tokens in styles.css. Calm, readable, long-form.
   ========================================================================== */

.legal-page { background: var(--cream); }

/* ---------- Hero band ---------- */
.doc-hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 0;
  color: #fff;
  background:
    radial-gradient(900px 420px at 85% 0%, rgba(140, 43, 78, .55), transparent 65%),
    radial-gradient(600px 320px at 0% 100%, rgba(242, 133, 109, .14), transparent 60%),
    linear-gradient(180deg, var(--plum-950), var(--plum-900));
  isolation: isolate;
}
.doc-hero::after {
  /* the band ends in a soft cream curve the summary card sits on */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; z-index: -1;
  background: var(--cream);
  border-radius: 48px 48px 0 0;
}

.doc-tabs {
  display: flex; width: max-content; max-width: 100%; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 40px;
  border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.doc-tabs a {
  padding: 9px 16px; border-radius: 99px;
  font-size: .88rem; font-weight: 600; color: rgba(255, 255, 255, .68);
  transition: color .25s, background-color .25s;
}
.doc-tabs a:hover { color: #fff; }
.doc-tabs a[aria-current="page"] { background: #fff; color: var(--plum-900); }

.doc-hero__title {
  font-family: var(--f-display);
  font-size: clamp(2.8rem, 1.4rem + 5vw, 5.6rem);
  line-height: .98; letter-spacing: -.045em; font-weight: 700;
  text-wrap: balance;
}
.doc-hero__title em { color: var(--rose); }
.doc-hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px;
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .02em; color: rgba(255, 240, 244, .62);
}
.doc-hero__meta span + span::before { content: "·"; margin-right: 22px; opacity: .5; }

.doc-short {
  position: relative;
  margin-top: 48px;
  padding: 26px 30px 28px;
  border-radius: var(--r-xl);
  background: #fff;
  color: var(--charcoal);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(22, 9, 16, .45);
  display: grid; grid-template-columns: 170px 1fr; gap: 24px; align-items: start;
}
.doc-short__label {
  font-family: var(--f-serif); font-style: italic; font-size: 1.6rem; line-height: 1.1; color: var(--wine);
}
.doc-short ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.doc-short li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: .96rem; font-weight: 550; line-height: 1.5; }
.doc-short svg {
  width: 24px; height: 24px; padding: 4px; border-radius: 50%;
  color: #fff; background: var(--wine);
}

/* ---------- Layout ---------- */
.doc-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  padding: 72px 0 clamp(96px, 10vw, 140px);
}

/* ---------- Table of contents ---------- */
.toc { position: sticky; top: 100px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; scrollbar-width: thin; }
.toc__box summary {
  list-style: none; cursor: default;
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.toc__box summary::-webkit-details-marker { display: none; }
.toc ol { display: grid; }
.toc a {
  position: relative;
  display: grid; grid-template-columns: 28px 1fr; gap: 6px;
  padding: 7px 0 7px 12px;
  font-size: .88rem; line-height: 1.4; color: var(--ink-2);
  border-left: 2px solid transparent;
  transition: color .2s, border-color .2s, background-color .2s;
}
.toc a span { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); padding-top: 2px; }
.toc a:hover { color: var(--charcoal); }
.toc a.is-active { color: var(--wine); font-weight: 650; border-left-color: var(--coral); }
.toc a.is-active span { color: var(--coral-deep); }
.toc__progress { height: 3px; margin-top: 18px; border-radius: 3px; background: var(--line); overflow: hidden; }
.toc__progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--coral), var(--wine)); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* ---------- Document body ---------- */
.doc { max-width: 720px; font-size: 1.04rem; line-height: 1.75; color: var(--ink-2); }
.doc a:not(.btn):not(.link) { color: var(--wine); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc a:not(.btn):not(.link):hover { color: var(--coral-deep); }
.doc strong { color: var(--charcoal); font-weight: 700; }
.doc em { font-style: italic; }
.doc-intro { font-family: var(--f-display); font-size: clamp(1.3rem, 1.1rem + .7vw, 1.65rem); line-height: 1.4; letter-spacing: -.015em; color: var(--charcoal); margin-bottom: 12px; }

.doc-sec { position: relative; padding: 44px 0 8px; scroll-margin-top: 100px; }
.doc-sec + .doc-sec { border-top: 1px solid var(--line); }
.doc > .callout + .doc-sec, .doc > .doc-intro + .doc-sec { margin-top: 24px; }
.doc-sec__num { display: block; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .06em; color: var(--coral-deep); margin-bottom: 8px; }
.doc-sec h2 { font-family: var(--f-display); font-size: clamp(1.5rem, 1.25rem + .8vw, 1.95rem); line-height: 1.15; letter-spacing: -.03em; color: var(--charcoal); margin-bottom: 16px; font-weight: 700; }
.doc-sec h3 { font-family: var(--f-body); font-size: 1.02rem; font-weight: 700; color: var(--charcoal); margin: 28px 0 8px; }
.doc-sec p + p, .doc-sec ul + p, .doc-sec p + ul, .doc-sec .callout + p, .doc-sec ul + .callout, .doc-sec p + .callout, .doc-sec .callout + ul { margin-top: 14px; }

.doc-sec ul li { position: relative; padding-left: 22px; }
.doc-sec ul li + li { margin-top: 8px; }
.doc-sec ul li::before {
  content: ""; position: absolute; left: 4px; top: .72em; width: 6px; height: 6px; border-radius: 50%;
  background: var(--coral);
}
.steps-list { counter-reset: step; display: grid; gap: 10px; margin-top: 14px; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps-list li::before {
  content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-mono); font-size: .78rem; color: var(--wine); background: var(--rose-soft); margin-top: 1px;
}

/* ---------- Callouts ---------- */
.callout { padding: 20px 22px; border-radius: 18px; border: 1px solid; font-size: .98rem; }
.callout strong { display: block; margin-bottom: 4px; }
.callout--note { background: rgba(140, 43, 78, .05); border-color: rgba(140, 43, 78, .16); }
.callout--note strong { color: var(--wine); }
.callout--firm { background: #fff; border-color: var(--line); border-left: 4px solid var(--wine); }
.callout--tip { background: var(--sage-soft); border-color: rgba(47, 107, 90, .2); color: #2c3d37; }
.callout--tip strong { color: var(--sage); }
.callout--critical { background: var(--slate); border-color: var(--slate); color: rgba(255, 255, 255, .82); }
.callout--critical strong { color: #fff; font-size: 1.05rem; }

/* Sent / never sent comparison */
.sent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.sent-grid__col { padding: 18px 18px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: .95rem; }
.sent-grid__col--never { background: transparent; border-style: dashed; }
.sent-grid__label { display: block; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wine); margin-bottom: 10px; }
.sent-grid__col--never .sent-grid__label { color: var(--muted); }
.sent-grid__col--never li::before { background: var(--muted) !important; }

.doc-closing { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); font-family: var(--f-serif); font-size: 1.3rem; line-height: 1.5; color: var(--plum-800); }
.doc-fineprint { margin-top: 18px; font-size: .88rem; color: var(--muted); }

.doc-end {
  margin-top: 56px; padding: 30px; border-radius: var(--r-lg);
  background: var(--cream-2); border: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
}
.doc-end p { flex: 1 1 100%; font-family: var(--f-display); font-size: 1.25rem; letter-spacing: -.02em; color: var(--charcoal); }
.doc-end .link { border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .doc-short { grid-template-columns: 1fr; gap: 16px; }
  .doc-short ul { grid-template-columns: 1fr; gap: 12px; }
  .doc-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 48px; }
  .toc { position: static; max-height: none; overflow: visible; }
  .toc__box { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
  .toc__box summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 0; margin: 0; border: 0; }
  .toc__box summary::after { content: "+"; font-size: 1.1rem; color: var(--wine); }
  .toc__box[open] summary::after { content: "–"; }
  .toc__box[open] summary { padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
  .toc__progress { display: none; }
  .doc { max-width: none; }
}

@media (max-width: 720px) {
  .doc-hero { padding-top: calc(var(--nav-h) + 48px); }
  .doc-hero::after { height: 60px; border-radius: 28px 28px 0 0; }
  .doc-tabs { display: flex; width: 100%; margin-bottom: 28px; }
  .doc-tabs a { flex: 1 1 auto; text-align: center; padding: 9px 10px; font-size: .82rem; }
  .doc-hero__meta span + span::before { margin-right: 12px; }
  .doc-hero__meta { gap: 6px 12px; }
  .doc-short { padding: 22px 20px; margin-top: 36px; }
  .doc { font-size: 1rem; }
  .sent-grid { grid-template-columns: 1fr; }
  .doc-end { padding: 22px; }
  .doc-end .btn { width: 100%; white-space: normal; height: auto; min-height: 48px; padding: 12px 18px; }
}
