/* ==========================================================================
   ship.css — the interior
   A near-black deck of the M-2442. Every surface is a photograph pulled down
   to shadow; the only light comes from the screens and one cold overhead
   shaft. Cables run from the ceiling to the floor in three depth layers.
   ========================================================================== */

:root {
  --accent: #cf9860;
  --accent-dim: #6b4f30;
  --ph: 132, 236, 172;          /* phosphor green, used by every screen */
  --ph-warm: 255, 190, 126;     /* lamp / amber spill */
}

/* ---------- sprite ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* ==========================================================================
   the room
   ========================================================================== */
.ship {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #000;
  contain: strict;
}

/* ==========================================================================
   surfaces — mostly transparent so the deck reads through
   ========================================================================== */
.hero { background: none; }
.section, .pdu { background: none; }
.contact { background: none; }

.section {
  border-bottom: 0;
  box-shadow:
    inset 0 1px 0 rgba(228, 232, 214, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.9);
}
.section::after {
  background: linear-gradient(90deg, rgba(207, 152, 96, 0.34), rgba(207, 152, 96, 0.04) 38%, transparent 70%);
  opacity: 0.4;
}

/* ==========================================================================
   screens — the only real light in the room
   ========================================================================== */
.terminal { --ph: 132, 236, 172; }

/* the halo that falls on the metal around the glass */
.screen-spill {
  position: absolute;
  inset: -58px -74px -46px;
  z-index: -1;
  pointer-events: none;
  border-radius: 70px;
  background:
    radial-gradient(58% 56% at 50% 46%, rgba(var(--ph), 0.24), rgba(var(--ph), 0.08) 46%, transparent 76%);
  filter: blur(30px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.is-awake .screen-spill {
  opacity: 1;
  animation: spill-breathe 11s ease-in-out infinite;
}
@keyframes spill-breathe {
  0%, 100% { opacity: 0.92; }
  36% { opacity: 1; }
  39% { opacity: 0.8; }
  42% { opacity: 0.98; }
  71% { opacity: 0.88; }
}

/* light washing back over the casing (bezel, keys, gauge) */
.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(116% 58% at 50% -6%, rgba(var(--ph), 0.2), transparent 56%),
    linear-gradient(180deg, rgba(var(--ph), 0.08), transparent 34%);
  transition: opacity 1s ease;
}
.is-awake .terminal::before { opacity: 1; }

.terminal-body {
  --ph: 132, 236, 172;
  box-shadow:
    0 0 0 1px #030404,
    0 0 0 6px #0f120e,
    0 0 0 7px rgba(0, 0, 0, 0.8),
    0 0 22px rgba(var(--ph), 0.16),
    0 0 70px rgba(var(--ph), 0.1),
    inset 0 0 46px rgba(0, 0, 0, 0.82),
    inset 0 1px 0 rgba(230, 235, 215, 0.04);
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.045) 0%, transparent 26%),
    radial-gradient(120% 96% at 50% 6%, #0b1a12 0%, #061009 54%, #020604 100%);
}
.terminal-body > .term-line { position: relative; z-index: 3; }

/* the phosphor itself: inner bloom + glass edge hot spot */
.crt-wake {
  position: absolute;
  inset: -18%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(52% 46% at 50% 44%, rgba(var(--ph), 0.22), rgba(var(--ph), 0.06) 46%, transparent 74%),
    radial-gradient(16% 12% at 50% 8%, rgba(240, 255, 244, 0.16), transparent 70%);
  filter: blur(14px);
}
.is-awake .crt-wake { animation: crt-on 1.9s steps(1, end) 0.15s both; }
@keyframes crt-on {
  0%   { opacity: 0; }
  8%   { opacity: 0.95; }
  11%  { opacity: 0.12; }
  16%  { opacity: 0.9; }
  20%  { opacity: 0.32; }
  26%  { opacity: 1; }
  33%  { opacity: 0.55; }
  42%  { opacity: 1; }
  100% { opacity: 0.9; }
}

.term-line .ok { text-shadow: 0 0 9px rgba(207, 152, 96, 0.45); }
.term-line .v { text-shadow: 0 0 10px rgba(180, 240, 200, 0.12); }
.terminal-head b { text-shadow: 0 0 10px rgba(190, 72, 34, 0.7); }

/* the keys and gauge sit under the screen and catch its light */
.terminal-foot { position: relative; }
.terminal-foot::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background: radial-gradient(70% 120% at 50% -30%, rgba(var(--ph), 0.14), transparent 62%);
  transition: opacity 1s ease;
}
.is-awake .terminal-foot::after { opacity: 1; }

.gauge-face {
  fill: #0c1510;
  filter: drop-shadow(0 0 8px rgba(var(--ph), 0.22));
}

