/*
 * The content pages generated from apps/web/site-pages by scripts/build-site-pages.mjs (7 November
 * 2026): a title band like the legal pages', one white sheet of words, a Related block and the
 * front page's closing bar. Loaded after studio.css and site.css, and styles only the elements the
 * fragment contract allows (see the top of the script). Light and dark, WCAG 2.2 AA: 44px targets,
 * text at 4.5:1 or better, the shared focus ring, and motion only where reduced motion allows it.
 */

/* The stage tokens the title band and closing bar use: the same values as the front page's. */
:root {
  --stage-bg: #f6f5fb; --stage-ink: #111216; --stage-muted: #575a68; --stage-line: rgba(17, 18, 22, .08);
  --stage-dot: rgba(17, 18, 22, .075);
  --glow-1: rgba(88, 101, 242, .26); --glow-2: rgba(155, 106, 230, .30); --glow-3: rgba(60, 230, 255, .20);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --stage-bg: #09090d; --stage-ink: #eef0f3; --stage-muted: #a3a6ae; --stage-line: rgba(255, 255, 255, .08);
    --stage-dot: rgba(255, 255, 255, .06);
    --glow-1: rgba(88, 101, 242, .36); --glow-2: rgba(155, 106, 230, .38); --glow-3: rgba(60, 230, 255, .10);
  }
}
:root[data-theme="dark"] {
  --stage-bg: #09090d; --stage-ink: #eef0f3; --stage-muted: #a3a6ae; --stage-line: rgba(255, 255, 255, .08);
  --stage-dot: rgba(255, 255, 255, .06);
  --glow-1: rgba(88, 101, 242, .36); --glow-2: rgba(155, 106, 230, .38); --glow-3: rgba(60, 230, 255, .10);
}

/* Title band: breadcrumbs, the H1, the lede and the dates */
.page-hero { position: relative; overflow: hidden; isolation: isolate; background: var(--stage-bg); color: var(--stage-ink); padding-block: clamp(40px, 6vw, 80px) clamp(40px, 5vw, 64px); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--stage-dot) 1px, transparent 1.2px); background-size: 18px 18px; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 30%, transparent 75%); }
.page-hero .glow { position: absolute; z-index: -1; inset: -20% -10% auto; height: 140%; pointer-events: none; background: radial-gradient(38% 34% at 26% 30%, var(--glow-1), transparent 70%), radial-gradient(36% 32% at 74% 26%, var(--glow-2), transparent 70%), radial-gradient(28% 26% at 52% 64%, var(--glow-3), transparent 70%); filter: blur(8px); }
.page-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 120px; z-index: -1; background: linear-gradient(180deg, transparent, var(--canvas)); pointer-events: none; }
.page-hero .frame { display: grid; gap: 16px; justify-items: start; max-width: calc(860px + 2 * var(--gutter)); }
.page-hero h1 { max-width: 20ch; font-size: clamp(38px, 5.6vw, 72px); font-weight: 600; line-height: 1.02; letter-spacing: -0.04em; color: var(--stage-ink); }
.page-hero .intro { max-width: 62ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--stage-muted); }
.page-hero .intro strong { color: var(--stage-ink); font-weight: 600; }
.page-hero .intro a { color: var(--plum); text-decoration: underline; text-underline-offset: 3px; }
.page-hero .updated { font-family: var(--mono); font-size: 13px; color: var(--stage-muted); }

.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; font-size: 14px; color: var(--stage-muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.crumbs li + li::before { content: "/"; color: var(--deco); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--stage-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--dash); }
.crumbs a:hover { color: var(--stage-ink); text-decoration-color: currentColor; }
.crumbs [aria-current="page"] { color: var(--stage-ink); font-weight: 500; }
/* On a phone the H1 just below already names the page, so the last crumb is hidden from view. It
   stays in the page for screen readers, which still hear which page is the current one. */
