*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
}

img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

a { color: var(--primary-ink); }
a:hover { color: var(--accent-ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--text);
  color: #fff;
  padding: 8px 12px;
  z-index: 400;
}
.skip-link:focus { top: 12px; }

.container {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}
.container-narrow { width: min(760px, calc(100% - 32px)); margin-inline: auto; }

section[id] { scroll-margin-top: 80px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 250;
  background: rgba(246, 251, 243, 0.96);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
}
.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: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.brand-mark {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-tag {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
}
.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.main-nav a[aria-current="page"],
.main-nav a.is-active {
  border-bottom-color: var(--primary);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 0;
  border-radius: var(--radius);
  white-space: nowrap;
  cursor: pointer;
}
.header-cta:hover,
.btn:hover { color: #fff; filter: brightness(0.95); }
.btn-ghost,
.header-cta-ghost {
  background: transparent;
  color: var(--primary-ink);
  border: 1px solid var(--primary-border);
}
.btn-ghost:hover,
.header-cta-ghost:hover { color: var(--primary-ink); background: var(--surface-2); }
.btn-ink { background: var(--text); color: #fff; }

.hamburger {
  display: none;
  z-index: 300 !important;
  position: relative !important;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--background);
  padding: 88px 24px 32px;
  overflow: auto;
  display: none;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.drawer-cta {
  margin-top: 20px;
  width: 100%;
}

/* Score strip / format chips */
.score-strip {
  background: var(--text);
  color: #E8F3E4;
}
.score-strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  padding: 10px 0;
}
.score-strip .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8FCF7A;
}
.chip,
.score-tile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #E8F3E4;
  text-decoration: none;
}
.chip b,
.score-tile b { color: #fff; font-weight: 700; }

/* Hero / editorial lead */
.hero {
  position: relative;
  padding: 28px 0 40px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 28px;
  align-items: center;
}
.hero-visual { position: relative; min-width: 0; }
.hero-visual img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}
.photo-note,
.layered-note {
  position: absolute;
  right: 6%;
  bottom: -18px;
  width: min(240px, 58%);
  background: var(--note);
  color: var(--text);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: rotate(-2.2deg);
  font-size: 14px;
  line-height: 1.45;
}
.photo-note strong,
.layered-note strong { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.hero-copy { min-width: 0; }
.hero-copy h1,
#hero-h {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.hero-lede {
  font-size: 18px;
  max-width: 38ch;
  margin: 0 0 20px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-ink);
  margin: 0 0 10px;
}