/* ---------- TailRef monitor ---------- */
.app-frame {
  --ph: 140, 232, 178;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(var(--ph), 0.1),
    0 46px 74px -52px #000,
    inset 0 1px 0 rgba(230, 235, 215, 0.13),
    inset 0 -3px 9px rgba(0, 0, 0, 0.55);
}
.app-frame::before {
  content: "";
  position: absolute;
  inset: -50px -62px -40px;
  z-index: -1;
  pointer-events: none;
  border-radius: 70px;
  background: radial-gradient(56% 56% at 50% 50%, rgba(var(--ph), 0.18), rgba(var(--ph), 0.05) 48%, transparent 76%);
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.section.is-awake .app-frame::before { opacity: 1; }
.app-body { background: #020604; }
.app-frame.is-powered .app-led,
.app-frame.is-powered .app-pwr {
  background: #9df0b8;
  box-shadow: 0 0 10px rgba(140, 240, 180, 0.8), 0 0 22px rgba(140, 240, 180, 0.35);
}

/* ---------- CRT dossier ---------- */
.panel {
  --ph: 138, 226, 170;
  position: relative;
  box-shadow:
    0 0 20px rgba(var(--ph), 0.08),
    0 36px 54px -42px #000,
    inset 0 1px 0 rgba(230, 235, 215, 0.09),
    inset 0 -2px 7px rgba(0, 0, 0, 0.5);
}
.panel::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(60% 52% at 50% 46%, rgba(var(--ph), 0.16), transparent 68%),
    linear-gradient(112deg, rgba(255, 255, 255, 0.05) 0%, transparent 28%);
  transition: opacity 1.2s ease;
}
.section.is-awake .panel::after { opacity: 1; }
.panel img { box-shadow: inset 0 0 0 1px #000, 0 0 26px rgba(var(--ph), 0.1); }

/* ---------- PDU cell displays ---------- */
.cell-screen {
  color: #8fe0aa;
  background: #04100a;
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px #000,
    0 0 10px rgba(var(--ph), 0.14);
}
.cell-screen b { color: #b6f0c8; text-shadow: 0 0 8px rgba(var(--ph), 0.5); }
.cell-bars i { background: #3f7a56; box-shadow: 0 0 6px rgba(var(--ph), 0.3); }
.cell-state { color: #96d6ac; }

/* ==========================================================================
   typography over the dark
   ========================================================================== */
/* section labels are real text: this bronze passes 4.5:1 on the night floor */
.label { color: #b8814a; }
.section-head p, .head-aside p, .hero-lead, .about p, .contact p { color: #b4ab98; }
h2, h3 { color: #e9e2d1; }
.card p { color: #a09a89; }

/* ==========================================================================
   work rack
   ========================================================================== */
.rack { position: relative; padding-top: 16px; }
.rack::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: 0;
  height: 13px;
  z-index: 3;
  border-radius: 2px;
  background:
    radial-gradient(circle at 14px 6px, rgba(210, 200, 172, 0.18) 0 1px, transparent 2px) 0 0 / 46px 13px,
    linear-gradient(180deg, #1c1f19, #0d0f0c 48%, #050605);
  box-shadow:
    inset 0 1px 0 rgba(230, 235, 215, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.9),
    0 8px 16px -10px #000;
}
.rack .rail { padding-top: 10px; }
.rack .rail-track {
  height: 10px;
  margin: 4px -6px 0;
  border-radius: 2px;
  background:
    radial-gradient(circle at 12px 5px, rgba(210, 200, 172, 0.14) 0 1px, transparent 2px) 0 0 / 42px 10px,
    linear-gradient(180deg, #171a15, #0b0d0a 60%, #050605);
  box-shadow: inset 0 1px 0 rgba(230, 235, 215, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
.rack .rail-track span {
  top: auto;
  bottom: 3px;
  height: 2px;
  width: 28%;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent));
  box-shadow: 0 0 10px rgba(207, 152, 96, 0.55);
}

/* archive plates */
.card {
  padding: 9px 9px 0;
  border: 1px solid #040504;
  border-radius: 3px;
  background-color: #121410;
  background-image:
    radial-gradient(circle at 5px 5px, #060705 0 1.3px, #565243 1.3px 2.4px, transparent 2.4px),
    radial-gradient(circle at calc(100% - 5px) 5px, #060705 0 1.3px, #565243 1.3px 2.4px, transparent 2.4px),
    radial-gradient(circle at 5px calc(100% - 5px), #060705 0 1.3px, #565243 1.3px 2.4px, transparent 2.4px),
    radial-gradient(circle at calc(100% - 5px) calc(100% - 5px), #060705 0 1.3px, #565243 1.3px 2.4px, transparent 2.4px),
    linear-gradient(180deg, #1a1d17, #121410 62%, #0b0d0a);
  box-shadow:
    inset 0 1px 0 rgba(230, 235, 215, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 30px 46px -38px rgba(0, 0, 0, 1);
  transition: border-color 0.4s var(--ease), transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(230, 235, 215, 0.03);
}
.card:hover {
  border-color: #0a0b08;
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(230, 235, 215, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 42px 60px -40px #000,
    0 0 40px -18px rgba(207, 152, 96, 0.35);
}
.card-media {
  overflow: hidden;
  background: #020302;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 34px rgba(0, 0, 0, 0.6);
}
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(240, 242, 226, 0.05) 0%, transparent 26%, transparent 76%, rgba(0, 0, 0, 0.3));
}
.card-media img { display: block; }
.card-index {
  position: absolute;
  z-index: 2;
  top: 9px;
  left: 9px;
  padding: 4px 7px 3px;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: #c6bfa8;
  background: rgba(6, 8, 6, 0.84);
  border: 1px solid rgba(198, 191, 168, 0.14);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}
.card-body { padding: 13px 7px 14px; align-items: flex-start; }
.card-tags { color: #a8763f; }
.card-go { align-self: center; color: #7d7b6c; }

/* ---------- the reference monitor ---------- */
/* the work rail sits inside a set; the selector is the set's dial */
.rack.tv {
  position: relative;
  padding: 16px 16px 0;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.95);
  background:
    linear-gradient(180deg, #14160f 0%, #101209 30%, #0b0c08 74%, #070805 100%);
  box-shadow:
    0 46px 80px -46px #000,
    inset 0 1px 0 rgba(232, 236, 214, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8);
}
.rack.tv::before { display: none; }

.tv-screen {
  position: relative;
  padding: 10px 12px 0;
  border-radius: 14px;
  background: #040503;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.95),
    inset 0 3px 22px rgba(0, 0, 0, 0.95),
    0 0 0 6px #0b0c09,
    0 0 0 7px rgba(0, 0, 0, 0.7);
}
.tv-screen .rail {
  padding-top: 6px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 38px, #000 calc(100% - 38px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 38px, #000 calc(100% - 38px), transparent 100%);
}
.tv-screen .rail-track { margin: 2px 0 10px; }

/* glass: one diagonal reflection, a vignette, faint scan lines */
.tv-glass {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  pointer-events: none;
  background:
    linear-gradient(114deg, rgba(240, 242, 226, 0.055) 0%, rgba(240, 242, 226, 0.015) 14%, transparent 34%),
    radial-gradient(120% 120% at 50% 40%, transparent 52%, rgba(0, 0, 0, 0.42) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.tv-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(240, 242, 226, 0.05), transparent 18%);
  mix-blend-mode: screen;
}

.rail-caption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
  white-space: nowrap;
}
.rail-caption b {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #ece2cb;
}
.rail-caption em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.56rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(207, 152, 96, 0.9);
}

.tv-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 4px 14px;
  margin-top: 18px;
  border-top: 1px solid rgba(232, 236, 214, 0.07);
}
.tv-grille {
  margin-left: auto;
  width: clamp(80px, 15vw, 190px);
  height: 34px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0 2px, rgba(232, 236, 214, 0.055) 2px 6px);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.8), inset 0 -1px 0 rgba(232, 236, 214, 0.04);
  opacity: 0.55;
}
.tv-brand {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(206, 200, 178, 0.32);
  white-space: nowrap;
}

/* ---------- the film bay: a DVD case in the console ------------------ */
.dvd-dock {
  flex: 0 1 clamp(236px, 26vw, 342px);
  min-width: 0;
  margin-left: clamp(0px, 1.2vw, 18px);
  padding: 5px 6px 6px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(236, 240, 218, 0.035), transparent 32%),
    linear-gradient(180deg, #0a0c07, #060704);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.9),
    inset 0 -1px 0 rgba(236, 240, 218, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.8);
}
.dvd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 4px;
}
.dvd-bay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.44rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #918977;
  white-space: nowrap;
}
.dvd-bay i {
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: #514a3b;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.75);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.rack.tv.is-film .dvd-bay i {
  background: var(--accent);
  box-shadow: 0 0 6px 1px rgba(240, 167, 94, 0.65);
}
.dvd-ext {
  flex: none;
  padding: 1px 0 2px;
  font-family: var(--mono);
  font-size: 0.44rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b3a892;
  border-bottom: 1px solid rgba(179, 168, 146, 0.26);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.dvd-ext:hover { color: var(--accent); border-color: var(--accent); }

.dvd-case {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 4px 7px 4px 4px;
  text-align: left;
  border: 1px solid #000;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(236, 240, 218, 0.055), transparent 22%),
    linear-gradient(180deg, #262920, #16190f 46%, #0b0d08);
  box-shadow:
    inset 0 1px 0 rgba(236, 240, 218, 0.1),
    inset 0 -2px 5px rgba(0, 0, 0, 0.8),
    0 9px 14px -12px #000;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.dvd-case::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 2px;
  height: 16px;
  margin-top: -8px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(236, 240, 218, 0.16), rgba(0, 0, 0, 0.7));
  opacity: 0.7;
}
.dvd-case:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(236, 240, 218, 0.14),
    inset 0 -2px 5px rgba(0, 0, 0, 0.8),
    0 14px 18px -14px #000,
    0 0 22px -10px rgba(240, 167, 94, 0.55);
}
.dvd-case:active { transform: translateY(0) scale(0.997); }
.dvd-case.is-playing {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 7px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(240, 167, 94, 0.18),
    0 0 24px -12px rgba(240, 167, 94, 0.5);
}

.dvd-cover {
  position: relative;
  flex: none;
  width: clamp(56px, 6.4vw, 74px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #050604;
  box-shadow:
    0 0 0 1px #000,
    0 0 0 2px rgba(236, 240, 218, 0.055),
    0 3px 7px rgba(0, 0, 0, 0.65);
}
.dvd-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.92);
  transition: filter 0.45s var(--ease), transform 0.5s var(--ease);
}
.dvd-case:hover .dvd-cover img {
  filter: grayscale(1) contrast(1.12) brightness(1);
  transform: scale(1.04);
}
.dvd-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg,
    rgba(0, 0, 0, 0.8) 0 3px,
    rgba(236, 240, 218, 0.22) 3px 5px);
  opacity: 0.35;
}
.dvd-glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg,
    rgba(255, 255, 255, 0.16) 0%,
    transparent 32%,
    transparent 74%,
    rgba(0, 0, 0, 0.3) 100%);
}

.dvd-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dvd-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.4rem;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
  color: #a49b88;
}
.dvd-led {
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: #514a3b;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.dvd-case.is-playing .dvd-led {
  background: var(--accent);
  box-shadow: 0 0 6px 1px rgba(240, 167, 94, 0.65);
}
.dvd-state--on { display: none; }
.dvd-case.is-playing .dvd-state--in { display: none; }
.dvd-case.is-playing .dvd-state--on { display: inline; color: var(--accent); }
.dvd-title {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.1;
  color: #f1e9d8;
}
.dvd-sub {
  font-family: var(--mono);
  font-size: 0.42rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: #b3a892;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dvd-action {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
  font-size: 0.42rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e6dcc6;
}
.dvd-action-eject { display: none; }
.dvd-case.is-playing .dvd-action-play { display: none; }
.dvd-case.is-playing .dvd-action-eject { display: inline; color: var(--accent); }
.dvd-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid rgba(236, 240, 218, 0.16);
  background: radial-gradient(circle at 38% 28%, #303327, #0d0f0a 72%);
  box-shadow:
    inset 0 1px 0 rgba(236, 240, 218, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.55);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.dvd-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 6px solid #f1e6d0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.dvd-case:hover .dvd-icon {
  border-color: rgba(240, 167, 94, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 10px -2px rgba(240, 167, 94, 0.4);
}
.dvd-case.is-playing .dvd-icon {
  border-color: rgba(240, 167, 94, 0.6);
  background: radial-gradient(circle at 38% 28%, #3a3325, #12100a 72%);
}
.dvd-case.is-playing .dvd-icon::before {
  margin-left: 0;
  width: 0;
  height: 0;
  border: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--accent);
}
.dvd-case.is-playing .dvd-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 10px;
  height: 2px;
  margin-left: -5px;
  background: var(--accent);
}

/* the console powers down its channel controls while the film runs */
.tv-panel > .rail-back,
.tv-panel > .rail-select,
.tv-panel > .rail-caption { transition: opacity 0.4s var(--ease), filter 0.4s var(--ease); }
.rack.tv.is-film .tv-panel > .rail-back,
.rack.tv.is-film .tv-panel > .rail-select,
.rack.tv.is-film .tv-panel > .rail-caption {
  opacity: 0.22;
  filter: grayscale(1);
  pointer-events: none;
}
.rack.tv.is-film .tv-lever { opacity: 0.3; pointer-events: none; }

/* ---------- the film on the set -------------------------------------- */
.tv-film {
  position: absolute;
  inset: 10px 12px 10px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 9px;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scaleY(0.985);
  transform-origin: 50% 0;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-out), visibility 0.4s;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9), 0 0 26px rgba(0, 0, 0, 0.8);
}
.rack.tv.is-film .tv-film {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  /* opening flips visibility at once, so the player can take focus;
     closing keeps the base transition and stays visible through the fade */
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-out);
}
.rack.tv.is-film .rail,
.rack.tv.is-film .rail-track { opacity: 0; pointer-events: none; }
.rack.tv.is-film .tv-standby { opacity: 0; }

.film-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 7px 11px 6px;
  border-bottom: 1px solid rgba(236, 240, 218, 0.07);
  background: linear-gradient(180deg, #0e100a, #070805);
  font-family: var(--mono);
}
.film-rec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.48rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.film-rec i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px 1px rgba(240, 167, 94, 0.6);
  animation: film-rec 2.2s ease-in-out infinite;
}
@keyframes film-rec {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.film-title {
  font-family: var(--display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #efe6d4;
}
.film-time {
  margin-left: auto;
  font-size: 0.46rem;
  letter-spacing: 0.18em;
  color: #b3a892;
  white-space: nowrap;
}
.film-eject {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  margin-left: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(240, 167, 94, 0.3);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.44rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f0c89a;
  background: rgba(240, 167, 94, 0.07);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}
.film-eject i {
  position: relative;
  width: 10px;
  height: 9px;
  flex: none;
}
.film-eject i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
  margin-left: -4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
}
.film-eject i::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: currentColor;
}
.film-eject:hover {
  border-color: var(--accent);
  color: #fff0dc;
  background: rgba(240, 167, 94, 0.16);
}

