/* A quiet, shared finish. Media layout and playback visibility remain in iteration.css. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg: #141516;
  --panel: #1e2022;
  --text: #f5f3ef;
  --muted: #b7b8ba;
  --line: #ffffff16;
  --accent: #f4a38c;
  --surface-hover: #ffffff08;
  --surface-pressed: #ffffff0d;
  --radius: 14px;
  --ease: 150ms ease;
}

body {
  font-size: 16px;
  line-height: 1.55;
  font-optical-sizing: auto;
  letter-spacing: -.012em;
}

h1, h2, h3 {
  font-weight: 560;
  letter-spacing: -.035em;
  text-wrap: balance;
}

button, input, a, summary { -webkit-tap-highlight-color: transparent; }
button, input { font-family: var(--font); }
button, a, summary { touch-action: manipulation; }
button:disabled { cursor: not-allowed; }

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

.eyebrow, .small-label {
  font-size: 12px;
  font-weight: 540;
  letter-spacing: .07em;
}

.primary, .secondary {
  min-height: 46px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.015em;
  transition: background var(--ease), box-shadow var(--ease);
}

.primary { background: var(--accent); color: #261c18; }
.primary:hover { background: var(--accent); transform: none; }
.primary:active { background: #e9937b; transform: none; }
.secondary { background: #ffffff06; border-color: #ffffff20; }
.secondary:hover { background: #ffffff06; transform: none; }
.secondary:active { background: var(--surface-pressed); transform: none; }
.text-button { min-height: 44px; font-weight: 510; letter-spacing: -.01em; }

.header { border-bottom-color: #ffffff0b; }
.navigation > a { font-weight: 530; }
.navigation > a[aria-current] { background: #ffffff08; }
.navigation small { font-weight: 650; font-variant-numeric: tabular-nums; }
.footer p { font-size: 12px; line-height: 1.6; }

/* Reset obsolete portrait overrides that otherwise win through specificity. */
.home-page .collection { padding-top: 34px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { font-size: 24px; font-weight: 550; letter-spacing: -.035em; }
.collection .section-heading .text-button { color: var(--muted); }
.story-art:after { content: none; }
.card-body, .library-grid .card-body { padding-top: 12px; }
.card-body h3, .library-grid .card-body h3 {
  margin: 0;
  padding-right: 0;
  font-size: 17px;
  font-weight: 520;
  line-height: 1.35;
  letter-spacing: -.025em;
  overflow-wrap: normal;
}
.card-availability { font-size: 12px; line-height: 1.5; margin-top: 5px; }
.card-link { margin-top: 6px; font-weight: 530; font-size: 14px; }
.story-art, .detail-art { border: 1px solid #ffffff08; border-radius: 12px; }
.story-art .poster-fallback strong { line-height: 1.3; font-weight: 540; }

.hero-feature { border-radius: 16px; border-color: #ffffff0c; background: #202224; }
.hero-copy h2 { font-weight: 580; line-height: 1.12; letter-spacing: -.045em; }
.hero-copy > p:not(.eyebrow) { color: #d7d6d3; line-height: 1.6; }
.hero-copy .eyebrow { font-weight: 540; }
.hero-details { color: var(--muted); font-weight: 500; }
.hero-actions .primary { white-space: normal; text-align: center; }

.continue-section { margin-bottom: 24px; }
.resume-card { background: #1e2022; border-color: #ffffff0c; border-radius: 14px; padding: 12px; }
.resume-card h3 { font-weight: 550; letter-spacing: -.025em; line-height: 1.35; }
.resume-card p { font-size: 13px; font-variant-numeric: tabular-nums; }
.resume-image { border-radius: 8px; }
.resume-image > i { height: 2px; }
.resume-image .poster-fallback { display: flex; place-items: normal; background: #29292c; }
.resume-image .poster-fallback strong, .resume-image .poster-fallback small { display: none; }
.resume-action { font-weight: 560; }
.more-continue > summary { font-size: 14px; padding-block: 13px; }

.library-intro h1 { font-size: 36px; font-weight: 580; line-height: 1.15; }
.library-intro p { font-size: 15px; line-height: 1.55; }
.search-box { border-bottom-color: #ffffff26; padding-block: 8px; }
.search-box input { font-size: 18px; font-weight: 450; line-height: 1.5; }
.search-box input::placeholder { color: #b0b1b4; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field { position: relative; max-width: 720px; }
.search-field .search-box { padding-right: 48px; }
.search-clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  background: transparent;
  border-radius: 50%;
  color: var(--muted);
}
.search-clear svg { width: 18px; height: 18px; }
.search-filters > summary { border-color: #ffffff20; padding-inline: 16px; font-weight: 520; }
.filter-options { background: #1d1f21; border: 1px solid #ffffff0c; border-radius: 14px; padding: 16px; }
.filter-chip { font-weight: 520; border-color: #ffffff20; }
.filter-chip[aria-pressed=true] { background: #f4a38c1f; color: #fac1ae; border-color: #f4a38c70; }
.include-unavailable { font-size: 14px; line-height: 1.45; }
.selection-links a { border-color: #ffffff16; padding: 10px 14px; line-height: 1.45; border-radius: 10px; }
.results-count { font-size: 13px; margin-block: 14px 16px; }
.saved-card-actions { display: flex; align-items: center; gap: 8px; }
.saved-card-actions .card-link { flex: 1; min-width: 0; }
.saved-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.saved-remove svg { width: 17px; height: 17px; }

.back-link { font-size: 14px; font-weight: 490; }
.detail-copy h1 { font-weight: 580; letter-spacing: -.045em; line-height: 1.14; }
.detail-premise { color: #d7d6d3; line-height: 1.6; }
.detail-availability { line-height: 1.55; }
.detail-tools { gap: 12px; }
.tool-button { border-radius: 9px; font-weight: 490; color: var(--muted); transition: background var(--ease), color var(--ease); }
.tool-button:hover { color: var(--muted); }
.tool-button[aria-pressed=true], .tool-button[aria-pressed=true]:hover { color: #fac1ae; }
.detail-tools .tool-button { padding: 8px 10px; }
.availability-notice { background: #f4a38c08; border-radius: 0 8px 8px 0; }
.detail-episodes h2 { font-size: 24px; }
.empty-state { gap: 12px; }
.empty-state h2 { font-size: 28px; font-weight: 550; letter-spacing: -.035em; }
.empty-state p { line-height: 1.6; color: var(--muted); }
.unavailable-card { border-color: #ffffff16; background: #1b1d1e; }

/* Controls surround the film; this layer never touches native video or iframe visibility. */
.watch-topbar h1 { font-weight: 520; letter-spacing: -.018em; line-height: 1.35; }
.watch-topbar p { font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.watch-tools .tool-button { font-size: 13px; min-height: 44px; }
.watch-tools .tool-button svg { width: 19px; height: 19px; }
.watch-sidebar .story-context h2 { font-weight: 560; letter-spacing: -.035em; }
.watch-description { line-height: 1.65; color: #d7d6d3; }
.play-overlay > span { box-shadow: 0 2px 16px #0003; }
.play-overlay:hover > span { transform: none; }
.play-overlay strong { font-size: 15px; font-weight: 520; letter-spacing: -.01em; }
.player-status.is-error strong { font-weight: 580; letter-spacing: -.025em; }
.player-status.is-error p { max-width: 340px; line-height: 1.6; }

/* One translucent material, used only for temporary controls over the story. */
.sheet {
  padding: 24px;
  background: #232527;
  border: 1px solid #ffffff1b;
  border-radius: 20px;
  box-shadow: 0 20px 80px #0005;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop { background: #0007; }
.sheet[open] { animation: sheet-reveal 150ms ease-out; }
.sheet-header { gap: 16px; margin-bottom: 14px; align-items: center; }
.sheet-header h2 { margin-top: 0; font-size: 24px; line-height: 1.2; font-weight: 580; letter-spacing: -.04em; }
.sheet-header .icon-button { width: 44px; height: 44px; min-height: 44px; border: 1px solid #ffffff06; background: #ffffff06; }
.sheet-header .icon-button svg { width: 19px; height: 19px; }
.sheet-story { margin: 0 0 12px; padding-right: 2px; color: #c3c4c6; font-size: 14px; line-height: 1.45; }
.autoplay-setting { justify-content: space-between; gap: 16px; min-height: 48px; margin-bottom: 12px; padding-bottom: 12px; border-color: #ffffff16; }
.autoplay-setting .switch-label { flex: 1; order: -1; font-size: 14px; line-height: 1.45; }
.switch-control, .autoplay-setting .switch-control {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  width: 38px;
  height: 24px;
  min-width: 38px;
  margin: 0;
  flex: none;
  border: 1px solid #ffffff35;
  border-radius: 24px;
  background: #ffffff16;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}
.switch-control::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5f3ef;
  box-shadow: 0 1px 3px #0003;
  transition: transform var(--ease), background var(--ease);
}
.switch-control:checked { background: var(--accent); border-color: var(--accent); }
.switch-control:checked::before { transform: translateX(14px); background: #2f211c; }
.switch-control:disabled { opacity: .65; cursor: not-allowed; }
.switch-control:focus-visible { outline-offset: 4px; }

.episode-grid { gap: 8px; }
.episode-sheet-list {
  max-height: 55dvh;
  padding: 7px;
  margin-inline: -7px;
  scroll-padding-block: 10px;
  scrollbar-width: thin;
  scrollbar-color: #ffffff28 transparent;
  scrollbar-gutter: stable;
}
.sheet .episode-sheet-list { max-height: min(55dvh, calc(88dvh - 230px)); min-height: 64px; }
.episode-sheet-list::-webkit-scrollbar { width: 4px; }
.episode-sheet-list::-webkit-scrollbar-thumb { background: #ffffff28; border-radius: 4px; }
.episode-sheet-list::-webkit-scrollbar-track { background: transparent; }
.episode-row, .sheet .episode-row {
  min-width: 0;
  min-height: 64px;
  padding: 8px 4px;
  align-items: center;
  text-align: center;
  gap: 3px;
  background: #ffffff03;
  border: 1px solid #ffffff18;
  border-radius: 10px;
  box-shadow: none;
  transition: background var(--ease), border-color var(--ease);
}
.episode-number { color: #d7d8da; font-size: 18px; font-weight: 520; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.episode-indicator { color: #b9babc; font-size: 12px; min-height: 18px; line-height: 1.5; }
.episode-row:hover { background: #ffffff03; }
.episode-row.is-current, .episode-row[aria-current] {
  border: 1px solid #f4a38ccf;
  background: #f4a38c12;
  box-shadow: none;
}
.episode-row[aria-current] .episode-number { color: var(--text); font-weight: 610; }
.episode-row[aria-current] .episode-indicator { color: #fac1ae; }
.episode-row.is-watched:not([aria-current]) .episode-number { color: #bfc0c2; }
.episode-row.is-watched .episode-number:after { content: " ✓"; font-size: 10px; color: #d8a190; vertical-align: 1px; }
.episode-row[aria-current] .episode-number:after { content: none; }
.episode-indicator.is-watched-label { visibility: hidden; }
.episode-row:disabled { opacity: 1; background: transparent; border-color: #ffffff0d; }
.episode-row:disabled .episode-number { color: #a6a8ac; }
.episode-row:disabled .episode-indicator { color: #b1b3b7; font-size: 12px; }
.desktop-chapters .episode-grid { padding: 7px; margin-inline: -7px; scrollbar-width: thin; scrollbar-color: #ffffff28 transparent; }

.dialog-copy { color: #dfdfde; font-size: 15px; line-height: 1.65; margin-block: 16px; }
.share-input { background: #0002; border-color: #ffffff24; font-size: 14px; line-height: 1.5; padding: 12px; }
.share-input + .primary { margin-top: 16px; }
.toast { padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 480; line-height: 1.4; box-shadow: 0 6px 22px #0003; }

.end-screen.has-next, .player-status.is-next-loading {
  background: #232527;
  border-color: #ffffff1b;
  border-radius: 14px;
  box-shadow: 0 6px 24px #0003;
}
.up-next-story h2 { font-weight: 580; font-size: 22px; letter-spacing: -.035em; }
.up-next-story .eyebrow { font-size: 12px; font-weight: 520; letter-spacing: .07em; }
.up-next-title { line-height: 1.4; }
.up-next-timing { gap: 10px; }
.up-next-timing p { font-size: 14px; font-variant-numeric: tabular-nums; }
.up-next-actions .primary { min-height: 44px; }
.up-next-actions .text-button { min-height: 44px; padding-inline: 10px; color: #d2d3d4; }
.countdown-ring[hidden], .search-clear[hidden], .search-selection[hidden] { display: none !important; }
.end-screen h2 { font-weight: 570; letter-spacing: -.035em; }
.end-screen > [data-action=replay] { font-size: 13px; }
.player-status.is-next-loading { font-size: 14px; font-weight: 490; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sheet, .end-screen.has-next, .player-status.is-next-loading {
    background: rgba(29, 31, 33, .88);
    -webkit-backdrop-filter: blur(20px) saturate(1.08);
    backdrop-filter: blur(20px) saturate(1.08);
  }
}

@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: #ffb9a3; transform: none; }
  .secondary:hover { background: #ffffff0c; transform: none; }
  .tool-button:hover, .saved-remove:hover, .search-clear:hover, .sheet-header .icon-button:hover { background: var(--surface-hover); color: var(--text); }
  .episode-row:not(:disabled):not([aria-current]):hover { background: #ffffff08; border-color: #ffffff35; }
  .story-card .story-art:hover { border-color: #ffffff26; }
}
.tool-button:active, .saved-remove:active, .search-clear:active, .sheet-header .icon-button:active { background: var(--surface-pressed); }
.episode-row:not(:disabled):active { background: #ffffff0d; }

@media (max-width: 760px) {
  .header { height: 56px; }
  .navigation { background: #191b1d; border-color: #ffffff13; }
  .navigation > a { font-size: 12px; font-weight: 510; min-height: 48px; gap: 4px; }
  .navigation svg { width: 21px; height: 21px; }
  .home-page .collection { padding-top: 28px; }
  .section-heading h2 { font-size: 22px; }
  .section-heading { margin-bottom: 14px; }
  .story-grid, .library-grid { gap: 22px 14px; }
  .card-body h3, .library-grid .card-body h3 { font-size: 16px; line-height: 1.35; padding-right: 0; }
  .card-link { font-size: 13px; }
  .saved-card-actions { flex-direction: column; align-items: stretch; gap: 0; }
  .saved-card-actions .card-link { flex: none; width: 100%; }
  .saved-remove { width: 100%; padding: 8px 0; justify-content: flex-start; gap: 6px; }
  .saved-remove span { font-size: 12px; }
  .hero-feature { min-height: 320px; height: auto; grid-template-columns: minmax(0, 1fr) 38%; border-radius: 14px; }
  .hero-copy { padding: 24px 16px; }
  .hero-copy h2 { font-size: 24px; line-height: 1.14; letter-spacing: -.04em; margin-top: 10px; }
  .hero-copy > p:not(.eyebrow) { font-size: 14px; line-height: 1.5; margin-top: 14px; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .primary { font-size: 13px; padding-inline: 10px; }
  .hero-details { font-size: 12px; margin-top: 2px; }
  .continue-section { margin-bottom: 20px; }
  .continue-section .section-heading h2 { font-size: 21px; }
  .resume-card { padding: 10px; gap: 12px; }
  .resume-card h3 { font-size: 16px; }
  .library-intro h1 { font-size: 32px; }
  .library-intro p { font-size: 14px; }
  .detail-copy h1 { font-size: 26px; }
  .detail-premise { font-size: 15px; }
  .detail-tools { gap: 6px; }
  .detail-tools .tool-button { padding-inline: 8px; }
  .detail-episodes h2 { font-size: 22px; }
  .watch-topbar h1 { font-size: 14px; }
  .watch-tools .tool-button { font-size: 13px; }
  .sheet { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-bottom: 0; }
  .sheet-header { margin-bottom: 12px; }
  .sheet-header h2 { font-size: 24px; }
  .sheet-story { margin-bottom: 10px; }
  .episode-sheet-list { max-height: 55dvh; }
  .episode-row, .sheet .episode-row { min-height: 64px; }
  .empty-state h2 { font-size: 26px; }
  .end-screen.has-next { padding: 16px; }
  .up-next-story h2 { font-size: 21px; }
}

@media (max-width: 370px) {
  .hero-feature { height: auto; min-height: 320px; }
  .hero-copy { padding: 22px 14px; }
  .hero-copy h2 { font-size: 22px; }
  .hero-actions .primary { padding-inline: 8px; }
  .sheet { padding-inline: 20px; }
  .episode-number { font-size: 17px; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .sheet, .end-screen.has-next, .player-status.is-next-loading {
    background: #232527;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
