/* ============================================================
   TCP 04 · "The Public Question"
   Interrogative civic architecture: serif questions, three-beat
   answers (Heard / Studied / Changed), a drawn spine.
   Palette: warm white surface, equity blue ink, gold evidence,
   community green outcomes. WCAG 2.2 AA.
   ============================================================ */

:root {
  --paper: #FDFCF8;
  --ink: #14283B;          /* 12.9:1 on paper */
  --ink-soft: #3D5166;     /* 7.0:1 on paper */
  --blue: #005793;         /* brand equity blue, 7.5:1 on paper */
  --blue-deep: #003A63;
  --gold: #FDBE57;
  --gold-ink: #6B4A00;
  --green: #2E7A54;        /* derived from brand green for AA text */
  --orange: #B04E12;       /* derived from brand orange for AA text */
  --line: #D9D3C7;
  --radius: 10px;
  --measure: 62ch;
  --font-serif: "Newsreader", Georgia, serif;
  --font-sans: "Public Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--ink);
  padding: 0.75rem 1.25rem; z-index: 100; font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
.site-header :focus-visible,
.moment :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--blue-deep);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.brand img { width: 132px; height: auto; }
.primary-nav { margin-left: auto; }
.primary-nav ul {
  display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0;
}
.primary-nav a {
  display: block; padding: 0.6rem 0.7rem;
  color: #fff; text-decoration: none;
  font-weight: 600; font-size: 0.95rem;
  border-radius: 6px;
}
.primary-nav a:hover { background: rgba(255,255,255,0.14); }
.header-utils { display: flex; align-items: center; gap: 0.75rem; }