.film-window { position: relative; flex: 1 1 auto; min-height: 0; background: #000; }
.film-window iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.tv-film.is-ready .film-window iframe { opacity: 1; }

.film-load {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  background: radial-gradient(80% 100% at 50% 46%, #080b07, #000 82%);
  font-family: var(--mono);
  text-align: center;
  transition: opacity 0.3s var(--ease);
}
.tv-film.is-ready .film-load { opacity: 0; pointer-events: none; }
.film-load b {
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d6cbb4;
}
.film-load em {
  font-style: normal;
  font-size: 0.44rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8f8776;
}
.film-reel {
  width: 30px;
  height: 30px;
  margin-bottom: 3px;
  border-radius: 50%;
  border: 2px solid rgba(236, 240, 218, 0.14);
  border-top-color: var(--accent);
  animation: film-spin 1.1s linear infinite;
}
@keyframes film-spin { to { transform: rotate(1turn); } }

/* opening the file straight from disk leaves the player without a referrer,
   which YouTube refuses (error 153). This slate keeps the set useful there
   and points at the two ways that do work: a local server or the live site. */
.film-local {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 26px;
  text-align: center;
  background: radial-gradient(80% 100% at 50% 46%, #080b07, #000 82%);
  font-family: var(--mono);
}
.tv-film.is-local .film-local { display: grid; }
.tv-film.is-local .film-load,
.tv-film.is-local .film-window iframe { display: none; }
.film-local-kicker {
  font-size: 0.48rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.film-local b {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #f1e8d6;
}
.film-local p {
  max-width: 44ch;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #b3a892;
  text-wrap: pretty;
}
.film-local a {
  margin-top: 6px;
  padding: 10px 18px;
  border: 1px solid rgba(240, 167, 94, 0.42);
  border-radius: 2px;
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f0c89a;
  background: linear-gradient(180deg, rgba(240, 167, 94, 0.12), rgba(240, 167, 94, 0.03));
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}
.film-local a:hover { border-color: var(--accent); color: #fff0dc; background: rgba(240, 167, 94, 0.18); }

.tv-film::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 46%, transparent 58%, rgba(0, 0, 0, 0.42) 100%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
  opacity: 0.55;
}

/* ---------- the disc slot on the set ---------- */
.tv-slot {
  position: absolute;
  top: -1px;
  right: 3.4%;
  width: 208px;
  height: 20px;
  z-index: 4;
  border-radius: 3px;
  background:
    radial-gradient(circle at 8px 10px, rgba(214, 206, 178, 0.18) 0 1px, transparent 1.8px),
    linear-gradient(180deg, #3b3e33 0%, #262a21 42%, #16190f 100%);
  box-shadow:
    inset 0 1px 0 rgba(236, 240, 216, 0.16),
    0 2px 5px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}
.tv-slot::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 6px;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(180deg, #000100 0%, #0a0c07 56%, #1b1e15 100%);
  box-shadow:
    inset 0 3px 4px rgba(0, 0, 0, 0.96),
    inset 0 -1px 0 rgba(226, 232, 210, 0.11);
}
.tv-slot::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 6px;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(226, 232, 210, 0) 0%,
    rgba(226, 232, 210, 0.42) 22%,
    rgba(226, 232, 210, 0.42) 78%,
    rgba(226, 232, 210, 0) 100%);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.tv-slot.is-loaded::after { opacity: 1; }

.tv-slot-led {
  position: absolute;
  left: 7px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: #4d4738;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65);
  transition: background 0.4s var(--ease), box-shadow 0.6s var(--ease);
}
.tv-slot.is-loaded .tv-slot-led {
  background: #ffce93;
  box-shadow:
    0 0 5px 1.5px rgba(255, 160, 70, 0.7),
    0 0 12px 4px rgba(255, 130, 40, 0.24);
}

/* ---------- the set is dark until the disc is in ---------- */
.rack.tv .rail,
.rack.tv .rail-track {
  transition: opacity 0.6s var(--ease) 0.15s;
}
.rack.tv.is-cold .rail,
.rack.tv.is-cold .rail-track {
  opacity: 0;
  pointer-events: none;
}
.rack.tv.is-cold .tv-screen { background: #020302; }

.tv-standby {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 9px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(207, 152, 96, 0.5);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.tv-standby em {
  font-style: normal;
  font-size: 0.48rem;
  letter-spacing: 0.28em;
  color: rgba(206, 200, 178, 0.24);
}
.rack.tv.is-cold .tv-standby { opacity: 1; }

.tv-wake {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120% 90% at 50% 50%,
    rgba(230, 238, 214, 0.42),
    rgba(207, 152, 96, 0.18) 46%,
    transparent 74%);
}
.rack.tv.is-waking .tv-wake { animation: tv-wake 0.9s ease-out; }
@keyframes tv-wake {
  0% { opacity: 0.85; transform: scaleY(0.006); }
  18% { opacity: 1; transform: scaleY(0.03); }
  38% { opacity: 0.62; transform: scaleY(1); }
  54% { opacity: 0.16; }
  66% { opacity: 0.44; }
  100% { opacity: 0; transform: scaleY(1); }
}

/* ---------- the handle: a slot machine lever ---------- */
.tv-lever {
  position: absolute;
  left: -58px;
  top: 90px;
  width: 100px;
  height: 250px;
  z-index: 3;
  cursor: pointer;
}

/* the bolted plate clamped to the cabinet flank */
.lever-bracket {
  position: absolute;
  left: 50%;
  bottom: 0;
  pointer-events: none;
  width: 80px;
  height: 94px;
  margin-left: -40px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(236, 236, 214, 0.022) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #2c2e24 0%, #1d1f18 42%, #0e100b 100%);
  box-shadow:
    0 18px 28px -18px #000,
    inset 0 1px 0 rgba(236, 240, 218, 0.16),
    inset 0 -3px 9px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.92);
}
.lever-bracket::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 1px 0 rgba(236, 240, 218, 0.05);
}
.lever-bracket::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 7px 7px, #6a6c56 0 1.6px, #050603 2.2px, transparent 2.8px),
    radial-gradient(circle at calc(100% - 7px) 7px, #6a6c56 0 1.6px, #050603 2.2px, transparent 2.8px),
    radial-gradient(circle at 7px calc(100% - 7px), #6a6c56 0 1.6px, #050603 2.2px, transparent 2.8px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #6a6c56 0 1.6px, #050603 2.2px, transparent 2.8px);
  opacity: 0.85;
  pointer-events: none;
}

/* the cast drum the arm turns in */
.lever-drum {
  position: absolute;
  left: 50%;
  bottom: 64px;
  pointer-events: none;
  width: 68px;
  height: 42px;
  margin-left: -34px;
  border-radius: 9px;
  background:
    linear-gradient(180deg, #4a4c3d 0%, #2a2c22 34%, #16180f 76%, #0a0b07 100%);
  box-shadow:
    0 12px 18px -12px #000,
    inset 0 1px 0 rgba(236, 240, 218, 0.18),
    inset 0 -4px 10px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(0, 0, 0, 0.9);
}
.lever-drum::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, #6d6f58 0%, #3a3c30 34%, #1a1c14 74%, #080906 100%);
  box-shadow:
    inset 0 1px 0 rgba(236, 240, 218, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.7);
}
.lever-drum::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: linear-gradient(180deg, #a5a284, #4c4d3d 60%, #1b1d14);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 250, 230, 0.35);
}

/* the arm: pulled down and to the right, with a long settle */
.lever-arm {
  position: absolute;
  left: 50%;
  bottom: 86px;
  width: 60px;
  height: 172px;
  margin-left: -30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.4, 0, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
}

/* pulled toward the viewer like a gear stick: the rod foreshortens from its
   tip down, and the ball rides the tip the whole way, so the two never part.
   rod: 120 -> 74 (x0.62), so the tip drops 46px, which is exactly how far
   the ball travels. */
.tv-lever.is-pulled .lever-rod {
  transform: scaleY(0.65);
}
.tv-lever.is-pulled .lever-knob {
  transform: translateY(42px) scale(1.4);
  filter: brightness(1.1) saturate(1.05) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}
.tv-lever.is-pulled .lever-rod::before { transform: scaleY(1.54); }
.tv-lever:hover .lever-knob { filter: brightness(1.08); }

.lever-rod {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 20px;
  height: 120px;
  margin-left: -10px;
  border-radius: 10px;
  transform-origin: 50% 100%;
  transition: transform 1.3s cubic-bezier(0.16, 0.84, 0.22, 1);
  background:
    linear-gradient(90deg, #11120d 0%, #34362b 16%, #7d7a66 34%, #ded5b8 47%, #a8a189 56%, #4a493d 74%, #141510 100%);
  box-shadow:
    inset 0 0 6px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 12px 22px -14px #000,
    0 0 26px rgba(255, 190, 120, 0.07);
}
.lever-rod::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  width: 26px;
  height: 14px;
  margin-left: -13px;
  border-radius: 4px;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, #77745f 0%, #3c3d30 42%, #161810 100%);
  box-shadow:
    inset 0 1px 0 rgba(240, 238, 214, 0.3),
    0 3px 6px rgba(0, 0, 0, 0.6);
}
.lever-rod::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), transparent 18%),
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(0, 0, 0, 0.4) 26px 28px);
}

