/* ==========================================================================
   Moncef Bouhafna — portfolio
   Layout: the page is a screenplay. One centred column with scene numbers
   hung in both margins; physical objects (turntable, posters, ticket)
   break out of the text grid. Dark "theatre" is the default; light is
   "house lights up".
   ========================================================================== */

:root {
  /* Theatre (dark, default) */
  --bg: #0d1f16;
  /* bottle green, the room */
  --bg-2: #132a1f;
  /* raised surfaces */
  --line: #2a4536;
  --fg: #ebe5d2;
  /* projector white */
  --fg-2: #a5b7aa;
  /* sage, secondary text */
  --accent: #e8b14b;
  /* marquee bulb */
  --on-accent: #1b1506;
  --header-bg: rgba(13, 31, 22, 0.82);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 22px 44px -22px rgba(0, 0, 0, 0.75);
  --grain-opacity: 0.075;
  color-scheme: dark;

  /* Objects keep their own colours in both themes */
  --vinyl: #111111;
  --vinyl-2: #1d1d1d;
  --bar: #040705;
  --p-green: #1f3d2c;
  --p-brass: #c9963b;
  --p-sage: #a9bba7;
  --p-blue: #4f6b78;
  --p-oxblood: #6b2b2a;
  --p-paper: #ece4cf;
  --p-ink: #17211b;

  /* Type */
  --font-display: "Bodoni Moda", "Bodoni 72", Didot, "Times New Roman", serif;
  --font-body: "Courier Prime", "Courier New", Courier, monospace;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.25rem, 2.2vw, 1.6rem);
  --step-3: clamp(2rem, 4.5vw, 3rem);
  --step-4: clamp(3.4rem, 11vw, 7.6rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e3e9e0;
    --bg-2: #edf1ea;
    --line: #c2ccbf;
    --fg: #11251b;
    --fg-2: #4b6053;
    --accent: #7d530a;
    --on-accent: #fff8e6;
    --header-bg: rgba(227, 233, 224, 0.85);
    --shadow: 0 1px 0 rgba(20, 40, 28, 0.08), 0 22px 40px -22px rgba(20, 40, 28, 0.5);
    --grain-opacity: 0.05;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #e3e9e0;
  --bg-2: #edf1ea;
  --line: #c2ccbf;
  --fg: #11251b;
  --fg-2: #4b6053;
  --accent: #7d530a;
  --on-accent: #fff8e6;
  --header-bg: rgba(227, 233, 224, 0.85);
  --shadow: 0 1px 0 rgba(20, 40, 28, 0.08), 0 22px 40px -22px rgba(20, 40, 28, 0.5);
  --grain-opacity: 0.05;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}

/* Smooth crossfade while the lights change */
.theme-fade,
.theme-fade *,
.theme-fade *::before,
.theme-fade *::after {
  transition: background-color 0.7s ease, color 0.7s ease, border-color 0.7s ease, fill 0.7s ease !important;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.5rem 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

/* --------------------------------------------------------------------------
   Opening sequence + film grain
   -------------------------------------------------------------------------- */
.letterbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.letterbox::before,
.letterbox::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background: var(--bar);
  animation: bars-open 1.15s cubic-bezier(0.77, 0, 0.18, 1) 0.15s both;
}

.letterbox::before {
  top: 0;
  transform-origin: top;
}

.letterbox::after {
  bottom: 0;
  transform-origin: bottom;
}

@keyframes bars-open {
  from {
    transform: scaleY(1);
  }

  to {
    transform: scaleY(0);
  }
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-size: 160px 160px;
  animation: grain 0.9s steps(6) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-3%, 2%);
  }

  40% {
    transform: translate(2%, -4%);
  }

  60% {
    transform: translate(-4%, -1%);
  }

  80% {
    transform: translate(3%, 3%);
  }

  100% {
    transform: translate(0, 0);
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-block: 0.85rem;
}

.brand {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  margin-right: auto;
  font-variation-settings: "opsz" 48;
}

.nav {
  position: relative;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: var(--step--1);
  padding-block: 0.25rem;
  background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease), color 0.35s ease;
}

.nav-links a:hover {
  background-size: 100% 1px;
  color: var(--accent);
}

.lights,
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: var(--step--1);
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.lights:hover,
.menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav .menu-btn {
  display: none;
}

