/* ============================================================
   GRAVITY — shared stylesheet
   Editorial / scientific-publishing aesthetic.
   Warm off-white, near-black ink, one accent (Klein blue).
   ============================================================ */

:root {
  --bg: #faf9f6;
  --bg-raised: #ffffff;
  --bg-sunk: #f2f0e9;
  --ink: #17160f;
  --ink-soft: #55534a;
  --ink-faint: #8b887b;
  --hairline: #ddd9cc;
  --hairline-strong: #c7c3b3;
  --accent: #1E3A8A;
  --accent-ink: #16295e;
  --accent-soft: #e7ebf9;
  --accent-soft-2: #eef1fb;
  --killed: #a8a496;
  --killed-bg: #f1efe7;

  --font-display: "Fraunces", "Newsreader", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1160px;
  --radius: 3px;

  --shadow-card: 0 1px 2px rgba(23, 22, 15, 0.04), 0 8px 24px -12px rgba(23, 22, 15, 0.12);
  --shadow-modal: 0 20px 60px -12px rgba(23, 22, 15, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  line-height: 1.05;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

button {
  font-family: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}

.eyebrow.accent {
  color: var(--accent);
}

/* ---------------------------------------------------------- */
/* Site header                                                 */
/* ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.wordmark .dot {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-cta {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 9px 20px !important;
  color: var(--ink) !important;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--bg) !important;
}

/* ---------------------------------------------------------- */
/* Buttons                                                      */
/* ---------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 3px;
  border: 1px solid transparent;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color .15s ease;
  letter-spacing: 0.01em;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--hairline-strong);
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 18px 30px;
  font-size: 16px;
}

/* ---------------------------------------------------------- */
/* Hero                                                         */
/* ---------------------------------------------------------- */

.hero {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--hairline);
}

.hero-kicker {
  margin-bottom: 22px;
}

.hero h1.cover-headline {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: none;
  font-size: clamp(3.4rem, 7.4vw, 6.6rem);
  letter-spacing: -0.01em;
  line-height: 0.92;
  max-width: 15ch;
}

.hero .hero-tagline {
  margin-top: 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: var(--accent);
}

.hero .subline {
  margin-top: 30px;
  max-width: 640px;
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
  font-weight: 400;
}

.hero .hero-actions {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-note {
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------- */
/* Stats strip                                                  */
/* ---------------------------------------------------------- */

.stats-strip {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-sunk);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat-cell {
  padding: 30px 40px;
  border-left: 1px solid var(--hairline);
}

.stat-cell:first-child {
  border-left: none;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stat-value .unit {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-left: 2px;
}

.stat-label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.stat-pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  animation: pulse 2.4s ease-in-out infinite;
  position: relative;
  top: -2px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.72); }
}

/* ---------------------------------------------------------- */
/* Section headers                                              */
/* ---------------------------------------------------------- */

.section {
  padding: 88px 0;
}

.section.tight {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 44px;
  gap: 24px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  max-width: 20ch;
}

.section-head .section-desc {
  max-width: 360px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------------------------------------------------------- */
/* Problem cards                                                */
/* ---------------------------------------------------------- */

.problem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}

.problem-card {
  background: var(--bg-raised);
  padding: 40px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.problem-card.flagship {
  background: var(--ink);
  color: var(--bg);
}

.problem-card .card-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 18px;
}

.problem-card.flagship .card-tag {
  color: #8ea2ea;
}

.problem-card h3 {
  font-size: 27px;
  line-height: 1.15;
  margin-bottom: 22px;
  max-width: 26ch;
}

.problem-card .card-meta {
  display: flex;
  gap: 28px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.card-meta-item .val {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  display: block;
}

.card-meta-item .lbl {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.problem-card.flagship .card-meta-item .lbl {
  color: #b7b4a8;
}

.card-live-metric {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  margin-top: auto;
  margin-bottom: 20px;
}

.problem-card.flagship .card-live-metric {
  border-top-color: #3a382f;
  color: #cbc8ba;
}

.mini-pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}

.problem-card.flagship .mini-pulse {
  background: #6f89e8;
}

.problem-card .funding-bar {
  margin-bottom: 20px;
}

.mass-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13.5px;
  color: #b7b4a8;
  margin-bottom: 18px;
}

.problem-card .btn {
  align-self: flex-start;
}

/* Funding bar (Tufte-ish) */
.funding-bar-track {
  height: 4px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.problem-card.flagship .funding-bar-track {
  background: #34321f;
  background: #3a382f;
}

.funding-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.problem-card.flagship .funding-bar-fill {
  background: #6f89e8;
}

.funding-bar-label {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
}

.problem-card.flagship .funding-bar-label {
  color: #b7b4a8;
}

/* ---------------------------------------------------------- */
/* How it works                                                 */
/* ---------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.step .step-num {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

.step h3 {
  font-size: 23px;
  margin-bottom: 12px;
  max-width: 16ch;
}

.step p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------------------------------------------------------- */
/* Manifesto                                                    */
/* ---------------------------------------------------------- */

.manifesto {
  background: var(--ink);
  color: var(--bg);
}

.manifesto blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.4;
  max-width: 22ch;
}

.manifesto cite {
  display: block;
  margin-top: 28px;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: #9a97c9;
  color: #8891c9;
  color: #9098d6;
}

/* ---------------------------------------------------------- */
/* Activity feed                                                */
/* ---------------------------------------------------------- */

.activity-feed {
  border: 1px solid var(--hairline);
  background: var(--bg-raised);
}

.activity-feed-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-soft);
}

