/* LOST IN CAPTIONS — project site */

:root {
  --bg: #000;
  --fg: #fff;
  --dim: rgba(255, 255, 255, 0.55);
  --faint: rgba(255, 255, 255, 0.28);
  --amber: #ffb25e;
  --cap-bg: #161616;
  --display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --body: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  --ascii: "Roboto Mono", ui-monospace, Menlo, monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* Hidden on screen, read by screen readers and search engines. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 1 · Film: the video fills the whole screen ---------- */

.film {
  position: relative;
  height: 100vh;
  height: 100svh;
  background: #000;
}

.player,
.player__frame {
  position: absolute;
  inset: 0;
}

/* YouTube letterboxes the 16:9 film inside the frame with black bars. */
.player__frame iframe,
.player__frame #yt-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.unsaid { color: var(--amber); }

.sound {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font: 500 13px/1 var(--body);
  letter-spacing: 0.06em;
  color: #000;
  background: var(--fg);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.sound:hover { transform: translateY(-1px); }
.sound:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.sound[hidden] { display: none; }
.sound__icon { font-size: 15px; }

/* ---------- ASCII curtain ---------- */

.curtain {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background: #000;
  pointer-events: none;
}
.curtain.is-open { background: transparent; }

.curtain__ascii {
  margin: 0;
  position: absolute;
  inset: 0;
  font-family: var(--mono);
  font-size: clamp(9px, 1.05vw, 15px);
  line-height: 1.12;
  white-space: pre;
  user-select: none;
  /* Velvet colour, lit by a soft spotlight from above. */
  color: #b3141e;
  background:
    radial-gradient(ellipse 55% 80% at 50% 12%, #ff8a70 0%, #e0303a 30%, #a8121c 60%, #5c070c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Countdown (before the premiere), drawn in ASCII ---------- */

.countdown {
  display: none;
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  margin: 0;
  font-family: var(--ascii);
  font-size: 14px;               /* script.js sizes this to fit the screen */
  line-height: 1.1;
  white-space: pre;
  color: #fff;
  background: #000;
  box-shadow: 0 0 0 1px #000, 0 10px 40px rgba(0, 0, 0, 0.7);
  transition: opacity 0.9s ease;
}
.prelaunch .countdown,
.countdown.is-leaving { display: block; }
.countdown.is-leaving { opacity: 0; }
.countdown .b { color: rgba(255, 255, 255, 0.38); }   /* border */
.countdown .d { color: #fff; }                        /* labels and date */

/* Before the premiere: only the curtain and countdown, nothing to scroll to. */
.prelaunch body { overflow: hidden; }
.prelaunch .about,
.prelaunch .sound { display: none; }

.noscript {
  position: absolute;
  z-index: 5;
  left: 0; right: 0; bottom: 24px;
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--dim);
}

/* ---------- 2 · About ---------- */

.about {
  padding: clamp(80px, 16vh, 180px) 20px clamp(60px, 10vh, 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.poem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(56px, 11vh, 120px);
  width: 100%;
  max-width: 640px;
}

/* Each stanza is drawn like a YouTube caption: every line gets its own
   dark box that hugs the text. */
.cap {
  margin: 0;
  font-weight: 400;
  font-size: clamp(14px, 4.2vw, 22px);
  line-height: 1.9;
  text-align: center;
}
.cap > span {
  background: var(--cap-bg);
  padding: 0.2em 0.5em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.cap--last { font-size: clamp(16px, 4.6vw, 26px); }

/* Reveal on scroll (only when JS is running and motion is OK). */
.js .cap {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.js .cap.is-shown {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .cap { opacity: 1; transform: none; transition: none; }
}

.credit {
  margin-top: clamp(100px, 18vh, 200px);
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.7;
}
.credit p { margin: 0; }
.credit__title {
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.06em;
  color: var(--fg);
  margin-bottom: 6px !important;
}
.credit__how {
  max-width: 420px;
  margin: 18px auto 0 !important;
  color: var(--faint);
  font-size: 13px;
}
.credit__year {
  margin-top: 18px !important;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
}
