/* =================================================================
   TIALA · SIGNAL DECK — design system
   broadcast-control-room aesthetic for a creator-first video platform
   ================================================================= */

/* -----  Fonts  ----- */
@import url("https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700;800;900&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

/* -----  Tokens  ----- */
:root {
  /* Surfaces */
  --ink:    #0B0B0E;          /* deepest warm-black */
  --haze:   #131318;          /* elevated surface */
  --smoke:  #1E1E25;          /* card surface */
  --soot:   #2A2A33;          /* hairline borders */
  --paper:  #F2EFE6;          /* warm ivory (light moments) */
  --mute:   #8A8A8E;          /* secondary text */
  --quiet:  #5A5A60;          /* tertiary text */

  /* Brand signals */
  --signal: #FDD931;          /* tiala yellow — the ON AIR light */
  --signal-soft: #E6C020;
  --burn:   #FF4D26;          /* coral — live, record, sparing */
  --cool:   #5179FF;          /* electric blue — tags, supporting */
  --gold:   #F2C744;          /* coins, accents */

  /* Type */
  --font-display: "Big Shoulders Display", "Impact", sans-serif;
  --font-body:    "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale (display) */
  --display-xl:  clamp(64px, 11vw, 168px);
  --display-l:   clamp(48px, 7vw, 104px);
  --display-m:   clamp(32px, 4.5vw, 64px);
  --display-s:   clamp(24px, 3vw, 40px);

  /* Motion */
  --ease:   cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --quick:  120ms;
  --med:    240ms;
  --long:   600ms;

  /* Rhythm */
  --rule-thin: 1px;
  --rule-bold: 2px;
  --rule-deck: 4px;
  --gutter: clamp(16px, 3vw, 32px);

  /* Effects */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  --glow-signal: 0 0 0 1px rgba(253, 217, 49, 0.4), 0 0 22px rgba(253, 217, 49, 0.18);
}

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

html {
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  /* Override Bootstrap tokens at the root so themed surfaces inherit dark */
  --bs-body-bg: var(--ink);
  --bs-body-color: var(--paper);
  --bs-secondary-bg: var(--haze);
  --bs-tertiary-bg: var(--smoke);
  --bs-border-color: var(--soot);
  --bs-emphasis-color: var(--paper);
}

/* Plain body rule (catches the design-preview.html which has no .light-style) */
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--paper);
  background: var(--ink);
  font-feature-settings: "ss01", "cv11";
  position: relative;
  overflow-x: hidden;
}

/* The production page sets `class="light-style"` on <html>, and front-page.css
   has `.light-style body { background: #fff }` which beats a plain `body`
   selector. Match their specificity so dark wins on the real site. */
html.light-style body,
html.dark-style body {
  background: var(--ink);
  color: var(--paper);
}

/* Page-level grain (subtle warmth) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.05;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

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

::selection { background: var(--signal); color: var(--ink); }

/* -----  Typography utilities  ----- */
.t-display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.t-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.t-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

/* -----  Top deck rail (the bar above the navbar)  ----- */
.deck-rail {
  position: relative;
  background: var(--ink);
  border-bottom: var(--rule-thin) solid var(--soot);
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 0;
  z-index: 10;
}

.deck-rail__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 var(--gutter);
}

.deck-rail__id {
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.deck-rail__id::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--signal);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(253, 217, 49, 0.18);
  animation: pulseSignal 1.8s infinite;
}

@keyframes pulseSignal {
  0%, 100% { box-shadow: 0 0 0 2px rgba(253, 217, 49, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(253, 217, 49, 0.05); }
}

.deck-rail__ticker {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 80px, #000 calc(100% - 80px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 80px, #000 calc(100% - 80px), transparent);
}

.deck-rail__ticker-track {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  animation: tickerSlide 60s linear infinite;
  will-change: transform;
}

.deck-rail__ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.deck-rail__ticker-item::before {
  content: "◆";
  color: var(--signal);
  font-size: 7px;
}

@keyframes tickerSlide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.deck-rail__clock {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

/* -----  Reusable: section deck-header  ----- */
.deck-section {
  position: relative;
  padding: clamp(40px, 6vw, 88px) 0 clamp(32px, 4vw, 64px);
}

.deck-section__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 24px;
  padding: 0 var(--gutter) 24px;
  border-bottom: var(--rule-thin) solid var(--soot);
  margin-bottom: clamp(24px, 3vw, 44px);
}

.deck-section__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mute);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.deck-section__num strong {
  color: var(--signal);
  font-weight: 600;
}

.deck-section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--display-m);
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0;
}

.deck-section__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute);
  text-transform: uppercase;
}

/* -----  Signal bars (decorative live-meter)  ----- */
.signal-bars {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}

