:root {
  --skin: #0E2311;
  --flesh: #D7E9A8;
  --core: #F1F6E0;
  --bloom: #F6C624;
  --ink: #0E2311;

  --display: "Unbounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, sans-serif;

  --gutter: clamp(20px, 4.5vw, 80px);
  --bar-h: 76px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --fg: var(--core);
  --line: color-mix(in srgb, var(--fg) 22%, transparent);
}

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

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--skin);
  color: var(--fg);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color .5s ease;
}
body[data-tone="light"] { --fg: var(--ink); }

button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--bloom); outline-offset: 4px; border-radius: 6px; }

#gl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
body.is-ready #gl { opacity: 1; }

.grain {
  position: fixed; inset: -50%;
  z-index: 20; pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.loader {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: var(--skin);
  transition: opacity .8s var(--ease-out), visibility .8s;
}
.loader span {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(215, 233, 168, .18);
  border-top-color: var(--flesh);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
body:not(.is-loading) .loader { opacity: 0; visibility: hidden; }

.progress {
  position: fixed; inset: 0 0 auto 0; z-index: 11;
  height: 2px; pointer-events: none;
}
.progress i {
  display: block; height: 100%;
  background: var(--fg); opacity: .5;
  transform-origin: 0 50%; transform: scaleX(0);
  transition: background-color .5s ease;
}

.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--bar-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: env(safe-area-inset-top) var(--gutter) 0;
  color: var(--fg);
  transition: color .5s ease;
}
.logo, .foot-mark {
  font-family: var(--display); font-weight: 500;
  letter-spacing: -0.035em;
  color: inherit; text-decoration: none;
}
.logo { font-size: .95rem; justify-self: start; }
.logo span, .foot-mark span { opacity: .45; }

.index ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.index a {
  position: relative;
  display: flex; align-items: baseline; gap: 6px;
  padding: 10px 12px;
  color: inherit; text-decoration: none;
  font-size: .8rem; font-weight: 500;
  opacity: .5;
  transition: opacity .3s ease;
}
.index .i-num { font-size: .68rem; font-variant-numeric: tabular-nums; opacity: .7; }
.index a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .index a:hover { opacity: .85; } }
.index a[aria-current="step"] { opacity: 1; }
.index a[aria-current="step"]::after { transform: scaleX(1); }
.index { transition: opacity .5s ease; }
body.at-top .index { opacity: 0; pointer-events: none; }

.lang {
  justify-self: end;
  display: flex; gap: 2px; padding: 3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.lang button {
  border: 0; background: none; cursor: pointer;
  font-weight: 600; font-size: .75rem; letter-spacing: .02em;
  padding: 7px 12px; border-radius: 999px;
  color: inherit;
  transition: background-color .25s ease, color .25s ease, transform .15s ease;
}
.lang button[aria-pressed="true"] { background: var(--fg); color: var(--skin); }
body[data-tone="light"] .lang button[aria-pressed="true"] { color: var(--core); }
.foot .lang button[aria-pressed="true"] { background: var(--core); color: var(--skin); }
.lang button:active { transform: scale(.96); }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--bar-h) var(--gutter) max(32px, env(safe-area-inset-bottom));
}
.hero-title {
  position: relative; z-index: 0;
  align-self: center;
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 12.6vw, 16rem);
  line-height: .85;
  letter-spacing: -0.065em;
  color: var(--flesh);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.hero-title .ch-wrap { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; }
.hero-title .ch-in { display: inline-block; will-change: transform; }
.hero-foot {
  position: relative; z-index: 2;
  display: flex; align-items: end; justify-content: space-between;
  font-size: .85rem;
}
.latin { margin: 0; font-style: italic; opacity: .6; }
.scroll-cue {
  display: flex; align-items: center; gap: 14px;
  color: inherit; text-decoration: none; opacity: .7;
}
.cue-line {
  width: 1px; height: 44px; background: currentColor;
  transform-origin: top;
}
@media (prefers-reduced-motion: no-preference) {
  .cue-line { animation: cue 2.4s var(--ease-out) infinite; }
  @keyframes cue {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
  }
}

.ch {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: end;
  padding: calc(var(--bar-h) + 6vh) var(--gutter) 13vh;
}
.copy { position: relative; z-index: 2; grid-column: 1 / span 5; max-width: 34rem; }

.kicker {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 clamp(20px, 3vh, 32px);
  font-size: .78rem; font-weight: 500; letter-spacing: .01em;
}
.k-num { font-variant-numeric: tabular-nums; opacity: .55; }
.k-rule { width: 44px; height: 1px; background: currentColor; opacity: .45; transform-origin: left; }

