/* BROADCASTERS - base layer. Flat only: no glow, no text-shadow, no box-shadow. */

:root {
  --ink: #0B0B0C;
  --panel: #141416;
  --panel-2: #1B1B1F;
  --line: #26262A;
  --paper: #FFFFFF;
  --grey: #8A8A90;
  --grey-dim: #5A5A60;
  --tally: #E5261F;

  /* SMPTE colour bars, used flat and only in the ident strip */
  --bar-1: #C6C600;
  --bar-2: #00C6C6;
  --bar-3: #00C600;
  --bar-4: #C600C6;
  --bar-5: #C60000;
  --bar-6: #1E32C6;

  --gap: 24px;
  --rail: clamp(20px, 4vw, 72px);
  --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-bodyText, "Inter", system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { display: block; max-width: 100%; }

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

/* ---------------------------------------------------------------- type */

.k-kicker {
  font-family: var(--f-sectionKicker, "JetBrains Mono", monospace);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--grey);
}

.k-heading {
  font-family: var(--f-sectionHeading, "Anton", sans-serif);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 0.92;
  text-transform: uppercase;
  margin: 12px 0 0;
}

.k-body {
  font-family: var(--f-bodyText, "Inter", sans-serif);
  color: #C9C9CE;
  line-height: 1.62;
  font-size: 16px;
}

.k-btn {
  font-family: var(--f-buttonText, "Bebas Neue", sans-serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper);
  padding: 14px 26px;
  font-size: 20px;
  line-height: 1;
  border-radius: var(--radius);
  transition: background 140ms linear, color 140ms linear, transform 140ms ease;
}
.k-btn:hover { background: transparent; color: var(--paper); }
.k-btn:active { transform: translateY(1px); }
.k-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.k-btn[disabled]:hover { background: var(--paper); color: var(--ink); }

.k-btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}
.k-btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.k-btn-live {
  background: var(--tally);
  border-color: var(--tally);
  color: var(--paper);
}
.k-btn-live:hover { background: transparent; color: var(--tally); }

/* --------------------------------------------------------- ident strip */

.bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 4px;
  width: 100%;
}
.bars i:nth-child(1) { background: var(--bar-1); }
.bars i:nth-child(2) { background: var(--bar-2); }
.bars i:nth-child(3) { background: var(--bar-3); }
.bars i:nth-child(4) { background: var(--bar-4); }
.bars i:nth-child(5) { background: var(--bar-5); }
.bars i:nth-child(6) { background: var(--bar-6); }

.tally {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-navText, "JetBrains Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--tally);
  text-transform: uppercase;
}
.tally b {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--tally);
  animation: tally-blink 2s steps(1, end) infinite;
}
@keyframes tally-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

/* -------------------------------------------------------------- marquee */

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 11px 0;
  background: var(--panel);
}
.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 34s linear infinite;
  will-change: transform;
}
.marquee span {
  font-family: var(--f-navText, "JetBrains Mono", monospace);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--grey);
  padding-right: 42px;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ------------------------------------------------------------ countdown */
/* Bare text. No frame, no box, no panel - only the numbers. */

.cd {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 26px);
  font-family: var(--f-countdown, "Anton", sans-serif);
  line-height: 0.84;
  user-select: none;
}
.cd-unit { display: flex; flex-direction: column; align-items: center; }
.cd-digits { display: flex; overflow: hidden; }
.cd-sep {
  font-family: var(--f-countdown, "Anton", sans-serif);
  color: var(--grey-dim);
  align-self: flex-start;
  line-height: 1.22;
}
.cd-label {
  font-family: var(--f-countdownLabel, "JetBrains Mono", monospace);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--grey);
  margin-top: 6px;
  text-transform: uppercase;
}
.cd-caption {
  font-family: var(--f-countdownTitle, "JetBrains Mono", monospace);
  font-size: 11px;
  letter-spacing: 0.36em;
  color: var(--grey);
  text-transform: uppercase;
  text-align: center;
}

/* Rolling digit: a 0-9 column that slides behind a window.
   The cell is deliberately taller than 1em. A display face at a tight
   line-height overflows a 1em box at the top, which clipped the caps and let
   the next digit in the column peek through above them. Every cell is one
   --roll-h tall, the glyph is centred inside it, and the column translates by
   exactly that height, so the window shows one whole digit and nothing else. */