.signal-bars span {
  display: block;
  width: 3px;
  background: var(--signal);
  animation: signalBar 1.2s var(--ease) infinite;
}

.signal-bars span:nth-child(1) { height: 30%; animation-delay: 0s; }
.signal-bars span:nth-child(2) { height: 70%; animation-delay: 0.2s; }
.signal-bars span:nth-child(3) { height: 50%; animation-delay: 0.4s; }
.signal-bars span:nth-child(4) { height: 90%; animation-delay: 0.6s; }

@keyframes signalBar {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}

/* -----  Channel number tag  ----- */
.channel-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: var(--signal);
  padding: 4px 8px 3px;
  text-transform: uppercase;
  line-height: 1;
}

.channel-tag--ghost {
  background: transparent;
  color: var(--signal);
  border: var(--rule-thin) solid var(--signal);
}

/* -----  Live dot  ----- */
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--burn);
}

.live-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--burn);
  box-shadow: 0 0 0 0 rgba(255, 77, 38, 0.5);
  animation: liveBlink 1.6s var(--ease) infinite;
}

@keyframes liveBlink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 38, 0.55); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 77, 38, 0); }
}

/* -----  Deck button  ----- */
.deck-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  border-radius: 0;
  transition: transform var(--quick) var(--ease), background-color var(--quick) var(--ease);
  position: relative;
  cursor: pointer;
}

.deck-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--rule-thin) solid var(--ink);
  transform: translate(4px, 4px);
  pointer-events: none;
  transition: transform var(--med) var(--ease);
}

.deck-btn:hover {
  transform: translate(-2px, -2px);
}
.deck-btn:hover::after {
  transform: translate(6px, 6px);
}

.deck-btn--ghost {
  background: transparent;
  color: var(--paper);
  border: var(--rule-thin) solid var(--paper);
}

.deck-btn--ghost::after {
  border-color: var(--signal);
}

.deck-btn--ghost:hover {
  background: var(--paper);
  color: var(--ink);
}

/* -----  Container  ----- */
.deck-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* -----  Page transitions  ----- */
@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--long);
  animation-timing-function: var(--ease-out);
}

/* -----  Reduced motion  ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .deck-rail__ticker-track { animation: none; }
}

/* =================================================================
   GLOBAL CHROME — container + header + Bootstrap dropdown
   These need to apply to EVERY front-facing page (home, series, films,
   creator profile, etc.) so they live in the design system, not on a
   single page stylesheet.
   ================================================================= */
.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 14, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: var(--rule-thin) solid var(--soot);
}

.header--fixed { /* legacy class hook — same as base */ }

.header .container,
.header > .container { padding: 0; }

.header__content {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 32px;
  padding: 14px var(--gutter);
}

.header__logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--paper);
  text-transform: uppercase;
  line-height: 1;
}

.header__logo img {
  height: 32px;
  width: auto;
}

.header__logo::after {
  content: "TV";
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  background: var(--signal);
  color: var(--ink);
  padding: 3px 6px 2px;
  margin-left: 2px;
  align-self: flex-start;
  margin-top: 2px;
}

.header__nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header__nav-link {
  position: relative;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  transition: color var(--quick) var(--ease);
}

.header__nav-link:hover { color: var(--paper); }

.header__nav-link.active { color: var(--paper); }

.header__nav-link.active::before {
  content: "";
  position: absolute;
  left: 16px;
  bottom: 2px;
  width: 14px;
  height: 2px;
  background: var(--signal);
}

.header__search {
  position: relative;
  min-width: 240px;
}

.header__search::before {
  content: "\2315";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute);
  font-size: 14px;
  pointer-events: none;
}

.header__search-input {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 36px;
  background: var(--haze);
  color: var(--paper);
  border: var(--rule-thin) solid var(--soot);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  outline: none;
  transition: border-color var(--quick) var(--ease);
}

.header__search-input::placeholder { color: var(--quiet); }

.header__search-input:focus { border-color: var(--signal); }

.header__actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.header__signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: var(--rule-thin) solid var(--paper);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all var(--quick) var(--ease);
}

.header__signin:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}

