:root {
  --ink: #f4f1ea;
  --ink-dim: rgba(244, 241, 234, 0.64);
  --ink-faint: rgba(244, 241, 234, 0.42);
  --black: #000;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--black);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

[hidden] { display: none !important; }

/* ---------- backdrop: stills + muted reel ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--black);
  z-index: 0;
}

.still,
.reel,
.shade {
  position: absolute;
  inset: 0;
}

.still {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 900ms ease;
}

.still.on { opacity: 1; }

.reel {
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
}

.reel.on { opacity: 1; }
.reel.snap { transition: none; }

/* Cover the viewport at 16:9, oversized so the player chrome is cropped away. */
.reel iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  transform: translate(-50%, -50%) scale(1.25);
  border: 0;
}

.shade {
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.72) 100%);
  transition: background-color 600ms ease;
}

body.watching .shade { background-color: rgba(0, 0, 0, 0.84); }
body.watching .reel { opacity: 0; }

/* ---------- views ---------- */

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 64px;
  text-align: center;
  animation: view-in 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- home ---------- */

.logo {
  margin: 0;
  width: min(600px, 88vw);
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.55));
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.films,
.social,
.film-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 6px 14px;
  max-width: 900px;
}

.films {
  margin-top: 26px;
  font-size: 17px;
  font-weight: 500;
}

.social {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-dim);
}

.dash { opacity: 0.5; }

.films a,
.social a,
.film-controls a,
.now {
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, color 200ms ease;
}

.films a:hover,
.films a.active,
.social a:hover,
.film-controls a:hover,
.now:hover {
  border-bottom-color: currentColor;
  color: #fff;
}

.now-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.now {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

.now-index {
  color: var(--ink-faint);
}

/* ---------- film ---------- */

.film {
  gap: 20px;
  padding-bottom: 36px;
}

.player {
  width: min(1100px, 100%, calc((100svh - 220px) * 16 / 9));
  aspect-ratio: 16 / 9;
  background: var(--black);
  box-shadow: 0 0 0 1px rgba(244, 241, 234, 0.22), 0 30px 80px rgba(0, 0, 0, 0.65);
}

.player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.caption h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.caption h2:focus {
  outline: none;
}

.caption p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-dim);
}

.film-controls {
  font-size: 13px;
  color: var(--ink-dim);
}

.film-controls .back {
  color: var(--ink);
}

.noscript {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 16px;
}

.noscript a {
  padding: 6px 2px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.35);
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .films {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 16px;
  }

  .films a,
  .social a,
  .film-controls a {
    padding: 8px 6px;
  }

  .films .dash { display: none; }

  .player { width: 100%; }

  .now {
    font-size: 10.5px;
    letter-spacing: 0.11em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .still, .reel, .shade { transition: none; }
  .view { animation: none; }
}