.activity-feed-head .label {
  font-weight: 600;
  color: var(--ink);
}

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: hidden;
}

.feed-list li {
  display: flex;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
  animation: feedIn 0.5s ease both;
}

.feed-list li:last-child {
  border-bottom: none;
}

.feed-time {
  color: var(--ink-faint);
  font-size: 12px;
  flex-shrink: 0;
  width: 52px;
  padding-top: 1px;
}

.feed-text {
  color: var(--ink);
}

.feed-text .accent-word {
  color: var(--accent);
  font-weight: 600;
}

@keyframes feedIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------- */
/* Footer                                                        */
/* ---------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 64px 0 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 48px;
}

.footer-brand .wordmark {
  margin-bottom: 14px;
}

.footer-brand p {
  max-width: 32ch;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.footer-cols {
  display: flex;
  gap: 64px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.footer-col a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ---------------------------------------------------------- */
/* Engine CTA (index.html + how-it-works.html)                 */
/* ---------------------------------------------------------- */

.engine-cta-panel {
  border: 1px solid var(--ink);
  background: var(--bg-raised);
  padding: 40px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.engine-cta-panel .engine-cta-copy {
  max-width: 520px;
}

.engine-cta-panel h3 {
  font-size: 24px;
  margin: 10px 0 10px;
}

.engine-cta-panel p {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}

.engine-cta-panel .btn {
  flex-shrink: 0;
}

@media (max-width: 740px) {
  .engine-cta-panel {
    padding: 26px 22px;
    flex-direction: column;
    align-items: flex-start;
  }
  .engine-cta-panel .btn {
    width: 100%;
  }
}

/* ============================================================
   PROBLEM PAGE
   ============================================================ */

.problem-hero {
  padding: 52px 0 40px;
  border-bottom: 1px solid var(--hairline);
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 24px;
}

.breadcrumb a {
  text-decoration: none;
  color: var(--ink-faint);
}

.breadcrumb a:hover {
  color: var(--ink);
}

.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 28px;
}

.mode-toggle button {
  border: none;
  background: transparent;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink-soft);
}

.mode-toggle button.active {
  background: var(--ink);
  color: var(--bg);
}

.problem-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.problem-title-row h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  max-width: 18ch;
  line-height: 1.02;
}

.problem-status-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 14px;
}

.problem-subline {
  margin-top: 18px;
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 62ch;
  line-height: 1.6;
}

.proposer-line {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.proposer-line .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body);
}

/* Layout: main content + sidebar */

.problem-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  padding: 56px 0;
  align-items: start;
}

.problem-main {
  display: flex;
  flex-direction: column;
  gap: 56px;
  min-width: 0;
}

.problem-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  border: 1px solid var(--hairline);
  background: var(--bg-raised);
  padding: 28px;
}

.panel h3 {
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 6px;
}

.back-panel {
  border: 1px solid var(--ink);
  padding: 30px 28px;
}

.back-panel .big-total {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  margin: 10px 0 2px;
}