/* Bootstrap dropdown inside the navbar */
.header .dropdown-menu {
  background: var(--haze) !important;
  border: var(--rule-thin) solid var(--soot) !important;
  border-radius: 0 !important;
  margin-top: 8px;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header .dropdown-item.text-white {
  color: var(--paper) !important;
  padding: 10px 16px;
  transition: background var(--quick) var(--ease);
}

.header .dropdown-item.text-white:hover {
  background: var(--smoke);
  color: var(--signal) !important;
}

.header .dropdown-divider { border-color: var(--soot) !important; }

@media (max-width: 900px) {
  .header__content {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
  }
  .header__nav,
  .header__search { display: none; }
}

/* =================================================================
   VIDEO PLAYER MODAL
   Markup is built dynamically by app-sample-{index,series-list,film-list}.js.
   Classes: .video-modal-overlay > .video-modal > .video-modal-content
            with optional .video-modal-nav-- prev/next and series info strip.
   ================================================================= */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 14, 0.94);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  padding: clamp(20px, 4vw, 56px);
  animation: vmOverlayIn 220ms var(--ease-out);
}

@keyframes vmOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.video-modal {
  position: relative;
  width: 100%;
  max-width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: vmPanelIn 280ms var(--ease-out);
}

@keyframes vmPanelIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* Make room for side nav buttons in series mode */
.video-modal--series { padding: 0 clamp(48px, 6vw, 80px); }

/* Player frame: 16:9, signal-yellow corner registration marks */
.video-modal-content {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--ink);
  border: var(--rule-thin) solid var(--soot);
  overflow: hidden;
}

.video-modal-content::before,
.video-modal-content::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: var(--rule-thin) solid var(--signal);
  pointer-events: none;
  z-index: 3;
}

.video-modal-content::before {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
}

.video-modal-content::after {
  bottom: 10px;
  right: 10px;
  border-left: 0;
  border-top: 0;
}

.video-modal-content iframe,
.video-modal-content .uploaded-video-player,
.uploaded-video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--ink);
  display: block;
}

/* Close button — pinned to the top-right of the overlay so it's always
   visible regardless of viewport height or modal size. */
.video-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  background: var(--ink);
  border: var(--rule-thin) solid var(--paper);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--quick) var(--ease);
  z-index: 2010;        /* above the overlay (2000) and any iframe */
}

.video-modal-close::after {
  /* mono "ESC" hint to make the affordance unmistakable */
  content: "ESC";
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--mute);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

.video-modal-close:hover {
  background: var(--burn);
  border-color: var(--burn);
  color: var(--paper);
}

.video-modal-close:hover::after { color: var(--paper); }

@media (max-width: 700px) {
  .video-modal-close { width: 40px; height: 40px; top: 12px; right: 12px; }
  .video-modal-close::after { display: none; }
}

/* =================================================================
   SERIES MODAL — series details + episode list
   Opens when a user clicks a .series-card or .netflix-series-card.
   Used by home, series list, and film list pages.
   ================================================================= */
.series-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(11, 11, 14, 0.92);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 56px);
  animation: vmOverlayIn 200ms var(--ease-out);
}

.series-modal.active { display: flex; }

.series-modal__content {
  position: relative;
  width: min(960px, 100%);
  max-height: 88vh;
  background: var(--haze);
  border: var(--rule-thin) solid var(--soot);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: vmPanelIn 260ms var(--ease-out);
}

.series-modal__header {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  grid-template-areas:
    "thumb info close"
    "thumb info count";
  gap: 8px 24px;
  padding: 22px 24px;
  border-bottom: var(--rule-thin) solid var(--soot);
  align-items: start;
  background: linear-gradient(180deg, var(--smoke), var(--haze));
}

.series-modal__thumbnail { grid-area: thumb; }
.series-modal__info      { grid-area: info; }
.series-modal__close     { grid-area: close; justify-self: end; }
.series-modal__count     { grid-area: count; justify-self: end; align-self: end; }

/* Section-style label above the title */
.series-modal__header::before {
  content: "◆  SERIES";
  position: absolute;
  top: 18px;
  left: 264px;          /* aligns with the start of the info column */
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--signal);
  text-transform: uppercase;
}

.series-modal__thumbnail {
  width: 220px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--smoke);
  border: var(--rule-thin) solid var(--soot);
  filter: grayscale(0.1) contrast(1.04);
}

.series-modal__info {
  min-width: 0;
  padding-top: 26px;     /* space for the ◆ SERIES label */
}

.series-modal__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 0.92;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 10px;
}

.series-modal__description {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  color: var(--mute);
  margin: 0 0 12px;
  max-width: 540px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.series-modal__count {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px 3px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  align-self: end;
}

.series-modal__close {
  width: 40px;
  height: 40px;
  background: transparent;
  border: var(--rule-thin) solid var(--soot);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-self: start;
  transition: all var(--quick) var(--ease);
  position: relative;
  z-index: 2;
}

.series-modal__close:hover {
  background: var(--burn);
  border-color: var(--burn);
  color: var(--paper);
}

.series-modal__close svg { width: 16px; height: 16px; stroke: currentColor; }

/* Scrollable episode list */
.series-modal__videos {
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--soot) transparent;
}

