/* ============================================================
   LUMIÈRE — Zen Design System
   "Where stories come to light."
   Fully aligned with UI_UX_AI_PROMPT.md specification.
   ============================================================ */

/* ─── 1. Design Tokens ─── */
:root {
  /* Light Mode (Warm & Papery) */
  --color-paper: #f2f0e3;
  --color-dark: #2e2e2e;
  --color-muted: rgba(0, 0, 0, 0.05);
  --color-subtle: rgba(0, 0, 0, 0.05);
  --color-accent: #f76f53;
  --color-accent-alt: #6287f5;
  --border-color: rgba(0, 0, 0, 0.15);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);

  /* Fonts */
  --font-sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Sizing */
  --nav-height: 72px;
  --container-max: 1280px;

  /* Easing */
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-row-btn: 10;
  --z-hero-content: 5;
  --z-nav: 100;
  --z-overlay: 140;
  --z-mobile-menu: 150;
  --z-modal: 200;
  --z-scroll-top: 90;
}

/* Dark Mode — warm off-white text on true dark gray (NOT pure black) */
:root[data-theme='dark'] {
  --color-paper: #1f1f1f;
  --color-dark: #d1cfc0;
  --color-muted: rgba(255, 255, 255, 0.05);
  --color-subtle: rgba(255, 255, 255, 0.1);
  --color-accent: #f76f53;
  --color-accent-alt: #6287f5;
  --border-color: rgba(255, 255, 255, 0.12);
}

/* ─── 2. Reset & Base ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-weight: 500;
  font-variation-settings: 'width' 100;
  color: var(--color-dark);
  background: var(--color-paper);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, video {
  max-width: 100%;
  display: block;
}

/* Dark mode images: reduce glare per spec */
:root[data-theme='dark'] img,
:root[data-theme='dark'] video {
  opacity: 0.85;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul, ol { list-style: none; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── 3. Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

/* Signature serif-italic accent on key heading words */
.accent-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent);
}

.text-muted { opacity: 0.55; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── 4. Layout ─── */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { max-width: 1024px; padding-inline: 1.5rem; } }
@media (min-width: 1280px) { .container { max-width: var(--container-max); padding-inline: 2rem; } }

.container-fluid {
  width: 100%;
  padding-inline: 1rem;
}
@media (min-width: 640px)  { .container-fluid { padding-inline: 1.5rem; } }
@media (min-width: 1280px) { .container-fluid { padding-inline: 3rem; } }

/* ─── 5. Buttons (per spec: 0.9rem, rounded-xl, scale micro-interactions) ─── */
.btn {
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  transition: transform 150ms ease, box-shadow 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  text-decoration: none;
}
.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[disabled] { cursor: not-allowed; opacity: 0.5; transform: none; }

/* Primary: dark fill, light text, soft shadow */
.btn-primary {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 12px 20px -3px rgba(0,0,0,0.15); }

/* Accent CTA variant (for Watch Now) */
.btn-accent {
  background: var(--color-accent);
  color: #fff;
  padding: 1rem 1.75rem;
  box-shadow: 0 8px 20px rgba(247, 111, 83, 0.25);
  font-weight: 600;
}
.btn-accent:hover { box-shadow: 0 12px 28px rgba(247, 111, 83, 0.35); }

.btn-secondary {
  background: var(--color-subtle);
  color: var(--color-dark);
}

.btn-bordered {
  border: 2px solid var(--color-dark);
  background: transparent;
  color: var(--color-dark);
}
.btn-bordered:hover {
  background: var(--color-dark);
  color: var(--color-paper);
}

.btn-ghost {
  background: transparent;
  color: var(--color-dark);
  padding: 0.5rem 1rem;
}
.btn-ghost:hover { background: var(--color-muted); }

/* ─── 6. Navbar ─── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  background: rgba(31, 31, 31, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(255,255,255,0.06);
}

:root[data-theme='light'] #navbar.scrolled {
  background: rgba(242, 240, 227, 0.85);
  border-bottom-color: rgba(0,0,0,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  max-width: var(--container-max);
  margin-inline: auto;
}

@media (min-width: 1280px) {
  .nav-inner { padding: 1.5rem 2rem; }
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  z-index: 10;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-dark);
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  color: var(--color-dark);
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}
.nav-link:hover,
.nav-link.active {
  opacity: 1;
  background: var(--color-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-search-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-dark);
  transition: background 0.2s;
}
.nav-search-btn:hover { background: var(--color-muted); }
.nav-search-btn svg { width: 20px; height: 20px; }

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

/* Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: background 0.2s;
}
.nav-hamburger:hover { background: var(--color-muted); }
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-dark);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (min-width: 768px) {
  .nav-hamburger { display: none; }
}

/* Mobile Menu */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