/* Bands and chapters */
.band,
.section {
  padding: 56px 0;
}
.band-paper { background: var(--paper); }
.band-wash { background: var(--surface-2); }
.band-ink { background: var(--text); color: #E8F3E4; }
.band-ink a { color: #fff; }
.band-ink .muted,
.band-ink p { color: #C5D6C2; }

.chapter-head h2,
.section h2,
.page-hero h1 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.lede { max-width: 62ch; color: var(--muted); margin: 0 0 24px; }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 16px; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

/* Split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.split > * { min-width: 0; }
.split img { aspect-ratio: 16 / 10; object-fit: cover; }

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.time-step,
.step-card {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius);
  min-width: 0;
}
.step-num,
.time-num {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

/* Choice / hover-reveal */
.choice-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.choice,
.evidence-card,
.data-card,
.card,
.loose-card,
.hub-card {
  background: var(--surface);
  padding: 20px;
  min-width: 0;
  border-radius: var(--radius);
  position: relative;
}
.choice { border: 1px solid transparent; }
.choice:hover,
.choice:focus-within,
.evidence-card:hover,
.evidence-card:focus-within {
  background: var(--paper);
}
.choice .extra,
.evidence-card .extra {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}
.choice:hover,
.choice:focus-within,
.evidence-card:hover,
.evidence-card:focus-within {
  box-shadow: inset 0 0 0 1px var(--primary-border);
}

/* Collage gallery */
.collage {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.collage figure { margin: 0; position: relative; min-width: 0; }
.collage img { aspect-ratio: 4 / 3; object-fit: cover; }
.collage figcaption,
.caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* Ledger / tables */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th { font-weight: 700; }

.def-list,
.inventory {
  display: grid;
  gap: 0;
}
.def-list div,
.inventory div {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.def-list dt,
.inventory dt { font-weight: 700; }

/* Feed */
.feed { display: grid; gap: 0; }
.feed a,
.news-item {
  display: grid;
  grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.feed time,
.news-item time { color: var(--muted); font-size: 13px; font-weight: 600; }

/* FAQ */
.faq-grid,
.community { display: grid; gap: 8px; }
.q-item,
.faq details {
  background: var(--surface);
  padding: 4px 16px;
}
.q-item summary,
.faq summary {
  cursor: pointer;
  font-weight: 650;
  padding: 12px 0;
  list-style: none;
}
.q-item summary::-webkit-details-marker { display: none; }
.q-body { padding: 0 0 14px; color: var(--muted); }

/* Inline images */
.inline-image-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 28px 0;
}
.inline-image-row img,
.inline-image-row .visual img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* Page hero for children */
.page-hero {
  padding: 28px 0 12px;
}
.page-hero-img img {
  aspect-ratio: 16 / 7;
  object-fit: cover;
  margin-top: 18px;
}
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumbs a { color: var(--muted); }

/* CTA band */
.cta-banner,
.cta-card {
  background: var(--surface-2);
  padding: 36px;
  display: grid;
  gap: 12px;
}
.cta-pair { display: flex; flex-wrap: wrap; gap: 10px; }

/* Footer */
.site-footer {
  background: var(--text);
  color: #D7E6D4;
  padding: 48px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 8px; }
.site-footer a { color: #D7E6D4; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-note {
  margin-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
  font-size: 13px;
  color: #A9C0A6;
}

/* Sticky mobile CTA */
.mobile-sticky {
  display: none;
}

/* Utility classes required by verify */
.card { border: 1px solid var(--border); padding: 20px; }
.data-card { border: 1px solid var(--border); padding: 20px; }
.step-card { border: 1px solid var(--border); padding: 18px; }
.loose-card {
  background: linear-gradient(135deg, rgba(44,122,54,0.08) 0%, rgba(44,122,54,0.02) 100%);
  border: 2px solid rgba(44,122,54,0.28);
  border-radius: 4px;
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.hub-card { border: 1px solid var(--border); padding: 20px; }
.stat-tile,
.stat-card {
  background: var(--surface);
  padding: 16px;
  border: 1px solid var(--border);
}
.hub-card a { text-decoration: none; color: inherit; display: block; }
.hub-card img { aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 10px; }
.collage { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.poster-grid,
.hub-grid,
.card-grid,
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.disclaimer {
  font-size: 14px;
  color: var(--muted);
}

.related-links ul { padding-left: 18px; }

/* Mobile */
@media (max-width: 899px) {
  .main-nav,
  .header-cta,
  .header-cta-ghost { display: none; }
  .hamburger { display: inline-flex; }
  .header-inner { grid-template-columns: 1fr auto; }
  .hero-grid,
  .split,
  .timeline,
  .choice-rail,
  .collage,
  .inline-image-row,
  .footer-grid,
  .grid-2,
  .grid-3,
  .poster-grid,
  .hub-grid,
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .def-list div,
  .inventory div,
  .feed a,
  .news-item { grid-template-columns: minmax(0, 1fr); }
  .hero {
    min-height: 0;
    max-height: none;
    height: auto;
    padding: 20px 0 28px !important;
    overflow: visible;
  }
  .hero-trust,
  .score-strip { display: none !important; }
  #hero-h { font-size: 32px !important; line-height: 1.1 !important; }
  .hero-lede { font-size: 16px !important; }
  .hero-cta .btn { flex: 1 1 auto !important; }
  .photo-note,
  .layered-note { position: static; transform: none; width: auto; margin-top: 10px; }
  .mobile-sticky {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 240;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(246,251,243,0.96);
    border-top: 1px solid var(--border);
  }
  .mobile-sticky .btn {
    width: 100%;
    white-space: nowrap;
  }
  body.has-sticky { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .page-hero-img img { aspect-ratio: 16 / 9; }
}

@media (max-width: 430px) {
  .container { width: min(var(--max), calc(100% - 24px)); }
}
