/* The app's legal pages (public/legal/), on top of brief.css: the same reading frame as nightlystudio.com/legal
   (site-src/assets/light.css, the .legal-* rules). White ground, Instrument Serif headings, Inter 400 and 500, nothing
   heavier. The contents stay beside the text on a computer and fold under "On this page" on a phone; section numbers
   in the accent; anchors clear the sticky top bar. Every link that stands on its own is at least 44px tall. */

/* ---------- Top bar: sticky, light, the logo and the way back ---------- */
.legal-page .top { position: sticky; top: 0; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.legal-page .logo { min-height: 44px; }
.top-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin-right: -12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; }
.top-link:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.legal-eyebrow .chip { color: var(--nudge); border-color: rgba(122, 79, 0, .28); background: #fdf7ec; }

/* ---------- The head: the other legal pages, then the title ---------- */
.legal { padding-top: 40px; padding-bottom: 120px; }
.legal-wrap { display: grid; gap: 48px; }
.legal-head { display: grid; gap: 12px; max-width: 760px; min-width: 0; }
.legal-pages { display: flex; flex-wrap: wrap; gap: 0 22px; margin: 0 0 20px; font-size: 14px; font-weight: 500; }
.legal-pages a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.legal-pages a:hover { color: var(--ink); }
.legal-pages a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -1.5px 0 var(--ink); }
.legal-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--accent); }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 6vw, 72px); line-height: 1; letter-spacing: -.012em; margin: 0; }
.legal-date { color: var(--muted); font-size: 15px; }
.legal-head .lede { max-width: 60ch; margin-top: 4px; }
.legal-head .lede a, .legal-note a { color: var(--accent); }
.legal-note { display: grid; gap: 2px; margin-top: 8px; padding: 14px 18px; border-radius: 14px; background: #fdf7ec; color: var(--ink-2); font-size: 15px; }
.legal-note strong { color: var(--nudge); }

/* ---------- The contents and the text ---------- */
.legal-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 64px; align-items: start; }
.legal-toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; font-size: 14px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.toc-fold { display: none; }
.legal-toc ol { list-style: none; display: grid; gap: 0; margin: 2px 0 8px; padding: 0; }
.legal-toc a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.legal-toc a:hover { color: var(--ink); }
.legal-toc .toc-top { color: var(--ink); font-weight: 500; padding: 8px 0 4px; }
.legal-toc .legal-n { min-width: 2em; }
.legal-n { font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.legal-body { max-width: 720px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.legal-body section, .legal-body [id] { scroll-margin-top: 88px; }
.legal-body section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 30px; min-width: 0; }
.legal-body > section:first-child { padding-top: 0; }
.legal-body h2 { font-family: var(--serif); font-weight: 400; font-size: 27px; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
.legal-body h2 .n { display: block; margin-bottom: 8px; font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 1.35; letter-spacing: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.legal-body p, .legal-body li { color: var(--ink-2); font-size: 16px; line-height: 1.65; overflow-wrap: break-word; }  /* only a written-out web address too long for a phone ever breaks */
.legal-body strong { font-weight: 500; color: var(--ink); }
.legal-body ul, .legal-body ol { margin: 0; padding-left: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.legal-body a { color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-body .fine { padding-top: 30px; font-size: 14px; color: var(--muted); }
.legal-short { background: var(--card); border-radius: 24px; padding: 24px 28px; display: grid; gap: 12px; margin-bottom: 6px; }
.legal-short > strong { font-weight: 500; color: var(--ink); }
.legal-short > span { color: var(--ink-2); font-size: 16px; }

/* ---------- Footer ---------- */
.legal-foot a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; color: var(--ink); }

@media (max-width: 900px) {
  .legal { padding-top: 24px; padding-bottom: 80px; }
  .legal-wrap { gap: 28px; }
  .legal-pages { margin-bottom: 12px; gap: 0 18px; }
  .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .legal-toc { position: static; max-height: none; overflow: visible; font-size: 15px; }
  .toc-side { display: none; }
  .toc-fold { display: block; border-block: 1px solid var(--line); }
  .toc-fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; font-weight: 500; }
  .toc-fold summary::-webkit-details-marker { display: none; }
  .toc-fold summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
  .toc-fold[open] summary::after { content: "\2013"; }
  .toc-fold[open] { padding-bottom: 12px; }
  .legal-body h2 { font-size: 24px; }
  .legal-short { padding: 20px; border-radius: 20px; }
}
