/* Shared styles for the document pages (story, privacy, terms, support, 404).
   index.html keeps its own inline CSS because the pour stage and showcase are
   specific to it and nothing else needs them. */

:root {
  --bone: #F5F0E8; --bone-2: #FBF8F2; --cobalt: #1B3A8C; --cobalt-2: #294ca4;
  --ink: #1A1A1A; --muted: #5F5F5F; --line: #DCD5C7; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* scroll-padding keeps an anchored heading clear of the 64px sticky header. */
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
/* Phones: a control answers a tap at once (no double-tap zoom wait), with a faint cobalt
   flash instead of the default grey box. */
html { -webkit-tap-highlight-color: rgba(27, 58, 140, 0.12); }
a, button, summary, label, input, select, textarea { touch-action: manipulation; }
body {
  background: var(--bone); color: var(--ink);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5; overflow-x: hidden;
  /* Column layout so main grows and the footer sits at the bottom on short pages. */
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
.mono { font-variant-numeric: tabular-nums; }
/* Display face, set once in fonts.css (--display). Body stays Satoshi.
   The legal documents opt out below (.legal-doc). */
h1, h2 { font-family: var(--display); }
/* Two italic words on the whole site, both on the landing page. Journal names stay upright. */
.cites i { font-style: normal; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 34px); }
/* Landscape notch and Dynamic Island clearance (viewport-fit=cover). */
.wrap { padding-left: max(clamp(18px, 4vw, 34px), env(safe-area-inset-left)); padding-right: max(clamp(18px, 4vw, 34px), env(safe-area-inset-right)); }
.narrow { max-width: 720px; }

a.skip { position: absolute; left: -9999px; top: 0; background: var(--cobalt); color: var(--bone);
  padding: 12px 18px; z-index: 200; border-radius: 0 0 var(--radius) 0; text-decoration: none; }
a.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }

/* One solid button, site-wide. No gradient, no glow. */
.btn { background: var(--cobalt); color: var(--bone); border: none; border-radius: var(--radius); padding: 11px 20px;
  font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; display: inline-block;
  transition: background-color 0.15s ease, transform 0.15s ease; }
/* Hover only where a pointer can hover, so the color never sticks after a tap. */
@media (hover: hover) { .btn:hover { background: var(--cobalt-2); } }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

/* Document body */
main { position: relative; z-index: 1; flex: 1 0 auto; }
.doc { padding: clamp(44px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.doc h1 { font-size: clamp(42px, 7vw, 72px); line-height: 1.02; margin: 0 0 20px; }
.doc .standfirst { font-size: clamp(17px, 1.9vw, 21px); color: var(--muted); margin: 0 0 10px; line-height: 1.45; }
/* Story byline: plain muted line, sits where the locked text puts it. */
.prose .byline { font-size: 15px; color: var(--muted); }

.prose { max-width: 35em; } /* 560px, about 75 characters of 17px Satoshi */
.prose p { font-size: 17px; line-height: 1.62; margin: 0 0 20px; }
.prose h2 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; margin: 44px 0 14px; }
.prose h3 { font-size: 17.5px; font-weight: 700; margin: 30px 0 10px; letter-spacing: -0.01em; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 20px; }
.prose li { font-size: 16.5px; line-height: 1.58; margin-bottom: 9px; }
.prose a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) { .prose a:hover { text-decoration-thickness: 2px; } }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Legal and help documents (terms, privacy, support): laid out like a document.
   One family, Satoshi, for every element including the title, sentence-case
   headings, no tracked caps. Story and 404 keep the display serif.
   :root .legal-doc :is(...) is (0,2,1), which beats the (0,2,0) display tuning
   in fonts.css, so the serif's weight 400 and balance cannot leak in here. */
/* 32em at 17px is 544px, about 70 characters a line in Satoshi (measured). */
:root .legal-doc { max-width: 32em; font-size: 17px; line-height: 1.6; }
:root .legal-doc :is(h1, h2, h3) { font-family: inherit; font-weight: 700; color: var(--ink); text-transform: none; }
:root .legal-doc h1 { font-size: clamp(32px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; }
:root .legal-doc h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; margin: 56px 0 12px; }
:root .legal-doc h3 { font-size: 18px; line-height: 1.4; letter-spacing: -0.005em; margin: 32px 0 8px; }
:root .legal-doc h2 + h3 { margin-top: 18px; }
.legal-doc p, .legal-doc li { font-size: 17px; line-height: 1.6; }
.legal-doc p { margin: 0 0 16px; }
.legal-doc ul { margin: 0 0 16px; padding-left: 22px; }
.legal-doc li { margin-bottom: 8px; }
.legal-doc .doc-meta { font-size: 16px; color: var(--muted); margin: 0 0 24px; }
.legal-doc .doc-meta span { display: block; }

