/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #0a0a0c;
  --bg-raise: #131316;
  --ink: #efeae2;
  --ink-2: #a8a298;
  --ink-3: #6f6a62;
  --line: rgba(255, 255, 255, 0.09);

  --accent: #ffc61a;
  --gold: linear-gradient(135deg, #fff0b8 0%, #ffd23f 35%, #ffb300 70%, #e08e00 100%);
  --gold-ink: #1c1300;

  --display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --jp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --gutter: clamp(16px, 4vw, 48px);
  --wrap: min(1200px, 100% - 2 * var(--gutter));
  --radius: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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)'/%3E%3C/svg%3E");
}

a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; fill: currentColor; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ───────────────────────── Top bar ───────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 var(--gutter);
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.topbar.is-scrolled {
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 400 20px/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand b { font-weight: 400; color: var(--accent); }
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px rgba(255, 198, 26, 0.55);
}

.nav { display: flex; gap: clamp(4px, 1.5vw, 12px); }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color 0.2s, background 0.2s;
}
.nav a i { font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.nav a.is-active i { color: var(--accent); }

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: hero-drift 18s var(--ease) infinite alternate;
}
@keyframes hero-drift { to { transform: scale(1.12) translate(-1.5%, 1%); } }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 10, 12, 0.6) 0%, rgba(10, 10, 12, 0) 22%, rgba(10, 10, 12, 0.15) 55%, var(--bg) 100%),
    linear-gradient(90deg, rgba(10, 10, 12, 0.78) 0%, rgba(10, 10, 12, 0.25) 55%, rgba(10, 10, 12, 0) 80%);
}

.hero-content {
  width: var(--wrap);
  margin: 0 auto;
  padding: 120px 0 clamp(64px, 12vh, 140px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 10px #ff3b30;
  animation: rec 1.6s steps(1) infinite;
}
@keyframes rec { 50% { opacity: 0.25; } }

h1 {
  margin: 0;
  font: 400 clamp(76px, 14.5vw, 210px) / 0.86 var(--display);
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-shadow: 0 10px 60px rgba(0, 0, 0, 0.45);
}
h1 span {
  color: transparent;
  background: var(--gold);
  -webkit-background-clip: text;
  background-clip: text;
}

.lede {
  max-width: 44ch;
  margin: 28px 0 0;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-2);
}

.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 20px 28px; margin-top: 36px; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--gold-ink);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 10px 40px -10px rgba(255, 198, 26, 0.7);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.cta svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--gold-ink); color: var(--accent); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 50px -12px rgba(255, 198, 26, 0.85); }

.hero-count { font-size: 14px; color: var(--ink-3); letter-spacing: 0.04em; }
.hero-count b { color: var(--ink-2); font-weight: 600; }

.hero-kanji {
  position: absolute;
  top: 50%;
  right: var(--gutter);
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font: 900 clamp(64px, 9vw, 140px) / 1 var(--jp);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  opacity: 0.92;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 24px;
  height: 40px;
  margin-left: -12px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
}
.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 3px;
  background: var(--ink);
  animation: cue 1.8s var(--ease) infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ───────────────────────── Reel sections ───────────────────────── */
.reel {
  --tint: 255, 150, 70;
  position: relative;
  padding: clamp(64px, 10vh, 120px) 0;
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(var(--tint), 0.09), transparent 70%),
    radial-gradient(50% 40% at 100% 60%, rgba(var(--tint), 0.05), transparent 70%);
}
.reel--wet { --tint: 80, 150, 255; }
.reel--others { --tint: 150, 200, 170; }
.reel + .reel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--wrap);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}

/* Sized so player + now-line + thumbnail row fit in one screen on desktop. */
.reel-inner {
  width: min(var(--wrap), max(720px, (100vh - 310px) * 1.8));
  width: min(var(--wrap), max(720px, (100svh - 310px) * 1.8));
  margin: 0 auto;
}