.lever-collar {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 34px;
  height: 28px;
  margin-left: -17px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, #5c5e4c 0%, #33352a 40%, #171910 78%, #090a06 100%);
  box-shadow:
    inset 0 1px 0 rgba(236, 240, 218, 0.22),
    inset 0 -3px 6px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(0, 0, 0, 0.8);
}

/* the bakelite ball */
.lever-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  border-radius: 50%;
  transform-origin: 50% 50%;
  transition: transform 1.3s cubic-bezier(0.16, 0.84, 0.22, 1), filter 1.3s ease;
  background:
    radial-gradient(circle at 31% 23%, #fff2e4 0%, #ffc3a0 5%, #e87850 14%, #b93f22 32%, #8a2412 50%, #5c1209 70%, #300803 88%, #170301 100%);
  box-shadow:
    inset 0 3px 4px rgba(255, 236, 216, 0.42),
    inset 0 -10px 18px rgba(0, 0, 0, 0.78),
    inset 0 0 0 1px rgba(255, 200, 170, 0.14),
    0 18px 28px -14px #000,
    0 0 34px rgba(214, 82, 44, 0.18);
}
.lever-knob::before {
  content: "";
  position: absolute;
  left: 25%;
  top: 13%;
  width: 26%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 248, 236, 0.9), rgba(255, 240, 220, 0.12) 70%, transparent);
  filter: blur(1.4px);
  transform: rotate(-18deg);
}
.lever-knob::after {
  content: "";
  position: absolute;
  left: 18%;
  top: 58%;
  width: 64%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 100, 0.22), transparent 72%);
  filter: blur(4px);
}

