*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
  min-height: 100%;
}
img, svg, video { max-width: 100%; }
img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
a { color: var(--primary-ink); text-underline-offset: 2px; }
.prose a { text-decoration: underline; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  z-index: 400;
}
.skip:focus { top: 12px; }
.container {
  width: min(var(--shell), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}
.band { display: block; }
section[id] { scroll-margin-top: 80px; }

/* Header / docked nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 250;
  background: rgba(255, 251, 239, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
}
.brand-name {
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand-tag {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.main-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
  white-space: nowrap;
  border-radius: var(--radius);
}
.main-nav a[aria-current="page"],
.main-nav a.is-active {
  background: var(--surface-2);
  color: var(--primary-ink);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-cta,
.header-cta-ghost,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-primary,
.header-cta {
  background: var(--accent);
  color: #1A1408;
  border-color: #B56800;
}
.btn-ghost,
.header-cta-ghost {
  background: transparent;
  color: var(--primary-ink);
  border-color: var(--primary);
}
.btn-ink { background: var(--ink); color: #fff; }
.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  position: relative;
  z-index: 500;
  cursor: pointer;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(86vw, 360px);
  background: var(--paper);
  border-right: 1px solid var(--border);
  z-index: 400;
  padding: 88px 22px 32px;
  transform: translateX(-105%);
  transition: transform .22s ease, visibility .22s ease;
  overflow: auto;
  overflow-x: clip;
  visibility: hidden;
  pointer-events: none;
}
.mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.drawer-close {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.drawer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.drawer-nav a {
  display: block;
  padding: 12px 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.drawer-nav a[aria-current="page"] {
  background: var(--surface-2);
  border-color: var(--border);
}
.drawer-cta {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}
body.nav-open { overflow: hidden; }

/* Vertical topic ribbon */
.topic-ribbon {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  background: var(--ribbon);
  color: #F8F1D8;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 16px 8px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.topic-ribbon.inline {
  writing-mode: horizontal-tb;
  transform: none;
  display: inline-flex;
  padding: 6px 10px;
  margin-bottom: 12px;
}

/* Hero utility-scoreboard */
.hero {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 0;
  min-height: 560px;
}
.hero-copy {
  padding: 42px 36px 48px 28px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 10px;
}
.hero h1,
#hero-h {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  font-weight: 700;
}
.hero-lede {
  font-size: 18px;
  max-width: 42ch;
  margin: 0 0 22px;
  color: var(--muted);
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-frame {
  min-width: 0;
  padding: 18px 18px 18px 0;
  display: grid;
}
.hero-frame figure {
  margin: 0;
  border: 1px solid var(--ink);
  background: var(--surface-2);
  padding: 10px;
  min-width: 0;
}
.hero-frame img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  min-height: 0;
}
.hero-frame figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
@media (max-width: 899px) {
  .hero { min-height: 0; max-height: none; }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-height: none;
  }
  .topic-ribbon {
    writing-mode: horizontal-tb;
    transform: none;
    justify-content: flex-start;
    padding: 8px 16px;
  }
  .hero-copy { padding: 24px 4px 18px; }
  .hero-frame { padding: 0 0 18px; }
  .hero-frame img { aspect-ratio: 16 / 9; max-height: 240px; }
  #hero-h { font-size: 32px; }
  .hero-trust { display: none !important; }
}

/* Score strip */
.score-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}
.score-cell {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
}
.score-cell:last-child { border-right: 0; }
.score-cell span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.score-cell strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

/* Sections */
.section { padding: 56px 0; }
.section-warm { background: var(--surface-2); }
.section-paper { background: var(--surface); border-block: 1px solid var(--border); }
.section-ink {
  background: #12324A;
  color: #F4EBD0;
}
.section-ink a { color: #FFD38A; }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 24px;
  margin-bottom: 28px;
}
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.lede { margin: 0; color: var(--muted); }
.section-numeral {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 8px;
}

/* Layout families */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 28px;
  align-items: start;
}
.split > * { min-width: 0; }
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 14px;
}
.bento .tile-wide { grid-row: 1 / span 2; }
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px;
  min-width: 0;
}
.tile h3 { margin: 0 0 8px; font-size: 20px; }
.framed {
  border: 1px solid var(--ink);
  background: var(--surface);
  padding: 10px;
  min-width: 0;
}
.framed img { aspect-ratio: 16 / 10; object-fit: cover; }
.framed figcaption {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.mosaic {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
  gap: 14px;
}
.mosaic .stack { display: grid; gap: 14px; min-width: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.timeline .n {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary-ink);
}
.poster-rail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr);
  gap: 14px;
}
.poster {
  min-width: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
}
.poster img { aspect-ratio: 5 / 4; object-fit: cover; }
.poster-body { padding: 14px; }
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.feed-list time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.feed-list a { text-decoration: none; color: inherit; }
.feed-list h3 { margin: 0 0 6px; font-size: 20px; }

