:root {
  --bg: #fbfbfa;
  --ink: #1a1a1a;
  --muted: #6e6e6e;
  --line: #e6e6e3;
  --hit: #2f8f4e;
  --miss: #c2413b;
  --sans: "Geist", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --ink: #ededed;
    --muted: #8f8f8f;
    --line: #262626;
    --hit: #5cc27d;
    --miss: #ec6d66;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font: 100%/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.2em; text-decoration-color: var(--muted); }
a:hover { text-decoration-color: currentColor; }

/* The name matches the chapter titles: Geist, heavy, lowercase, tightly tracked */
h1 {
  font-size: clamp(2.25rem, 9.5vw, 65px);
  white-space: nowrap;
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.06em;
  text-transform: lowercase;
  margin: 0 0 0.4rem;
}
h3 { font-size: 1rem; font-weight: 600; margin: 0; }

/* Intro: dark, the swan on the right, the words on the left. It stays put for a screen while the "bigger than" lines arrive. */
#intro { position: relative; height: 340svh; background: #0b0b0b; color: #ededed; }
.intro-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#swan { position: absolute; right: 0; top: 0; width: 58vw; height: 100%; color: rgb(237 237 237 / 0.85); }
.intro-text { position: relative; max-width: 72rem; height: 100%; margin: 0 auto; padding: 10.4rem max(1.5rem, 6vw) 5rem max(1.5rem, calc(6vw - 2rem)); display: flex; flex-direction: column; justify-content: center; }
.intro-text > * { max-width: 40rem; }
.meta { color: var(--muted); margin: 0 0 1.25rem; }
#intro .meta, #intro .hint, #intro .skip { color: #8a8a8a; }
#intro .meta { font-size: 0.95rem; font-style: italic; margin: 0.2rem 0 0; }
#intro .lede { font-size: clamp(1.05rem, 1.7vw, 1.25rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; margin: 1.2rem 0 1.75rem; }
#intro .lede p { margin: 0; }
#intro .lede .more { color: #9a9a9a; opacity: 0; transform: translateY(0.5em); transition: opacity 0.8s ease, transform 0.8s ease; }
#intro .lede .more:last-child { color: #ededed; }
#intro .lede .more.in { opacity: 1; transform: none; }
#intro .hint { font-size: 0.875rem; margin: 4rem 0 0 0.5rem; }
#intro .links { margin-top: 11.5rem; }
.skip { font-size: 0.875rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1rem; }

/* Journey: vertical scroll rolls a row of panels sideways.
   The panels are see-through; the stage behind them carries the chapter color and blends between chapters. */
.dusk { height: 70svh; background: linear-gradient(#0b0b0b, #2438a8); }
#journey { position: relative; }
#stage {
  --stage-bg: #0b0b0b;
  --stage-glow: #1a1a1a;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(var(--stage-bg), transparent 30%),
    radial-gradient(60% 70% at 78% 30%, var(--stage-glow), transparent 70%),
    radial-gradient(50% 60% at 10% 100%, color-mix(in srgb, var(--stage-glow) 55%, transparent), transparent 70%),
    var(--stage-bg);
}
/* Film grain over every chapter so flat color never looks flat */
#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#row { display: flex; height: 100%; width: max-content; will-change: transform; }
.bar { position: absolute; left: 1rem; right: 1rem; top: 1rem; z-index: 2; height: 3px; background: rgb(255 255 255 / 0.35); border-radius: 3px; overflow: hidden; mix-blend-mode: difference; opacity: 0; transition: opacity 0.4s; }
#stage.pinned .bar { opacity: 1; }
#fill { height: 100%; width: 0; background: #fff; }

.panel {
  position: relative;
  flex: none;
  width: 100vw;
  height: 100%;
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 4rem max(1.5rem, 8vw);
  overflow: hidden;
  font-family: var(--sans);
}
.panel a { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
.panel a::after { content: " ↗"; font-weight: 400; }
.panel figure a::after { content: none; }
.ticker { text-decoration: none; display: inline-block; font-family: var(--mono); font-size: 0.42em; font-weight: 500; letter-spacing: 0; vertical-align: middle; padding: 0.25em 0.55em; border: 1.5px solid currentColor; border-radius: 6px; }

/* Chapter titles: the name, then the subtitle under it */
.panel.title { width: max-content; min-width: 80vw; padding-right: 12vw; white-space: nowrap; flex-direction: column; align-items: flex-start; justify-content: center; }
.panel.title h2 {
  font-size: clamp(4rem, 15vw, 13rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.06em;
  margin: 0;
}
.panel.title .sub { font-size: clamp(1.25rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -0.02em; margin: 1.25rem 0 0 0.3rem; }
.panel.title .sub + .when { margin-top: 0.4rem; }
.panel.title .when { font-size: clamp(1.25rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -0.02em; opacity: 0.7; margin: 1.25rem 0 0 0.3rem; }

.words { position: relative; z-index: 1; max-width: 36rem; }
.text { font-size: clamp(1.4rem, 2.9vw, 2.35rem); line-height: 1.18; letter-spacing: -0.03em; font-weight: 600; }
.text ul { margin: 0; padding: 0; list-style: none; }
.text li + li { margin-top: 0.35em; }
.mark { display: block; font-size: 1.5rem; margin-bottom: 1rem; opacity: 0.8; }
.beat.result .text { font-size: clamp(1.4rem, 2.6vw, 2.2rem); letter-spacing: -0.035em; }
.note { opacity: 0.6; }
s { opacity: 0.55; text-decoration-thickness: 0.08em; }

/* The picture sits behind the words, tilted like a card on a table */
.beat.has-img { width: 120vw; }
.beat figure {
  position: absolute;
  right: 6vw;
  top: 50%;
  margin: 0;
  transform: translateY(-50%) rotate(-3deg);
}
.beat img, .beat video { display: block; width: auto; height: auto; max-width: min(62vw, 960px); max-height: 68vh; border-radius: 14px; box-shadow: 0 30px 80px rgb(0 0 0 / 0.35); }
.beat figure { opacity: 0; transition: opacity 0.9s ease, translate 0.9s ease; translate: 0 1.5rem; }
.beat.seen figure.ready { opacity: 1; translate: 0 0; }
.beat .words { opacity: 0; transition: opacity 0.7s ease; }
.beat.seen .words { opacity: 1; }
.beat figcaption { margin-top: 1rem; font-size: 1.125rem; font-weight: 600; text-align: right; }
.beat.has-img .words { max-width: min(34vw, 30rem); }

.beat figure.scroll { transform: translateY(-50%) rotate(-1deg); }
.scroll .frame { width: min(46vw, 700px); height: 78vh; overflow-y: auto; border-radius: 14px; background: #000; box-shadow: 0 30px 80px rgb(0 0 0 / 0.35); }
.scroll .frame img { width: 100%; max-width: none; max-height: none; border-radius: 0; box-shadow: none; }

.post { position: relative; }
.post img { max-height: 74vh; }
.post video { position: absolute; left: 11.19%; top: 32.07%; width: 86.14%; height: 59.52%; max-width: none; max-height: none; object-fit: cover; border-radius: 1.9% / 3.1%; box-shadow: none; }

/* Two pictures, one on each side of the words */
.beat.two { width: 100vw; gap: 3vw; padding-left: 3vw; padding-right: 3vw; justify-content: center; }
.beat.two figure { position: relative; right: auto; top: auto; transform: rotate(-3deg); flex: none; }
.beat.two figure.right { transform: rotate(3deg); }
.beat.two img { max-width: min(30vw, 560px); max-height: 62vh; }
.beat.two .words { max-width: 28rem; flex: none; }

/* The strike-through draws itself, then the correction fades in */
.strike { position: relative; display: inline-block; }
.strike::after { content: ""; position: absolute; left: 0; top: 50%; height: 0.08em; width: 0; translate: 0 -50%; background: currentColor; transition: width 0.7s ease 0.6s; }
.after { opacity: 0; transition: opacity 0.8s ease 1.4s; }
.seen .strike { opacity: 0.55; transition: opacity 0.4s ease 1.2s; }
.seen .strike::after { width: 100%; }
.seen .after { opacity: 1; }

/* Reflections: a small label over the paragraph */
.label { display: block; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; opacity: 0.6; margin-bottom: 1rem; }
.beat.labelled { width: 90vw; }
.beat.labelled .words { max-width: 46rem; }
.beat.labelled .text { font-size: clamp(1.25rem, 2.3vw, 1.9rem); font-weight: 500; }

/* Text-only beats are narrower */
.beat:not(.has-img) { width: 75vw; }

/* Random Labs: graphite with one lime accent */
.panel.rl .mark, .panel.rl a { color: #c6f24e; }

@media (max-width: 40rem) {
  #swan { width: 100vw; opacity: 0.35; }
  .panel.title { min-width: 100vw; }
  .beat:not(.has-img), .beat.has-img { width: 100vw; }
  .beat.has-img { align-items: flex-end; }
  .beat figure { top: 8%; right: -10vw; transform: rotate(-3deg); }
  .beat.has-img .words { max-width: none; }
  .beat img, .beat video { max-width: 115vw; max-height: 40vh; }
  .beat figure.scroll { right: 6vw; transform: rotate(-1deg); }
  .scroll .frame { width: 88vw; height: 44vh; }
  .beat.two { flex-direction: column; justify-content: center; gap: 1.5rem; padding: 3rem 1.5rem; width: 100vw; }
  .beat.two figure.left { display: none; }
  .beat.two img { max-width: 88vw; max-height: 38vh; }
  .beat.two .words { max-width: none; }
  .beat figcaption { text-align: left; padding: 0 16vw 0 14vw; }
}

/* Summary: the same beats as a timeline */
.screen { max-width: 40rem; margin: 0 auto; padding: 5rem 1rem 6rem; }
/* The timeline sits a little left of center */
#timeline.screen { margin-left: max(0px, calc((100vw - 40rem) / 2 - 8vw)); }
#timeline h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; margin: 4rem 0 0; padding-top: 2rem; border-top: 1px solid var(--line); }
#timeline h2:first-child { margin-top: 0; border-top: 0; }
#timeline { position: relative; }
.rail-wrap { position: relative; }
#wave { position: absolute; right: 100%; top: 0; width: 160px; height: 100%; color: var(--muted); }
.timeline { position: relative; list-style: none; margin: 1.5rem 0 0; padding: 0 0 0 1.25rem; }
.timeline > li { position: relative; padding-bottom: 2rem; }
.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(-1.25rem - 4.5px);
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}
.t-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.when { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.panel .when { color: inherit; }

.way { list-style: none; margin: 0.75rem 0 0; padding: 0; font-size: 0.95rem; line-height: 1.55; }
.way li { position: relative; padding: 0.3rem 0 0.3rem 1.75rem; }
.way li::before { position: absolute; left: 0; color: var(--muted); content: "·"; }
.way .hit::before { content: "✓"; color: var(--hit); }
.way .miss::before { content: "✗"; color: var(--miss); }
.way .result { font-weight: 600; margin-top: 0.4rem; }
.way .result::before { content: "→"; color: var(--ink); }
.way .star::before { content: "★"; color: var(--ink); }
.way .doing::before { content: "◐"; color: var(--muted); }
.way ul { list-style: none; margin: 0; padding: 0; font-weight: 400; }
.way ul li { padding: 0 0 0.2rem; }
.way ul li::before { content: none; }
.way .moment { margin-top: 0.6rem; padding-left: 1.75rem; color: var(--muted); }
.way .moment::before { content: "“"; color: var(--muted); }
.way .moment b { display: block; color: var(--ink); font-weight: 600; }
.way .strike { text-decoration: line-through; opacity: 0.6; }
.way .after { opacity: 1; }
.way .ticker { font-size: 0.75em; padding: 0.05em 0.4em; }

.end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: 3rem; }
.end .links { margin-top: 0; }
.replay { color: var(--muted); }

/* The flock follows the cursor across everything, inverting whatever it passes over */
#flock { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 4; pointer-events: none; mix-blend-mode: difference; color: rgb(255 255 255 / 0.85); }

