@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --night: #071217;
  --night-2: #0c1c22;
  --night-3: #12272e;
  --line: rgba(160, 200, 205, 0.13);
  --ink: #ece5d6;
  --ink-2: #a9b8b9;
  --ink-3: #6f8487;
  --amber: #f0b35a;
  --amber-hot: #ffd08a;
  --serif: "Cormorant", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --bar: 0px;
  --bar-b: 0px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); }
body {
  font-family: var(--mono);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(40, 90, 100, 0.25), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(240, 179, 90, 0.07), transparent 60%),
    var(--night);
}
button { font: inherit; color: inherit; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lamp {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--amber-hot);
  box-shadow: 0 0 6px 2px rgba(255, 190, 100, 0.8), 0 0 22px 6px rgba(240, 160, 70, 0.35);
  animation: lamp 3.6s ease-in-out infinite;
}
@keyframes lamp { 50% { opacity: 0.7; } }
.brand-title { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.05; }
.brand-sub { color: var(--ink-2); font-size: 11px; letter-spacing: 0.02em; margin-top: 2px; }
.brand-sub em { font-style: normal; color: var(--amber); }
.top-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  border: 1px solid rgba(240, 179, 90, 0.45); color: var(--amber-hot); border-radius: 999px;
  padding: 4px 10px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.pill.ghost { border-color: var(--line); color: var(--ink-2); text-transform: none; letter-spacing: 0.02em; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.player { display: flex; flex-direction: column; min-height: 0; padding: 14px 16px 10px 20px; gap: 10px; }

/* ---------- stage ---------- */
.stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 4px; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  container-type: inline-size;
}
#film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.bar {
  position: absolute; left: 0; right: 0; height: var(--bar); background: #000; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px;
  font-size: 10px; letter-spacing: 0.08em; color: rgba(210, 225, 225, 0.55); text-transform: uppercase; overflow: hidden;
}
.bar-top { top: 0; }
.bar-bottom { bottom: 0; height: var(--bar-b); }
.bar > * { opacity: var(--bar-text, 0); transition: opacity 0.4s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slate b { color: var(--amber); font-weight: 500; margin-right: 6px; }
.slate i { font-style: normal; color: rgba(210, 225, 225, 0.38); margin-left: 8px; }
.tc { font-variant-numeric: tabular-nums; color: rgba(230, 240, 240, 0.7); }
.burn { color: rgba(210, 225, 225, 0.38); }

/* Captions: over a soft scrim inside the picture by default (phones)... */
.scrim {
  position: absolute; left: 0; right: 0; bottom: var(--bar-b); height: 36%; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.38) 45%, rgba(0, 0, 0, 0.66) 100%);
  will-change: opacity;
}
.caption {
  position: absolute; left: 6%; right: 6%; bottom: calc(var(--bar-b) + 5%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  pointer-events: none; opacity: 0; will-change: opacity, transform;
}
.caption .text {
  font-family: var(--serif); font-style: italic; font-weight: 500; line-height: 1.2;
  font-size: clamp(19px, 2.35vw, 31px); color: #f6efe1; max-width: 26em; text-wrap: balance;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.6);
}
/* ...and in the black bottom letterbox bar, one line, whenever the bar is tall enough (wide layouts). */
.stage.cap-bar .caption { left: 2%; right: 2%; bottom: 0; height: var(--bar-b); }
.stage.cap-bar .caption .text {
  font-size: min(28px, calc(var(--bar-b) * 0.46), 2.9cqw); white-space: nowrap; max-width: none;
  color: #f3ead8; text-shadow: none; line-height: 1.1; padding-bottom: 0.08em;
}
/* Narrow (portrait) stages: a two-line caption band. */
@container (max-width: 640px) {
  .stage.cap-bar .caption { left: 5%; right: 5%; }
  .stage.cap-bar .caption .text { white-space: normal; font-size: clamp(17px, 4.9cqw, 22px); line-height: 1.18; max-width: 24em; }
}

.titlecard {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; padding: 0 6%;
}
.titlecard > * { opacity: 0; will-change: opacity, transform; }
.tc-title {
  font-family: var(--serif); font-weight: 500; text-transform: uppercase; color: #f4ead6;
  font-size: clamp(28px, 5.4vw, 64px); letter-spacing: 0.26em; margin-right: -0.26em; line-height: 1.05;
  text-shadow: 0 0 30px rgba(255, 180, 90, 0.35), 0 0 80px rgba(255, 160, 70, 0.18);
}
.tc-rule { width: min(220px, 40%); height: 1px; margin: 22px 0 18px; background: linear-gradient(90deg, transparent, rgba(255, 200, 130, 0.8), transparent); }
.tc-ep { font-family: var(--mono); font-size: clamp(10px, 1.1vw, 13px); letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink-2); }
.tc-ep span { color: var(--amber); margin: 0 0.4em; }
.tc-tag { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.3vw, 28px); color: var(--amber-hot); margin-top: 26px; text-shadow: 0 0 20px rgba(255, 170, 80, 0.35); }