.back-panel .big-total-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.back-panel .btn {
  margin-top: 6px;
}

.mini-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  font-size: 13.5px;
}

.mini-stat-row:first-of-type {
  border-top: none;
}

.mini-stat-row .lbl {
  color: var(--ink-soft);
}

.mini-stat-row .val {
  font-weight: 600;
  font-family: var(--font-display);
}

/* Counters row */

.counter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hairline);
}

.counter-cell {
  padding: 26px 24px;
  border-left: 1px solid var(--hairline);
}

.counter-cell:first-child {
  border-left: none;
}

.counter-cell .stat-value {
  font-size: 28px;
}

/* Story */

.story h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.story .lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 18px;
}

.story p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.story p:last-child {
  margin-bottom: 0;
}

/* Sparkline */

.sparkline-block {
  border: 1px solid var(--hairline);
  padding: 26px 28px;
}

.sparkline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.sparkline-head h3 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
}

.sparkline-head .current-score {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}

.sparkline-caption {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
}

/* Evidence ladder */

.evidence-ladder-block {
  border: 1px solid var(--hairline);
}

.evidence-ladder-block .block-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--hairline);
}

.evidence-ladder-block .block-head h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.evidence-ladder-block .block-head p {
  font-size: 13.5px;
  color: var(--ink-soft);
}

.ladder-legend {
  display: flex;
  gap: 26px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-sunk);
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.ladder-legend span {
  flex: 1;
  text-align: center;
}
.ladder-legend span:first-child{ text-align:left; flex: 0 0 140px; }

.candidate-row {
  padding: 22px 28px;
  border-bottom: 1px solid var(--hairline);
}

.candidate-row:last-child {
  border-bottom: none;
}

.candidate-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 16px;
}

.candidate-id {
  font-weight: 600;
  font-size: 14.5px;
}

.candidate-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.candidate-status-label {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.ladder {
  display: flex;
  align-items: center;
  flex: 0 0 140px;
  margin-right: 0;
}

.candidate-ladder-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.ladder-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  position: relative;
  width: 100%;
}

.ladder-track::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  height: 1px;
  background: var(--hairline-strong);
  z-index: 0;
}

.ladder-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ladder-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--hairline-strong);
}

.ladder-node.lit .ladder-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.ladder-node.current .ladder-dot {
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.ladder-node-label {
  font-size: 10.5px;
  color: var(--ink-faint);
  text-transform: none;
  letter-spacing: 0.04em;
  text-align: center;
}

.ladder-node.lit .ladder-node-label {
  color: var(--ink-soft);
}

/* Updates feed reuse .activity-feed but bigger */

.updates-block .feed-list li {
  align-items: flex-start;
}

.updates-block .feed-text strong {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
}

/* ---------------------------------------------------------- */
/* Research mode                                                */
/* ---------------------------------------------------------- */

.spec-block {
  border: 1px solid var(--hairline);
}

.spec-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--hairline);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-row .spec-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  padding-top: 2px;
}

.spec-row .spec-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.spec-row ul {
  margin: 0;
  padding-left: 18px;
}

.spec-row li {
  margin-bottom: 6px;
}

.spec-row li:last-child {
  margin-bottom: 0;
}

.mono {
  font-family: "SF Mono", "Menlo", monospace;
  font-size: 13px;
}

/* task graph */

.graph-block {
  border: 1px solid var(--hairline);
  padding: 8px;
  overflow-x: auto;
}

.graph-legend {
  display: flex;
  gap: 22px;
  padding: 14px 20px;
  font-size: 12px;
  color: var(--ink-soft);
}

.graph-legend .item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-swatch.active { border: 1.5px solid var(--ink); background: #fff; }
.legend-swatch.promoted { background: var(--accent); }
.legend-swatch.killed { border: 1.5px dashed var(--killed); background: var(--killed-bg); }

/* tables */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}

.data-table thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--hairline-strong);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table td.num {
  font-variant-numeric: tabular-nums;
}

.tag-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.tag-pill.promoted { background: var(--accent-soft); color: var(--accent); }
.tag-pill.killed { background: var(--killed-bg); color: #7a7767; text-decoration: line-through; }
.tag-pill.active { background: var(--bg-sunk); color: var(--ink-soft); border: 1px solid var(--hairline-strong); }
.tag-pill.pending { background: var(--bg-sunk); color: var(--ink-soft); }

.negative-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
}