/* Contents list: numbered h2 links, two columns where the measure allows. */
.toc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0 14px; margin: 28px 0 8px; }
.legal-doc .toc-title { font-weight: 700; margin: 0 0 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; columns: 2 15rem; column-gap: 32px; }
.legal-doc .toc li { font-size: 16px; line-height: 1.4; margin: 0; padding: 4px 0; break-inside: avoid; }
.legal-doc .toc a { color: var(--ink); text-decoration: none; }
.legal-doc .toc a:hover { color: var(--cobalt); text-decoration: underline; }
/* 44px rows where the finger is the pointer; the desktop list stays compact. */
@media (pointer: coarse) {
  .legal-doc .toc li { padding: 0; }
  .legal-doc .toc a { display: block; padding: 11px 0; }
}

/* Warranty disclaimer and liability limits must be conspicuous (UCC 1-201(b)(10),
   Cal. Com. Code 1201 and 2316). Bold body text is "contrasting type" and the rule
   sets it "off from surrounding text", so it stays conspicuous without all caps. */
.conspicuous { border-left: 3px solid var(--cobalt); padding: 2px 0 2px 18px; margin: 0 0 16px; }
.conspicuous > :last-child { margin-bottom: 0; }

/* Citation block, same treatment as the FAQ on the landing page. */
.cites { list-style: none; padding: 0; margin: 20px 0 0; }
.cites li { font-size: 14px; color: var(--muted); padding: 9px 0; border-bottom: 1px dashed var(--line); line-height: 1.45; }
.cites li:last-child { border-bottom: none; }
.cites b { color: var(--ink); }
/* Underlined at rest: color alone does not mark a link (WCAG 1.4.1). */
.cites a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose .cites { padding-left: 0; } /* flush with the prose, like the FAQ copy */

/* Closing CTA band, matching index.html */
.closing { position: relative; z-index: 1; background: #16306f;
  color: var(--bone); text-align: center; padding: clamp(48px, 7vw, 92px) 0; }
.closing h2 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; margin: 0 0 12px; }
.closing p { color: rgba(245,240,232,0.75); font-size: clamp(15px, 1.7vw, 18px); margin: 0 0 24px; }
.btn-light { background: var(--bone); color: var(--cobalt); border: none; border-radius: 12px;
  padding: 14px 24px; font-weight: 700; font-family: inherit; font-size: 15px; cursor: pointer;
  text-decoration: none; display: inline-block; transition: transform 0.15s ease, background-color 0.15s ease; }
.btn-light:active { transform: scale(0.98); }
@media (hover: hover) { .btn-light:hover { background: #fff; } }
/* The global cobalt ring is invisible on the cobalt band. */
.closing :focus-visible { outline-color: var(--bone); }

footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 24px 0 40px; }
.foot { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); flex-wrap: wrap; gap: 10px; }
/* 44px-tall hit areas (21px line plus 12px above and below); type unchanged. */
.foot a { color: var(--muted); text-decoration: none; display: inline-block; padding: 12px 6px; }
/* Footer links wrap on phones instead of running the page wide. No row gap: the link
   padding already spaces wrapped rows, so their hit areas never overlap. */
.foot nav { display: flex; flex-wrap: wrap; gap: 0 6px; margin: 0 -6px; } /* 6 + 6 + 6 = the old 18px gap */
.foot a:hover { color: var(--ink); }
.legal { font-size: 14px; color: var(--muted); max-width: 70ch; margin: 14px 0 0; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn-light, header { transition: none; }
}

/* Print: the document only, black on white. The contents list is dropped because
   its links do nothing on paper; the section numbers carry the structure. */
@media print {
  @page { margin: 18mm 16mm; }
  /* .closing is bone text on a cobalt band, which prints invisible on white. */
  .ambient, header, footer, a.skip, .toc, .closing { display: none; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .doc { padding: 0; }
  :root .legal-doc { max-width: none; }
  .legal-doc p, .legal-doc li { font-size: 11pt; line-height: 1.5; orphans: 3; widows: 3; }
  :root .legal-doc h1 { font-size: 20pt; }
  :root .legal-doc h2 { font-size: 14pt; margin-top: 20pt; break-after: avoid; }
  :root .legal-doc h3 { font-size: 12pt; margin-top: 12pt; break-after: avoid; }
  .legal-doc .doc-meta { font-size: 10pt; color: #000; }
  .legal-doc a { color: #000; }
  /* Site links do nothing on paper, so print where they go. */
  .legal-doc a[href^="/"]::after { content: " (compoundcabinet.app" attr(href) ")"; font-size: 0.9em; }
  .conspicuous { border-left-color: #000; break-inside: avoid; }
}