.ch h2 {
  margin: 0 0 clamp(18px, 2.4vh, 26px);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 3.7vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
  max-width: 13ch;
}
.mask { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.mask > span { display: block; will-change: transform; }

.lede {
  margin: 0 0 clamp(24px, 4vh, 40px);
  max-width: 36ch;
  font-size: clamp(1rem, 1.1vw, 1.12rem);
  line-height: 1.6;
  opacity: .72;
  text-wrap: pretty;
}

.fact {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0; padding-top: 18px;
  max-width: 24rem;
  border-top: 1px solid var(--line);
}
.fact dt {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  letter-spacing: -0.045em; line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fact dd { margin: 0; font-size: .85rem; opacity: .6; }

.picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 clamp(18px, 3vh, 28px); }
.picker button {
  border: 0; cursor: pointer;
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(14, 35, 17, .2);
  padding: 10px 16px; border-radius: 999px;
  font-weight: 500; font-size: .88rem;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease, transform .15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .picker button:hover { box-shadow: inset 0 0 0 1px rgba(14, 35, 17, .55); }
}
.picker button:active { transform: scale(.96); }
.picker button[aria-pressed="true"] { background: var(--ink); color: var(--core); box-shadow: inset 0 0 0 1px var(--ink); }

.ch-tall { display: block; min-height: 300svh; padding: 0; }
.pin {
  position: sticky; top: 0;
  height: 100svh;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: end;
  padding: calc(var(--bar-h) + 6vh) var(--gutter) 13vh;
}

.hist { position: relative; height: 760svh; }
.hist-pin {
  position: sticky; top: 0; z-index: 2;
  height: 100svh;
  overflow: hidden;
}
.hist-track {
  display: flex;
  width: calc(100vw * 7);
  height: 100%;
  will-change: transform;
}
.panel {
  flex: 0 0 100vw;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: end;
  padding: calc(var(--bar-h) + 6vh) var(--gutter) calc(13vh + 36px);
}
.p-copy { grid-column: 1 / span 5; max-width: 36rem; }

.p-year {
  margin: 0 0 .16em;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 8.6rem);
  line-height: .9;
  letter-spacing: -0.065em;
  color: var(--flesh);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body[data-tone="light"] .p-year { color: var(--ink); }
.p-title {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.panel .lede { margin-bottom: clamp(20px, 3.4vh, 34px); max-width: 40ch; }

.panel .p-copy > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .9s var(--ease-out);
}
.panel.is-active .p-copy > * { opacity: 1; transform: none; }
.panel.is-active .p-copy > :nth-child(2) { transition-delay: .06s; }
.panel.is-active .p-copy > :nth-child(3) { transition-delay: .12s; }
.panel.is-active .p-copy > :nth-child(4) { transition-delay: .18s; }
.panel.is-active .p-copy > :nth-child(5) { transition-delay: .24s; }
.panel .k-rule { transform: scaleX(0); transition: transform 1.1s var(--ease-out) .1s; }
.panel.is-active .k-rule { transform: scaleX(1); }

.hist-rail {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: max(4.2vh, 22px);
  z-index: 3;
}
.hist-rail ol { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; }
.hist-rail button {
  position: relative;
  border: 0; background: none; cursor: pointer; color: inherit;
  padding: 14px 0 4px;
  font-size: .72rem; font-weight: 500; letter-spacing: .01em;
  opacity: .45;
  transition: opacity .3s ease;
}
.hist-rail button::before {
  content: ""; position: absolute; top: -3px; left: 50%;
  width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: currentColor; transform: scale(.6);
  transition: transform .4s var(--ease-out);
}
.hist-rail li:first-child button::before { left: 3.5px; }
.hist-rail li:last-child button::before { left: auto; right: -3.5px; }
.hist-rail button[aria-current] { opacity: 1; }
.hist-rail button[aria-current]::before { transform: scale(1); }
@media (hover: hover) and (pointer: fine) { .hist-rail button:hover { opacity: .8; } }
.rail-line { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.rail-line i { display: block; height: 100%; background: currentColor; opacity: .6; transform-origin: left; transform: scaleX(0); }

.hold {
  display: inline-flex; align-items: center; gap: 12px;
  border: 0; background: none; color: inherit; cursor: pointer;
  padding: 6px 18px 6px 6px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: .88rem; font-weight: 500;
  user-select: none; -webkit-user-select: none; touch-action: none;
  transition: box-shadow .25s ease, transform .15s ease;
}
.hold:active, .hold.is-holding { transform: scale(.97); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 50%, transparent); }
.hold-ring { width: 38px; height: 38px; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .22; }
.hold-ring .hold-fill { stroke: var(--bloom); opacity: 1; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.slide { display: grid; gap: 12px; max-width: 22rem; }
.slide-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 500; }
.slide-val { font-variant-numeric: tabular-nums; opacity: .55; }
.slide input {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; margin: 0;
  background: transparent; cursor: pointer; color: inherit;
  touch-action: pan-y;
}
.slide input::-webkit-slider-runnable-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(to right, currentColor var(--p), var(--line) var(--p));
}
.slide input::-moz-range-track { height: 2px; background: var(--line); }
.slide input::-moz-range-progress { height: 2px; background: currentColor; }
.slide input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -9px; border-radius: 50%;
  background: var(--bloom); border: 0;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--bloom) 22%, transparent);
  transition: transform .15s ease;
}
.slide input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--bloom); border: 0; }
.slide input:active::-webkit-slider-thumb { transform: scale(1.12); }