.mobile-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--color-paper);
  z-index: var(--z-mobile-menu);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease-smooth);
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
}
.mobile-panel.open { transform: translateX(0); }

.mobile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-close {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  transition: background 0.2s;
}
.mobile-close:hover { background: var(--color-muted); }

.mobile-nav-link {
  display: block;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 1rem 0.75rem;
  border-radius: 0.75rem;
  transition: background 0.2s, color 0.2s;
}
.mobile-nav-link:hover { background: var(--color-muted); color: var(--color-accent); }

/* ─── 7. Theme Toggle ─── */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.3s;
  position: relative;
}
.theme-toggle:hover { background: var(--color-muted); transform: rotate(20deg); }
.theme-toggle svg { width: 20px; height: 20px; position: absolute; transition: opacity 0.3s, transform 0.3s; }

.icon-sun { opacity: 0; transform: rotate(-90deg) scale(0); }
.icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

:root[data-theme='light'] .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
:root[data-theme='light'] .icon-moon { opacity: 0; transform: rotate(90deg) scale(0); }

/* ─── 8. Hero Section ─── */
.hero {
  position: relative;
  width: 100%;
  min-height: 75vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

@media (min-width: 768px) { .hero { min-height: 88vh; } }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-slide.active { opacity: 1; }

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transform: scale(1.05);
  transition: transform 10s ease;
}
.hero-slide.active .hero-backdrop {
  transform: scale(1);
}

:root[data-theme='dark'] .hero-backdrop { opacity: 0.6; }
:root[data-theme='light'] .hero-backdrop { opacity: 0.85; }

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--color-paper) 0%,
    rgba(31, 31, 31, 0.7) 45%,
    transparent 100%
  );
}

:root[data-theme='light'] .hero-gradient {
  background: linear-gradient(
    to top,
    var(--color-paper) 0%,
    rgba(242, 240, 227, 0.6) 45%,
    rgba(242, 240, 227, 0.2) 100%
  );
}

.hero-content {
  position: relative;
  z-index: var(--z-hero-content);
  padding-bottom: 4rem;
  max-width: 680px;
}

@media (min-width: 768px) { .hero-content { padding-bottom: 6rem; } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(247, 111, 83, 0.12);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(247, 111, 83, 0.2);
}

.hero-title {
  font-size: clamp(2.25rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 0.95;
  margin-bottom: 1.25rem;
  text-wrap: balance;
  letter-spacing: -0.02em;
}

.hero-overview {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.55;
  margin-bottom: 1.5rem;
  max-width: 500px;
  text-wrap: pretty;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  font-size: 0.85rem;
}

.hero-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  color: #fbbf24;
}
.hero-rating svg { width: 14px; height: 14px; fill: #fbbf24; }

.hero-year { opacity: 0.55; }

.hero-genres {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-genre-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  opacity: 0.6;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Hero dots navigation */
.hero-dots {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  gap: 0.5rem;
  z-index: var(--z-hero-content);
}

.hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--color-dark);
  opacity: 0.25;
  transition: opacity 0.3s, width 0.3s, border-radius 0.3s;
  cursor: pointer;
  border: none;
}
.hero-dot.active {
  opacity: 1;
  width: 28px;
  border-radius: 5px;
  background: var(--color-accent);
}

/* ─── 9. Content Rows (Home page) ─── */
.home-page { /* no extra top padding — hero covers it */ }

.home-rows {
  padding: 2rem 0 0;
}

.content-section {
  padding: 1.5rem 0 2.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-inline: 1rem;
}

@media (min-width: 640px) { .section-header { padding-inline: 1.5rem; } }
@media (min-width: 1280px) { .section-header { padding-inline: 3rem; } }

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

@media (min-width: 768px) { .section-title { font-size: 1.5rem; } }

