:root {
  --paper: #f2eee3;
  --ink: #131510;
  --acid: #dfff52;
  --line: rgba(242, 238, 227, 0.28);
  --safe-x: clamp(1.25rem, 4vw, 4.5rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  background: #11130f;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #11130f;
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #11130f;
  color: var(--paper);
  text-align: center;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 5.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--safe-x);
  border-bottom: 1px solid var(--line);
  mix-blend-mode: difference;
  pointer-events: none;
}

.wordmark,
.top-actions {
  pointer-events: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  justify-self: start;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark-dot {
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px transparent;
  transition: background 300ms ease;
}

.wordmark:hover .wordmark-dot {
  background: currentColor;
}

.era-readout {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.era-number {
  font-variant-numeric: tabular-nums;
  opacity: 0.58;
}

.era-divider {
  width: 2.6rem;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}

.design-credit {
  color: #fff;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 1;
  opacity: 0.68;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 180ms ease;
}

.design-credit:hover,
.design-credit:focus-visible {
  opacity: 1;
}

.action-divider {
  width: 1px;
  height: 0.9rem;
  background: currentColor;
  opacity: 0.34;
}

.sound-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  justify-self: end;
  padding: 0.6rem 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sound-bars {
  height: 0.8rem;
  display: flex;
  align-items: center;
  gap: 2px;
}

.sound-bars i {
  display: block;
  width: 1px;
  height: 25%;
  background: currentColor;
  transition: height 300ms ease;
}

.sound-button[aria-pressed="true"] .sound-bars i {
  animation: soundbar 850ms ease-in-out infinite alternate;
}

.sound-button[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -260ms; }
.sound-button[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -510ms; }
.sound-button[aria-pressed="true"] .sound-bars i:nth-child(4) { animation-delay: -120ms; }

@keyframes soundbar {
  from { height: 20%; }
  to { height: 100%; }
}

.journey {
  position: relative;
  height: 1100vh;
}

.viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 35rem;
  overflow: hidden;
  background: #667463;
  isolation: isolate;
}

#city-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.film-grain,
.vignette,
.story-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.film-grain {
  z-index: 2;
  opacity: 0.065;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
  animation: grain 180ms steps(2) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(1%, 1%); }
  100% { transform: translate(-1%, -1%); }
}

.vignette {
  z-index: 3;
  box-shadow: inset 0 0 12rem rgba(0, 0, 0, 0.38);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.28));
}

.story-scrim {
  z-index: 4;
  opacity: 0;
  background: linear-gradient(
    90deg,
    rgba(3, 7, 8, 0.9) 0%,
    rgba(4, 8, 9, 0.72) 25%,
    rgba(5, 9, 10, 0.34) 50%,
    rgba(5, 9, 10, 0) 74%
  );
  will-change: opacity;
}

.story-scrim[data-side="right"] {
  background: linear-gradient(
    270deg,
    rgba(3, 7, 8, 0.9) 0%,
    rgba(4, 8, 9, 0.72) 25%,
    rgba(5, 9, 10, 0.34) 50%,
    rgba(5, 9, 10, 0) 74%
  );
}

.story-scrim[data-side="center"] {
  background: radial-gradient(
    ellipse 58% 70% at 50% 50%,
    rgba(3, 7, 8, 0.78) 0%,
    rgba(4, 8, 9, 0.48) 45%,
    rgba(5, 9, 10, 0) 78%
  );
}

.intro-lockup,
.chapter,
.finale {
  position: absolute;
  z-index: 5;
  will-change: opacity, transform;
}