.lights svg,
.menu-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  .nav .menu-btn {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.6rem);
    flex-direction: column;
    gap: 0.2rem;
    min-width: 12rem;
    padding: 0.6rem;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 0.5rem 0.6rem;
    font-size: var(--step-0);
    background: none;
  }

  .header-inner {
    gap: 0.6rem;
  }
}

@media (max-width: 400px) {
  .lights-label {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font: inherit;
  font-weight: 700;
  font-size: var(--step--1);
  text-decoration: none;
  cursor: pointer;
  padding: 0.85rem 1.3rem;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(3.5rem, 8vw, 6rem);
}

.fade-in {
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--fg-2);
  margin-bottom: 1.2rem;
  animation: type-in 0.6s steps(8) 1s both;
  overflow: hidden;
  white-space: nowrap;
  width: 8ch;
}

@keyframes type-in {
  from {
    width: 0;
  }

  to {
    width: 8ch;
  }
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-4);
  line-height: 0.92;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 96;
  margin-bottom: 1.8rem;
}

.hero-name .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.hero-name .line>span {
  display: inline-block;
  animation: rise 1s var(--ease) both;
}

.hero-name .line:nth-child(1)>span {
  animation-delay: 0.85s;
}

.hero-name .line:nth-child(2)>span {
  animation-delay: 0.98s;
}

@keyframes rise {
  from {
    transform: translateY(105%);
  }

  to {
    transform: translateY(0);
  }
}

.hero-lead {
  max-width: 44ch;
  font-size: var(--step-0);
  color: var(--fg);
  margin-bottom: 2rem;
  animation: settle 1s var(--ease) 1.2s both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  animation: settle 1s var(--ease) 1.3s both;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-deck {
    justify-items: start;
  }
}

/* Turntable */
.hero-deck {
  display: grid;
  gap: 1.4rem;
  justify-items: center;
  animation: settle 1.2s var(--ease) 1.1s both;
}

.deck {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 112 / 100;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.platter {
  position: absolute;
  left: 3.57%;
  top: 14%;
  width: 64.3%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--p-ink);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.7);
}

.record {
  position: absolute;
  inset: 2.5%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 33%, rgba(255, 255, 255, 0.05) 33.4% 34%, transparent 34.6% 64%, rgba(255, 255, 255, 0.04) 64.4% 65%, transparent 65.6%),
    repeating-radial-gradient(circle, var(--vinyl) 0 1.4px, var(--vinyl-2) 1.4px 2.8px);
  animation: spin 1.8s linear infinite;
  /* 33 1/3 rpm */
  animation-play-state: paused;
}

.is-playing .record {
  animation-play-state: running;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.sheen {
  position: absolute;
  inset: 2.5%;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 20deg, transparent 0 8%, rgba(255, 255, 255, 0.09) 13%, transparent 19% 50%, rgba(255, 255, 255, 0.07) 62%, transparent 69%);
}

.label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--p-brass);
}

.label svg {
  display: block;
  width: 100%;
  height: 100%;
}

.label text {
  fill: var(--p-ink);
  font-family: var(--font-body);
}

.label-ring {
  font-size: 8.4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.label .label-mid {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
}

.label-small {
  font-size: 7px;
}

.label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--fg-2);
  box-shadow: 0 0 0 2px var(--p-ink);
}

.arm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.arm-g {
  transform-box: view-box;
  transform-origin: 95px 16px;
  transform: rotate(-4deg);
  transition: transform 1.4s cubic-bezier(0.5, 0, 0.2, 1);
}

.is-playing .arm-g {
  transform: rotate(30deg);
}

.arm-rod {
  stroke: var(--fg-2);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.arm-head,
.arm-weight {
  fill: var(--fg-2);
}

.arm-base {
  fill: var(--line);
  stroke: var(--fg-2);
  stroke-width: 1;
}

.arm-pin {
  fill: var(--fg-2);
}

.deck-light {
  position: absolute;
  left: 5%;
  bottom: 6%;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.is-playing .deck-light {
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent);
}

.deck-speed {
  position: absolute;
  right: 6%;
  bottom: 5%;
  font-size: 0.75rem;
  color: var(--fg-2);
}

.now-playing {
  width: min(100%, 440px);
  display: grid;
  gap: 0.35rem;
  justify-items: start;
}

.np-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-style: italic;
}

.np-k {
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--step--1);
  color: var(--fg-2);
  margin-right: 0.4rem;
}

.np-sub {
  font-size: var(--step--1);
  color: var(--fg-2);
  margin-bottom: 0.7rem;
}