.series-modal__videos::-webkit-scrollbar { width: 4px; }
.series-modal__videos::-webkit-scrollbar-thumb { background: var(--soot); }

/* -----  Episode rows (injected by JS as .series-video-item)  ----- */
.series-video-item {
  display: grid;
  grid-template-columns: 44px 140px 1fr 40px;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  cursor: pointer;
  border-bottom: var(--rule-thin) solid var(--soot);
  transition: background var(--quick) var(--ease);
  position: relative;
}

.series-video-item:last-child { border-bottom: 0; }

.series-video-item:hover {
  background: var(--smoke);
}

.series-video-item:hover .series-video-item__play {
  background: var(--signal);
  color: var(--ink);
  border-color: var(--signal);
  transform: scale(1);
}

.series-video-item:hover .series-video-item__title { color: var(--signal); }

.series-video-item:hover .series-video-item__thumbnail img,
.series-video-item:hover .series-video-item__thumbnail {
  filter: grayscale(0) saturate(1.05);
}

.series-video-item__number {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--mute);
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: color var(--quick) var(--ease);
}

.series-video-item:hover .series-video-item__number { color: var(--signal); }

.series-video-item__thumbnail {
  width: 140px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--smoke);
  border: var(--rule-thin) solid var(--soot);
  filter: grayscale(0.15);
  transition: filter var(--med) var(--ease), border-color var(--quick) var(--ease);
}

.series-video-item:hover .series-video-item__thumbnail {
  border-color: var(--signal);
}

.series-video-item__info { min-width: 0; }

.series-video-item__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.32;
  color: var(--paper);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--quick) var(--ease);
}

.series-video-item__meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--mute);
  text-transform: uppercase;
}

.series-video-item__play {
  width: 40px;
  height: 40px;
  background: transparent;
  border: var(--rule-thin) solid var(--soot);
  color: var(--mute);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.92);
  transition: transform var(--quick) var(--ease), background var(--quick) var(--ease), color var(--quick) var(--ease), border-color var(--quick) var(--ease);
}

.series-video-item__play svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 700px) {
  .series-modal__header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "thumb close"
      "info  info"
      "count count";
    gap: 12px 16px;
  }
  .series-modal__thumbnail { width: 100%; }
  .series-modal__header::before {
    position: static;
    margin-bottom: 6px;
    display: block;
  }
  .series-modal__info { padding-top: 0; }
  .series-modal__count { justify-self: start; }

  .series-video-item {
    grid-template-columns: 28px 96px 1fr;
    gap: 12px;
    padding: 12px 16px;
  }
  .series-video-item__number { font-size: 18px; }
  .series-video-item__thumbnail { width: 96px; }
  .series-video-item__play { display: none; }
}

/* Prev / next side navigation */
.video-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(40px, 4vw, 56px);
  height: clamp(56px, 6vw, 72px);
  background: transparent;
  border: var(--rule-thin) solid var(--soot);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: all var(--quick) var(--ease);
}

.video-modal-nav:hover:not(.disabled) {
  border-color: var(--signal);
  color: var(--signal);
}

.video-modal-nav.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--soot);
  color: var(--quiet);
}

.video-modal-nav--prev { left: 0; }
.video-modal-nav--next { right: 0; }

.video-modal-nav svg { stroke: currentColor; }

/* Bottom series info strip */
.video-modal-series-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--haze);
  border: var(--rule-thin) solid var(--soot);
}

.video-modal-series-counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px 3px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.video-modal-series-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

@media (max-width: 700px) {
  .video-modal--series { padding: 0; }
  .video-modal--series .video-modal-close { right: 0; }
  .video-modal-nav {
    top: auto;
    bottom: -52px;
    transform: none;
    width: 44px;
    height: 40px;
  }
  .video-modal-nav--prev { left: 0; right: auto; }
  .video-modal-nav--next { right: 0; left: auto; }
  .video-modal-series-info {
    margin-bottom: 48px;  /* leave room for the bottom nav buttons */
  }
}

/* YouTube fallback row: "Open on YouTube" link below the player.
   Always visible for YouTube embeds so users can escape when YouTube
   refuses to play (embedding disabled / region-locked / etc.) */
.video-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: var(--haze);
  border: var(--rule-thin) solid var(--soot);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.video-modal-actions__hint { color: var(--mute); }

.video-modal-actions__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 5px;
  background: transparent;
  border: var(--rule-thin) solid var(--burn);
  color: var(--burn);
  font-weight: 700;
  text-decoration: none;
  transition: all var(--quick) var(--ease);
}

.video-modal-actions__link:hover {
  background: var(--burn);
  color: var(--paper);
}

.video-modal-actions__link span {
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}