.lang { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font: inherit; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; min-height: 44px;
}
.lang-btn:hover { border-color: #fff; }
.lang-glyph { font-size: 0.85rem; opacity: 0.85; letter-spacing: 0.05em; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(10, 30, 50, 0.25);
  list-style: none; margin: 0; padding: 0.5rem;
  min-width: 220px; max-height: 60vh; overflow: auto;
  z-index: 60;
}
.lang-menu [role="option"] {
  padding: 0.55rem 0.9rem; border-radius: 6px;
  cursor: pointer; font-weight: 500;
}
.lang-menu [role="option"]:hover { background: #EEF4FA; }
.lang-menu [role="option"][aria-selected="true"] {
  background: var(--blue); color: #fff; font-weight: 700;
}
.lang-menu [role="option"]:focus-visible {
  outline: 3px solid var(--blue); outline-offset: -3px;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 700; font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  min-height: 44px;
  cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #FFCD7A; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-deep); }
.btn-line { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-line:hover { background: rgba(0, 87, 147, 0.08); }
.btn-line-light { border-color: rgba(255,255,255,0.7); color: #fff; background: transparent; }
.btn-line-light:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.header-donate { padding: 0.55rem 1.2rem; font-size: 0.9rem; }

.menu-btn {
  display: none;
  align-items: center; gap: 0.5rem;
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 8px; padding: 0.5rem 0.9rem;
  font: inherit; font-weight: 600; cursor: pointer;
  min-height: 44px;
}
.menu-bars, .menu-bars::before, .menu-bars::after {
  content: ""; display: block; width: 18px; height: 2px;
  background: currentColor; position: relative;
}
.menu-bars::before { position: absolute; top: -6px; }
.menu-bars::after { position: absolute; top: 6px; }

/* ---------- Typography ---------- */
.question {
  font-family: var(--font-serif);
  font-weight: 550;
  font-variation-settings: "opsz" 60;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.section-head { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; padding: 0 1.5rem; }
.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 600; margin: 0 0 0.5rem; line-height: 1.15;
}
.section-head p { color: var(--ink-soft); margin: 0; font-size: 1.1rem; }
.section-head.light h2, .section-head.light p { color: #fff; }
.section-head.light p { opacity: 0.85; }

.text-link {
  color: var(--blue); font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px;
}
.text-link:hover { color: var(--blue-deep); }
.text-link.big { display: block; text-align: center; font-size: 1.1rem; margin-top: 2rem; }

.proto { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 4rem;
  align-items: center;
}
.hero-kicker {
  font-size: 0.9rem; font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
}
.hero-question {
  font-size: clamp(2.2rem, 5vw, 3.9rem);
}
.hero-question::after {
  content: "";
  display: block;
  width: 88px; height: 8px;
  background: var(--gold);
  border-radius: 4px;
  margin-top: 1.25rem;
}
.hero-answer {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 1.5rem 0 2rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.75rem; }
.hero-now {
  border-left: 4px solid var(--gold);
  padding-left: 1rem;
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 0;
}
.hero-now a { color: var(--blue); font-weight: 600; }
.hero-figure { margin: 0; }
.hero-figure img {
  border-radius: var(--radius);
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  width: 100%;
}
.hero-figure figcaption {
  font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem;
}

/* ---------- How change happens (spine) ---------- */
.how {
  background: #fff;
  border-block: 1px solid var(--line);
  padding: 4.5rem 1.5rem;
}
.spine {
  position: relative;
  max-width: 1200px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  list-style: none; padding: 3rem 0 0; counter-reset: step;
}
.spine-line {
  position: absolute; top: 0.5rem; left: 0;
  width: 100%; height: 8px;
}
.spine-line line {
  stroke: var(--blue);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 100;
  transition: stroke-dashoffset 1.4s ease;
}
/* Hidden initial states apply ONLY when JS is running (html.js),
   so all content is visible by default and without scripts. */
html.js .spine-line line { stroke-dashoffset: 100; }
html.js .spine.is-visible .spine-line line { stroke-dashoffset: 0; }
.spine-step { position: relative; padding-top: 1rem; }
.spine-dot {
  position: absolute; top: -3rem; left: 0;
  width: 20px; height: 20px;
  background: var(--paper);
  border: 5px solid var(--blue);
  border-radius: 50%;
  transition: transform 0.4s ease;
}
html.js .spine-dot { transform: scale(0); }
.spine.is-visible .spine-step:nth-child(2) .spine-dot { transition-delay: 0.15s; }
.spine.is-visible .spine-step:nth-child(3) .spine-dot { transition-delay: 0.45s; }
.spine.is-visible .spine-step:nth-child(4) .spine-dot { transition-delay: 0.75s; }
.spine.is-visible .spine-step:nth-child(5) .spine-dot { transition-delay: 1.05s; }
.spine.is-visible .spine-dot { transform: scale(1); }
.spine-step h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem; font-weight: 650; margin: 0 0 0.5rem;
}
.spine-step p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Question blocks ---------- */
.questions { position: relative; max-width: 1280px; margin: 0 auto; }
.q-rail {
  position: sticky; top: 40vh;
  float: left;
  display: flex; flex-direction: column; gap: 1rem;
  padding-left: 1.5rem;
  width: 60px;
}
.q-rail-item {
  font-family: var(--font-serif);
  font-size: 0.95rem; font-weight: 600;
  color: #6d665d;
  border-top: 2px solid var(--line);
  padding-top: 0.3rem;
  width: 36px;
  transition: color 0.3s, border-color 0.3s;
}
.q-rail-item.is-current { color: var(--blue); border-color: var(--gold); }

.q-block {
  padding: 5rem 1.5rem 5rem calc(60px + 3rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  grid-template-areas:
    "kicker figure"
    "question figure"
    "answer figure"
    "actions figure";
  column-gap: 3.5rem;
  align-items: start;
  border-bottom: 1px solid var(--line);
}
.q-kicker {
  grid-area: kicker;
  margin: 0 0 1rem;
  font-weight: 700; font-size: 0.9rem;
  color: var(--green);
}
.q-block .question {
  grid-area: question;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  margin-bottom: 2rem;
}
.q-answer { grid-area: answer; display: grid; gap: 1.25rem; margin-bottom: 2rem; }
.q-step {
  border-left: 4px solid var(--line);
  padding: 0.25rem 0 0.25rem 1.25rem;
  transition: opacity 0.55s ease, transform 0.55s ease, border-color 0.55s ease;
}
html.js .q-step:not(.is-visible) { opacity: 0; transform: translateY(16px); }
/* Without JS, colored beat markers still apply */
html:not(.js) .q-step:nth-child(1) { border-color: var(--gold); }
html:not(.js) .q-step:nth-child(2) { border-color: var(--blue); }
html:not(.js) .q-step:nth-child(3) { border-color: var(--green); }
.q-step.is-visible { opacity: 1; transform: none; }
.q-step:nth-child(1).is-visible { border-color: var(--gold); }
.q-step:nth-child(2).is-visible { border-color: var(--blue); transition-delay: 0.18s; }
.q-step:nth-child(3).is-visible { border-color: var(--green); transition-delay: 0.36s; }
.q-step h3 {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.02rem; font-weight: 800;
  text-transform: none; margin: 0 0 0.35rem;
}
.q-step-mark {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.q-step-mark.heard { background: var(--gold); }
.q-step-mark.studied { background: var(--blue); }
.q-step-mark.changed { background: var(--green); }
.q-step p { margin: 0; color: var(--ink-soft); max-width: 58ch; }
.q-step em { font-style: italic; }
.q-figure { grid-area: figure; margin: 0; align-self: center; }
.q-figure img {
  border-radius: var(--radius);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.q-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }

/* ---------- Voice + evidence ---------- */
.voice { background: var(--blue-deep); color: #fff; padding: 5rem 1.5rem; }
.voice-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 4fr);
  gap: 3rem; align-items: center;
}
.voice-quote { margin: 0; }
.voice-quote p {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.25; font-weight: 500;
  margin: 0 0 1.25rem;
}
.voice-quote p::before { content: ""; display: block; width: 64px; height: 6px; background: var(--gold); border-radius: 3px; margin-bottom: 1.5rem; }
.voice-quote cite { font-style: normal; opacity: 0.85; font-size: 0.95rem; }
.voice-fact { font-size: 1.15rem; margin: 0 0 0.75rem; }
.voice-evidence p:not(.voice-fact) { opacity: 0.85; margin: 0 0 1.5rem; }
.voice-figure { margin: 0; }
.voice-figure img { border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; }

/* ---------- Policy moment ---------- */
.moment { background: var(--blue); color: #fff; padding: 5rem 1.5rem; }
.moment-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.moment-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.moment-card h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem; font-weight: 650; margin: 0;
}
.moment-card p { margin: 0; opacity: 0.92; }
.moment-card .btn { align-self: flex-start; margin-top: auto; }
.agenda-list { margin: 0; padding: 0 0 0 1.1rem; display: grid; gap: 0.5rem; }
.agenda-list li::marker { color: var(--gold); }
.moment-note { font-size: 0.85rem; opacity: 0.75; margin-top: auto; }

/* ---------- Research list ---------- */
.research { padding: 5rem 1.5rem; max-width: 1000px; margin: 0 auto; }
.research-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.research-list a {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1.5rem; align-items: baseline;
  padding: 1.25rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.research-list a:hover .research-title { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.research-date { font-size: 0.9rem; font-weight: 700; color: var(--orange); }
.research-title { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 550; }
.research-type {
  font-size: 0.8rem; font-weight: 700;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0.25rem 0.75rem;
}

/* ---------- News ---------- */
.news { padding: 0 1.5rem 5rem; max-width: 1000px; margin: 0 auto; }
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.news-item { border-top: 4px solid var(--gold); padding-top: 1rem; }
.news-date { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); margin: 0 0 0.4rem; }
.news-item h3 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; margin: 0 0 0.5rem; line-height: 1.25; }
.news-item h3 a { color: inherit; text-decoration: none; }
.news-item h3 a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.news-item p { margin: 0; color: var(--ink-soft); }

/* ---------- Close ---------- */
.close {
  background: #fff; border-top: 1px solid var(--line);
  padding: 5rem 1.5rem; text-align: center;
}
.close-question { font-size: clamp(2rem, 4vw, 3rem); }
.close > p { color: var(--ink-soft); font-size: 1.15rem; max-width: 54ch; margin: 1rem auto 2.5rem; }
.close-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; max-width: 1000px; margin: 0 auto;
}
.close-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem; text-align: left;
  text-decoration: none; color: inherit;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.close-card:hover { border-color: var(--blue); transform: translateY(-3px); }
.close-card h3 { font-family: var(--font-serif); font-size: 1.35rem; margin: 0 0 0.4rem; }
.close-card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-deep); color: #fff; padding: 4rem 1.5rem 3rem; }
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 3rem;
}
.footer-brand img { width: 150px; margin-bottom: 1rem; }
.footer-brand p { margin: 0; opacity: 0.85; }
.footer-brand a { color: #fff; }
.footer-nav h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; margin: 0 0 0.75rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-nav a { color: #fff; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-note p:first-child { font-family: var(--font-serif); font-size: 1.1rem; font-style: italic; margin: 0 0 1rem; }
.footer-note .proto { color: rgba(255,255,255,0.65); }

/* ---------- Language toast ---------- */
.lang-toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  border-radius: 999px;
  padding: 0.8rem 1.5rem;
  font-weight: 600; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 90; max-width: min(90vw, 560px); text-align: center;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding-top: 3rem; }
  .hero-figure img { aspect-ratio: 16 / 9; }
  .q-rail { display: none; }
  .q-block { padding-left: 1.5rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); column-gap: 2rem; }
  .voice-grid { grid-template-columns: 1fr 1fr; }
  .voice-figure { grid-column: 1 / -1; }
  .voice-figure img { aspect-ratio: 21 / 9; }
  .moment-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .primary-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--blue-deep);
    border-bottom: 3px solid var(--gold);
    padding: 0.5rem 1rem 1.25rem;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav a { padding: 0.85rem 0.75rem; font-size: 1.05rem; }
  .menu-btn { display: flex; }
  .header-donate { display: none; }
}

@media (max-width: 768px) {
  .q-block {
    grid-template-columns: 1fr;
    grid-template-areas: "kicker" "question" "figure" "answer" "actions";
  }
  .q-figure { margin-bottom: 2rem; }
  .q-figure img { aspect-ratio: 16 / 10; }
  .spine { grid-template-columns: 1fr; padding-top: 0; padding-left: 2.25rem; }
  .spine-line { top: 0; left: 0.55rem; width: 8px; height: 100%; }
  .spine-line line { x1: 4; y1: 0; x2: 4; y2: 8; }
  .spine-dot { top: 0.35rem; left: -2.25rem; }
  .news-grid, .close-grid { grid-template-columns: 1fr; }
  .voice-grid { grid-template-columns: 1fr; }
  .voice-figure img { aspect-ratio: 16 / 10; }
}

@media (max-width: 480px) {
  body { font-size: 1rem; }
  .header-inner { padding: 0.6rem 1rem; gap: 0.75rem; }
  .brand img { width: 108px; }
  .hero { padding: 2.5rem 1rem 3rem; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .research-list a { grid-template-columns: 1fr; gap: 0.35rem; }
  .research-type { justify-self: start; }
  .q-actions .btn { width: 100%; text-align: center; }
}

/* ============================================================
   Reduced motion: everything visible, states instant.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .q-step { opacity: 1; transform: none; }
  .q-step:nth-child(1) { border-color: var(--gold); }
  .q-step:nth-child(2) { border-color: var(--blue); }
  .q-step:nth-child(3) { border-color: var(--green); }
  .spine-line line { stroke-dashoffset: 0; }
  .spine-dot { transform: scale(1); }
  .close-card:hover { transform: none; }
}
