@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:wght@500;600&display=swap");

:root {
  --bg: #0f1b22;
  --bg-2: #15232c;
  --ink: #f4efe6;
  --muted: #9aa3a9;
  --line: #3a4a53;
  --gold: #e8c36a;
  --red: #c4453c;
  --green: #6fbf8a;
  --blue: #7eb4e2;
  --hatch: rgba(221, 209, 209, 0.035);
  --shadow: transparent;
  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

html[data-theme="light"] {
  --bg: #faf9f4;
  --bg-2: #f5efe1;
  --ink: #1a1c1b;
  --muted: #5c5a52;
  --line: #cfc6b3;
  --gold: #8a5a12;
  --red: #9f2d28;
  --green: #1f6b45;
  --blue: #155a8a;
  --hatch: rgba(0, 0, 0, 0.035);
}

html[data-cb="1"] {
  --gold: #e0d36a;
  --red: #d07a2a;
  --green: #3d8fd1;
}

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

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 38px,
    var(--hatch) 38px,
    var(--hatch) 40px
  );
  background-size: 82px 82px;
  animation: scroll-diagonal 5s linear infinite;
}

@keyframes scroll-diagonal {
  from { background-position: 0 0; }
  to { background-position: 82px 82px; }
}

a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold);
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.masthead,
main,
.site-footer {
  width: min(1080px, calc(100% - 32px));
  margin-inline: auto;
}

.masthead {
  padding: 48px 0 12px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.masthead h1 {
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 14vw, 8.4rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 0.82;
  text-transform: uppercase;
}

.masthead h1 span {
  display: block;
  color: var(--gold);
}

.lede {
  max-width: 42rem;
  margin-top: 18px;
  color: var(--muted);
  font-size: 1.02rem;
}

.hero {
  padding: 36px 0 8px;
}

.answer-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.answer {
  font-family: var(--font-display);
  font-size: clamp(4.8rem, 16vw, 9.5rem);
  line-height: 0.85;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-top: 6px;
}

.answer-sub {
  font-size: 1.15rem;
  color: var(--muted);
  margin-top: 8px;
}

.hero-days {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.hero-days-value {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 10vw, 6.4rem);
  line-height: 0.9;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.hero-days-label {
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress-block {
  padding: 22px 0 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-meta span:nth-child(2) {
  color: var(--gold);
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.progress-bar {
  height: 10px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  overflow: hidden;
}

.progress {
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 0.4s ease;
}

html[data-cb="1"] .progress {
  background: repeating-linear-gradient(
    90deg,
    var(--gold),
    var(--gold) 8px,
    color-mix(in srgb, var(--gold) 55%, var(--bg)) 8px,
    color-mix(in srgb, var(--gold) 55%, var(--bg)) 16px
  );
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  margin: 28px 0;
}

.stat {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.stat:last-child {
  border-bottom: 0;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 600;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.stat-note {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.tick-down {
  color: var(--red);
}

.panel {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  margin: 22px 0;
}

.panel-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  align-items: flex-end;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  font-weight: 400;
  text-transform: uppercase;
}

.panel-head p,
.lede,
.copy-stack p {
  color: var(--muted);
}

.panel-head p {
  margin-top: 4px;
  font-size: 0.92rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.toolbar select,
.text-btn {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 10px;
  cursor: pointer;
}

.text-btn {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.text-btn:hover,
.toolbar select:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.countdown-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.countdown-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 20px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.countdown-item:nth-child(2n) {
  border-right: 0;
}

.countdown-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.milestone-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.milestone {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.milestone:last-child {
  border-bottom: 0;
}

.milestone.done .milestone-value {
  color: var(--muted);
  text-decoration: line-through;
}

.milestone-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.milestone-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.03em;
  line-height: 1;
  margin: 8px 0 6px;
  text-transform: uppercase;
}

.milestone p {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.scoreboard th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.scoreboard td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.scoreboard tr:last-child td {
  border-bottom: 0;
}

.metric-name {
  font-weight: 600;
}

.metric-group {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.metric-detail {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
  max-width: 36rem;
}

.delta {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delta.worse { color: var(--red); }
.delta.better { color: var(--green); }
.delta.watch,
.delta.mixed { color: var(--gold); }

.delta::before {
  margin-right: 6px;
}

.delta.worse::before { content: "↓"; }
.delta.better::before { content: "↑"; }
.delta.watch::before { content: "→"; }
.delta.mixed::before { content: "~"; }

html[data-cb="1"] .delta.worse::before { content: "▼"; }
html[data-cb="1"] .delta.better::before { content: "▲"; }

.now-cell,
.then-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 22px 0;
}

.news-grid .panel {
  margin: 0;
}

.headlines {
  list-style: none;
}

.headlines li {
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
}

.headlines li:last-child {
  border-bottom: 0;
}

.headlines a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.headlines a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.headline-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted {
  color: var(--muted);
  padding: 16px 20px;
}

.timeline {
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold);
}

.timeline h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline p {
  color: var(--muted);
  font-size: 0.92rem;
}

.copy-stack {
  display: grid;
  gap: 28px;
  padding: 12px 0 8px;
}

.copy-stack h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.copy-stack p + p {
  margin-top: 10px;
}

.source-list {
  list-style: none;
  padding: 8px 0 12px;
}

.source-list li {
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
}

.source-list li:last-child {
  border-bottom: 0;
}

.site-footer {
  padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

@media (min-width: 640px) {
  .stat-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .stat {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .stat:last-child {
    border-right: 0;
  }

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

  .countdown-item {
    border-right: 1px solid var(--line);
  }

  .countdown-item:nth-child(2n) {
    border-right: 1px solid var(--line);
  }

  .countdown-item:nth-child(4n) {
    border-right: 0;
  }

  .countdown-item:nth-last-child(-n + 3) {
    border-bottom: 0;
  }

  .milestone-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .milestone {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .milestone:last-child {
    border-right: 0;
  }
}

@media (min-width: 900px) {
  .masthead,
  main,
  .site-footer {
    width: min(1080px, calc(100% - 48px));
  }

  .countdown-list {
    grid-template-columns: repeat(7, 1fr);
  }

  .countdown-item {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .countdown-item:nth-child(2n),
  .countdown-item:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .countdown-item:last-child {
    border-right: 0;
  }

  .news-grid {
    grid-template-columns: 1fr 1fr;
  }

  .timeline li {
    grid-template-columns: 9.5rem 1fr;
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg {
    animation: none;
  }

  .progress {
    transition: none;
  }
}
