/* Ghost Clip — design system v1
   Dark, editorial, technical. Hairlines, mono labels, generous measure.
   Design lane owns this file; see memory/design.md for the contract. */

:root{
  --bg:#0c0d0e;
  --panel:#121415;
  --panel-2:#171a1c;
  --ink:#e9e7e2;
  --dim:#9aa1a7;
  --faint:#7d858b;   /* 5.19:1 on --bg, 4.93:1 on --panel (worst case): AA floor for 12px and below */
  --rule:#24282c;
  --rule-soft:#1b1e21;
  --accent:#d9a441;
  --accent-ink:#1b1405;
  --good:#7fae6b;
  --warn:#c98a4b;
  --mono:ui-monospace,"Cascadia Mono","SF Mono",Menlo,Consolas,monospace;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --label:12px;
  --measure:32em;   /* 32em ≈ 76 characters as the audit counts glyphs; 66ch was digit-width and rendered 81–87 */
  --wide:1120px;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:var(--sans);font-size:17px;line-height:1.62;
  font-feature-settings:"kern" 1,"liga" 1;
  text-rendering:optimizeLegibility;
}
img,svg{max-width:100%;height:auto}
a{color:var(--ink);text-decoration:none;border-bottom:1px solid var(--rule)}
a:hover{border-bottom-color:var(--accent);color:#fff}
a:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

.wrap{width:100%;max-width:var(--wide);margin:0 auto;padding:0 24px}
.prose{max-width:var(--measure)}

/* ---------- masthead ---------- */
/* Opaque, not glass: this sat at rgba(12,13,14,.92) with backdrop-filter:blur(8px)
   until 26 November, when the contract's "no glass panels" clause became a gate
   (design_audit.py, rule `surface`). The blur bought nothing a solid fill does not
   -- the bar is one step off the page already, and the hairline does the separating. */
.top{position:sticky;top:0;z-index:10;background:var(--bg);border-bottom:1px solid var(--rule)}
/* padding-block only: the shorthand was wiping the .wrap gutter, so on a phone the header ran
   edge to edge and the last nav item sat against the screen. */
.top__in{display:flex;align-items:baseline;gap:28px;padding-block:16px 14px;flex-wrap:wrap}
.wordmark{font-family:var(--serif);font-size:21px;letter-spacing:.01em;border:0}
.wordmark span{color:var(--accent)}
.nav{display:flex;gap:20px;margin-left:auto;flex-wrap:wrap;min-width:0}
.nav a{white-space:nowrap}
.nav a{font-family:var(--mono);font-size:var(--label);letter-spacing:.14em;text-transform:uppercase;color:var(--dim);border:0;padding:8px 0 6px;display:inline-block}
.nav a:hover,.nav a[aria-current=page]{color:var(--ink);border-bottom:1px solid var(--accent)}

/* ---------- type ---------- */
.kicker{font-family:var(--mono);font-size:var(--label);letter-spacing:.16em;text-transform:uppercase;color:var(--accent);margin:0 0 14px}
h1{font-family:var(--serif);font-weight:400;font-size:clamp(34px,5.2vw,58px);line-height:1.06;letter-spacing:-.015em;margin:0 0 18px;max-width:20ch}
h2{font-family:var(--serif);font-weight:400;font-size:clamp(24px,3vw,32px);line-height:1.18;margin:52px 0 12px;letter-spacing:-.01em}
h3{font-size:15px;font-weight:600;margin:32px 0 8px;letter-spacing:.01em}
p{margin:0 0 18px;max-width:var(--measure)}
.lede{font-size:clamp(19px,2.1vw,23px);line-height:1.5;color:#d5d2cb;max-width:44ch}
.dim{color:var(--dim)}
.small{font-size:14px}
.mono{font-family:var(--mono);font-size:13px}

/* ---------- layout blocks ---------- */
.hero{padding:76px 0 40px;border-bottom:1px solid var(--rule)}
.hero__grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,.65fr);gap:56px;align-items:start}
/* single column BELOW 820 -- the contract breakpoint is inclusive, so 820 is two columns */
@media (max-width:819.9px){.hero__grid{grid-template-columns:1fr;gap:28px}.hero{padding:48px 0 30px}}