.roll {
  --roll-h: 1.22em;
  height: var(--roll-h);
  overflow: hidden;
  /* contain: paint is a hard clip. overflow: hidden alone can fail to clip a
     child the browser has promoted to its own compositing layer, which is
     what let a rolling digit spill out below the window. */
  contain: paint;
  display: inline-block;
  vertical-align: top;
}
.roll-col {
  display: flex;
  flex-direction: column;
  /* No will-change here on purpose: promoting this to its own layer is what
     caused the spill, and the animation is cheap enough without it. */
  transition: transform 260ms cubic-bezier(0.22, 0.9, 0.24, 1);
  backface-visibility: hidden;
}
.roll-col span {
  height: var(--roll-h);
  line-height: var(--roll-h);
  display: block;
  text-align: center;
}

.cd-flat .roll-col { transition: none; }

/* ---------------------------------------------------------- reveal room */

.reveal {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--ink);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.reveal.on { display: flex; }

.reveal-static {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 2px);
  background-size: 100% 3px, 2px 100%;
}
.reveal.tuning .reveal-static { opacity: 1; animation: tune 620ms steps(6, end); }
@keyframes tune {
  0% { opacity: 1; transform: translateY(0); }
  30% { opacity: 0.9; transform: translateY(-14px); }
  60% { opacity: 1; transform: translateY(9px); }
  100% { opacity: 0; transform: translateY(0); }
}

.reveal-slate {
  font-family: var(--f-countdownLabel, "JetBrains Mono", monospace);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--tally);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.card-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  max-width: min(1120px, 94vw);
  padding: 6px 2px 18px;
  scrollbar-width: thin;
}

.card {
  flex: 0 0 auto;
  width: 268px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  animation: card-in 460ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}
.card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--panel-2); }
.card-meta { padding: 14px 16px 18px; }
.card-id {
  font-family: var(--f-statLabel, "JetBrains Mono", monospace);
  font-size: 10px; letter-spacing: 0.28em; color: var(--grey);
}
.card-name {
  font-family: var(--f-castName, "Anton", sans-serif);
  font-size: 26px; line-height: 1; margin-top: 8px; text-transform: uppercase;
}
.card-role {
  font-family: var(--f-castRole, "JetBrains Mono", monospace);
  font-size: 10px; letter-spacing: 0.2em; color: var(--grey); margin-top: 8px; text-transform: uppercase;
}
.card-flag {
  display: inline-block; margin-top: 12px; padding: 4px 8px;
  border: 1px solid var(--tally); color: var(--tally);
  font-family: var(--f-statLabel, "JetBrains Mono", monospace);
  font-size: 9px; letter-spacing: 0.22em;
}
@keyframes card-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(140%);
  background: var(--paper);
  color: var(--ink);
  padding: 13px 20px;
  border-radius: var(--radius);
  font-family: var(--f-navText, "JetBrains Mono", monospace);
  font-size: 12px;
  letter-spacing: 0.06em;
  max-width: min(560px, 92vw);
  z-index: 950;
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.toast.on { transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--tally); color: var(--paper); }

/* ------------------------------------------------------------- cutouts */

.actor {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  transform-origin: 50% 100%;
}
.actor img { width: 100%; height: auto; }
.actor[data-anim="float"] img { animation: float 7.5s ease-in-out infinite; }
.actor[data-anim="sway"] img { animation: sway 9s ease-in-out infinite; }
.actor[data-anim="none"] img { animation: none; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

/* ------------------------------------------------------- scroll reveal */

.rise { opacity: 0; transform: translateY(26px); transition: opacity 620ms ease, transform 620ms cubic-bezier(0.2, 0.8, 0.25, 1); }
.rise.seen { opacity: 1; transform: none; }

.wipe { clip-path: inset(0 100% 0 0); transition: clip-path 780ms cubic-bezier(0.22, 0.9, 0.24, 1); }
.wipe.seen { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .rise { opacity: 1; transform: none; }
  .wipe { clip-path: none; }
}

/* -------------------------------------------------------------- fields */

.field {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--paper);
  padding: 11px 13px;
  border-radius: var(--radius);
  font-family: var(--f-mintPanel, "JetBrains Mono", monospace);
  font-size: 13px;
  width: 100%;
}
.field:focus { border-color: var(--paper); outline: none; }

.scanlines::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.22) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}