.end-replay {
  position: absolute; left: 50%; bottom: calc(var(--bar-b) + 16px); transform: translate(-50%, 6px);
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(4, 12, 16, 0.55); border: 1px solid rgba(240, 179, 90, 0.45); color: var(--amber-hot);
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity 0.4s, transform 0.4s, visibility 0s 0.4s;
}
.end-replay svg { width: 14px; height: 14px; fill: currentColor; }
.end-replay:hover { background: rgba(240, 179, 90, 0.14); }
.stage.ended .end-replay { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.8s 1.4s, transform 0.8s 1.4s, visibility 0s 1.4s; }

/* ---------- poster ---------- */
.poster {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start;
  padding: 0 5% 5.5%;
  background:
    linear-gradient(90deg, rgba(4, 12, 16, 0.78) 0%, rgba(4, 12, 16, 0.35) 42%, transparent 70%),
    linear-gradient(0deg, rgba(4, 12, 16, 0.7) 0%, transparent 45%);
  transition: opacity 0.9s ease, visibility 0.9s;
}
.poster.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.poster-inner { max-width: 410px; }
.kicker { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber); margin-bottom: 10px; white-space: nowrap; }
.poster h1 {
  margin: 0; font-family: var(--serif); font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em;
  font-size: clamp(28px, 3.7vw, 48px); line-height: 1; color: #f6eedd; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
}
.logline {
  margin: 12px 0 0; font-family: var(--serif); font-size: clamp(16px, 1.45vw, 19px); line-height: 1.35; color: #e4dccb;
  max-width: 24em; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}
.poster-ep { font-family: var(--serif); font-style: italic; font-size: clamp(17px, 1.7vw, 22px); color: var(--ink-2); margin-top: 8px; }
.big-play {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 22px; padding: 0; border: 0; background: none; cursor: pointer;
}
.big-play .ring {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 50% 45%, #ffd79a, #f0a948 60%, #c9812c);
  box-shadow: 0 0 0 6px rgba(240, 179, 90, 0.16), 0 0 40px 6px rgba(255, 170, 70, 0.35);
  transition: transform 0.25s;
  position: relative;
}
.big-play .ring::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 5px rgba(240, 179, 90, 0.12), 0 0 50px 8px rgba(255, 170, 70, 0.3);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.35; } }
.big-play:hover .ring, .big-play:focus-visible .ring { transform: scale(1.06); }
.big-play svg { width: 26px; height: 26px; fill: #2a1804; margin-left: 4px; }
.big-play-label { font-family: var(--serif); font-size: 22px; font-weight: 500; color: #f6eedd; text-align: left; line-height: 1.1; }
.big-play-label small { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--ink-2); margin-top: 3px; }
.poster-note { font-size: 12px; line-height: 1.5; color: rgba(215, 226, 226, 0.85); margin: 16px 0 0; max-width: 32em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }

/* ---------- transport ---------- */
.transport { display: flex; align-items: center; gap: 14px; height: 46px; flex: none; }
.play {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px 0 12px; border-radius: 999px; cursor: pointer;
  background: var(--amber); color: #23160a; border: 0; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px;
  box-shadow: 0 0 22px -4px rgba(240, 170, 80, 0.55); flex: none; min-width: 98px;
}
.play:hover { background: var(--amber-hot); }
.play svg { width: 16px; height: 16px; fill: currentColor; display: none; }
.play[data-state="play"] .i-play, .play[data-state="pause"] .i-pause, .play[data-state="replay"] .i-replay { display: block; }
.time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 11.5px; white-space: nowrap; flex: none; }
.time #t-now { color: var(--ink); }
.time .sep { margin: 0 5px; color: var(--ink-3); }