.side{background:var(--panel);border:1px solid var(--rule);padding:22px}
.side p:last-child{margin-bottom:0}
.side h3{margin-top:0}
.statusline{display:flex;align-items:center;gap:10px;font-family:var(--mono);font-size:var(--label);letter-spacing:.08em;text-transform:uppercase;color:var(--dim);margin:0 0 14px}
.dot{width:7px;height:7px;border-radius:50%;background:var(--good);flex:0 0 auto}
.dot--warn{background:var(--warn)}

.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--rule);border:1px solid var(--rule);margin:40px 0}
@media (max-width:820px){.cards{grid-template-columns:1fr}}
@media (max-width:560px){
  .rows li{grid-template-columns:1fr;gap:4px}
  .rows .date{order:-1}
}
.card{background:var(--bg);padding:26px 24px 28px;display:flex;flex-direction:column;gap:10px}
.card:hover{background:var(--panel)}
.card .kicker{margin:0}
.card h3{margin:0;font-family:var(--serif);font-size:21px;font-weight:400;line-height:1.25}
/* `p` here means body copy. The kicker and the meta inside a card are labels and
   keep the --label token: `.card p` out-specified both of them, so they rendered
   at 14.5px -- uppercase mono at a size the token does not have. */
.card p:not(.kicker):not(.meta){margin:0;font-size:14.5px;color:var(--dim);max-width:var(--measure)}
.card .meta{margin-top:auto;padding-top:12px}

.section{padding-block:56px 0}
.section__head{display:flex;align-items:baseline;justify-content:space-between;gap:20px;border-bottom:1px solid var(--rule);padding-bottom:10px;margin-bottom:26px}
.section__head h2{margin:0}
.section__head .more{font-family:var(--mono);font-size:var(--label);letter-spacing:.12em;text-transform:uppercase;border:0;color:var(--dim)}
.section__head .more:hover{color:var(--accent)}
.section__head .more{display:inline-block;padding:6px 0}

/* ---------- lists ---------- */
.rows{list-style:none;padding:0;margin:0;border-top:1px solid var(--rule-soft)}
.rows li{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:baseline;padding:16px 0;border-bottom:1px solid var(--rule-soft)}
.rows a{border:0}
.rows a:hover{color:var(--accent)}
.rows .date{font-family:var(--mono);font-size:var(--label);letter-spacing:.08em;color:var(--faint);text-transform:uppercase;white-space:nowrap}
.rows .sub{display:block;color:var(--dim);font-size:14px;margin-top:3px;max-width:58ch}