.section-see-all {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-accent);
  opacity: 0.7;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.section-see-all:hover { opacity: 1; }

.content-row {
  position: relative;
}

.row-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-inline: 1rem;
  padding-bottom: 0.75rem;
}
.row-scroll::-webkit-scrollbar { display: none; }

@media (min-width: 640px) { .row-scroll { gap: 1.25rem; padding-inline: 1.5rem; } }
@media (min-width: 1280px) { .row-scroll { padding-inline: 3rem; } }

.row-btn {
  position: absolute;
  top: 0;
  bottom: 0.75rem;
  width: 52px;
  z-index: var(--z-row-btn);
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to right, var(--color-paper), transparent);
  border: none;
  cursor: pointer;
  color: var(--color-dark);
  font-size: 1.75rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.content-row:hover .row-btn { opacity: 1; }
.row-btn-left { left: 0; }
.row-btn-right { right: 0; background: linear-gradient(to left, var(--color-paper), transparent); }

@media (min-width: 768px) { .row-btn { display: flex; width: 60px; } }

/* ─── 10. Movie Card ─── */
.movie-card {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 145px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.movie-card:hover { transform: translateY(-6px); }

@media (min-width: 640px) { .movie-card { width: 165px; } }
@media (min-width: 1024px) { .movie-card { width: 185px; } }

.movie-card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--color-subtle);
  box-shadow: var(--shadow-md);
  border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.movie-card:hover .movie-card-poster {
  border-color: var(--color-dark);
  box-shadow: var(--shadow-lg);
}

.movie-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-smooth);
}
.movie-card:hover .movie-card-poster img {
  transform: scale(1.05);
}

.movie-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.85rem;
}
.movie-card:hover .movie-card-overlay { opacity: 1; }

.movie-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -35%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.35s var(--ease-bounce);
  box-shadow: 0 4px 16px rgba(247, 111, 83, 0.4);
}
.movie-card:hover .movie-card-play {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.movie-card-rating {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.movie-card-rating svg { width: 12px; height: 12px; fill: #fbbf24; }

.movie-card-info {
  padding: 0.6rem 0.2rem 0;
}

.movie-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card-year {
  font-size: 0.75rem;
  opacity: 0.45;
  margin-top: 0.2rem;
}

/* Card Grid (Browse/Search) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 2rem 1.25rem;
}

@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); } }

.card-grid .movie-card {
  width: 100%;
}

/* ─── 11. Search ─── */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3.25rem;
  font-size: 1rem;
  font-weight: 500;
  border: 2px solid var(--color-dark);
  border-radius: 9999px;
  background: transparent;
  color: var(--color-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(247, 111, 83, 0.12);
}

.search-input::placeholder { color: var(--color-dark); opacity: 0.35; }

.search-icon {
  position: absolute;
  left: 1.15rem;
  width: 20px; height: 20px;
  opacity: 0.4;
  pointer-events: none;
  color: var(--color-dark);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  width: 32px; height: 32px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0.45;
  transition: background 0.2s, opacity 0.2s;
}
.search-clear:hover { background: var(--color-subtle); opacity: 1; }

/* ─── 12. Filters ─── */
.filter-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 0.4rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--color-subtle);
  background: transparent;
  color: var(--color-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.filter-pill:hover { background: var(--color-muted); }
.filter-pill.active {
  background: var(--color-dark);
  color: var(--color-paper);
  border-color: var(--color-dark);
}

/* ─── 13. Player ─── */
.player-page {
  padding-top: var(--nav-height);
}

.player-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .player-container {
    border-radius: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-xl);
  }
}

.player-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.player-info {
  max-width: 1100px;
  margin: 2.5rem auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) { .player-info { padding-inline: 1.5rem; } }

.player-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) { .player-title { font-size: 2rem; } }

.player-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  opacity: 0.55;
  margin-bottom: 1.25rem;
}

.player-overview {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.55;
  max-width: 750px;
  margin-bottom: 2rem;
  text-wrap: pretty;
}

/* Season / Episode Picker */
.season-picker {
  margin-bottom: 2.5rem;
}

.season-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1.5rem;
  padding-bottom: 0.25rem;
}
.season-tabs::-webkit-scrollbar { display: none; }