/* the engraved plate under the base */
.lever-tag {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 3px 9px 2px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.46rem;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(213, 168, 115, 0.6);
  background: linear-gradient(180deg, #211d14, #100e09);
  box-shadow:
    inset 0 1px 0 rgba(213, 168, 115, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.7);
  transition: color 0.4s ease, box-shadow 0.4s ease;
  pointer-events: none;
}
.tv-lever:hover .lever-tag,
.tv-lever:focus-within .lever-tag {
  color: rgba(255, 206, 150, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 206, 150, 0.24),
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 0 18px rgba(226, 150, 90, 0.18);
}
.tv-lever.is-pulled .lever-tag { color: rgba(255, 206, 150, 0.95); }

/* ---------- the win: the piece itself, pushed in ---------- */
.tv-drop {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(62% 56% at 50% 46%, rgba(255, 196, 128, 0.07), rgba(4, 5, 3, 0.66) 58%, rgba(3, 4, 3, 0.88) 100%);
  transition: opacity 0.35s ease;
}
.tv-screen.is-drawn .tv-drop { opacity: 1; }
.tv-screen.is-drawn .rail { filter: brightness(0.4) saturate(0.6); }
.tv-screen .rail { transition: filter 0.4s ease; }

.drop-win {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}
.drop-win img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  transform-origin: 50% 44%;
  filter: saturate(1.05) contrast(1.03);
  opacity: 0;
  will-change: transform;
}
.tv-screen.is-open .drop-win img {
  animation:
    win-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.05s forwards,
    win-zoom 4.6s cubic-bezier(0.15, 0.7, 0.3, 1) 0.05s forwards;
}
@keyframes win-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes win-zoom {
  from { transform: scale(1.04); }
  to { transform: scale(1.26); }
}

