/* imadethisup.org — shared stylesheet
   Design system: Source Serif 4 (editorial) + Inter Tight (UI) + JetBrains Mono (forensic).
   Light/paper aesthetic with a forensic-green accent (#00b341).
*/

:root {
  --ink: #0a0d10;
  --ink-2: #1c2227;
  --paper: #ffffff;
  --paper-2: #f6f4ef;
  --paper-3: #ecebe6;
  --rule: rgba(10,13,16,.12);
  --rule-strong: rgba(10,13,16,.28);
  --muted: rgba(10,13,16,.6);
  --dark-bg: #0a0d10;
  --dark-bg-2: #11161a;
  --dark-rule: rgba(255,255,255,.12);
  --dark-rule-strong: rgba(255,255,255,.28);
  --dark-muted: rgba(255,255,255,.6);
  --dark-ink: #e8e6df;
  --accent: #00b341;
  --accent-ink: #ffffff;
  --accent-soft: #e6f7ec;
  --warn: #c8451c;

  --serif: 'Source Serif 4','Iowan Old Style',Georgia,serif;
  --display: 'Source Serif 4','Iowan Old Style',Georgia,serif;
  --ui: 'Inter Tight',ui-sans-serif,system-ui,-apple-system,sans-serif;
  --mono: 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;

  --pad-section: clamp(56px, 7vw, 120px);
  --col-gap: 32px;
  --row-gap: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { max-width: 100%; display: block; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }
.ui { font-family: var(--ui); }
.mono { font-family: var(--mono); font-feature-settings: "ss01"; }
.muted { color: var(--muted); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; background: var(--accent);
  display: inline-block; border-radius: 1px;
}

.rule { height: 1px; background: var(--rule); width: 100%; }

/* Display type */
.display-xl {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(44px, 8vw, 128px);
  line-height: .98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.display-l {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display-m {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.display-s {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(18px, 1.4vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 60ch;
}

/* Top nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--paper) 84%, transparent);
  border-bottom: 1px solid var(--rule);
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.brandmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brandmark svg { height: 22px; width: auto; }
.topnav nav {
  display: flex; gap: 22px;
  font-family: var(--ui); font-size: 13px;
  flex: 1; justify-content: center;
}
.topnav nav a { color: var(--muted); transition: color .15s; }
.topnav nav a:hover, .topnav nav a[aria-current="page"] { color: var(--ink); }
.topnav nav a[aria-current="page"]::after {
  content: ""; display: block; height: 1px; background: var(--accent); margin-top: 4px;
}
.topnav .cta {
  font-family: var(--ui); font-size: 12px;
  border: 1px solid var(--rule-strong);
  padding: 7px 12px; border-radius: 999px;
  color: var(--ink);
  white-space: nowrap;
}
.topnav .cta:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--rule-strong);
  border-radius: 4px; padding: 6px 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--ink);
}

@media (max-width: 880px) {
  .topnav nav { display: none; flex: unset; }
  .topnav nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 18px clamp(20px, 4vw, 48px); gap: 14px;
    justify-content: flex-start;
  }
  .nav-toggle { display: inline-flex; }
  .topnav .cta { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ui); font-size: 13px; font-weight: 500;
  padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--rule-strong);
  background: transparent; color: inherit;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
  text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.btn.primary:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn .arr { width: 14px; height: 10px; }

/* Tags */
.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px;
  border: 1px solid var(--rule);
  color: var(--muted);
  display: inline-block;
}
.tag.live::before {
  content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; transform: translateY(-1px);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* Sections */
section, footer { padding-top: var(--pad-section); padding-bottom: var(--pad-section); }
section[id] { scroll-margin-top: 80px; }
section.dark {
  background: var(--dark-bg); color: var(--dark-ink);
}
section.dark .lede, section.dark .muted { color: var(--dark-muted); }
section.dark .eyebrow { color: rgba(255,255,255,.55); }
section.dark .rule { background: var(--dark-rule); }
section.dark .tag { border-color: var(--dark-rule); color: var(--dark-muted); }

/* Grid */
.grid { display: grid; gap: var(--col-gap); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-12-7-5 { grid-template-columns: 7fr 5fr; }
@media (max-width: 900px) {
  .g-2, .g-3, .g-4, .g-12-7-5 { grid-template-columns: 1fr; }
}

/* Cards */
.card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: rgba(255,255,255,.45);
  display: grid; gap: 14px;
  transition: border-color .2s, transform .2s, background .2s;
}
.card:hover { border-color: var(--accent); }
.card .ix {
  position: absolute; top: 14px; right: 16px;
  font-family: var(--mono); font-size: 11px; opacity: .5;
}

/* Stat block */
.stat {
  padding-top: 18px;
  border-top: 1px solid var(--rule-strong);
  display: grid; gap: 8px;
}
.stat .v {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(26px, 3vw, 44px); line-height: 1.05;
  font-feature-settings: '"lnum"';
}
.stat .l { font-family: var(--ui); font-size: 13px; line-height: 1.4; }
.stat .s { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* Citation/footnote line */
.cite { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.cite a { color: inherit; border-bottom: 1px dotted var(--muted); }
.cite a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Portrait placeholder */
.portrait {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,.03) 0 12px, rgba(0,0,0,.06) 12px 24px),
    linear-gradient(180deg, #ddd5c5, #cfc7b6);
  border: 1px solid var(--rule);
  aspect-ratio: 4/5;
}
.portrait .cap {
  position: absolute; left: 10px; bottom: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(0,0,0,.6);
  background: rgba(255,255,255,.5); backdrop-filter: blur(6px);
  padding: 4px 7px; border-radius: 3px;
}
.portrait .ix {
  position: absolute; right: 10px; top: 10px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .08em;
  color: rgba(0,0,0,.5);
}

/* Hero */
.hero {
  padding-top: 72px; padding-bottom: 72px;
  min-height: min(85vh, 820px);
  display: grid; align-items: center;
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(10,13,16,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,13,16,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 50%, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 50%, black 30%, transparent 75%);
  pointer-events: none;
}
.hero .wrap { position: relative; width: 100%; }
.bottom-ticker {
  position: absolute; left: 0; right: 0; bottom: 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--muted);
  display: flex; justify-content: space-between;
  padding: 12px clamp(20px, 4vw, 48px);
  background: var(--paper);
}

/* Reference list — used on per-page citation tables */
.refs { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.refs li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.refs li:last-child { border-bottom: 1px solid var(--rule); }
.refs .n { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.refs .t { font-family: var(--serif); font-size: 16px; line-height: 1.5; }
.refs .meta { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; display: block; }
.refs a.ref-link { border-bottom: 1px dotted var(--muted); color: var(--ink); }
.refs a.ref-link:hover { border-bottom-style: solid; }

/* FAQ accordion */
.faq { display: grid; gap: 0; }
.faq details {
  border-top: 1px solid var(--rule);
  padding: 22px 0;
}
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  cursor: pointer;
  font-family: var(--display);
  font-size: clamp(19px, 1.6vw, 24px);
  line-height: 1.3;
  letter-spacing: -.005em;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-weight: 300;
  font-size: 22px; color: var(--accent);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a {
  margin: 14px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.65;
  color: var(--ink-2); max-width: 72ch;
}
.faq .a a { border-bottom: 1px solid var(--accent); }

/* Tabs (vanilla) */
[role="tablist"] {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  margin-top: 12px;
}
[role="tab"] {
  appearance: none; border: none; background: transparent;
  padding: 26px 22px; text-align: left; color: inherit;
  border-top: 2px solid transparent; margin-top: -1px;
  cursor: pointer; transition: background .15s;
  font-family: inherit;
}
[role="tab"]:not(:first-child) { border-left: 1px solid var(--rule); }
[role="tab"]:hover { background: rgba(10,13,16,.03); }
[role="tab"][aria-selected="true"] {
  border-top-color: var(--accent);
  background: var(--paper);
}

/* Footer */
footer.colophon {
  background: var(--paper-3);
  border-top: 1px solid var(--rule);
  padding: 56px 0 40px;
}
footer.colophon .col-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
}
footer.colophon .legal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
@media (max-width: 900px) {
  footer.colophon .col-grid { grid-template-columns: 1fr 1fr; }
  footer.colophon .legal-grid { grid-template-columns: 1fr; }
}
footer.colophon h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px;
}
footer.colophon ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
footer.colophon ul a { font-family: var(--ui); font-size: 14px; color: var(--ink); }
footer.colophon ul a:hover { color: var(--accent); }
footer.colophon .legal p { font-family: var(--mono); font-size: 11px; color: var(--muted); line-height: 1.55; margin: 0; }

/* Search input (resource library, glossary) */
.search {
  width: 100%;
  padding: 14px 14px 14px 40px;
  font-family: var(--ui); font-size: 14px;
  background: rgba(255,255,255,.7); color: inherit;
  border: 1px solid var(--rule); border-radius: 4px;
  outline: none;
}
.search:focus { border-color: var(--accent); }
.search-wrap { position: relative; }
.search-wrap::before {
  content: "⌕"; position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); font-family: var(--mono);
  font-size: 14px; color: var(--muted);
}
.filter-group {
  display: flex; gap: 4px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
}
.filter-group button {
  padding: 10px 14px; background: transparent; color: inherit;
  border: 1px solid var(--rule); border-radius: 4px;
  text-transform: uppercase;
}
.filter-group button[aria-pressed="true"] {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}

/* Real vs Synth slider */
.rvs {
  position: relative; aspect-ratio: 16/9; width: 100%;
  overflow: hidden; border: 1px solid var(--dark-rule); border-radius: 4px;
  user-select: none; cursor: ew-resize; background: #0a0d10;
}
.rvs .real, .rvs .synth { position: absolute; inset: 0; }
.rvs .real {
  background:
    repeating-linear-gradient(135deg, #2a2520 0 14px, #312b25 14px 28px),
    linear-gradient(180deg, #3a342d, #1a1612);
}
.rvs .synth {
  background:
    repeating-linear-gradient(135deg, #14181d 0 14px, #1a1f24 14px 28px),
    linear-gradient(180deg, #1f262c, #0a0d10);
}
.rvs .cap-real, .rvs .cap-synth {
  position: absolute; top: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  padding: 4px 8px; border: 1px solid;
}
.rvs .cap-real { left: 14px; color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.2); }
.rvs .cap-synth { right: 14px; color: var(--accent); border-color: var(--accent); }
.rvs .divider {
  position: absolute; top: 0; bottom: 0;
  width: 1px; background: var(--accent);
}
.rvs .handle {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.rvs-meta {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--muted); margin-top: 16px;
}

/* Quiz */
.quiz { display: grid; gap: 16px; }
.quiz .specimen {
  width: 100%; aspect-ratio: 4/3;
  background: #0d1115;
  border: 1px solid var(--dark-rule);
  position: relative;
  overflow: hidden;
  transition: outline .2s, border-color .2s;
}
.quiz .specimen svg { width: 100%; height: 100%; display: block; }
.quiz .specimen.specimen-correct { outline: 2px solid var(--accent); outline-offset: -2px; }
.quiz .specimen.specimen-wrong   { outline: 2px solid var(--warn);   outline-offset: -2px; }
.quiz .specimen .marker {
  animation: marker-fade-in .35s cubic-bezier(.2,.7,.2,1);
  transform-origin: center;
}
@keyframes marker-fade-in {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
.quiz .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz button {
  padding: 14px; border: 1px solid var(--dark-rule-strong);
  background: transparent; color: var(--dark-ink);
  font-family: var(--ui); font-size: 13px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px;
}
.quiz button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.quiz .feedback {
  padding: 18px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  display: grid; gap: 10px;
}
.quiz .feedback.wrong { border-color: var(--warn); }
.quiz .feedback .verdict {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--accent);
}
.quiz .feedback.wrong .verdict { color: var(--warn); }
.quiz .feedback .reason { color: var(--dark-muted); font-size: 14px; line-height: 1.55; }

/* Breadcrumbs */
.crumbs {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--muted); padding: 14px 0; text-transform: uppercase;
}
.crumbs a { color: inherit; border-bottom: 1px dotted transparent; }
.crumbs a:hover { border-bottom-color: var(--muted); }
.crumbs .sep { margin: 0 8px; opacity: .6; }

/* Glossary */
.glossary dl { display: grid; gap: 0; margin: 0; }
.glossary dt {
  font-family: var(--ui); font-weight: 600; font-size: 17px;
  padding: 22px 0 6px; border-top: 1px solid var(--rule);
}
.glossary dd {
  margin: 0 0 22px; font-size: 16px; line-height: 1.6; color: var(--ink-2);
  max-width: 72ch;
}
.glossary .term-mark {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  margin-right: 10px;
}

/* Blog */
.post-meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap;
}
.prose {
  max-width: 70ch;
  font-family: var(--serif); font-size: 18px; line-height: 1.65;
}
.prose p { margin: 0 0 1em; }
.prose h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(24px, 2.5vw, 34px); line-height: 1.2;
  margin: 2.2em 0 .6em; letter-spacing: -.01em;
}
.prose h3 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(19px, 1.7vw, 22px); line-height: 1.3;
  margin: 1.8em 0 .5em;
}
.prose blockquote {
  margin: 1.5em 0; padding: 0 0 0 24px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2); font-style: italic;
}
.prose a { border-bottom: 1px solid var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .5em; }
.prose sup { font-family: var(--mono); font-size: .65em; color: var(--accent); }

/* Helpers */
.hide { display: none !important; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }
.mt-6 { margin-top: 64px; }
.mt-7 { margin-top: 96px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* ─────────────────────────────────────────────────────────────
   Mobile QC additions
   ───────────────────────────────────────────────────────────── */

/* Honour iPhone safe-area on the bottom (notched home-indicator gap) */
body { padding-bottom: env(safe-area-inset-bottom, 0); }

/* Prevent any element forcing horizontal scroll on the document */
html, body { overflow-x: hidden; }

/* Long URLs / inline code wrap rather than overflow */
.prose a, .cite a, .refs a { word-break: break-word; overflow-wrap: anywhere; }
code { word-break: break-word; }

/* Tables: stack into label-value rows on narrow viewports.
   We use display:block and CSS-generated labels via data-label attrs,
   but to keep authoring simple the design also degrades gracefully
   without data-label by simply scrolling horizontally. */
.prose-table { width: 100%; }
.prose-table th, .prose-table td { vertical-align: top; }
@media (max-width: 720px) {
  .prose-table { display: block; border-collapse: collapse; }
  .prose-table thead { display: none; }
  .prose-table tbody, .prose-table tr { display: block; width: 100%; }
  .prose-table tr {
    border: 1px solid var(--rule);
    border-radius: 4px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: rgba(255,255,255,.5);
  }
  .prose-table td {
    display: block;
    border: 0 !important;
    padding: 6px 0 !important;
  }
  .prose-table td:first-child {
    font-family: var(--ui);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--rule) !important;
    margin-bottom: 6px !important;
  }
}

/* Blog listing: stack the 3-col layout on mobile.
   The inline style sets grid-template-columns:120px 1fr 220px.
   We override via a class hook added to each <a>. */
.blog-list-row { display: grid; grid-template-columns: 120px 1fr 220px; gap: 24px; padding: 32px 0; align-items: baseline; text-decoration: none; color: inherit; border-top: 1px solid var(--rule); }
.blog-list-row:last-child { border-bottom: 1px solid var(--rule); }
.blog-list-row .blog-list-cta { text-align: right; }
@media (max-width: 720px) {
  .blog-list-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 22px 0;
  }
  .blog-list-row .blog-list-cta { text-align: left; }
}

/* Reading-list rows in research-lab: wrap 4-col to 1-col on mobile */
.read-row { display: grid; grid-template-columns: 60px 1fr 220px auto; gap: 24px; padding: 22px 0; align-items: baseline; border-top: 1px solid var(--rule); }
.read-row:last-of-type { border-bottom: 1px solid var(--rule); }
@media (max-width: 720px) {
  .read-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 0; }
  .read-row > .read-cta { display: none; }
}