.season-tab {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--color-dark);
  cursor: pointer;
  transition: background 0.2s;
  border: none;
}
.season-tab:hover { background: var(--color-muted); }
.season-tab.active { background: var(--color-subtle); font-weight: 600; }

.episode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 768px) { .episode-grid { grid-template-columns: repeat(2, 1fr); } }

.episode-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--color-subtle);
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  cursor: pointer;
}
.episode-card:hover {
  border-color: var(--color-accent);
  background: var(--color-muted);
  transform: translateY(-2px);
}
.episode-card.active {
  border-color: var(--color-accent);
  background: rgba(247, 111, 83, 0.06);
}

.episode-thumb {
  width: 140px;
  flex-shrink: 0;
  aspect-ratio: 16/9;
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--color-subtle);
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }

.episode-info { flex: 1; min-width: 0; }
.episode-number { font-size: 0.72rem; font-weight: 600; color: var(--color-accent); margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 0.05em; }
.episode-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.episode-overview { font-size: 0.8rem; opacity: 0.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── 14. Detail Page ─── */
.detail-page { padding-top: 0; }

.detail-hero {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

@media (min-width: 768px) { .detail-hero { min-height: 75vh; } }

.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

:root[data-theme='dark'] .detail-backdrop { opacity: 0.45; }
:root[data-theme='light'] .detail-backdrop { opacity: 0.7; }

.detail-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--color-paper) 0%, rgba(31,31,31,0.5) 55%, transparent 100%);
}

:root[data-theme='light'] .detail-gradient {
  background: linear-gradient(to top, var(--color-paper) 0%, rgba(242,240,227,0.5) 55%, rgba(242,240,227,0.1) 100%);
}

.detail-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 2.5rem;
  align-items: flex-end;
  padding-bottom: 3.5rem;
  width: 100%;
}

.detail-poster {
  display: none;
  width: 220px;
  flex-shrink: 0;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--color-dark);
}

@media (min-width: 768px) { .detail-poster { display: block; } }

.detail-poster img { width: 100%; height: auto; }

.detail-info { flex: 1; min-width: 0; }

.detail-title {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.05;
}

.detail-tagline {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  opacity: 0.45;
  margin-bottom: 1.25rem;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.detail-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.8rem;
}

.detail-meta-divider { opacity: 0.25; }

.detail-genres {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.detail-genre-tag {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  transition: background 0.2s;
}
.detail-genre-tag:hover { background: var(--color-muted); }

.detail-overview {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.55;
  margin-bottom: 2rem;
  max-width: 700px;
  text-wrap: pretty;
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Cast Section */
.cast-section {
  padding: 2.5rem 0;
}

.cast-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}
.cast-scroll::-webkit-scrollbar { display: none; }

.cast-card {
  flex-shrink: 0;
  width: 100px;
  text-align: center;
}

.cast-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 0.6rem;
  background: var(--color-subtle);
  border: 2px solid var(--border-color);
}
.cast-photo img { width: 100%; height: 100%; object-fit: cover; }

.cast-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.cast-character {
  font-size: 0.7rem;
  opacity: 0.45;
  margin-top: 0.15rem;
}

/* ─── 15. Footer (Always inverted per spec) ─── */
#app-footer {
  background: var(--color-dark);
  color: var(--color-paper);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--color-dark);
}

.footer-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
  position: relative;
  z-index: 2;
}

@media (min-width: 1280px) { .footer-inner { padding-inline: 2rem; } }

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