/* a warm edge, a vignette, and a flash on landing */
.drop-win::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 110% at 50% 44%, transparent 46%, rgba(4, 5, 3, 0.62) 100%),
    linear-gradient(180deg, rgba(255, 186, 116, 0.1), transparent 18%, transparent 74%, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.drop-frame {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 214, 160, 0.2);
  border-radius: 2px;
  box-shadow: inset 0 0 34px rgba(255, 170, 96, 0.12);
  pointer-events: none;
}
.drop-frame::before,
.drop-frame::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 214, 160, 0.42);
  pointer-events: none;
}
.drop-frame::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.drop-frame::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

.drop-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 48% at 50% 50%, rgba(255, 240, 214, 0.55), rgba(255, 190, 120, 0.18) 46%, transparent 74%);
  opacity: 0;
  pointer-events: none;
}
.tv-screen.is-open .drop-flash {
  animation: win-flash 0.6s ease-out forwards;
}
@keyframes win-flash {
  0% { opacity: 0; }
  14% { opacity: 1; }
  100% { opacity: 0; }
}

.drop-cut {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 244, 226, 0.1), rgba(255, 250, 240, 0.22) 46%, rgba(255, 240, 214, 0.08));
  opacity: 0;
  pointer-events: none;
}
.tv-screen.is-cut .drop-cut {
  animation: cut-flash 0.24s ease-out;
}
@keyframes cut-flash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0; }
}

.drop-shine {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.drop-shine::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -34%;
  width: 13%;
  height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255, 246, 224, 0.26) 42%, rgba(255, 250, 236, 0.34) 52%, transparent 78%);
  filter: blur(3px);
  transform: rotate(9deg);
}
.tv-screen.is-open .drop-shine::before {
  animation: drop-shine 1.15s ease-out 0.32s forwards;
}
@keyframes drop-shine {
  from { transform: translateX(0) rotate(8deg); opacity: 0; }
  20% { opacity: 1; }
  to { transform: translateX(520%) rotate(8deg); opacity: 0; }
}

.rail-select {
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
  padding: 0;
  border: 1px solid #030403;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 34% 28%, #454a3c 0%, #262b21 46%, #121510 78%, #070806 100%);
  box-shadow:
    0 18px 30px -18px #000,
    0 0 0 3px #0a0b08,
    0 0 0 4px rgba(0, 0, 0, 0.9),
    inset 0 2px 0 rgba(230, 235, 215, 0.18),
    inset 0 -5px 12px rgba(0, 0, 0, 0.7);
  -webkit-tap-highlight-color: transparent;
  animation: dial-invite 3.6s ease-in-out infinite;
}
@keyframes dial-invite {
  0%, 100% { box-shadow: 0 18px 30px -18px #000, 0 0 0 3px #0a0b08, 0 0 0 4px rgba(0, 0, 0, 0.9),
    inset 0 2px 0 rgba(230, 235, 215, 0.18), inset 0 -5px 12px rgba(0, 0, 0, 0.7), 0 0 0 0 rgba(207, 152, 96, 0); }
  50% { box-shadow: 0 18px 30px -18px #000, 0 0 0 3px #0a0b08, 0 0 0 4px rgba(0, 0, 0, 0.9),
    inset 0 2px 0 rgba(230, 235, 215, 0.18), inset 0 -5px 12px rgba(0, 0, 0, 0.7), 0 0 0 9px rgba(207, 152, 96, 0.07); }
}
.rail-console.is-used .rail-select { animation: none; }
.rail-select::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(207, 152, 96, 0.14), transparent 66%);
  opacity: 0.5;
  transition: opacity 0.4s ease;
}
.rail-select:hover::after { opacity: 1; }
.rail-select:focus-visible { outline: 2px solid rgba(207, 152, 96, 0.7); outline-offset: 5px; }

.rs-face {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  transform: rotate(var(--turn, 0deg));
  transition: transform 0.52s cubic-bezier(0.2, 1.5, 0.35, 1);
  background:
    radial-gradient(circle at 40% 32%, #4a4e40 0%, #2c3027 44%, #171a14 80%, #0d0f0b);
  box-shadow:
    inset 0 1px 0 rgba(230, 235, 215, 0.18),
    inset 0 -4px 8px rgba(0, 0, 0, 0.65),
    0 2px 4px rgba(0, 0, 0, 0.6);
}
.rs-face::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 1px solid rgba(230, 235, 215, 0.06);
}
.rs-tick {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 3px;
  height: 9px;
  margin-left: -1.5px;
  background: rgba(214, 205, 180, 0.4);
  transform-origin: 1.5px 38px;
}
.rs-tick--1 { transform: rotate(-45deg); }
.rs-tick--2 { transform: rotate(0deg); }
.rs-tick--3 { transform: rotate(45deg); }
.rs-tick--4 { transform: rotate(90deg); }
.rs-pointer {
  position: absolute;
  left: 50%;
  top: 13px;
  width: 5px;
  height: 34px;
  margin-left: -2.5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f4e9d2, #bda680 58%, #6d5c40);
  box-shadow: 0 0 10px rgba(240, 220, 180, 0.5);
}
.rs-legend {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 16px);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.18em;
  color: #7a7767;
  white-space: nowrap;
  pointer-events: none;
}
.rs-legend b { color: #e0b989; font-weight: 500; }

.rail-select.is-turning .rs-face { filter: brightness(1.12); }

.rail-back {
  position: relative;
  width: 44px;
  height: 66px;
  flex: none;
  border: 1px solid #040504;
  border-radius: 3px;
  cursor: pointer;
  background: linear-gradient(180deg, #2c3027, #191c16 56%, #0c0e0b);
  box-shadow:
    0 6px 10px -8px #000,
    inset 0 1px 0 rgba(230, 235, 215, 0.12),
    inset 0 -2px 5px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.rail-back span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5px 0 0 -5px;
  border-left: 2px solid #c3ac83;
  border-bottom: 2px solid #c3ac83;
  transform: rotate(45deg);
}
.rail-back:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7);
}
.rail-back:disabled { opacity: 0.32; cursor: default; }
.rail-back:focus-visible { outline: 2px solid rgba(207, 152, 96, 0.7); outline-offset: 3px; }

/* ==========================================================================
   power-on choreography
   ========================================================================== */