.negative-list li {
  padding: 18px 24px;
  border-bottom: 1px solid var(--hairline);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.negative-list li:last-child { border-bottom: none; }

.negative-list li strong {
  color: var(--ink);
  font-weight: 600;
}

.raw-links {
  columns: 2;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.raw-links li {
  margin-bottom: 10px;
  break-inside: avoid;
}

.raw-links a {
  font-size: 13px;
  text-decoration: none;
  color: var(--accent);
  font-family: "SF Mono", Menlo, monospace;
}

.raw-links a:hover {
  text-decoration: underline;
}

/* task graph nodes */

.graph-svg {
  display: block;
  width: 100%;
  height: auto;
}

.gnode rect {
  stroke-width: 1.4;
}

.gnode .title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
}

.gnode .meta {
  font-family: var(--font-body);
  font-size: 10.5px;
}

.gnode.root rect { fill: var(--ink); stroke: var(--ink); }
.gnode.root .title { fill: #fff; }
.gnode.root .meta { fill: #c7c4b6; }

.gnode.active rect { fill: #fff; stroke: var(--ink); }
.gnode.active .title { fill: var(--ink); }
.gnode.active .meta { fill: var(--ink-soft); }

.gnode.promoted rect { fill: var(--accent); stroke: var(--accent); }
.gnode.promoted .title { fill: #fff; }
.gnode.promoted .meta { fill: #dbe2fa; }

.gnode.killed rect { fill: var(--killed-bg); stroke: var(--killed); stroke-dasharray: 4 3; }
.gnode.killed .title { fill: #7a7767; text-decoration: line-through; }
.gnode.killed .meta { fill: #9a9686; }

.gedge {
  fill: none;
  stroke: var(--hairline-strong);
  stroke-width: 1.4;
}

.gedge.killed {
  stroke: var(--killed);
  stroke-dasharray: 3 3;
}

.gedge.promoted {
  stroke: var(--accent);
  stroke-width: 1.6;
}

.gcol-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  fill: var(--ink-faint);
}

/* ============================================================
   MODAL — back-flow
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 22, 15, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-raised);
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.22s ease;
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 28px 0;
}

.modal-head .eyebrow {
  margin-bottom: 6px;
}

.modal-head h2 {
  font-size: 22px;
  max-width: 22ch;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-faint);
  padding: 4px;
}

.modal-close:hover {
  color: var(--ink);
}

.modal-body {
  padding: 22px 28px 30px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.amount-btn {
  border: 1px solid var(--hairline-strong);
  background: var(--bg-raised);
  padding: 14px 4px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  border-radius: 3px;
  cursor: pointer;
}

.amount-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.custom-amount-wrap {
  display: none;
  align-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 3px;
  padding: 0 14px;
  margin-bottom: 22px;
}

.custom-amount-wrap.visible {
  display: flex;
}

.custom-amount-wrap span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink-soft);
}

.custom-amount-wrap input {
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  padding: 13px 8px;
  width: 100%;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.preview-box {
  background: var(--bg-sunk);
  border: 1px solid var(--hairline);
  padding: 20px 22px;
  margin-bottom: 22px;
}

.preview-box .preview-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.preview-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.preview-stats .p-stat {
  flex: 1;
}

.preview-stats .p-val {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: var(--accent);
}

.preview-stats .p-lbl {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.35;
}

/* modal stages */

.modal-stage {
  display: none;
}

.modal-stage.active {
  display: block;
}

.stage-confirming {
  text-align: center;
  padding: 30px 0 10px;
}

.pulse-dot-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.pulse-dot-row .d {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotFade 1.2s ease-in-out infinite;
}

.pulse-dot-row .d:nth-child(2) { animation-delay: 0.15s; }
.pulse-dot-row .d:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotFade {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.stage-confirming p {
  color: var(--ink-soft);
  font-size: 15px;
}

.stage-confirmed .joined-line {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.35;
  margin-bottom: 26px;
}

.stage-confirmed .joined-line .accent-num {
  color: var(--accent);
}

.overnight-card {
  border: 1px solid var(--ink);
  padding: 22px;
  background: var(--bg);
}

.overnight-card .eyebrow {
  margin-bottom: 10px;
}

.overnight-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.overnight-card p strong {
  color: var(--ink);
  font-weight: 600;
}

.overnight-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.overnight-stats .o-stat {
  text-align: center;
  padding: 10px 4px;
  background: var(--bg-sunk);
}

.overnight-stats .o-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}

.overnight-stats .o-lbl {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 2px;
  line-height: 1.3;
}

.modal-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

/* ---------------------------------------------------------- */
/* Utility                                                       */
/* ---------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

@media (max-width: 980px) {
  .problem-layout {
    grid-template-columns: 1fr;
  }
  .problem-sidebar {
    position: static;
  }
  .problem-grid, .stats-grid, .steps, .counter-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-top {
    flex-direction: column;
    gap: 32px;
  }
}

/* ============================================================
   RESPONSIVE — nav (all 5 pages share this markup, so this is
   the single place the nav-overflow fix lives)
   ============================================================ */

@media (max-width: 1200px) {
  .site-header .container {
    gap: 16px;
  }
  .wordmark {
    flex-shrink: 0;
  }
  .site-nav {
    flex: 1 1 auto;
    min-width: 0;
    gap: 22px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* right-edge fade hints there's more to scroll */
    mask-image: linear-gradient(to right, #000 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%);
  }
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  .site-nav a {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav-cta {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ============================================================
   RESPONSIVE — tablet / mobile layout
   Desktop (>740px) is untouched by anything below.
   ============================================================ */

@media (max-width: 740px) {
  /* Global rhythm */
  .container { padding: 0 24px; }
  .section { padding: 56px 0; }
  .section.tight { padding: 40px 0; }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 32px;
  }
  .section-head .section-desc { max-width: 100%; }

  /* Nav — tighten further now there's less room */
  .site-header .container { padding: 0 20px; }
  .wordmark { font-size: 20px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 13px; }
  .nav-cta { padding: 7px 14px !important; }

  /* Hero */
  .hero { padding: 52px 0 40px; }
  .hero h1.cover-headline {
    font-size: clamp(2.6rem, 12vw, 4.4rem);
    max-width: 100%;
  }
  .hero .hero-tagline { font-size: 17px; margin-top: 16px; }
  .hero .subline { font-size: 16px; margin-top: 18px; }
  .hero .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 28px;
  }

  /* Stats strip -> 2x2 */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cell { padding: 20px 18px; min-width: 0; }
  .stat-cell:nth-child(odd) { border-left: none; }
  .stat-cell:nth-child(n+3) {
    border-top: 1px solid var(--hairline);
    border-left: 1px solid var(--hairline);
  }
  .stat-value { font-size: 24px; overflow-wrap: break-word; }
  .stat-value .unit { font-size: 13px; }

  /* Problem cards -> single column, full width */
  .card-tag { flex-wrap: wrap; row-gap: 6px; }
  .problem-grid { grid-template-columns: 1fr; }
  .problem-card { padding: 26px 22px; min-width: 0; }
  .problem-card h3 { font-size: 21px; }
  .card-meta-item .val { font-size: 19px; overflow-wrap: break-word; }

  /* How it works -> stacked steps */
  .steps { grid-template-columns: 1fr; gap: 32px; }

  /* Manifesto */
  .manifesto blockquote { max-width: 100%; }

  /* Activity feed */
  .activity-feed-head { padding: 14px 16px; }
  .feed-list li { padding: 12px 16px; gap: 10px; }

  /* Footer */
  .footer-cols { flex-direction: column; gap: 28px; }

  /* ---- problem.html ---- */
  .problem-hero { padding: 36px 0 28px; }
  .title-badge-row { flex-wrap: wrap; row-gap: 8px; }
  .problem-title-row h1 { max-width: 100%; }
  .proposer-line { flex-wrap: wrap; }

  .problem-layout { gap: 32px; padding: 32px 0; }
  .problem-main { gap: 40px; }
  .problem-sidebar { gap: 16px; }
  .panel { padding: 20px; }
  .back-panel { padding: 22px 20px; }
  .back-panel .big-total { font-size: 30px; overflow-wrap: break-word; }

  .counter-cell { padding: 16px 14px; min-width: 0; }
  .counter-cell .stat-value { font-size: 19px; overflow-wrap: break-word; }

  .story h2 { font-size: 1.6rem; }
  .story .lede { font-size: 17px; }

  .sparkline-block { padding: 20px 18px; }

  /* Evidence ladder — compress rather than truncate */
  .evidence-ladder-block .block-head { padding: 18px 20px; }
  .ladder-legend { padding: 12px 20px; gap: 10px; font-size: 10px; }
  .ladder-legend span:first-child { flex: 0 0 64px; }
  .ladder-legend span { overflow-wrap: break-word; word-break: break-word; }
  .candidate-row { padding: 16px 20px; }
  .candidate-row-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .candidate-status-label { white-space: normal; }
  .ladder-node-label { font-size: 9.5px; overflow-wrap: break-word; word-break: break-word; }

  /* Research mode spec rows -> stacked label/value */
  .spec-row { grid-template-columns: 1fr; gap: 8px; padding: 18px 20px; }

  /* Task graph — scroll instead of squash (container already
     has overflow-x:auto; force the svg to keep its native size) */
  .graph-block .graph-svg { min-width: 760px; }
  .graph-legend { padding: 12px 4px; flex-wrap: wrap; gap: 14px; }

  .raw-links { columns: 1; }
  .raw-links a { word-break: break-all; }

  /* Tables — scroll horizontally in their own container */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .data-table { min-width: 640px; }

  /* Back-flow modal */
  .modal-overlay { padding: 16px; }
  .modal-head { padding: 22px 20px 0; }
  .modal-body { padding: 18px 20px 24px; }
  .amount-grid { gap: 8px; }
  .overnight-stats { gap: 6px; }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .hero h1.cover-headline { font-size: clamp(2.2rem, 13vw, 2.9rem); }
  .problem-title-row h1 { font-size: clamp(1.7rem, 9vw, 2.2rem); }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .overnight-stats { grid-template-columns: repeat(2, 1fr); }
  .modal-actions { flex-direction: column; }
}

/* ===== The Search (swarm animation) ===== */

.search-frame {
  position: relative;
  margin-top: 8px;
  border: 1px solid var(--hairline);
  background: var(--bg-raised);
  height: 78vh;
  min-height: 480px;
  max-height: 820px;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.9s ease;
}

.search-frame.is-fading {
  opacity: 0.22;
}

.search-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.search-canvas-residue { z-index: 1; }
.search-canvas-live { z-index: 2; }

.search-stage-label {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 3;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  pointer-events: none;
}

.search-caption-wrap {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  max-width: 640px;
  width: 86%;
  text-align: center;
  pointer-events: none;
}

.search-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  line-height: 1.4;
  color: var(--ink);
  transition: opacity 0.5s ease;
}

.search-subcaption {
  margin-top: 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink-soft);
  transition: opacity 0.5s ease;
}

.search-counters {
  position: absolute;
  left: 26px;
  bottom: 22px;
  z-index: 3;
  max-width: 60%;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  pointer-events: none;
}

.search-replay {
  position: absolute;
  right: 22px;
  bottom: 20px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-raised);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.search-replay:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.search-replay-icon {
  font-size: 13px;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .search-replay { display: none; }
  .search-frame { cursor: default; }
}

@media (max-width: 740px) {
  .search-frame { height: 60vh; min-height: 420px; }
  .search-stage-label { top: 16px; left: 18px; font-size: 10px; }
  .search-caption-wrap { top: 32%; width: 92%; }
  .search-caption { font-size: clamp(1rem, 4.6vw, 1.3rem); }
  .search-subcaption { font-size: 12.5px; }
  .search-counters { left: 18px; bottom: 16px; font-size: 12.5px; max-width: 66%; }
  .search-replay { right: 14px; bottom: 14px; padding: 7px 12px; font-size: 10.5px; }
}

@media (max-width: 420px) {
  .search-frame { height: 60vh; min-height: 380px; }
  .search-caption-wrap { top: 28%; width: 94%; }
  .search-caption { font-size: clamp(0.92rem, 5vw, 1.1rem); line-height: 1.35; }
  .search-subcaption { font-size: 11.5px; }
  .search-counters { font-size: 11.5px; bottom: 14px; left: 16px; max-width: 68%; line-height: 1.4; }
  .search-replay { right: 12px; bottom: 12px; padding: 6px 10px; font-size: 10px; }
}