/* SVG diagrams: at narrow viewports allow horizontal scroll on the
   diagram container so labels stay legible — better than crushing them. */
.diagram-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram-wrap svg { min-width: 480px; display: block; }

/* Tighter topnav on medium screens — keep some routes visible up to 1100px,
   then hand off to the mobile drawer at <880px (existing rule). */
@media (max-width: 1100px) and (min-width: 881px) {
  .topnav nav { gap: 14px; font-size: 12px; }
  .topnav .cta { padding: 6px 10px; font-size: 11px; }
}

/* Tap targets: WCAG 2.5.5 / Apple HIG recommend ≥44×44 CSS px for touch.
   .btn was 12×18 padding ≈ 40px high — bump to 44px on coarse-pointer devices. */
@media (pointer: coarse) {
  .btn { min-height: 44px; padding-top: 13px; padding-bottom: 13px; }
  .nav-toggle, .filter-group button { min-height: 44px; padding-top: 12px; padding-bottom: 12px; }
  .topnav nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .faq summary { min-height: 44px; padding: 4px 0; }
  .privacy-notice-x { min-height: 40px; }
}

/* War-room protocol grid: single-column at narrow widths */
@media (max-width: 700px) {
  section.dark .mt-4[style*="grid-template-columns:repeat(2,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* Footer cells: ensure they don't squeeze too small */
@media (max-width: 540px) {
  footer.colophon .col-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* Stat values may be long ("$2.77 B" etc.) — keep them on one line */
.stat .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Privacy notice (informational; not consent — we set no trackers) */
.privacy-notice {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--ink); color: var(--paper);
  border-top: 2px solid var(--accent);
  box-shadow: 0 -8px 32px rgba(0,0,0,.18);
  animation: pn-slide-in .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes pn-slide-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.privacy-notice-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 14px clamp(20px, 4vw, 48px);
}
.privacy-notice-text {
  margin: 0; font-family: var(--ui); font-size: 13px; line-height: 1.5;
  color: rgba(255,255,255,.85); flex: 1; max-width: 80ch;
}
.privacy-notice-text strong { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.privacy-notice-text em { color: var(--accent); font-style: normal; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; }
.privacy-notice-text a { color: var(--paper); border-bottom: 1px solid var(--accent); }
.privacy-notice-text a:hover { background: var(--accent); color: var(--accent-ink); }
.privacy-notice-x {
  appearance: none; background: transparent;
  border: 1px solid rgba(255,255,255,.4); color: var(--paper);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.privacy-notice-x:hover {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
@media (max-width: 700px) {
  .privacy-notice-inner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 20px; }
  .privacy-notice-x { align-self: flex-end; }
}

/* GPC status pill (used on /privacy-choices) */
.gpc-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  border: 1px solid var(--rule-strong);
}
.gpc-pill[data-on="1"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--ink);
}
.gpc-pill[data-on="1"]::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.gpc-pill[data-on="0"]::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted);
}

