:root {
  --bg: #0a0a0a;
  --ink: #f2f2ef;
  --ink-dim: rgba(242, 242, 239, 0.5);
  --ink-faint: rgba(242, 242, 239, 0.7);
  --line: rgba(242, 242, 239, 0.12);
  --track: rgba(255, 255, 255, 0.14);
}

/* Dark bg on BOTH html + body so iOS overscroll bounce doesn't flash white */
html, body {
  background: var(--bg);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

/* ── Reader (scroll container) ─────────────────── */

.reader {
  width: 100%;
  /* proximity (not mandatory) so the cover/end anchor, while the plate
     strip scrolls freely without being forced into snap points */
  scroll-snap-type: y proximity;
}

/* ── Cover / landing hero ──────────────────────── */

.cover-hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  scroll-snap-align: start;
}

.cover-inner {
  max-width: 640px;
  padding: 48px 24px;
  text-align: center;
}

.kicker {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 28px;
}

.cover-title {
  font-weight: 300;
  font-size: clamp(40px, 8vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 28px;
}

.cover-logo {
  width: min(44vw, 268px);
  height: auto;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.cover-sub {
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-dim);
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--ink-dim);
}

.scroll-cue span {
  width: 1px;
  height: 48px;
  background: var(--track);
  position: relative;
  overflow: hidden;
}

.scroll-cue span::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: var(--ink);
  animation: scrollball 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.scroll-cue p {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

@keyframes scrollball {
  0% { transform: translateY(200%); }
  100% { transform: translateY(-100%); }
}

/* ── Plate strip ──────────────────────────────── */

.plates {
  width: 100%;
}

.plate {
  position: relative;
  width: 100%;
  /* 250:176 = the plate's true aspect ratio → height follows from width,
     nothing is ever cropped or letterboxed */
  aspect-ratio: 250 / 176;
  overflow: hidden;
}

.plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateY(24px) scale(1.02);
  transition: opacity 900ms ease, transform 900ms ease;
}

.plate.in-view img {
  opacity: 1;
  transform: none;
}

/* Per-plate watermark */
.watermark {
  position: absolute;
  right: 18px;
  bottom: 14px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  mix-blend-mode: difference;
  pointer-events: none;
  user-select: none;
}

/* ── End hero (credits) ────────────────────────── */

.end-hero {
  min-height: 100vh;             /* not locked to one screen — grows to fit */
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding: 96px 24px 120px;
}

.end-inner {
  width: 100%;
  max-width: 460px;
}

.end-logo {
  width: 88px;
  height: auto;
  margin: 0 auto 28px;
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.end-fin {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 28px;
}

.end-title {
  font-weight: 300;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 56px;
}

/* Crew credits: one grouped block per person */

.credits {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.credit {
  display: flex;
  flex-direction: column;
  gap: 3px;                       /* tight between name / roles / handle */
}

.credit-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
}

.credit-role {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.credit-handle {
  font-size: 11.5px;
  color: var(--ink-faint);
  opacity: 0.7;
}

/* Real handle link: no blue, no default underline; thin underline on hover */

.credit-handle a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.credit-handle a:hover {
  border-bottom-color: var(--ink-faint);
}

/* Special thanks: quieter, separated by a thin top divider */

.special-thanks {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.special-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 18px;
}

.special-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.special-name {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
}

.special-role {
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.special-handle {
  font-size: 11.5px;
  color: var(--ink-faint);
  opacity: 0.7;
}

/* ── Fixed chrome (mix-blend-mode: difference) ── */

.mark {
  position: fixed;
  top: 22px;
  left: 22px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  mix-blend-mode: difference;
  user-select: none;
  z-index: 20;
}

.counter {
  position: fixed;
  right: 22px;
  bottom: 22px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #fff;
  mix-blend-mode: difference;
  user-select: none;
  z-index: 20;
}

/* Left-edge vertical progress line */
.progress {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--track);
  z-index: 20;
}

.progress-fill {
  width: 100%;
  height: 0;
  background: #fff;
  mix-blend-mode: difference;
}

/* Sound toggle */
.sound {
  position: fixed;
  left: 22px;
  bottom: 22px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 20;
  color: #fff;
  mix-blend-mode: difference;
}

/* Equalizer bars: static when paused, animated while playing */
.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.eq i {
  width: 2.5px;
  height: 5px;
  background: currentColor;
}

.sound.playing .eq i {
  animation: eq 1s ease-in-out infinite;
}

.sound.playing .eq i:nth-child(1) { animation-delay: 0s; }
.sound.playing .eq i:nth-child(2) { animation-delay: 0.15s; }
.sound.playing .eq i:nth-child(3) { animation-delay: 0.3s; }
.sound.playing .eq i:nth-child(4) { animation-delay: 0.45s; }

@keyframes eq {
  0%, 100% { height: 5px; }
  50% { height: 16px; }
}

:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}