.np-error {
  font-size: var(--step--1);
  color: var(--accent);
  min-height: 0;
}

.play-btn .i-stop,
.mini-btn .i-stop {
  display: none;
}

.is-playing .play-btn .i-stop,
.is-playing .mini-btn .i-stop {
  display: block;
}

.is-playing .play-btn .i-play,
.is-playing .mini-btn .i-play {
  display: none;
}

/* --------------------------------------------------------------------------
   Scenes
   -------------------------------------------------------------------------- */
.scene {
  padding-block: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--line);
}

.scene-grid {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  column-gap: clamp(0.5rem, 2vw, 1.5rem);
}

.scene-no {
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.3;
  color: var(--fg-2);
}

.scene-no-r {
  text-align: right;
}

.scene-body {
  min-width: 0;
}

.slug {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin-bottom: clamp(1.6rem, 4vw, 2.6rem);
}

.action {
  max-width: 62ch;
}

.action.intro {
  color: var(--fg-2);
  margin-top: -1rem;
  margin-bottom: 2.6rem;
}

.caps {
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 700px) {
  .scene-grid {
    grid-template-columns: 1.8rem minmax(0, 1fr);
  }

  .scene-no-r {
    display: none;
  }
}

/* Focus-pull reveal (only applied by script to things below the fold) */
[data-pull] {
  transition: filter 1.1s ease, opacity 1.1s ease, transform 1.1s var(--ease);
}

[data-pull].is-out {
  filter: blur(7px);
  opacity: 0.3;
  transform: translateY(16px);
}

/* --------------------------------------------------------------------------
   Scene 1: screenplay
   -------------------------------------------------------------------------- */
.script {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  max-width: 70ch;
}

.script .character {
  margin-left: 34%;
  margin-top: 0.8rem;
  font-weight: 700;
}

.script .parenthetical {
  margin-left: 28%;
  margin-top: -1rem;
  color: var(--fg-2);
}

.script .dialogue {
  margin-left: 16%;
  max-width: 40ch;
  margin-top: -1rem;
}

.script .caps {
  margin-top: 1rem;
}

.script .transition {
  justify-self: end;
  font-weight: 700;
  margin-top: 0.4rem;
}

@media (max-width: 600px) {
  .script .character {
    margin-left: 22%;
  }

  .script .parenthetical {
    margin-left: 16%;
  }

  .script .dialogue {
    margin-left: 8%;
  }
}

.monitor {
  margin: 0;
  min-width: 0;
}

.monitor pre {
  margin: 0;
  overflow-x: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
  font-family: var(--font-body);
  font-size: var(--step--1);
  line-height: 1.75;
  tab-size: 2;
}

.monitor .ln {
  display: inline-block;
  width: 2ch;
  margin-right: 1.4ch;
  color: var(--fg-2);
  opacity: 0.6;
  user-select: none;
}

.monitor .kw {
  color: var(--fg-2);
  font-style: italic;
}

.monitor .key {
  color: var(--fg);
}

.monitor .str {
  color: var(--accent);
}

.cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1.1em;
  margin-left: 0.3ch;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   Scene 2: the poster wall (masonry)
   -------------------------------------------------------------------------- */
.wall {
  columns: 3 260px;
  column-gap: clamp(1.25rem, 3vw, 2.2rem);
}

.pin {
  break-inside: avoid;
  margin: 0 0 clamp(2rem, 4vw, 2.8rem);
  display: grid;
  gap: 1rem;
}

.pin .art {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  box-shadow: var(--shadow);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.pin:hover .art {
  transform: translateY(-6px) rotate(-0.6deg);
}

.pin:nth-child(even):hover .art {
  transform: translateY(-6px) rotate(0.6deg);
}

.pin figcaption {
  display: grid;
  gap: 0.3rem;
}

.pin-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-1);
  line-height: 1.2;
}

.pin-meta {
  font-size: var(--step--1);
  color: var(--fg-2);
}

.pin-text {
  font-size: var(--step--1);
  max-width: 42ch;
}

