:root {
  --enamel: #E8EBED;
  --ink: #111214;
  --graphite: #A9AEB4;
  --cobalt: #1E3AD2;
  --oxblood: #9C1A30;
  --slate: #5D636B;

  --display: 'Bodoni Moda', 'Didot', 'Bodoni 72', serif;
  --body: 'Schibsted Grotesk', system-ui, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;

  --gutter: clamp(16px, 3.2vw, 56px);
  --rail: clamp(300px, 33vw, 540px);
  --ease: cubic-bezier(0.2, 0.9, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--enamel); }
body {
  margin: 0;
  background: var(--enamel);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(16px, 1.05vw, 18.5px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--cobalt); color: var(--enamel); }

/* ---------- the stage: curtain and its instruments ---------- */

.stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#curtain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  outline: none;
  cursor: crosshair;
}
#curtain:focus-visible { box-shadow: inset 0 0 0 2px var(--cobalt); }

.axis .tick,
.floor-read,
.months span,
.probe {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-stretch: 87.5%;
}
.axis .tick {
  position: absolute;
  color: var(--slate);
  transform: translate(calc(-100% - 14px), -50%);
}
.now {
  position: absolute;
  height: 0;
  border-top: 1px solid var(--ink);
  will-change: transform;
  opacity: 0.55;
}
.floor {
  position: absolute;
  height: 0;
  border-top: 1px solid var(--ink);
  transform-origin: 50% 50%;
}
.floor::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: 5px;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 0.5s var(--ease);
}
.floor.hit::after { transition: transform 0.16s cubic-bezier(0.3, 1.8, 0.5, 1); }
.thunk .floor { animation: thunk 0.5s cubic-bezier(0.2, 0.9, 0.2, 1); }
@keyframes thunk {
  0% { transform: none; }
  14% { transform: translateY(4px); }
  100% { transform: none; }
}
.count {
  position: absolute;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.045em;
  color: var(--ink);
  white-space: nowrap;
  font-variation-settings: 'wght' 110, 'wdth' 112.5;
}
.axis, .months, .now { transition: opacity 0.9s var(--ease); }
.floor-read { transition: opacity 0.9s var(--ease); }
.bare .axis, .bare .months, .bare .floor-read { opacity: 0; }
.floor.hit::after { transform: scaleY(1); }
.floor-read {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(calc(-100% - 14px), -50%);
  font-weight: 600;
}
.months {
  position: absolute;
  display: flex;
  justify-content: space-between;
  color: var(--slate);
}
.months, .sortaxis { transition: opacity 0.8s var(--ease); }
.sortaxis { position: absolute; display: flex; justify-content: space-between; color: var(--slate); opacity: 0; }
.sortaxis span { font-family: var(--mono); font-size: 10.5px; font-stretch: 87.5%; letter-spacing: 0.02em; }
.sorted .months { opacity: 0; }
.sorted .sortaxis { opacity: 1; }
.months span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.mark {
  position: absolute;
  width: 7px;
  border: 1px solid var(--ink);
  border-left: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.mark span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10.5px;
  font-stretch: 87.5%;
  font-weight: 600;
  white-space: nowrap;
}
.show-mark .mark { opacity: 1; transform: none; transition-delay: 0.4s; }

.probe {
  position: absolute;
  padding: 8px 10px 7px;
  background: var(--ink);
  color: var(--enamel);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 0.18s linear;
  line-height: 1.5;
}
.probe.on { opacity: 1; }
.probe b { font-weight: 600; }

/* ---------- the story ---------- */

.story {
  position: relative;
  width: var(--rail);
  padding: 0 var(--gutter);
}
.beat {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12vh 0;
}
.beat > * { max-width: 30em; }
.hero { min-height: 100vh; justify-content: flex-end; padding-bottom: 14vh; }