@media (max-width: 560px) {
  .crumbs li:last-child { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
}

/* The sheet of words */
.page-body { display: grid; gap: clamp(32px, 4vw, 48px); padding-block: 8px clamp(56px, 7vw, 96px); }
.page-sheet { display: grid; gap: 22px; width: 100%; max-width: 860px; margin-inline: auto; padding: clamp(22px, 4.5vw, 56px); background: var(--panel); border-radius: 24px; box-shadow: var(--shadow-2); min-width: 0; font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.page-sheet > * { margin: 0; }
.page-sheet section { display: grid; gap: 14px; min-width: 0; scroll-margin-top: 100px; }
.page-sheet section + section, .page-sheet > section:not(:first-child) { padding-top: 28px; border-top: 1px solid var(--line-soft); }
.page-sheet section > * { margin: 0; }
.page-sheet h2 { font-size: clamp(23px, 2.4vw, 30px); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
.page-sheet h3 { margin-top: 6px; font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.page-sheet p.lede { font-size: clamp(18px, 1.6vw, 20px); line-height: 1.6; color: var(--muted); max-width: none; }
.page-sheet strong { font-weight: 600; color: var(--ink); }
.page-sheet a:not(.btn) { color: var(--plum); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.page-sheet a:not(.btn):hover { text-decoration-thickness: 2px; }
.page-sheet ul, .page-sheet ol { display: grid; gap: 8px; margin: 0; padding-left: 24px; }
.page-sheet li::marker { color: var(--plum); }
.page-sheet ol li::marker { font-family: var(--mono); font-size: .9em; }
.page-sheet code { font-family: var(--mono); font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); overflow-wrap: anywhere; }
.page-sheet abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; }
.page-sheet img { display: block; max-width: 100%; height: auto; border-radius: 14px; }

.page-sheet blockquote { margin: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--plum); font-size: 18px; color: var(--ink); }
.page-sheet blockquote p + p { margin-top: 8px; }
.page-sheet cite { font-style: normal; font-size: 14.5px; color: var(--muted); }
.page-sheet figure { display: grid; gap: 10px; margin: 0; min-width: 0; }
.page-sheet figcaption { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* Honesty notes: a block, not a grid, so a sentence with a link or <strong> in it stays one sentence */
.page-sheet aside.note { display: block; padding: 16px 18px; border-radius: 16px; background: var(--plum-soft); box-shadow: inset 3px 0 0 var(--plum); color: var(--ink); font-size: 16px; }
.page-sheet aside.note > * { margin: 0; }
.page-sheet aside.note > * + * { margin-top: 8px; }

/* Tables scroll sideways inside their box on a phone (the script wraps each one) */
.page-sheet .table-wrap { overflow-x: auto; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); -webkit-overflow-scrolling: touch; }
.page-sheet .table-wrap:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }
.page-sheet table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.page-sheet caption { padding: 14px 16px 0; text-align: left; font-size: 14.5px; font-weight: 600; color: var(--ink); caption-side: top; }
.page-sheet th, .page-sheet td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.page-sheet thead :is(th, td) { background: var(--sunk); color: var(--ink); font-weight: 600; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.page-sheet tbody th { color: var(--ink); font-weight: 600; }
.page-sheet tbody tr:last-child > * { border-bottom: 0; }

/* FAQ: the same cards as studio.css's .faq, with plain <details> content */
.page-sheet .faq { display: grid; gap: 10px; }
.page-sheet .faq details { background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }
.page-sheet .faq details[open] { background: var(--panel); box-shadow: var(--shadow-2); }
.page-sheet .faq summary { min-height: 56px; font-size: 16.5px; color: var(--ink); }
.page-sheet .faq details > :not(summary) { margin: 0; padding: 0 20px 12px; }
.page-sheet .faq details > :last-child { padding-bottom: 18px; }

/* Buttons: the near-black pill */
.page-sheet a.btn { justify-self: start; background: var(--pri-bg); color: var(--pri-fg); box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 8px 20px -10px rgba(16, 17, 22, .55); }
.page-sheet a.btn:hover { transform: translateY(-1px); }
.page-sheet p > a.btn { margin: 4px 8px 4px 0; }

/* Free tools (group "tools"): a tinted box with fields at 44px or more */
.page-sheet .tool { display: grid; gap: 18px; padding: clamp(18px, 3vw, 28px); border-radius: 20px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.page-sheet .tool > * { margin: 0; }
.page-sheet form { display: grid; gap: 16px; margin: 0; min-width: 0; }
.page-sheet fieldset { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.page-sheet legend { padding: 0 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.page-sheet label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
.page-sheet label:has(> input[type="checkbox"]), .page-sheet label:has(> input[type="radio"]) { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.page-sheet input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .page-sheet select {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 12px;
  background: var(--panel); color: var(--ink); font: inherit; font-size: 16px; font-weight: 400; line-height: 1.2;
}
.page-sheet select { padding-right: 36px; }
.page-sheet input[type="checkbox"], .page-sheet input[type="radio"] { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--plum-fill); }
.page-sheet input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--plum-fill); }
.page-sheet input:focus-visible, .page-sheet select:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; border-color: var(--plum); }
.page-sheet input::placeholder { color: var(--muted); opacity: 1; }
.page-sheet input:invalid:not(:placeholder-shown) { border-color: var(--red); }
.page-sheet button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; justify-self: start; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--pri-bg); color: var(--pri-fg); font-size: 15.5px; font-weight: 600; line-height: 1; }
.page-sheet button[type="reset"], .page-sheet button.secondary { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.page-sheet button:disabled { opacity: .5; cursor: default; }
.page-sheet output { display: block; font-family: var(--mono); font-size: clamp(22px, 3vw, 30px); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); overflow-wrap: anywhere; }
@media (forced-colors: active) {
  .page-sheet input, .page-sheet select, .page-sheet button { border: 1px solid ButtonText; }
}

/* Related pages */
.related { width: 100%; max-width: 860px; margin-inline: auto; display: grid; gap: 14px; }
.related h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.related a { display: grid; gap: 4px; height: 100%; min-height: 44px; padding: 16px 18px; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s var(--ease); }
.related a:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.related b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.related a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.related span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* The closing bar sits on its own after the words */
main > .close-sec { padding-block: 0 clamp(56px, 7vw, 96px); }

@media (prefers-reduced-motion: reduce) {
  .related a, .page-sheet a.btn { transition: none; }
  .related a:hover, .page-sheet a.btn:hover { transform: none; }
}