@media (min-width: 768px) {
  .footer-top { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}

.footer-brand {
  max-width: 350px;
}

.footer-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.footer-desc {
  font-size: 0.9rem;
  opacity: 0.55;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

@media (min-width: 768px) { .footer-links-grid { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }

.footer-links-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.footer-links-col a {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.55;
  padding: 0.3rem 0;
  transition: opacity 0.2s;
}
.footer-links-col a:hover { opacity: 1; }

.footer-social {
  display: flex;
  gap: 0.75rem;
  opacity: 0.7;
}
.footer-social a {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.2s, opacity 0.2s;
}
.footer-social a:hover { background: rgba(255,255,255,0.08); opacity: 1; }
.footer-social svg { width: 16px; height: 16px; }

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  opacity: 0.35;
}

@media (min-width: 768px) {
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* Footer decorative circles */
.footer-circles {
  position: absolute;
  right: -120px;
  bottom: -140px;
  pointer-events: none;
}

.footer-circle {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
  border-color: var(--color-paper);
  opacity: 0.04;
}
.footer-circle:nth-child(1) { width: 216px; height: 216px; border-width: 20px; bottom: 0; right: 0; }
.footer-circle:nth-child(2) { width: 396px; height: 396px; border-width: 30px; bottom: -90px; right: -90px; }
.footer-circle:nth-child(3) { width: 576px; height: 576px; border-width: 40px; bottom: -180px; right: -180px; }

@media (min-width: 768px) {
  .footer-circle { opacity: 0.06; }
}

/* ─── 16. Scroll to Top ─── */
.scroll-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-dark);
  color: var(--color-paper);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-scroll-top);
  transition: transform 0.3s var(--ease-smooth), opacity 0.3s;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
.scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-to-top:hover { transform: translateY(-3px) scale(1.05); }
.scroll-to-top:active { transform: scale(0.95); }

/* ─── 17. Skeleton Loading ─── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-subtle) 25%,
    var(--color-muted) 50%,
    var(--color-subtle) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

.skeleton-card {
  flex-shrink: 0;
  width: 145px;
}
@media (min-width: 640px) { .skeleton-card { width: 165px; } }
@media (min-width: 1024px) { .skeleton-card { width: 185px; } }

.skeleton-poster {
  aspect-ratio: 2/3;
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.skeleton-text-sm {
  height: 10px;
  width: 60%;
  border-radius: 3px;
}

.skeleton-hero {
  width: 100%;
  min-height: 75vh;
  border-radius: 0;
}

@media (min-width: 768px) { .skeleton-hero { min-height: 88vh; } }

/* ─── 18. Browse Page ─── */
.browse-page {
  padding-top: calc(var(--nav-height) + 3rem);
  min-height: 80vh;
}

.browse-header {
  margin-bottom: 2rem;
}

.browse-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.browse-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--color-subtle);
  padding: 0.3rem;
  border-radius: 0.75rem;
  width: fit-content;
  margin-bottom: 1.5rem;
}

.browse-tab {
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--color-dark);
}
.browse-tab.active {
  background: var(--color-paper);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 4rem;
  padding-bottom: 3rem;
}

.page-btn {
  min-width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--color-dark);
  cursor: pointer;
  transition: all 0.2s;
}
.page-btn:hover { background: var(--color-muted); }
.page-btn.active {
  background: var(--color-dark);
  color: var(--color-paper);
  border-color: var(--color-dark);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ─── 19. Search Page ─── */
.search-page {
  padding-top: calc(var(--nav-height) + 4rem);
  min-height: 80vh;
}

.search-page-title {
  text-align: center;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 600;
  margin-bottom: 2.5rem;
}

.search-results-info {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.55;
  margin: 2rem 0;
}

/* ─── 20. 404 Page ─── */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 2rem;
  padding-top: var(--nav-height);
}

.not-found-code {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 1rem;
}

.not-found-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.not-found-desc {
  font-size: 0.95rem;
  opacity: 0.55;
  margin-bottom: 2.5rem;
  max-width: 400px;
  text-wrap: pretty;
}

/* ─── 21. Empty State ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  opacity: 0.25;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 0.9rem;
  opacity: 0.55;
  max-width: 350px;
}

/* ─── 22. Animations ─── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

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

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Zen Reveal — the signature scroll-in animation */
.zen-reveal {
  opacity: 0.001;
  filter: blur(4px);
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-smooth),
              filter 0.5s var(--ease-smooth),
              transform 0.5s var(--ease-smooth);
}

.zen-reveal.visible {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0);
}

/* Page enter animation */
.page-enter {
  animation: slideUp 0.4s var(--ease-smooth) both;
}

/* ─── 23. Utilities ─── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.opacity-60 { opacity: 0.6; }
.opacity-80 { opacity: 0.8; }

/* Link style */
.zen-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.2s;
}
.zen-link:hover { opacity: 0.8; }

/* ─── 24. Responsive fine-tuning ─── */
@media (max-width: 767px) {
  .detail-content { flex-direction: column; align-items: flex-start; }
  .hero-overview { font-size: 0.88rem; }
  .episode-thumb { width: 100px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .zen-reveal { opacity: 1; filter: none; transform: none; }
}