.scrubber { position: relative; flex: 1; height: 34px; cursor: pointer; touch-action: none; outline: none; border-radius: 3px; }
.scrubber:focus-visible { box-shadow: 0 0 0 2px rgba(240, 179, 90, 0.6); }
.segs { position: absolute; inset: 0; display: flex; gap: 2px; border-radius: 3px; overflow: hidden; }
.seg {
  position: relative; height: 100%; background-size: cover; background-position: center; opacity: 0.55;
  transition: opacity 0.3s; filter: saturate(0.8);
}
.seg.active { opacity: 0.95; filter: none; }
.seg span { position: absolute; left: 5px; top: 3px; font-size: 9px; letter-spacing: 0.06em; color: #fff; text-shadow: 0 1px 3px #000; }
.seg.concept { background: linear-gradient(135deg, #0b1d24, #16323a); }
.fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: rgba(240, 179, 90, 0.16); border-right: 0; pointer-events: none; }
.head { position: absolute; top: -5px; bottom: -5px; left: 0; width: 100%; pointer-events: none; will-change: transform; }
.head::after { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--amber-hot); box-shadow: 0 0 10px rgba(255, 190, 100, 0.9); }
.head::before { content: ""; position: absolute; top: -3px; left: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber-hot); }
.marks { position: absolute; inset: 0; pointer-events: none; }
/* Caption track: one thin bar per V.O. line, like a subtitle lane. */
.cap-span { position: absolute; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(255, 222, 170, 0.9); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }
.mark { position: absolute; bottom: 2px; width: 2px; height: 11px; margin-left: -1px; border-radius: 1px; background: #9fd0c9; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }

.sound {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  display: grid; place-items: center; cursor: pointer; flex: none; color: var(--ink-2);
}
.sound:hover { color: var(--ink); border-color: rgba(240, 179, 90, 0.5); }
.sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound .i-off, .sound[aria-pressed="false"] .i-on { display: none; }
.sound[aria-pressed="false"] .i-off { display: block; }
.keys { margin: -2px 0 0; color: var(--ink-3); font-size: 10px; letter-spacing: 0.04em; }

/* ---------- panel ---------- */
.panel { position: relative; border-left: 1px solid var(--line); overflow-y: auto; padding: 14px 16px 18px; background: rgba(4, 12, 15, 0.35); scrollbar-width: thin; scrollbar-color: #25414a transparent; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: 0.04em; }
.panel-head span { color: var(--ink-3); font-size: 10px; letter-spacing: 0.04em; }
.shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shot {
  position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 10px; padding: 6px; border-radius: 5px;
  cursor: pointer; border: 1px solid transparent; background: rgba(255, 255, 255, 0.015); transition: background 0.25s, border-color 0.25s;
}
.shot:hover { background: rgba(255, 255, 255, 0.045); }
.shot:focus-visible { outline: 2px solid rgba(240, 179, 90, 0.6); outline-offset: 1px; }
.shot.active { border-color: rgba(240, 179, 90, 0.45); background: rgba(240, 179, 90, 0.07); }
.thumb { position: relative; width: 104px; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .num { position: absolute; left: 4px; top: 3px; font-size: 9px; color: #fff; text-shadow: 0 1px 3px #000; letter-spacing: 0.06em; }
.thumb-title {
  width: 100%; height: 100%; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 60%, #173038, #050c10 75%);
  font-family: var(--serif); font-size: 8.5px; letter-spacing: 0.18em; text-transform: uppercase; color: #f0e4cc; line-height: 1.5;
}
.thumb-title i { display: block; font-size: 7.5px; text-transform: none; letter-spacing: 0.02em; color: var(--amber); }
.prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--amber-hot); transform-origin: 0 50%; transform: scaleX(0); }
.shot-meta { min-width: 0; }
.shot-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.shot-id { color: var(--amber); font-size: 10px; letter-spacing: 0.08em; }
.shot-time { color: var(--ink-3); font-size: 9.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shot-title { font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.1; margin: 2px 0 2px; }
.shot-note { color: var(--ink-2); font-size: 10px; line-height: 1.45; margin: 0; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); color: var(--ink-3); white-space: nowrap; }
.tag.still { color: #9fd0c9; border-color: rgba(120, 190, 180, 0.3); }
.tag.concept { color: var(--amber-hot); border-color: rgba(240, 179, 90, 0.45); }
.tag.vo { color: #e9dcc2; }

.ref { display: grid; grid-template-columns: 104px 1fr; gap: 10px; margin-top: 14px; padding: 8px 6px 0; border-top: 1px dashed var(--line); align-items: center; }
.ref img { width: 104px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; display: block; opacity: 0.85; }
.ref-title { color: var(--ink-2); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.ref p { margin: 3px 0 0; color: var(--ink-3); font-size: 9.5px; line-height: 1.45; }
.panel-foot { color: var(--ink-3); font-size: 9.5px; line-height: 1.5; margin: 12px 2px 0; }

/* ---------- phone / narrow ---------- */
@media (max-width: 900px) {
  .app { display: block; height: auto; }
  .top { padding: 10px 14px; }
  .brand-title { font-size: 16px; letter-spacing: 0.18em; }
  .brand-sub { font-size: 10px; }
  .hide-sm { display: none !important; }
  .pill { font-size: 9px; padding: 3px 8px; }
  .layout { display: block; }
  .player { padding: 0; gap: 0; position: sticky; top: 0; z-index: 5; background: var(--night); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8); }
  .stage { flex: none; height: min(60vh, 128vw); border-radius: 0; }
  .transport { padding: 8px 12px 10px; gap: 8px 10px; height: auto; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
  .time { margin-right: auto; }
  .scrubber { order: 5; flex: 1 0 100%; height: 34px; }
  .play { min-width: 0; padding: 0 12px; }
  .play .play-label { display: none; }
  .play { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .time { font-size: 10.5px; }

  .panel { position: relative; border-left: 0; overflow: visible; padding: 14px 12px 28px; }
  .shot { grid-template-columns: 112px 1fr; }
  .thumb { width: 112px; }
  .poster { padding: 0 6% 7%; background: linear-gradient(0deg, rgba(4, 12, 16, 0.85) 0%, rgba(4, 12, 16, 0.45) 45%, transparent 70%); }
  .poster h1 { font-size: 27px; letter-spacing: 0.12em; }
  .poster-ep { font-size: 16px; margin-top: 4px; }
  .poster-note { display: none; }
  .logline { font-size: 14.5px; line-height: 1.3; margin-top: 6px; max-width: 24em; }
  .kicker { font-size: 9px; letter-spacing: 0.12em; margin-bottom: 6px; }
  .big-play { margin-top: 12px; }
  .big-play .ring { width: 48px; height: 48px; }
  .big-play svg { width: 22px; height: 22px; }
  .big-play-label { font-size: 20px; }
  .bar { padding: 0 10px; font-size: 8.5px; }
  .caption { left: 5%; right: 5%; }
  .caption .text { font-size: clamp(20px, 4.2vw, 30px); }
  .tc-title { font-size: clamp(24px, 6.4vw, 46px); letter-spacing: 0.2em; margin-right: -0.2em; }
  .tc-tag { font-size: clamp(19px, 4.4vw, 28px); }
}
@media (max-width: 900px) and (orientation: landscape) {
  .top { padding: 6px 14px; }
  .top .brand-sub { display: none; }
  .stage { height: calc(100vh - 92px); height: calc(100dvh - 92px); }
  .transport { flex-wrap: nowrap; padding: 6px 12px; }
  .time { margin-right: 0; }
  .scrubber { order: 0; flex: 1 1 auto; }
  .poster { padding: 0 4% 4%; background: linear-gradient(90deg, rgba(4, 12, 16, 0.85) 0%, rgba(4, 12, 16, 0.4) 55%, transparent 80%); }
  .poster-inner { max-width: 58%; }
  .poster h1 { font-size: 24px; }
  .logline { font-size: 14px; }
  .big-play { margin-top: 10px; }
  .big-play .ring { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .lamp, .big-play .ring::before { animation: none; }
}