.eyebrow, .cue {
  font-family: var(--mono);
  font-size: 11px;
  font-stretch: 87.5%;
  letter-spacing: 0.04em;
  color: var(--slate);
  margin: 0;
}
h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(96px, 13vw, 232px);
  line-height: 0.8;
  letter-spacing: -0.035em;
  margin: 0.12em 0 0.42em -0.06em;
  font-variation-settings: 'opsz' 96;
}
.lede { font-size: 1.12em; max-width: 24em; margin: 0 0 2.4em; }
.cue::after {
  content: '';
  display: block;
  width: 1px;
  height: 56px;
  margin-top: 14px;
  background: var(--ink);
  transform-origin: 0 0;
  animation: drip 2.6s var(--ease) infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 2.7vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  font-variation-settings: 'opsz' 72;
  text-wrap: balance;
}
h2 .n { font-style: normal; font-weight: 600; font-variation-settings: 'opsz' 11; letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
h2.big { font-size: clamp(44px, 4.6vw, 84px); line-height: 0.95; }
.arrow { font-size: 0.42em; vertical-align: 0.35em; color: var(--slate); letter-spacing: 0; }
.beat p { margin: 0 0 1em; text-wrap: pretty; }

.sw { display: inline-block; width: 10px; height: 22px; margin-right: 4px; vertical-align: -5px; }
.sw-c { background: var(--cobalt); }
.sw-g { background: var(--graphite); }
.sw-o { background: var(--oxblood); margin-right: 10px; }

.rates { margin: 0.4em 0 1.2em; padding: 0; display: flex; align-items: flex-end; gap: 0.7em; flex-wrap: wrap; }
.rates div { display: flex; flex-direction: column; gap: 6px; }
.rates dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: 'opsz' 11;
  font-variant-numeric: lining-nums;
  font-size: calc(14px + var(--v) * 1.3px);
  line-height: 0.85;
  letter-spacing: -0.03em;
  color: var(--oxblood);
}
.rates dt { font-family: var(--mono); font-size: 10.5px; font-stretch: 87.5%; color: var(--slate); white-space: nowrap; }

.fine { font-size: 0.8em; color: var(--slate); max-width: 34em; margin-top: 2.4em !important; }
.coda { min-height: 120vh; }

/* text settles in as its beat becomes the present */
.beat:not(.hero) > * {
  opacity: 0.18;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.beat:not(.hero).active > * { opacity: 1; transform: none; }
.beat.active > :nth-child(2) { transition-delay: 0.06s; }
.beat.active > :nth-child(3) { transition-delay: 0.12s; }

.fallback { display: none; position: fixed; left: var(--gutter); bottom: var(--gutter); z-index: 3; max-width: 28em; margin: 0; font-family: var(--mono); font-size: 12px; background: var(--enamel); }
.no-webgl .fallback, .fallback.on { display: block; }

/* ---------- narrow screens: curtain on top, story beneath ---------- */

@media (max-width: 820px) {
  .stage {
    bottom: auto;
    height: 52svh;
    background: var(--enamel);
    z-index: 2;
    box-shadow: 0 1px 0 rgba(17, 18, 20, 0.12);
  }
  .story { width: 100%; padding: 52svh 16px 0; }
  .beat { min-height: 62svh; padding: 6svh 0; justify-content: flex-start; }
  .hero { min-height: 42svh; justify-content: flex-start; padding: 3svh 0 4svh; }
  h1 { font-size: 30vw; margin-top: 0.05em; }
  .lede { font-size: 1em; margin-bottom: 1.4em; }
  .cue::after { height: 32px; }
  .coda { min-height: 80svh; }
  .axis .tick { transform: translate(4px, -125%); }
  .axis .tick:not([data-s="60"]) { display: none; }
  .floor-read { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cue::after { animation: none; transform: none; }
  .beat:not(.hero) > * { opacity: 1; transform: none; transition: none; }
  .floor::after, .mark { transition: none; }
  .thunk .floor { animation: none; }
}