.latin-list { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.lw {
  border: 0; background: none; color: inherit; cursor: pointer;
  padding: 4px 0;
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
  opacity: .5;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: opacity .25s ease, background-size .4s var(--ease-out);
}
.lw.is-key { opacity: .9; color: var(--bloom); }
.lw.is-on { opacity: 1; background-size: 100% 1px; }
.lw-out { margin: 0; font-size: .88rem; opacity: .65; min-height: 1.5em; }

.route { margin: 0; max-width: 340px; }
.route svg { width: 100%; height: auto; overflow: visible; }
.route-sea { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 2 5; opacity: .25; }
.route-line { fill: none; stroke: var(--bloom); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.route-dot { fill: currentColor; }
.route-end { fill: var(--bloom); }
.route text { fill: currentColor; font-size: 11px; font-family: var(--text); opacity: .6; }

@media (min-width: 1600px) { .p-copy { grid-column: 1 / span 4; } }
@media (max-width: 1100px) { .p-copy { grid-column: 1 / span 6; } }

@media (max-width: 820px) {
  .panel {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 var(--gutter) calc(max(9svh, 56px) + 30px);
  }
  .p-copy { grid-column: 1; max-width: none; }
  .p-year { font-size: clamp(2.6rem, 13vw, 4rem); }
  .p-title { font-size: clamp(1.35rem, 6vw, 1.8rem); }
  .panel .lede { font-size: .95rem; margin-bottom: 18px; }
  .hist-rail button { font-size: 0; padding: 12px 6px 4px; }
  .hist-rail button::before { top: -3px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel .p-copy > *, .panel .k-rule { transition: none; }
}

.js .reveal { opacity: 0; transform: translateY(16px); }

.foot {
  position: relative; z-index: 2;
  background: var(--skin);
  padding: 18vh var(--gutter) max(36px, env(safe-area-inset-bottom));
  color: var(--core);
}
.foot-mark {
  margin: 0 0 6vh;
  font-weight: 800;
  font-size: clamp(2.2rem, 10.4vw, 14rem);
  line-height: .85;
  letter-spacing: -0.065em;
  color: var(--flesh);
  white-space: nowrap;
}
.foot-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid rgba(241, 246, 224, .18);
  font-size: .85rem;
}
.foot .lang { box-shadow: inset 0 0 0 1px rgba(241, 246, 224, .25); }
body .foot .lang button { color: var(--core); }
body .foot .lang button[aria-pressed="true"] { background: var(--core); color: var(--skin); }

@media (min-width: 1600px) {
  body { font-size: 1.125rem; }
  .copy { grid-column: 1 / span 4; }
}

@media (max-width: 1100px) {
  .index .i-num { display: none; }
  .copy { grid-column: 1 / span 6; }
}

@media (max-width: 820px) {
  :root { --bar-h: 64px; }
  .bar { grid-template-columns: 1fr auto; }
  .index { display: none; }
  .ch, .pin {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 var(--gutter) max(9svh, 56px);
  }
  .copy { grid-column: 1; max-width: none; }
  .ch h2 { font-size: clamp(1.85rem, 8.4vw, 2.6rem); max-width: 14ch; }
  .lede { margin-bottom: 22px; }
  .kicker { margin-bottom: 16px; }
  .hero-title { align-self: center; margin-top: 30svh; font-size: clamp(2.6rem, 13.5vw, 7rem); }
}

@media (max-width: 420px) {
  .lang button { padding: 7px 10px; }
  .picker button { padding: 9px 13px; font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  #gl, .loader, body, .bar { transition: none; }
}