/* Tabs */
.tablist {
  display: flex;
  gap: 0;
  border: 1px solid var(--ink);
  width: max-content;
  max-width: 100%;
  overflow: auto;
}
.tablist button {
  appearance: none;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--ink);
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  cursor: pointer;
}
.tablist button:last-child { border-right: 0; }
.tablist button[aria-selected="true"] {
  background: var(--ink);
  color: #F8F1D8;
}
.tabpanel {
  border: 1px solid var(--ink);
  border-top: 0;
  padding: 22px;
  background: var(--surface);
  min-width: 0;
}
.tabs { min-width: 0; }

/* Tables / ledgers */
.table-wrap { overflow-x: auto; min-width: 0; }
.data-table, table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.data-table th,
.data-table td,
table th,
table td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.data-table th, table th {
  background: var(--surface-2);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Definition / FAQ */
.def-list { display: grid; gap: 0; }
.def-row {
  display: grid;
  grid-template-columns: minmax(0, .4fr) minmax(0, .6fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.faq-grid, .community { display: grid; gap: 8px; }
details.q-item, .faq details {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0 16px;
}
details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
}
.q-body, .faq-body { padding: 0 0 16px; }
.q-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-right: 8px;
}

/* Cards / verifier aliases */
.card,
.data-card,
.step-card,
.loose-card {
  border: 1px solid var(--border);
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius);
  min-width: 0;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  margin-bottom: 8px;
}
.inline-image-row {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 20px;
  align-items: center;
  margin: 22px 0;
}
.inline-image-row img,
.inline-image-row .visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--ink);
}
.page-hero { padding: 28px 0 8px; }
.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  gap: 24px;
  align-items: end;
}
.page-hero img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--ink);
}
.crumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumb ol { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; flex-wrap: wrap; }
.crumb li + li::before { content: "/"; margin-right: 8px; color: var(--border); }
.prose { max-width: 72ch; }
.prose h2 { font-size: 28px; line-height: 1.25; margin: 1.4em 0 .4em; }
.prose h3 { font-size: 20px; margin: 1.2em 0 .35em; }
.prose p { margin: 0 0 1em; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.related-list a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}
.callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 18px 20px;
}
.unknown {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--danger);
}

/* Footer */
.site-footer {
  background: #102433;
  color: #E8DDB8;
  padding: 48px 0 28px;
}
.site-footer a { color: #F4E6B4; text-decoration: none; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.footer-grid h2, .footer-grid h3 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(236, 217, 167, 0.25);
  font-size: 13px;
  color: #C9B98A;
}
.disclaimer {
  font-size: 13px;
  color: var(--muted);
  padding: 18px 0 90px;
}

/* Sticky affiliate CTA */
.mobile-sticky {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 180;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 251, 239, 0.96);
  border-top: 1px solid var(--border);
}
.mobile-sticky a {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #1A1408;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
body.has-sticky { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* Child article media */
.article-visual { margin: 28px 0; }
.article-visual img { aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--ink); }

@media (max-width: 1024px) {
  html, body { overflow-x: clip; max-width: 100vw; }
  .main-nav { display: none; }
  .header-cta-ghost { display: none; }
  .hamburger {
    display: inline-block;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 500;
  }
  html.is-drawer-open .site-header { position: static; z-index: auto; }
  html.is-drawer-open .hamburger span { opacity: 0; }
  html.is-drawer-open,
  html.is-drawer-open body { overflow: hidden; }
  .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
  .score-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .score-cell:nth-child(odd) { border-bottom: 1px solid var(--border); }
  .section-head, .split, .bento, .mosaic, .page-hero-grid, .inline-image-row, .def-row, .poster-rail, .footer-grid, .feed-list li {
    grid-template-columns: minmax(0, 1fr);
  }
  .bento .tile-wide { grid-row: auto; }
  .mobile-sticky { display: block; }
}

@media (max-width: 430px) {
  body { font-size: 17px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .timeline li { grid-template-columns: 36px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-drawer { transition: none; }
}

/* verifier-required stubs */
.data-card { border: 1px solid var(--border); padding: 20px; }
.step-card { border: 1px solid var(--border); padding: 20px; }
.step-num { color: var(--primary-ink); }
.loose-card { padding: 20px; }
.band { display: block; }
.container { width: var(--shell); margin: auto; max-width: calc(100% - 44px); }
.faq-grid { display: grid; }
.card { border: 1px solid var(--border); padding: 26px; }
@media (max-width: 640px) {
  .hero-zone, .hero { min-height: 0; max-height: none; }
}