.hero > .wrap,
.pdu > .wrap,
.section > .wrap {
  /* dim the room, not the reading: text keeps its contrast even before a
     section wakes up, the desaturation alone carries the "lights off" look */
  opacity: 1;
  filter: saturate(0.55) brightness(0.92);
  transition: filter 1.3s var(--ease, ease);
}
.hero.is-awake > .wrap,
.pdu.is-awake > .wrap,
.section.is-awake > .wrap { opacity: 1; filter: none; }

.is-awake .s-tray { opacity: 0.75; }
.is-awake .s-feed { opacity: 0.8; }
.is-awake .s-feed .pulse-line {
  animation: feed-pulse 1.6s cubic-bezier(0.3, 0.7, 0.2, 1) 0.15s 1;
}
@keyframes feed-pulse {
  0%   { stroke: rgba(255, 212, 154, 0.9); stroke-dashoffset: 30; }
  62%  { stroke: rgba(255, 212, 154, 0.9); }
  100% { stroke: rgba(255, 212, 154, 0); stroke-dashoffset: -660; }
}

.is-awake .terminal-body { animation: screen-on 1.3s steps(1, end) 0.2s both; }
.is-awake .app-body,
.is-awake .panel img,
.is-awake .cell-screen { animation: screen-on 1.1s steps(1, end) 0.3s both; }

@keyframes screen-on {
  0%   { filter: brightness(0.12) contrast(1.25); }
  7%   { filter: brightness(1.6) contrast(0.9); }
  10%  { filter: brightness(0.26); }
  17%  { filter: brightness(1.25); }
  21%  { filter: brightness(0.5); }
  30%  { filter: brightness(1.06); }
  40%  { filter: brightness(0.88); }
  100% { filter: none; }
}

/* ==========================================================================
   nav console
   ========================================================================== */
.site-nav {
  height: calc(var(--nav-h) + 2px);
  border-bottom: 0;
  background: linear-gradient(180deg, #101310 0%, #0a0c0a 58%, #050605 100%);
  box-shadow:
    inset 0 1px 0 rgba(230, 235, 215, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.9),
    0 22px 40px -30px #000;
}
.site-nav.is-stuck {
  background: linear-gradient(180deg, #101310 0%, #0a0c0a 58%, #050605 100%);
  backdrop-filter: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.9), 0 22px 40px -28px #000;
}
.site-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  opacity: 0.4;
  background-image: radial-gradient(circle at 8px 4px,
    rgba(210, 200, 172, 0.2) 0 1px,
    rgba(0, 0, 0, 0.85) 1px 2.1px,
    transparent 2.1px);
  background-size: 48px 8px;
}
.brand { color: #d9d3c1; }
.brand small { color: #7e7c6d; }
.brand-mark {
  width: 21px;
  height: 21px;
  border: 1px solid #2d3028;
  background: #050605;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.9);
}
.brand-mark::before { width: 6px; height: 6px; background: #c48c52; box-shadow: 0 0 8px rgba(196, 140, 82, 0.7); }
.nav-links a { position: relative; color: #a7a493; }
.nav-links a::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: #26281f;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav-links a:hover::before,
.nav-links a[aria-current="true"]::before {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(207, 152, 96, 0.85);
}
.nav-cta {
  color: #d4b58c;
  border-color: rgba(207, 152, 96, 0.22);
  background: rgba(207, 152, 96, 0.04);
  box-shadow: inset 0 1px 0 rgba(230, 235, 215, 0.05);
}
.nav-cta:hover {
  background: rgba(207, 152, 96, 0.1);
  border-color: rgba(207, 152, 96, 0.36);
}
.progress { height: 2px; opacity: 0.7; }

/* ==========================================================================
   footer — the deck ends in black
   ========================================================================== */
.footer {
  position: relative;
  border-top: 0;
  padding-block: 2.2rem 1.8rem;
  background: none;
}
.footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(228, 232, 214, 0.09) 16%, rgba(228, 232, 214, 0.09) 84%, transparent);
}
.footer-inner { color: var(--muted); }

/* ==========================================================================
   buttons
   ========================================================================== */
.btn--solid {
  background: #262a21;
  border-color: rgba(207, 152, 96, 0.28);
  color: #e2cbaa;
  box-shadow: inset 0 1px 0 rgba(230, 235, 215, 0.08);
}
.btn--solid:hover { background: #2f342a; border-color: rgba(207, 152, 96, 0.46); }

/* ==========================================================================
   contact channels
   ========================================================================== */
.contact-links {
  counter-reset: ch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.75rem, 4vw, 3.5rem);
  margin-top: clamp(2.1rem, 3.4vw, 2.9rem);
  border-top: 1px solid var(--line-2);
}
.contact-links a {
  counter-increment: ch;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr) 1.1rem;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.35rem 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  transition: box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}
.contact-links a::before {
  content: counter(ch, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  color: #b8814a;
  transition: color 0.3s var(--ease);
}
.contact-links .cl-body { min-width: 0; }
.contact-links .cl-name {
  display: block;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: var(--text);
  transition: color 0.3s var(--ease);
}
.contact-links .cl-meta {
  display: block;
  margin-top: 0.32rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-links .arrow {
  display: inline-block;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--muted);
  transition: color 0.3s var(--ease), transform 0.3s var(--ease);
}
.contact-links a:hover,
.contact-links a:focus-visible {
  background-color: rgba(207, 152, 96, 0.05);
  box-shadow: inset 2px 0 0 var(--accent);
}
.contact-links a:hover::before,
.contact-links a:focus-visible::before { color: var(--accent); }
.contact-links a:hover .cl-name,
.contact-links a:focus-visible .cl-name { color: var(--accent); }
.contact-links a:hover .arrow,
.contact-links a:focus-visible .arrow { color: var(--accent); transform: translate(2px, -2px); }
.contact-links a:focus-visible { outline: 1px solid rgba(207, 152, 96, 0.45); outline-offset: 2px; }

/* ==========================================================================
   lights in the dark — arcs, glows, blinks
   Nothing is placed; they appear where they like and go out again.
   ========================================================================== */
.light {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--s, 200px);
  height: var(--s, 200px);
  margin: calc(var(--s, 200px) / -2) 0 0 calc(var(--s, 200px) / -2);
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}

/* a lamp deep in the room, only half seen */
.light--glow {
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(var(--l, 255, 186, 116), 0.42) 0%,
    rgba(var(--l, 255, 186, 116), 0.25) 12%,
    rgba(var(--l, 255, 186, 116), 0.15) 27%,
    rgba(var(--l, 255, 186, 116), 0.06) 44%,
    rgba(var(--l, 255, 186, 116), 0.018) 60%,
    transparent 78%);
  filter: blur(38px);
  animation: light-breathe var(--d, 3s) ease-out 1 both;
}
.light--glow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27%;
  height: 27%;
  margin: -13.5% 0 0 -13.5%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(var(--l, 255, 206, 150), 0.58) 0%,
    rgba(var(--l, 255, 206, 150), 0.24) 34%,
    rgba(var(--l, 255, 206, 150), 0.06) 62%,
    transparent 80%);
  filter: blur(16px);
}