.reel-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: clamp(16px, 3vw, 40px);
  margin-bottom: clamp(28px, 4vw, 48px);
}
.reel-num {
  font: 400 clamp(64px, 9vw, 128px) / 0.78 var(--display);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.3);
  font-variant-numeric: tabular-nums;
}
.reel-title {
  margin: 0;
  font: 400 clamp(44px, 6.4vw, 92px) / 0.9 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.reel-title .pre { color: var(--ink-3); }
.reel-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 14px 0 0;
  color: var(--ink-2);
}
.reel-sub p { margin: 0; max-width: 52ch; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip--gold { border-color: rgba(255, 198, 26, 0.45); color: var(--accent); }
.chip--gold svg { width: 12px; height: 12px; }

.reel-kanji {
  font: 900 clamp(64px, 9vw, 132px) / 0.85 var(--jp);
  color: rgba(var(--tint), 0.85);
  text-shadow: 0 0 60px rgba(var(--tint), 0.35);
}

/* Stage + ambient glow */
.stage { position: relative; }
.ambient {
  position: absolute;
  inset: 8% 6% -2%;
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: blur(70px) saturate(1.6);
  opacity: 0.5;
  transform: translateZ(0);
  transition: background-image 0.6s, opacity 0.6s;
  pointer-events: none;
}

/* ───────────────────────── Player ───────────────────────── */
.player {
  position: relative;
  z-index: 1;
  margin: 0;
  aspect-ratio: 9 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  box-shadow:
    0 0 0 1px var(--line),
    0 50px 120px -40px rgba(0, 0, 0, 0.9);
  transition: box-shadow 0.5s var(--ease);
}
.player.is-final {
  box-shadow:
    0 0 0 1.5px rgba(255, 198, 26, 0.75),
    0 0 80px -20px rgba(255, 198, 26, 0.45),
    0 50px 120px -40px rgba(0, 0, 0, 0.9);
}
.player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.25s, filter 0.25s;
}
.player.is-switching video { opacity: 0.35; filter: blur(6px); }
.player:fullscreen { border-radius: 0; }
.player:fullscreen video { object-fit: contain; }

/* Final badge */
.final-badge {
  position: absolute;
  top: clamp(12px, 2vw, 20px);
  left: clamp(12px, 2vw, 20px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 8px 30px -6px rgba(255, 180, 0, 0.65);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.final-badge svg { width: 16px; height: 16px; }
.final-badge span { font-weight: 600; opacity: 0.7; letter-spacing: 0.06em; }
.final-badge span::before { content: "·"; margin-right: 8px; }
.player.is-final .final-badge { opacity: 1; transform: none; }

/* Big play button */
.big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(64px, 8vw, 88px);
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 10, 12, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.25s, transform 0.25s var(--ease), background 0.2s;
  pointer-events: none;
}
.big-play svg { width: 40%; height: 40%; margin-left: 6%; }
.big-play:hover { background: rgba(255, 198, 26, 0.9); color: var(--gold-ink); }
.player.is-paused .big-play { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }

/* Control bar */
.controls {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 48px clamp(10px, 1.6vw, 18px) clamp(8px, 1.2vw, 14px);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.player:hover .controls,
.player:focus-within .controls,
.player.is-paused .controls { opacity: 1; transform: none; }
@media (hover: none) { .controls { opacity: 1; transform: none; } }

.ctl {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}
.ctl svg { width: 20px; height: 20px; }
.ctl:hover { background: rgba(255, 255, 255, 0.12); }

.time {
  flex: none;
  min-width: 82px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
}

.seek {
  --p: 0%;
  flex: 1;
  min-width: 0;
  height: 20px;
  margin: 0 6px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--p), rgba(255, 255, 255, 0.25) var(--p));
}
.seek::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--p), rgba(255, 255, 255, 0.25) var(--p));
}
.seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 198, 26, 0.35);
  transform: scale(0);
  transition: transform 0.15s;
}
.seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 198, 26, 0.35);
  transform: scale(0);
  transition: transform 0.15s;
}
.seek:hover::-webkit-slider-thumb, .seek:focus-visible::-webkit-slider-thumb { transform: scale(1); }
.seek:hover::-moz-range-thumb, .seek:focus-visible::-moz-range-thumb { transform: scale(1); }
.seek:focus-visible { outline: none; }