.intro-lockup {
  top: 50%;
  left: 50%;
  width: min(92vw, 78rem);
  transform: translate(-50%, -48%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 1.25rem;
  font-size: clamp(0.6rem, 0.7vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-transform: uppercase;
}

.intro-lockup h1,
.chapter h2,
.finale h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 0.78;
}

.intro-lockup h1 {
  font-size: clamp(4.8rem, 10.5vw, 10.5rem);
  text-shadow: 0 0.04em 0.2em rgba(0, 0, 0, 0.16);
}

.intro-lockup h1 em {
  font-weight: 400;
}

.intro-copy {
  margin: 2.25rem auto 0;
  font-size: clamp(0.78rem, 1vw, 1rem);
  line-height: 1.6;
  text-shadow: 0 1px 1rem rgba(0, 0, 0, 0.45);
}

.screen-credit {
  margin-top: 1.15rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  text-shadow: 0 1px 0.75rem rgba(0, 0, 0, 0.65);
}

.screen-credit a {
  color: inherit;
  opacity: 0.72;
  text-decoration-color: rgba(255, 255, 255, 0.38);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3rem;
  transition: opacity 180ms ease, text-decoration-color 180ms ease;
}

.screen-credit a:hover,
.screen-credit a:focus-visible {
  opacity: 1;
  text-decoration-color: currentColor;
}

.finale .screen-credit {
  margin-top: 1rem;
}

.chapter {
  top: 50%;
  width: min(31rem, 38vw);
  opacity: 0;
  --vital-accent: #e5d36a;
  --vital-tint: rgba(229, 211, 106, 0.12);
  --vital-border: rgba(229, 211, 106, 0.46);
}

.chapter-layer > .chapter:nth-of-type(1) {
  --vital-accent: #dbea70;
  --vital-tint: rgba(184, 211, 90, 0.13);
  --vital-border: rgba(219, 234, 112, 0.48);
}

.chapter-layer > .chapter:nth-of-type(2) {
  --vital-accent: #f1b866;
  --vital-tint: rgba(207, 127, 68, 0.14);
  --vital-border: rgba(241, 184, 102, 0.48);
}

.chapter-layer > .chapter:nth-of-type(3) {
  --vital-accent: #f1d18c;
  --vital-tint: rgba(225, 184, 111, 0.14);
  --vital-border: rgba(241, 209, 140, 0.5);
}

.chapter-layer > .chapter:nth-of-type(4) {
  --vital-accent: #b8cf79;
  --vital-tint: rgba(122, 153, 82, 0.15);
  --vital-border: rgba(184, 207, 121, 0.48);
}

.chapter-layer > .chapter:nth-of-type(5) {
  --vital-accent: #e99564;
  --vital-tint: rgba(196, 87, 58, 0.15);
  --vital-border: rgba(233, 149, 100, 0.5);
}

.chapter-layer > .chapter:nth-of-type(6) {
  --vital-accent: #82d7ef;
  --vital-tint: rgba(69, 164, 197, 0.15);
  --vital-border: rgba(130, 215, 239, 0.52);
}

.chapter-layer > .chapter:nth-of-type(7) {
  --vital-accent: #dc8fff;
  --vital-tint: rgba(164, 85, 207, 0.17);
  --vital-border: rgba(220, 143, 255, 0.54);
}

.chapter-left {
  left: var(--safe-x);
}

.chapter-right {
  right: var(--safe-x);
}

.chapter-year {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.2vw, 2.7rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
  opacity: 0.9;
}

.chapter-year::before {
  content: "";
  width: 2.8rem;
  height: 1px;
  background: currentColor;
}

.chapter h2,
.finale h2 {
  font-size: clamp(3.6rem, 6.5vw, 7.7rem);
  text-shadow: 0 0.04em 0.18em rgba(0, 0, 0, 0.45), 0 2px 1.5rem rgba(0, 0, 0, 0.45);
}

.chapter > p:not(.chapter-year),
.finale > p:last-of-type {
  max-width: 27rem;
  margin: 2rem 0 0;
  font-size: clamp(0.84rem, 1vw, 1rem);
  font-weight: 500;
  line-height: 1.65;
  text-shadow: 0 1px 0.8rem rgba(0, 0, 0, 0.85);
}

.vitals {
  --reveal: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1.4rem;
  width: min(27rem, 100%);
  margin-top: 1.6rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--vital-border);
  border-left-width: 2px;
  background: linear-gradient(115deg, var(--vital-tint), rgba(5, 8, 9, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 0.7rem 2rem rgba(0, 0, 0, 0.12);
  text-shadow: 0 1px 0.75rem rgba(0, 0, 0, 0.45);
}

.vitals-title {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.05rem;
  color: var(--vital-accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.vitals-title span {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--paper);
  opacity: 0.72;
}

.vital {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  min-width: 0;
}

.vital span {
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.76;
}

.vital strong {
  justify-self: end;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--vital-accent);
  font-size: 0.96rem;
  font-style: italic;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vital i {
  position: relative;
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.24) 0,
    rgba(255, 255, 255, 0.24) calc(14.285% - 2px),
    transparent calc(14.285% - 2px),
    transparent 14.285%
  );
}

.vital i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  background: var(--vital-accent);
  transform: scaleX(var(--reveal));
  transform-origin: left;
  transition: transform 180ms linear;
}

