/* Tokens and base */
:root {
  --paper: #eef0ed;
  --ink: #1f2326;
  --ink-soft: #4a4f52;
  --asphalt: #3e4245;
  --pavement: #bfc1b8;
  --soot: #7a4a33;
  --grit: #6b6e70;
  --go: #1e9e5a;
  --go-deep: #0d6b3b;
  --card: rgba(250, 251, 249, 0.97);
  --hairline: rgba(31, 35, 38, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.1875rem;
  line-height: 1.55;
}

/* Sticky canvas stage */
#stage-wrap {
  position: relative;
  max-width: 1800px;
  margin: 0 auto;
}

@media (min-width: 1800px) {
  #stage {
    border-left: 1px solid var(--hairline);
    border-right: 1px solid var(--hairline);
  }
}

#stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
}

/* HUD readouts */
#hud {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#hud.on { opacity: 1; }

.readout {
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  padding: 0.625rem 0.875rem 0.75rem;
  min-width: 172px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.readout .label {
  font-family: "Archivo", sans-serif;
  font-size: 1.15rem;
  color: rgba(238, 240, 237, 0.65);
  margin: 0 0 0.125rem;
}

.readout .value {
  font-family: "Archivo", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  margin: 0;
}

.readout .delta {
  font-family: "Archivo", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
  color: var(--go);
  margin: 0.1875rem 0 0;
  min-height: 1em;
}

#readout-child { display: none; }

#readout-child.on { display: block; }

/* Scroll steps and cards */
.steps {
  position: relative;
  z-index: 2;
  pointer-events: none;
  margin-top: -100vh;
  margin-top: -100svh;
}

.step {
  min-height: 115vh;
  display: flex;
  align-items: center;
  padding: 0 5vw;
}

.step.hero {
  min-height: 100vh;
  align-items: flex-end;
  padding-bottom: 54.5vh;
}

.step:last-of-type { min-height: 130vh; }

.card {
  pointer-events: auto;
  max-width: 35rem;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1.6rem 1.9rem;
  box-shadow: 0 4px 20px rgba(31, 35, 38, 0.1);
}

.card p {
  font-size: 1.35rem;
  line-height: 1.6;
  margin: 0;
}

.card p + p {
  margin-top: 0.7em;
}

.card p.lead {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.35;
}

.card h2 {
  font-family: "Archivo", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--go-deep);
  margin: 0 0 0.6rem;
}

.card:has(h2) {
  border-top: 2px solid var(--go);
}

/* Hero */
.hero-card {
  background: var(--card);
  padding: 3rem 3rem 2rem 3rem;
  pointer-events: auto;
  max-width: 44rem;
  transition: background 0.5s ease;
}

.hero-card.solid {
  background: #fafbf9;
}

.hero-card h1 {
  font-family: "Archivo", sans-serif;
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(2.6rem, 7.5vw, 4rem);
  line-height: 0.98;
  margin: 0 0 1rem;
}

.hero-card h1 em {
  font-style: normal;
  color: var(--soot);
}

.hero-card p {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  max-width: 34rem;
  margin: 0 0 1.6rem;
}

.scroll-cue {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  color: var(--ink-soft);
}

.scroll-cue::after {
  content: "↓";
  margin-left: 0.67em;
  display: inline-block;
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob { 50% { transform: translateY(4px); } }

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

/* Footer */
footer {
  position: relative;
  z-index: 3;
  background: var(--ink);
  color: var(--paper);
  padding: 4rem 5vw 5rem;
}

footer .inner {
  max-width: 44rem;
  margin: 0 auto;
}

.takeaways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
}

.takeaways li {
  border-top: 2px solid var(--go);
  padding-top: 0.8rem;
}

.takeaways .who {
  font-family: "Archivo", sans-serif;
  font-size: inherit;
  font-weight: 700;
  color: var(--go);
  margin: 0 0 0.3rem;
}

.takeaways p {
  margin: 0;
  color: rgba(238,240,237,0.88);
}

footer h2 {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  margin: 0 0 0.8rem;
}

footer .method {
  color: rgba(238,240,237,0.78);
}

footer .method p {
  margin: 0 0 0.8em;
}

footer a {
  color: var(--go);
}

/* Small screens */
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .card { padding: 1.1rem 1.2rem 1.2rem; }
  .hero-card { padding: 1.8rem 1.6rem; }
  #hud { top: 12px; right: 12px; }
  .readout { min-width: 148px; padding: 0.5rem 0.75rem 0.625rem; }
  .readout .value { font-size: 1.5rem; }
}