/* ---------- article furniture ---------- */
.meta{font-family:var(--mono);font-size:var(--label);letter-spacing:.1em;text-transform:uppercase;color:var(--faint);display:flex;gap:14px;flex-wrap:wrap;max-width:none}
.badge{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:var(--label);letter-spacing:.1em;text-transform:uppercase;padding:3px 8px;border:1px solid var(--rule);color:var(--dim)}
.badge--tested{border-color:#2c3f28;color:var(--good)}
.badge--sourced{border-color:#3a3226;color:var(--accent)}
/* padding-block, not the shorthand: this element is also .wrap, and the shorthand
   was wiping the 24px gutter -- article heads ran edge-to-edge on a phone and sat
   24px left of the masthead on desktop. */
.article-head{padding-block:56px 30px;border-bottom:1px solid var(--rule)}
.article-head h1{max-width:26ch}
.article-head .meta{margin-top:18px}

/* patch sheet — breaks out of the prose measure, because it is tabular data */
.patch{margin:26px 0 8px;border:1px solid var(--rule);background:var(--panel);
  width:min(900px,calc(100vw - 48px));}
@media (max-width:760px){
  .patch{width:100%}
  .patch__t{display:block;overflow-x:auto}
  .patch__t thead,.patch__t tbody,.patch__t tr{display:block}
  .patch__t th{display:none}
  .patch__t td{display:grid;grid-template-columns:9rem minmax(0,1fr);gap:10px;padding:8px 14px}
  .patch__t td::before{content:attr(data-k);font-family:var(--mono);font-size:var(--label);letter-spacing:.12em;text-transform:uppercase;color:var(--faint)}
  /* card mode: the why column is the only prose running the full card width,
     so it keeps the measure instead of the container -- 84-94 glyphs at 561
     and 760 until it did, invisible because no viewport ever landed there */
  .patch__t td.w{display:block;max-width:var(--measure)}
  .patch__t td.w::before{content:none}
}
@media (min-width:761px){
  /* the visible column header already says WHY; the card-mode prefix must not duplicate it */
  .patch__t td.w .sr-only{display:none}
}
.diagram{width:min(900px,calc(100vw - 48px));max-width:none;margin:22px 0 8px;border:1px solid var(--rule);background:var(--panel)}
@media (max-width:760px){.diagram{width:100%}}
.patch__cap{display:flex;justify-content:space-between;gap:14px;padding:10px 14px;border-bottom:1px solid var(--rule);font-family:var(--mono);font-size:var(--label);letter-spacing:.12em;text-transform:uppercase;color:var(--faint);flex-wrap:wrap}
table.patch__t{width:100%;border-collapse:collapse;font-size:14.5px}
/* the why column is the only one that can run long, so it is the only one with a share */
.patch__t th:last-child{width:36%}
.patch__t th{text-align:left;font-family:var(--mono);font-size:var(--label);letter-spacing:.12em;text-transform:uppercase;color:var(--faint);font-weight:400;padding:10px 14px;border-bottom:1px solid var(--rule)}
.patch__t td{padding:10px 14px;border-bottom:1px solid var(--rule-soft);vertical-align:top}
.patch__t tr:last-child td{border-bottom:0}
/* Values may be a word ("On") or a sentence ("0.328125 ..."). nowrap made the
   longest value the column's minimum width, which squeezed Why to 108px and
   pushed the table past 761-821px. Let the value wrap and the table rebalance. */
.patch__t td.v{font-family:var(--mono);font-size:13px;color:var(--accent);white-space:normal;overflow-wrap:break-word}
.patch__t td.d{font-family:var(--mono);font-size:13px;color:var(--ink)}
.patch__t td.w{color:var(--dim);font-size:13.5px}
.patch__t caption{text-align:left;caption-side:top;width:100%;padding:12px 14px;font-family:var(--mono);font-size:var(--label);letter-spacing:.12em;text-transform:uppercase;color:var(--faint)}
/* the caption is the table's accessible name; it must keep the sr-only geometry
   even though the caption rule above is more specific than .sr-only */
.patch__t caption.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

/* callouts */
.note{border-left:2px solid var(--accent);background:var(--panel);padding:14px 18px;margin:26px 0;max-width:var(--measure)}
.note p{margin:0;font-size:15px}
.note p + p{margin-top:10px}
.note__label{font-family:var(--mono);font-size:var(--label);letter-spacing:.14em;text-transform:uppercase;color:var(--accent);display:block;margin-bottom:6px}

/* sources */
.sources{margin:56px 0 0;border-top:1px solid var(--rule);padding-top:18px}
.sources h3{margin:0 0 12px}
.sources ol{margin:0;padding-left:20px;font-size:13.5px;color:var(--dim);max-width:var(--measure)}
.sources li{margin-bottom:8px}
.sources a{color:var(--dim);border-bottom-color:var(--rule)}
.u{font-family:var(--mono);font-size:12px;color:var(--faint);overflow-wrap:anywhere;word-break:break-word}

/* tables (generic) */
table.data{width:100%;border-collapse:collapse;font-size:14.5px;margin:20px 0 8px}
table.data caption{text-align:left;color:var(--faint)}
/* an sr-only data caption is still measured as prose by the audit; --faint is a
   label tier, so the hidden caption takes --dim (7.44:1) and cannot fail the gate. */
table.data caption.sr-only{color:var(--dim)}
table.data th{text-align:left;font-family:var(--mono);font-size:var(--label);letter-spacing:.12em;text-transform:uppercase;color:var(--faint);font-weight:400;padding:9px 12px 9px 0;border-bottom:1px solid var(--rule)}
table.data td{padding:11px 12px 11px 0;border-bottom:1px solid var(--rule-soft);vertical-align:top}
table.data td:last-child{padding-right:0}
table.data td a{display:inline-block;padding-block:2px;padding-right:2px;margin-right:-2px}

/* footer */
.foot{margin-top:80px;border-top:1px solid var(--rule);padding:26px 0 56px;font-size:13px;color:var(--dim)}
.foot__in{display:flex;justify-content:space-between;gap:24px;flex-wrap:wrap}
.foot p{max-width:var(--measure);margin:0}
.foot a{color:var(--dim);border-bottom-color:var(--rule);display:inline-block;padding:6px 0}

/* motion, politely: colour transitions of 120ms or less, and only when the reader has
   not asked for less motion. Both halves are a gate rule now (`motion` in
   scripts/design_audit.py): a transition on anything but a colour, over the ceiling,
   or outside this guard is a finding, so a new one cannot ship by being pretty. */
@media (prefers-reduced-motion:no-preference){
  .card,.rows a{transition:color .12s ease,background-color .12s ease}
}
::selection{background:var(--accent);color:var(--accent-ink)}

/* wide tables scroll inside their own box rather than pushing the page sideways */
@media (max-width:760px){
  .prose table.data{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .prose table.data caption{display:block}
}

/* tested panel — the one place the site reports a human's ears rather than a source */
.tested{
  border:1px solid #2c3f28;background:#0f1411;padding:20px 22px;margin:30px 0;
  width:min(900px,calc(100vw - 48px));
}
.tested__label{display:flex;gap:14px;align-items:center;margin:0 0 12px;flex-wrap:wrap}
.tested__meta{font-family:var(--mono);font-size:var(--label);letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
.tested__report{font-family:var(--serif);font-size:19px;line-height:1.5;color:var(--ink);margin:0 0 14px;max-width:var(--measure)}
.tested__method,.tested__limits{font-size:13.5px;line-height:1.55;color:var(--dim);margin:0 0 8px;max-width:var(--measure)}
/* .tested__limits is prose -- it says what the listening test does not prove --
   so it keeps --dim (7.12:1 on the tested panel). --faint is 4.96:1 there:
   a label tier, and the contract says faint is never prose. */

/* ---- accessibility furniture -------------------------------------------------------------- */
/* Skip link: first focusable element on every page, invisible until focused. */
.skip{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}
.skip:focus{position:fixed;width:auto;height:auto;margin:0;overflow:visible;clip:auto;clip-path:none;
  left:12px;top:12px;z-index:100;background:var(--accent);color:var(--accent-ink);
  padding:12px 16px;font:600 14px/1 var(--mono)}
/* A heading that exists for the accessibility tree, not the eye (card grids sit under one h1). */
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}
@media (max-width:560px){
  /* Full-width nav on phones: as a flex item it otherwise takes its max-content width, spills
     past the gutter and sits flush against the screen edge. */
  .nav{width:100%;margin-left:0;gap:10px 14px}
  .nav a{min-height:44px;display:inline-flex;align-items:center}
  .rows a{padding:8px 0}
  .foot a{min-height:44px;display:inline-flex;align-items:center}
}
/* Long words must break rather than push the column sideways when text is enlarged (WCAG 1.4.4). */
h1, h2, h3, h4, p, li, blockquote, td, th, .brand, .standfirst { overflow-wrap: break-word; }