.finale {
  top: 50%;
  left: 50%;
  width: min(92vw, 66rem);
  text-align: center;
  opacity: 0;
}

.finale > p:last-of-type {
  margin-right: auto;
  margin-left: auto;
}

.replay-button {
  margin-top: 2.2rem;
  padding: 0.9rem 1.15rem 0.9rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  background: rgba(10, 20, 25, 0.15);
  color: #fff;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}

.replay-button span {
  display: inline-block;
  margin-left: 0.8rem;
  font-size: 0.9rem;
  transition: transform 200ms ease;
}

.replay-button:hover {
  background: #fff;
  color: #101711;
  transform: translateY(-2px);
}

.replay-button:hover span {
  transform: rotate(-45deg);
}

.scroll-cue {
  position: absolute;
  z-index: 6;
  bottom: 2.3rem;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transform: translateX(-50%);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scroll-cue i {
  display: block;
  width: 1px;
  height: 2.4rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
}

.scroll-cue i::after {
  content: "";
  display: block;
  width: 100%;
  height: 45%;
  background: #fff;
  animation: scrollline 1.8s ease-in-out infinite;
}

@keyframes scrollline {
  0% { transform: translateY(-120%); }
  55%, 100% { transform: translateY(240%); }
}

.timeline {
  position: absolute;
  z-index: 8;
  right: var(--safe-x);
  bottom: 2rem;
  left: var(--safe-x);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 450ms ease, transform 450ms ease;
}

.timeline.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.timeline-track {
  position: absolute;
  top: 0.24rem;
  right: 0;
  left: 0;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.32);
}

.timeline-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.timeline button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline button i {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #252920;
  transition: background 200ms ease, transform 200ms ease;
}

.timeline button:hover i,
.timeline button.is-active i {
  background: #fff;
  transform: scale(1.3);
}

.timeline button span {
  opacity: 0.6;
  transition: opacity 200ms ease;
}

.timeline button:hover span,
.timeline button.is-active span {
  opacity: 1;
}

.coordinates {
  position: absolute;
  z-index: 6;
  right: 1rem;
  top: 50%;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translate(50%, -50%) rotate(90deg);
}

@media (max-width: 760px) {
  .story-scrim,
  .story-scrim[data-side="left"],
  .story-scrim[data-side="right"],
  .story-scrim[data-side="center"] {
    background: linear-gradient(
      0deg,
      rgba(3, 7, 8, 0.94) 0%,
      rgba(4, 8, 9, 0.82) 35%,
      rgba(5, 9, 10, 0.42) 68%,
      rgba(5, 9, 10, 0) 90%
    );
  }

  .story-scrim[data-side="center"] {
    background: radial-gradient(
      ellipse 88% 62% at 50% 50%,
      rgba(3, 7, 8, 0.88) 0%,
      rgba(4, 8, 9, 0.56) 52%,
      rgba(5, 9, 10, 0) 88%
    );
  }

  .topbar {
    grid-template-columns: 1fr auto;
    height: 4.5rem;
  }

  .era-readout {
    display: none;
  }

  .sound-label {
    display: none;
  }

  .intro-lockup h1 {
    font-size: clamp(3.7rem, 18vw, 6.4rem);
  }

  .intro-copy {
    max-width: 20rem;
  }

  .intro-copy br {
    display: none;
  }

  .chapter,
  .chapter-left,
  .chapter-right {
    top: auto;
    right: var(--safe-x);
    bottom: 7rem;
    left: var(--safe-x);
    width: auto;
  }

  .chapter h2 {
    font-size: clamp(3.4rem, 15vw, 5.2rem);
  }

  .chapter > p:not(.chapter-year) {
    max-width: 23rem;
  }

  .vitals {
    gap: 0.62rem 1rem;
    margin-top: 1rem;
    padding-top: 0.65rem;
  }

  .vital strong {
    font-size: 0.86rem;
  }

  .timeline {
    bottom: 1.35rem;
  }

  .timeline button span,
  .coordinates {
    display: none;
  }

  .timeline button {
    width: 1rem;
    align-items: center;
  }

  .scroll-cue {
    bottom: 1.5rem;
  }

  .finale h2 {
    font-size: clamp(3.7rem, 16vw, 6.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .film-grain,
  .scroll-cue i::after,
  .sound-button[aria-pressed="true"] .sound-bars i {
    animation: none;
  }
}

@media (pointer: coarse) {
  .sound-button,
  .timeline button,
  .replay-button {
    min-height: 44px;
  }
}
