/**
 * Gist Policy Pages — prose stylesheet (v3.6 dark-first).
 *
 * Source of truth: README/Plans (vast-frolicking-clock plan).
 *
 * Loaded by policy-shell.ts at /about, /privacy, /tos, after tokens.css and
 * home.css. tokens.css supplies brand fonts. home.css supplies the dark paper
 * cascade, the sticky nav, the quiet footer, and section primitives. This file
 * owns only what's unique to policy pages: the `.prose` content style for the
 * rendered markdown body, the `.policy-hero` framing, and the `.contact-cta`
 * quiet aside above the shared footer.
 *
 * SCOPE INTENT:
 * - Legal/policy markdown emits only: h1-h6, p, ul, li, strong, em, a, inline
 *   code. (Confirmed against src/lib/markdown.ts.) No tables. No blockquotes.
 *   No ordered lists. No pre/code blocks. So this file does not style them.
 * - Reading width is 64ch — comfortable for dense prose.
 * - The "Last Updated: ..." line is the first <p> in every markdown body and
 *   is styled as a quiet mono eyebrow via :first-child.
 */

/* ================================================================
   PAGE FRAME — policy surface inherits the dark paper from home.css.
   These rules add only what the prose body needs.
   ================================================================ */
.policy-body {
  /* main is the centered article wrapper; ensure it can breathe. */
  background: var(--paper);
  color: var(--ink);
}

/* ================================================================
   POLICY HERO — small .sec band with eyebrow + headline + sub.
   ================================================================ */
.policy-hero {
  padding-block: 96px 64px;
  text-align: center;
}
.policy-hero .frame { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.policy-hero .eyebrow { justify-content: center; }
.policy-hero-portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline);
  background: var(--paper-3);
  display: block;
  filter: grayscale(100%);
  opacity: 0.92;
}
.policy-hero .policy-headline {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 72px);
  letter-spacing: -0.038em;
  line-height: 1.02;
  color: var(--ink);
  margin: 0;
  max-width: 22ch;
  text-wrap: balance;
}
.policy-headline .it {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.024em;
}
.policy-hero .policy-sub {
  font-size: 19px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0;
  letter-spacing: -0.005em;
}

/* ================================================================
   PROSE — rendered markdown body.
   Scoped to .prose so it cannot leak into other surfaces.
   ================================================================ */
.policy-article {
  max-width: 64ch;
  margin: 0 auto;
  padding-block: 32px 96px;
  padding-inline: var(--page-x);
}

.prose {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.7;
  font-feature-settings: "ss01", "cv11";
}

.prose h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.028em;
  line-height: 1.1;
  color: var(--ink);
  margin: 56px 0 24px;
  text-wrap: balance;
}
.prose h1 .it,
.prose h1 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.018em;
}
/*
 * H2 separates section beats with the sunrise gradient hairline — the same
 * verb home.css's `.sec::after` uses. The hairline runs the full width of the
 * prose column so the section break is obvious, not a stub easily missed.
 * Size + weight tracks the brand guide `.sub-head` (28px / 600 / -0.02em).
 */
.prose h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin: 64px 0 16px;
  padding-top: 36px;
  position: relative;
}
.prose h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--gradient);
  opacity: 0.78;
}
.prose h2:first-of-type { margin-top: 56px; }

/*
 * About opens with h2 immediately after the hero subtitle — the hero already
 * framed the page, so skip the sunrise hairline + section-break spacing that
 * legal pages need after their "Last Updated" block.
 */
.prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
}
.prose > h2:first-child::before {
  content: none;
}
.policy-hero:has(+ .policy-article > h2:first-child) {
  padding-bottom: 40px;
}
.policy-article:has(> h2:first-child) {
  padding-top: 16px;
}
.prose h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.018em;
  line-height: 1.3;
  color: var(--ink);
  margin: 36px 0 12px;
}
.prose h4,
.prose h5,
.prose h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--ink);
  margin: 24px 0 8px;
}

.prose p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}
.prose p:last-child { margin-bottom: 0; }

.prose strong {
  color: var(--ink);
  font-weight: 600;
}
.prose em { font-style: italic; }

.prose ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.prose ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.prose ul li::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}
.prose a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  color: var(--ink);
}

/* "Last Updated: ..." — the first paragraph of every legal markdown.
   Quiet mono eyebrow that tells the reader the document is current
   without competing with the body. */
.prose > p:first-child {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}
.prose > p:first-child strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ================================================================
   CONTACT CTA — quiet aside above the shared footer.
   One line: "Questions about our terms? [Contact Legal]".
   ================================================================ */
.contact-cta {
  max-width: 64ch;
  margin: 0 auto;
  padding-block: 32px 96px;
  padding-inline: var(--page-x);
  border-top: 1px solid var(--hairline);
  margin-top: 32px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}
.contact-cta-question {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}
.contact-cta-action {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline-stronger);
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.contact-cta-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-soft);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 980px) {
  .policy-hero { padding-block: 72px 48px; }
  .policy-hero:has(+ .policy-article > h2:first-child) { padding-bottom: 32px; }
  .policy-article { padding-block: 24px 64px; }
  .policy-article:has(> h2:first-child) { padding-top: 12px; }
  .contact-cta { padding-block: 24px 64px; flex-direction: column; align-items: flex-start; }
}