/* Form */
.form { display: grid; gap: 22px; max-width: 720px; }
.form-row { display: grid; gap: 6px; }
.form-row.two { grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-row.two { grid-template-columns: 1fr; } }
.form label {
  font-family: var(--ui); font-size: 13px; font-weight: 500;
  color: var(--ink); display: flex; gap: 4px;
}
.form label .req { color: var(--accent); }
.form .hint { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.form input[type="text"],
.form input[type="email"],
.form input[type="tel"],
.form select,
.form textarea {
  width: 100%; padding: 12px 14px;
  font-family: var(--serif); font-size: 16px; line-height: 1.5;
  color: var(--ink); background: rgba(255,255,255,.7);
  border: 1px solid var(--rule-strong); border-radius: 4px;
  outline: none; transition: border-color .15s, background .15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form textarea { min-height: 140px; resize: vertical; font-family: var(--serif); }
.form .radio-group, .form .checkbox-group {
  display: grid; gap: 10px; padding-top: 4px;
}
.form .radio-row {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: var(--ui); font-size: 14px; line-height: 1.5;
  cursor: pointer; padding: 4px 0;
}
.form .radio-row input { margin-top: 4px; accent-color: var(--accent); }
.form .consent {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--rule);
  border-radius: 4px; background: rgba(0,0,0,.02);
  font-family: var(--serif); font-size: 14px; line-height: 1.55;
}
.form .consent input { margin-top: 4px; accent-color: var(--accent); }
.form .actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.form .honeypot { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }
.form-success {
  padding: 28px; border: 2px solid var(--accent);
  border-radius: 6px; background: var(--accent-soft);
  display: grid; gap: 12px;
}
.form-error {
  padding: 16px; border: 1px solid var(--warn);
  border-radius: 4px; background: rgba(200,69,28,.06);
  font-family: var(--ui); font-size: 14px; color: var(--warn);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