.pin-link {
  justify-self: start;
  margin-top: 0.3rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.pin-link:hover {
  text-decoration-thickness: 2px;
}

/* Poster colour utilities (fixed object colours) */
.f-paper {
  fill: var(--p-paper);
}

.f-ink {
  fill: var(--p-ink);
}

.f-green {
  fill: var(--p-green);
}

.f-brass {
  fill: var(--p-brass);
}

.f-sage {
  fill: var(--p-sage);
}

.f-blue {
  fill: var(--p-blue);
}

.f-oxblood {
  fill: var(--p-oxblood);
}

.s-paper {
  stroke: var(--p-paper);
}

.s-ink {
  stroke: var(--p-ink);
}

.s-sage {
  stroke: var(--p-sage);
}

.t-display {
  font-family: var(--font-display);
  font-weight: 500;
}

.t-mono {
  font-family: var(--font-body);
}

.billing {
  font-size: 6.6px;
  letter-spacing: 0.6px;
}

.blend circle {
  mix-blend-mode: multiply;
  opacity: 0.92;
}

.slot-empty {
  fill: none;
  stroke: var(--p-ink);
  stroke-opacity: 0.35;
  stroke-dasharray: 3 3;
}

.bulbs-a {
  animation: chase 1.4s steps(1) infinite;
}

.bulbs-b {
  animation: chase 1.4s steps(1) -0.7s infinite;
}

@keyframes chase {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

/* --------------------------------------------------------------------------
   Scene 3: record sleeve / tracklist
   -------------------------------------------------------------------------- */
.sleeve {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.side-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1;
  font-variation-settings: "opsz" 96;
}

.side-sub {
  color: var(--fg-2);
  margin: 0.4rem 0 1.8rem;
}

.sleeve-meta {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1.6rem;
  font-size: var(--step--1);
}

.sleeve-meta div {
  display: flex;
  gap: 0.8rem;
  border-bottom: 1px dotted var(--line);
  padding-bottom: 0.35rem;
}

.sleeve-meta dt {
  color: var(--fg-2);
  min-width: 6.5rem;
}

.sleeve-meta dd {
  margin: 0;
}

.liner {
  font-size: var(--step--1);
  color: var(--fg-2);
  font-style: italic;
  max-width: 30ch;
}

.tracks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.track {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  padding-block: 1.3rem;
  border-top: 1px solid var(--line);
}

.track:last-child {
  border-bottom: 1px solid var(--line);
}

.track-no {
  font-weight: 700;
  color: var(--accent);
  padding-top: 0.35rem;
}

.track-body {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.track-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  transition: transform 0.45s var(--ease);
}

.track:hover .track-title {
  transform: translateX(6px);
}

.track-desc {
  max-width: 52ch;
}

.track-tools {
  font-size: var(--step--1);
  color: var(--fg-2);
}

@media (max-width: 760px) {
  .sleeve {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Scene 4: end credits
   -------------------------------------------------------------------------- */
.roll {
  max-width: 860px;
  margin-inline: auto;
  display: grid;
  gap: 1.4rem;
}

.roll-head {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: var(--step-3);
  text-align: center;
  line-height: 1.1;
  margin-top: 1.4rem;
}

.roll-head:first-child {
  margin-top: 0;
}

.credits {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.credits div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 2rem;
  align-items: baseline;
}

.credits dt {
  text-align: right;
  color: var(--fg-2);
  font-size: var(--step--1);
}

.credits dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.3;
}

.credits .yr {
  display: block;
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .credits div {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    row-gap: 0.15rem;
  }

  .credits dt {
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Scene 5: box office
   -------------------------------------------------------------------------- */
.box-office {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
}

.ticket-wrap {
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.35));
}

.ticket {
  --stub: 7.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--stub);
  background: var(--p-paper);
  color: var(--p-ink);
  border-radius: 10px;
  transform: rotate(-1.5deg);
  transition: transform 0.6s var(--ease);
  -webkit-mask:
    radial-gradient(circle at calc(100% - var(--stub)) 0, transparent 13px, #000 13.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent 13px, #000 13.5px) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle at calc(100% - var(--stub)) 0, transparent 13px, #000 13.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent 13px, #000 13.5px) bottom / 100% 51% no-repeat;
}

.ticket:hover {
  transform: rotate(0deg);
}

.ticket-main {
  padding: clamp(1.4rem, 3.5vw, 2.2rem);
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.admit {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1;
  font-variation-settings: "opsz" 96;
}

.ticket-to {
  font-size: var(--step--1);
}

.ticket-lines {
  margin: 0.4rem 0 0;
  display: grid;
  gap: 0.6rem;
}

.ticket-lines div {
  display: grid;
  gap: 0.1rem;
  border-top: 1px dashed rgba(23, 33, 27, 0.35);
  padding-top: 0.6rem;
}

.ticket-lines dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.ticket-lines dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
}

.sel {
  font-weight: 700;
  overflow-wrap: anywhere;
  user-select: all;
}

.copy {
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--p-ink);
  background: transparent;
  border: 1px solid rgba(23, 33, 27, 0.4);
  border-radius: 3px;
  padding: 0.1rem 0.5rem;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.copy:hover,
.copy.is-done {
  background: var(--p-ink);
  color: var(--p-paper);
}

.copy:focus-visible {
  outline-color: var(--p-ink);
}

.ticket-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 0.4rem;
  font-size: var(--step--1);
}

.ticket-links a {
  color: var(--p-ink);
  font-weight: 700;
  text-underline-offset: 0.25em;
}

.ticket-links a:focus-visible {
  outline-color: var(--p-ink);
}

.ticket-stub {
  border-left: 2px dashed rgba(23, 33, 27, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  background: var(--p-brass);
}

.stub-no {
  font-weight: 400;
  font-size: 0.7rem;
  margin-top: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.message {
  display: grid;
  gap: 1.1rem;
}

.form-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.05;
  margin-bottom: 0.2rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: var(--step--1);
  color: var(--fg-2);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--fg);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

.field textarea {
  resize: vertical;
  min-height: 9rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.field [aria-invalid="true"] {
  border-color: var(--accent);
}

.message .btn {
  justify-self: start;
}

.form-status {
  font-size: var(--step--1);
  min-height: 1.4em;
}

.form-status.is-ok {
  color: var(--fg);
}

.form-status.is-err {
  color: var(--accent);
}

@media (max-width: 860px) {
  .box-office {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .ticket {
    --stub-h: 4.2rem;
    grid-template-columns: minmax(0, 1fr);
    -webkit-mask:
      radial-gradient(circle at 0 calc(100% - var(--stub-h)), transparent 13px, #000 13.5px) left / 51% 100% no-repeat,
      radial-gradient(circle at 100% calc(100% - var(--stub-h)), transparent 13px, #000 13.5px) right / 51% 100% no-repeat;
    mask:
      radial-gradient(circle at 0 calc(100% - var(--stub-h)), transparent 13px, #000 13.5px) left / 51% 100% no-repeat,
      radial-gradient(circle at 100% calc(100% - var(--stub-h)), transparent 13px, #000 13.5px) right / 51% 100% no-repeat;
  }

  .ticket-stub {
    border-left: 0;
    border-top: 2px dashed rgba(23, 33, 27, 0.35);
    flex-direction: row;
    gap: 1rem;
    height: var(--stub-h);
    padding: 0 1rem;
  }

  .stub-no {
    margin-top: 0;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: grid;
  gap: 0.8rem;
  padding-block: clamp(3rem, 7vw, 5rem) calc(clamp(2rem, 5vw, 3rem) + env(safe-area-inset-bottom, 0px));
}

.fade-out {
  font-weight: 700;
  justify-self: end;
  font-size: var(--step-1);
}

.footer-note {
  font-size: var(--step--1);
  color: var(--fg-2);
}

.footer-top {
  justify-self: start;
  font-size: var(--step--1);
  color: var(--accent);
  text-underline-offset: 0.25em;
}

/* --------------------------------------------------------------------------
   Mini player
   -------------------------------------------------------------------------- */
.mini {
  position: fixed;
  z-index: 70;
  right: calc(1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.45rem 0.45rem 0.55rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: var(--step--1);
  animation: settle 0.5s var(--ease) both;
}

.mini-disc {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--p-brass) 0 26%, var(--vinyl) 27% 100%);
  animation: spin 1.8s linear infinite;
}

.mini-txt {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
}

.mini-btn {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
}

.mini-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

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

  .letterbox,
  .grain {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .record,
  .mini-disc {
    animation: none !important;
  }

  [data-pull].is-out {
    filter: none;
    opacity: 1;
    transform: none;
  }
}

.script .dialogue {
  text-align: justify;
  hyphens: auto;
}

.watch {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.screen {
  width: min(92vw, 1100px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #000;
}

.screen::backdrop {
  background: rgba(4, 7, 5, 0.85);
}

.screen video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.screen-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font: inherit;
  font-size: 0.875rem;
  color: #ece4cf;
  background: rgba(13, 31, 22, 0.8);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}