:root {
  color-scheme: dark;
  --ink: #f3f3eb;
  --muted: #b9c3c6;
  --accent: #d6f872;
  --pad: clamp(1.25rem, 4vw, 4rem);
  font-family: Inter, "Segoe UI", sans-serif;
  background: #0b1117;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .25em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
h1, h2, p { margin: 0; }
.stage { position: relative; padding: var(--pad); }
.masthead {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
  border-bottom: 1px solid #efffff28; padding-bottom: 1rem;
}
.masthead h1 { font-size: clamp(1rem, 2vw, 1.4rem); letter-spacing: -.045em; }
.masthead h1 span { color: var(--accent); }
.masthead a, .rail a { text-decoration: none; }
canvas, .timeline { display: none; }
.chapters { max-width: 40rem; }
.chapters article { padding: 2.5rem 0; }
.label {
  color: var(--accent); font: 600 .75rem/1.4 "IBM Plex Mono", Consolas, monospace;
  letter-spacing: .14em; text-transform: uppercase;
}
h2 { font-size: clamp(2.75rem, 6.85vw, 7.5rem); line-height: .92; letter-spacing: -.075em; }
.label + h2 { margin-top: .75rem; }
h2 + p { color: var(--muted); line-height: 1.55; margin-top: 1.35rem; max-width: 39ch; }
.pill {
  display: inline-flex; align-items: center; gap: .65rem; margin-top: 1.1rem;
  border: 1px solid #f4ffff53; border-radius: 4rem; padding: .68rem 1rem;
  font-size: .85rem; font-weight: 600; text-decoration: none;
}
.pill:hover { color: #0b1117; background: var(--accent); border-color: var(--accent); }
.rail { display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem clamp(.65rem, 1.7vw, 1.55rem); }
.rail a {
  display: flex; align-items: center; min-height: 2.4rem; border-bottom: 1px solid transparent;
  color: var(--muted); font-size: .75rem; white-space: nowrap;
}
.rail a[aria-current] { border-color: currentColor; }
.timeline { font-family: "IBM Plex Mono", Consolas, monospace; }
.rail a[aria-current], .rail a:hover { color: var(--accent); }
.menu-toggle { display: none; }
.motion .journey { height: 410svh; }
.motion .stage {
  position: sticky; top: 0; height: 100svh; isolation: isolate;
  display: grid; grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
  padding-block: clamp(1rem, 3vh, 2rem);
  overflow: clip; background: #0b1117;
}
.motion .masthead { grid-area: 1 / 1; }
.motion .timeline { grid-area: 3 / 1; }
.motion canvas {
  display: block; position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%;
}
.motion .chapters {
  position: absolute; inset: 34% var(--pad) auto; display: grid; max-width: 58rem;
}
.motion .chapters article {
  grid-area: 1 / 1; padding: 0; text-align: left;
  text-shadow: 0 2px 4px #060a0f, 0 2px 18px #060a0f;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 105ms ease-in, visibility 0s linear 105ms;
}
.motion .chapters .is-active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 190ms ease-out 85ms;
}
.motion .chapters h2 { font-size: clamp(3.5rem, 8vw, 8.5rem); }
.motion .chapters .pill { background: #0b1117dd; }
.motion .chapters .pill:hover { background: var(--accent); text-shadow: none; }
.motion .timeline {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .55rem;
  color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .68rem;
}
.track { grid-column: 1 / -1; height: 2px; background: #edfaff38; }
.track i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
@media (max-width: 850px) {
  .menu-ready .menu-toggle:not([hidden]) {
    display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem;
    padding: .45rem .7rem; color: var(--ink); background: #0b1117;
    border: 1px solid #edfaff38; border-radius: .35rem; font: inherit; font-size: .8rem;
  }
  .menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .menu-icon {
    display: block; width: 1rem; height: .7rem; border-block: 1px solid currentColor;
    background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
  }
  .menu-ready .rail {
    position: absolute; top: 100%; right: 0; display: none; width: min(16rem, 100%);
    padding: .4rem .8rem; background: #101821; border: 1px solid #edfaff38;
    border-radius: .35rem; box-shadow: 0 12px 32px #0008;
  }
  .menu-ready .menu-toggle[aria-expanded="true"] + .rail { display: grid; justify-content: stretch; }
  .menu-ready .rail a { min-height: 2.75rem; padding-inline: .3rem; }
}
@media (max-width: 700px) {
  .motion .chapters { top: 32%; }
  .motion .chapters h2 { font-size: clamp(2.85rem, 12vw, 5.25rem); }
}
@media (max-height: 550px) {
  .motion .stage { padding-block: .65rem; }
  .motion .masthead { padding-bottom: .55rem; }
  .motion .chapters { top: 24%; }
  .motion .chapters h2 { font-size: clamp(1.85rem, 7.5vh, 3.15rem); }
  .motion h2 + p { margin-top: .6rem; }
  .motion .pill { margin-top: .55rem; padding-block: .4rem; }
}