/* Now-playing line */
.now {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.now-title { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.now-index {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.now-label { font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; letter-spacing: -0.01em; }
.now-label.is-final {
  color: transparent;
  background: var(--gold);
  -webkit-background-clip: text;
  background-clip: text;
}
.now-side { display: flex; align-items: center; gap: 14px; }
.now-meta { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.step { display: flex; gap: 6px; }
.step button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.step button:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); }
.step svg { width: 18px; height: 18px; }

/* ───────────────────────── Thumbnails ───────────────────────── */
.thumbs {
  list-style: none;
  display: grid;
  /* One row; --cols is the largest clip count so thumbnails are the same size in every section */
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
  margin: clamp(24px, 3vw, 36px) 0 0;
  padding: 0;
}

.thumb {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
}
.thumb-media {
  position: relative;
  display: block;
  aspect-ratio: 9 / 5;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-raise);
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.thumb-media img,
.thumb-media canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.3s, opacity 0.3s;
}
.thumb-media img { filter: saturate(0.55) brightness(0.68); }
.thumb-media canvas { opacity: 0; }
.thumb-media.is-previewing canvas { opacity: 1; }

.thumb:hover .thumb-media { transform: translateY(-3px); }
.thumb:hover .thumb-media img,
.thumb.is-active .thumb-media img { filter: none; }
.thumb:hover .thumb-media img { transform: scale(1.05); }

.thumb.is-active .thumb-media { box-shadow: 0 0 0 2px var(--ink), 0 14px 40px -16px rgba(0, 0, 0, 0.9); }
.thumb.is-final .thumb-media { box-shadow: 0 0 0 1.5px rgba(255, 198, 26, 0.6), 0 10px 40px -18px rgba(255, 180, 0, 0.6); }
.thumb.is-final.is-active .thumb-media { box-shadow: 0 0 0 2.5px var(--accent), 0 14px 50px -14px rgba(255, 180, 0, 0.75); }

.thumb-ribbon {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px -4px rgba(255, 180, 0, 0.7);
}
.thumb-ribbon svg { width: 11px; height: 11px; }

.thumb-num {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 2;
  font: 400 22px/1 var(--display);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  font-variant-numeric: tabular-nums;
}

.thumb-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.2s;
}
.thumb-label small { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.thumb.is-final .thumb-label small { color: var(--accent); }
.thumb:hover .thumb-label,
.thumb.is-active .thumb-label { color: var(--ink); }

/* "Now playing" equalizer on the active thumbnail */
.eq { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: var(--accent); animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.eq i { transform-origin: bottom; }
.thumb.is-active .eq { display: inline-flex; }
.thumb.is-active .thumb-label small { display: none; }
.reel.is-paused .eq i { animation-play-state: paused; }

/* ───────────────────────── Footer ───────────────────────── */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: var(--wrap);
  margin: 0 auto;
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
}
.footer b { color: var(--accent); font-weight: 600; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 760px) {
  .nav a { padding: 8px 9px; }
  .nav a i { display: none; }
  .hero-kanji { top: 96px; transform: none; font-size: 56px; opacity: 0.75; }
  .reel-head { grid-template-columns: 1fr auto; }
  .reel-num { display: none; }
  .now-meta { display: none; }

  .thumbs {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: minmax(150px, 44%);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 8px;
    scroll-padding-inline: var(--gutter);
  }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumbs li { scroll-snap-align: start; }
}

@media (max-width: 420px) {
  .brand { font-size: 17px; }
  .time { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