/* a single indicator, blinking to itself */
.light--blink {
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(var(--l, 255, 206, 150), 0.72) 0%,
    rgba(var(--l, 255, 206, 150), 0.28) 18%,
    rgba(var(--l, 255, 206, 150), 0.07) 40%,
    transparent 66%);
  filter: blur(7px);
  animation: light-blink var(--d, 2s) steps(1, end) 1 both;
}

@keyframes light-breathe {
  0%   { opacity: 0; }
  9%   { opacity: 0.88; }
  26%  { opacity: 0.56; }
  38%  { opacity: 0.8; }
  52%  { opacity: 0.38; }
  70%  { opacity: 0.76; }
  86%  { opacity: 0.26; }
  100% { opacity: 0; }
}
@keyframes light-blink {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  16%  { opacity: 0; }
  30%  { opacity: 1; }
  46%  { opacity: 0; }
  58%  { opacity: 0.9; }
  70%  { opacity: 0; }
  100% { opacity: 0; }
}

/* the deck loses power for a heartbeat */
body.is-brownout .light { opacity: 0 !important; }
body.is-brownout .room {
  filter: brightness(0.18) contrast(1.3) saturate(0.2);
  transition: filter 0.14s linear;
}
body.is-brownout .hero > .wrap,
body.is-brownout .pdu > .wrap,
body.is-brownout .section > .wrap {
  filter: brightness(0.3) saturate(0.35);
  transition: filter 0.14s linear;
}
body.is-brownout .screen-spill,
body.is-brownout .app-frame::before,
body.is-brownout .terminal::before,
body.is-brownout .terminal-foot::after,
body.is-brownout .panel::after {
  opacity: 0 !important;
  transition: opacity 0.1s linear;
}

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width: 1400px) {
  .s-stencil { display: none; }
  .s-feed { width: 60px; opacity: 0.3; }
}
@media (max-width: 1180px) {
  .s-feed { display: none; }
  @media (max-width: 900px) {
  .app-frame { padding: 9px 9px 7px; }
  .room { filter: brightness(0.5) contrast(1.1) saturate(0.6); }
}
}
@media (max-width: 1080px) {
  .tv-grille { display: none; }
  .dvd-dock { flex-basis: 300px; }
}
@media (max-width: 900px) {
  .tv-brand { display: none; }
  .dvd-dock { flex-basis: 260px; }
}
@media (max-width: 720px) {
  .contact-links { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .contact-links a { gap: 0.75rem; padding: 0.95rem 0; }
  .contact-links .cl-meta { font-size: 0.54rem; }
  .s-tray { height: 100px; opacity: 0.28; }
  .deck { height: 70px; }
  .rack.tv { padding: 14px 14px 0; border-radius: 16px; }
  .tv-lever { left: -48px; top: 54px; height: 216px; transform: scale(0.78); transform-origin: 50% 100%; }
  .lever-tag { font-size: 0.42rem; }
  .drop-plate { padding: 16px 22px 15px; min-width: min(240px, 76%); }
  .tv-panel { gap: 12px; padding: 12px 0 10px; margin-top: 12px; }
  .tv-grille { display: none; }
  .tv-brand { display: none; }
  .dvd-dock { flex-basis: 230px; margin-left: 4px; }
  .dvd-cover { width: 56px; }
  .dvd-title { font-size: 0.78rem; }
  .dvd-sub { font-size: 0.4rem; }
  .dvd-action-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .rail-select { width: 78px; height: 78px; }
  .rail-back { width: 38px; height: 56px; }
  .rs-tick { top: 5px; height: 7px; transform-origin: 1.5px 30px; }
  .rs-pointer { top: 10px; height: 26px; }
  .rs-legend { transform: translate(-50%, 13px); font-size: 0.46rem; }
  .rail-caption b { font-size: 0.58rem; }
  .rail-caption em { font-size: 0.44rem; }
}
@media (max-width: 620px) {
  .rack.tv { padding: 11px 11px 10px; border-radius: 13px; }
  .tv-screen { padding: 8px 8px 0; border-radius: 11px; }
  .tv-lever { display: none; }
  .tv-slot { width: 148px; height: 16px; }
  .tv-slot::before, .tv-slot::after { left: 11px; right: 11px; }
  .tv-panel { gap: 12px; padding: 8px 0 4px; margin-top: 10px; justify-content: center; flex-wrap: wrap; row-gap: 9px; }
  .rail-caption { display: none; }
  .dvd-dock { flex: 1 1 100%; max-width: none; margin-left: 0; }
  .dvd-cover { width: 64px; }
  .dvd-title { font-size: 0.86rem; }
  .dvd-sub { font-size: 0.44rem; }
  .dvd-action-text { display: inline; position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; border: 0; }
  .tv-standby { gap: 6px; font-size: 0.5rem; letter-spacing: 0.26em; }
  .tv-film { inset: 8px; border-radius: 7px; }
  .film-top { padding: 6px 8px 5px; gap: 7px; }
  .film-rec { font-size: 0.42rem; letter-spacing: 0.2em; }
  .film-title { font-size: 0.58rem; }
  .film-time { display: none; }
  .film-eject { margin-left: auto; padding: 4px 7px; font-size: 0.42rem; }
  .film-load b { font-size: 0.52rem; }
  .film-load em { font-size: 0.4rem; }
  .film-local { padding: 18px 14px; gap: 6px; }
  .film-local p { font-size: 0.72rem; }
  .film-local a { padding: 9px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-awake .terminal-body,
  .is-awake .app-body,
  .is-awake .panel img,
  .is-awake .cell-screen,
  .is-awake .crt-wake,
  .is-awake .screen-spill,
  .is-awake .s-feed .pulse-line { animation: none; }
  .room, .s-tray, .s-feed, .hero > .wrap, .pdu > .wrap, .section > .wrap { transition: none; }
  .rs-face { transition: none; }
}
@media (scripting: none) {
  .hero > .wrap, .pdu > .wrap, .section > .wrap { opacity: 1; filter: none; }
}
