/* =========================================================================
   Ana Yurt Online — Design Tokens & Base
   Premium streaming aesthetic + Crimean Tatar cultural warmth
   ========================================================================= */

:root {
  /* Brand */
  --brand-deep: #0B1430;        /* badge navy */
  --brand-deeper: #060B1B;
  --accent: #E8B447;            /* amber/gold — CTA, ratings, ornaments */
  --accent-hot: #F5C758;
  --accent-soft: rgba(232, 180, 71, 0.16);

  /* Channel brand colors */
  --ch-atr: #E0314A;
  --ch-filmler: #3F7DEA;
  --ch-multfilm: #9956DB;
  --ch-qirimjr: #1FB39E;
  --ch-kozaydin: #E68224;

  /* Semantic */
  --ok: #6FCB92;
  --warn: #F5A623;
  --err: #EF6E5C;

  /* Surfaces — DARK (default) */
  --bg-0: #080C1A;
  --bg-1: #0E1426;
  --bg-2: #161E36;
  --bg-3: #1F2A45;
  --bg-4: #2A3656;
  --surface-glass: rgba(14, 20, 38, 0.78);
  --border: rgba(244, 239, 227, 0.09);
  --border-strong: rgba(244, 239, 227, 0.16);

  --text-1: #F4EFE3;            /* warm cream — primary */
  --text-2: rgba(244, 239, 227, 0.72);
  --text-3: rgba(244, 239, 227, 0.48);
  --text-4: rgba(244, 239, 227, 0.28);

  /* Type */
  --font-display: "Bricolage Grotesque", "PT Serif", serif;
  --font-ui: "Manrope", -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;

  /* Type scale (1.250 — major third, tuned) */
  --t-xs: 11px;
  --t-sm: 13px;
  --t-base: 15px;
  --t-md: 17px;
  --t-lg: 20px;
  --t-xl: 26px;
  --t-2xl: 34px;
  --t-3xl: 44px;
  --t-4xl: 58px;
  --t-5xl: 76px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Shadow */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px rgba(232, 180, 71, 0.35), 0 10px 30px rgba(232, 180, 71, 0.18);

  /* Easing */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --d-fast: 140ms;
  --d-med: 240ms;
  --d-slow: 480ms;

  /* Layout */
  --max-w: 1440px;
  --header-h: 72px;
}

/* Light theme */
[data-theme="light"] {
  --bg-0: #F4EEDE;
  --bg-1: #FAF6EB;
  --bg-2: #FFFFFF;
  --bg-3: #F0E8D2;
  --bg-4: #E5DBC0;
  --surface-glass: rgba(250, 246, 235, 0.85);
  --border: rgba(11, 20, 48, 0.10);
  --border-strong: rgba(11, 20, 48, 0.18);
  --text-1: #0B1430;
  --text-2: rgba(11, 20, 48, 0.72);
  --text-3: rgba(11, 20, 48, 0.50);
  --text-4: rgba(11, 20, 48, 0.30);
  --accent: #B98214;
  --accent-hot: #D49829;
  --accent-soft: rgba(185, 130, 20, 0.14);
}

/* =========================================================================
   Reset / base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.06;
}
h1 { font-size: var(--t-4xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

p { margin: 0; }

::selection { background: var(--accent); color: var(--brand-deeper); }

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================================
   App scaffolding
   ========================================================================= */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(232,180,71,0.06), transparent 60%),
    radial-gradient(900px 500px at 10% -10%, rgba(63,125,234,0.08), transparent 60%),
    var(--bg-0);
}
[data-theme="light"] .app {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(185,130,20,0.06), transparent 60%),
    radial-gradient(900px 500px at 10% -10%, rgba(63,125,234,0.05), transparent 60%),
    var(--bg-0);
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-8);
}
@media (max-width: 720px) {
  .container { padding: 0 var(--s-5); }
}

/* =========================================================================
   Header
   ========================================================================= */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: linear-gradient(to bottom, rgba(8,12,26,0.85), rgba(8,12,26,0.55));
  border-bottom: 1px solid transparent;
  transition: background var(--d-med) var(--ease-out), border-color var(--d-med) var(--ease-out);
}
[data-theme="light"] .header {
  background: linear-gradient(to bottom, rgba(244,238,222,0.92), rgba(244,238,222,0.70));
}
.header[data-scrolled="true"] {
  background: var(--surface-glass);
  border-bottom-color: var(--border);
}
.header-inner {
  width: 100%; max-width: var(--max-w);
  margin: 0 auto; padding: 0 var(--s-8);
  display: flex; align-items: center; gap: var(--s-8);
}
.brand { display: flex; align-items: center; gap: var(--s-3); flex-shrink: 0; }
.brand-mark { width: 38px; height: 38px; }
.brand-wordmark {
  display: flex; flex-direction: column; line-height: 1;
  white-space: nowrap;
}
.brand-wordmark .w1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-wordmark .w2 {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav { display: flex; gap: var(--s-2); }
.nav a {
  padding: 8px 14px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-full);
  transition: background var(--d-fast), color var(--d-fast);
  position: relative;
}
.nav a:hover { color: var(--text-1); background: rgba(255,255,255,0.04); }
[data-theme="light"] .nav a:hover { background: rgba(0,0,0,0.04); }
.nav a[data-active="true"] {
  color: var(--text-1);
  background: rgba(255,255,255,0.06);
}
[data-theme="light"] .nav a[data-active="true"] { background: rgba(0,0,0,0.06); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }

.search-trigger {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 8px 14px 8px 12px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: var(--t-sm);
  min-width: 240px;
  transition: all var(--d-fast);
}
[data-theme="light"] .search-trigger { background: rgba(0,0,0,0.04); }
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger kbd {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-3);
  border: 1px solid var(--border);
}
[data-theme="light"] .search-trigger kbd { background: rgba(0,0,0,0.05); }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  color: var(--text-2);
  transition: all var(--d-fast);
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-1); }
[data-theme="light"] .icon-btn:hover { background: rgba(0,0,0,0.06); }

.lang-toggle {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 0;
}
[data-theme="light"] .lang-toggle { background: rgba(0,0,0,0.04); }
.lang-toggle button {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--r-full);
  color: var(--text-3);
  transition: all var(--d-fast);
}
.lang-toggle button[data-active="true"] {
  background: var(--text-1);
  color: var(--bg-0);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), #D87420);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--brand-deeper);
  border: 2px solid var(--border-strong);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  height: 44px;
  padding: 0 22px;
  border-radius: var(--r-full);
  font-family: var(--font-ui);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: all var(--d-fast) var(--ease-out);
  white-space: nowrap;
}
/* Keep icon + label optically centred: icons never shrink, and any
   inner wrapper (e.g. bookmark on/off spans) inherits the flex centring. */
.btn > svg { flex: 0 0 auto; }
.btn > span { display: inline-flex; align-items: center; gap: var(--s-2); line-height: 1; }
.btn-primary {
  background: var(--accent);
  color: var(--brand-deeper);
  box-shadow: 0 8px 24px rgba(232,180,71,0.30);
}
.btn-primary:hover {
  background: var(--accent-hot);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(232,180,71,0.42);
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
}
[data-theme="light"] .btn-secondary {
  background: rgba(11,20,48,0.06);
}
.btn-secondary:hover { background: rgba(255,255,255,0.14); }
[data-theme="light"] .btn-secondary:hover { background: rgba(11,20,48,0.10); }

.btn-ghost {
  color: var(--text-2);
  height: 36px;
  padding: 0 14px;
}
.btn-ghost:hover { color: var(--text-1); background: rgba(255,255,255,0.06); }

.btn-lg { height: 52px; padding: 0 28px; font-size: var(--t-base); }

/* =========================================================================
   Cards / Carousels
   ========================================================================= */
.row { margin: var(--s-12) 0; }
.row-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: var(--s-5);
  padding: 0 var(--s-8);
  max-width: var(--max-w); margin-left: auto; margin-right: auto;
}
.row-head h2 {
  font-size: var(--t-xl);
  display: flex; align-items: center; gap: var(--s-3);
}
.row-head .sub {
  font-size: var(--t-sm);
  color: var(--text-3);
  margin-top: 6px;
}
.row-arrows { display: flex; gap: var(--s-2); }
.row-arrow {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--d-fast);
}
.row-arrow:hover { background: rgba(255,255,255,0.12); color: var(--text-1); }
.row-arrow:disabled { opacity: 0.35; cursor: not-allowed; }

.scroller {
  display: flex; gap: var(--s-4);
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 4px var(--s-8) var(--s-6);
  max-width: var(--max-w);
  margin: 0 auto;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; flex-shrink: 0; }

/* Title card */
.card {
  width: 200px;
  position: relative;
  cursor: pointer;
  transition: transform var(--d-med) var(--ease-out);
}
.card:hover { transform: translateY(-4px); }
.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--d-med);
}
.card:hover .card-poster { box-shadow: var(--shadow-lg); }
.card-poster .poster-art { width: 100%; height: 100%; }
.card-poster::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: inherit;
  pointer-events: none;
}

.card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.45) 35%, transparent 65%);
  opacity: 0;
  transition: opacity var(--d-med);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--s-4);
  gap: var(--s-2);
}
.card:hover .card-overlay,
.card:focus-within .card-overlay { opacity: 1; }
.card-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 56px; height: 56px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--brand-deeper);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: all var(--d-med);
  box-shadow: 0 8px 20px rgba(232,180,71,0.35);
}
.card:hover .card-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.card-badge-tl {
  position: absolute; top: 10px; left: 10px;
  z-index: 2;
  display: flex; gap: 6px;
}
.card-badge-tr {
  position: absolute; top: 10px; right: 10px;
  z-index: 2;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.55);
  color: var(--text-1);
  border: 1px solid rgba(255,255,255,0.10);
  white-space: nowrap;
}
.badge-new { background: var(--ok); color: #0B1430; border-color: transparent; }
.badge-featured { background: var(--accent); color: var(--brand-deeper); border-color: transparent; }
.badge-dur {
  background: rgba(0,0,0,0.65);
  color: var(--text-1);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 11px;
}
.badge-channel {
  background: var(--ch);
  color: white;
  border-color: transparent;
}

.card-meta {
  margin-top: var(--s-3);
  padding: 0 4px;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-base);
  color: var(--text-1);
  line-height: 1.25;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.card-sub {
  font-size: 11px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.card-sub .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); }

/* Rating stars */
.rating { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.rating .star { color: var(--accent); }

/* =========================================================================
   Hero
   ========================================================================= */
.hero {
  position: relative;
  height: 78vh;
  min-height: 580px;
  max-height: 760px;
  overflow: hidden;
  display: flex; align-items: flex-end;
  margin-top: calc(-1 * var(--header-h));
  padding-top: var(--header-h);
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
}
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(8,12,26,0.95) 0%, rgba(8,12,26,0.60) 45%, rgba(8,12,26,0.20) 75%, transparent 100%),
    linear-gradient(to top, var(--bg-0) 0%, rgba(8,12,26,0.55) 30%, transparent 60%);
  z-index: 2;
}
[data-theme="light"] .hero-bg::before {
  background:
    linear-gradient(to right, rgba(244,238,222,0.96) 0%, rgba(244,238,222,0.65) 45%, rgba(244,238,222,0.20) 75%, transparent 100%),
    linear-gradient(to top, var(--bg-0) 0%, rgba(244,238,222,0.60) 30%, transparent 60%);
}
.hero-art {
  position: absolute; inset: 0;
  background-position: center; background-size: cover;
}

.hero-content {
  position: relative; z-index: 3;
  max-width: 640px;
  padding-bottom: var(--s-12);
}
.hero-channel {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: var(--s-5);
}
.hero-channel .chip {
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  background: var(--ch);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 11px;
}
.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: var(--s-5);
}
.hero-meta {
  display: flex; align-items: center; gap: var(--s-3);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
  font-size: var(--t-sm);
  color: var(--text-2);
}
.hero-meta .pill {
  border: 1px solid var(--border-strong);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); }
.hero-desc {
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--text-2);
  margin-bottom: var(--s-8);
  max-width: 540px;
}
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }

.hero-dots {
  position: absolute;
  z-index: 3;
  right: var(--s-8);
  bottom: var(--s-12);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.hero-dot {
  width: 8px; height: 28px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.18);
  transition: all var(--d-med);
}
.hero-dot[data-active="true"] { background: var(--accent); height: 44px; }

/* =========================================================================
   Title Detail
   ========================================================================= */
.detail-hero {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  margin-top: calc(-1 * var(--header-h));
  padding-top: calc(var(--header-h) + var(--s-12));
}
.detail-hero .hero-bg { z-index: 0; }
.detail-hero-inner {
  position: relative; z-index: 3;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--s-12);
  align-items: end;
  padding: var(--s-12) 0;
}
@media (max-width: 720px) {
  .detail-hero-inner { grid-template-columns: 1fr; gap: var(--s-6); }
}
.detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
}

.player {
  margin: var(--s-12) 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: black;
  position: relative;
  border: 1px solid var(--border-strong);
}
.player-poster {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.player::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.55) 100%);
  z-index: 1;
}
.player-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 92px; height: 92px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--brand-deeper);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 60px rgba(232,180,71,0.45);
  transition: all var(--d-med) var(--ease-out);
}
.player-play:hover { transform: translate(-50%, -50%) scale(1.05); }
.player-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: var(--s-4) var(--s-5);
  display: flex; align-items: center; gap: var(--s-4);
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: white;
}
.player-bar .progress {
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.player-bar .progress::after {
  content: ""; position: absolute; inset: 0;
  width: 32%;
  background: var(--accent);
  border-radius: inherit;
}
.player-bar .time { font-variant-numeric: tabular-nums; font-size: var(--t-sm); opacity: 0.8; }

/* =========================================================================
   Catalog
   ========================================================================= */
.catalog {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--s-8);
  padding: var(--s-12) 0;
}
@media (max-width: 960px) { .catalog { grid-template-columns: 1fr; } }
.filters {
  position: sticky;
  top: calc(var(--header-h) + var(--s-6));
  align-self: start;
  display: flex; flex-direction: column; gap: var(--s-6);
}
.filter-group h4 {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-3);
  font-weight: 600;
}
.filter-list { display: flex; flex-direction: column; gap: 2px; }
.filter-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--t-sm);
  transition: all var(--d-fast);
  cursor: pointer;
}
.filter-item:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.filter-item[data-active="true"] { background: var(--accent-soft); color: var(--accent); }
.filter-item .count { font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.filter-item[data-active="true"] .count { color: var(--accent); opacity: 0.7; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--t-sm);
  cursor: pointer;
  transition: all var(--d-fast);
}
.chip:hover { border-color: var(--border-strong); color: var(--text-1); }
.chip[data-active="true"] {
  background: var(--text-1);
  color: var(--bg-0);
  border-color: var(--text-1);
}

.catalog-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-6);
  gap: var(--s-4);
  flex-wrap: wrap;
}
.catalog-head .title-row {
  display: flex; align-items: baseline; gap: var(--s-3);
}
.catalog-head .count {
  font-size: var(--t-sm);
  color: var(--text-3);
}
.sort {
  display: flex; align-items: center; gap: var(--s-2);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: var(--t-sm);
  color: var(--text-2);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-6) var(--s-5);
}
.grid .card { width: 100%; }

/* =========================================================================
   Channel page
   ========================================================================= */
.channel-hero {
  position: relative;
  padding: var(--s-12) 0 var(--s-8);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.channel-hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--ch) 0%, transparent 50%);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none; /* decorative overlay must not swallow clicks (e.g. "Все каналы") */
}
/* Keep the back link above the decorative overlay so it stays clickable */
.channel-hero .container { position: relative; z-index: 1; }
.channel-hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: var(--s-8);
}
.channel-mark {
  width: 88px; height: 88px;
  border-radius: var(--r-xl);
  background: var(--ch);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: white;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}
.channel-meta-row {
  display: flex; gap: var(--s-6);
  margin-top: var(--s-3);
  font-size: var(--t-sm);
  color: var(--text-2);
}
.channel-meta-row strong { color: var(--text-1); font-weight: 700; }

/* =========================================================================
   Section / About / Footer
   ========================================================================= */
.section { padding: var(--s-12) 0; }

.cast {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-5);
}
.cast-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); }
.cast-avatar {
  width: 84px; height: 84px;
  border-radius: var(--r-full);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.cast-name { font-size: var(--t-sm); font-weight: 600; }
.cast-role { font-size: 11px; color: var(--text-3); }

.trailer {
  width: 280px;
  flex-shrink: 0;
  cursor: pointer;
}
.trailer-thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-2);
}
.trailer-thumb::after {
  content: "▶";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  padding-left: 3px;
}
.trailer-title { margin-top: var(--s-2); font-size: var(--t-sm); color: var(--text-2); }

.review {
  padding: var(--s-5);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.review-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.review-author { font-weight: 600; }
.review-date { font-size: 11px; color: var(--text-3); }
.review-body { font-size: var(--t-sm); color: var(--text-2); line-height: 1.6; }

.divider-ornament {
  display: flex; align-items: center; gap: var(--s-4);
  color: var(--text-4);
  margin: var(--s-6) 0;
}
.divider-ornament .line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--border-strong), transparent); }

.footer {
  margin-top: auto;
  padding: var(--s-16) 0 var(--s-8);
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.footer-pattern {
  position: absolute; inset: 0;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'><g fill='none' stroke='%23E8B447' stroke-width='1'><path d='M36 8 L60 36 L36 64 L12 36 Z'/><circle cx='36' cy='36' r='8'/><path d='M36 28 L36 44 M28 36 L44 36'/></g></svg>");
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--s-8);
  position: relative;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h5 {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-bottom: var(--s-4);
  font-weight: 600;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: var(--t-sm); color: var(--text-2); transition: color var(--d-fast); }
.footer-links a:hover { color: var(--accent); }
.footer-mission { font-size: var(--t-sm); color: var(--text-2); line-height: 1.6; max-width: 360px; margin-top: var(--s-3); }
.footer-bottom {
  margin-top: var(--s-10);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  color: var(--text-3);
}

/* Page transitions */
.page-enter { animation: pageIn var(--d-slow) var(--ease-out); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   Mobile menu (hamburger + off-canvas drawer)
   ========================================================================= */
.hamburger { display: none; }

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  z-index: 90;
  opacity: 0; pointer-events: none;
  transition: opacity var(--d-med) var(--ease-out);
}
.drawer-overlay[data-open="true"] { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  z-index: 100;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 56px rgba(0,0,0,0.5);
  transform: translateX(100%);
  transition: transform var(--d-med) var(--ease-out);
  display: flex; flex-direction: column;
  padding: var(--s-5);
  overflow-y: auto;
}
.drawer[data-open="true"] { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s-6);
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s-6); }
.drawer-nav a {
  padding: 14px 12px;
  font-size: var(--t-md);
  font-weight: 600;
  color: var(--text-1);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-nav a:hover, .drawer-nav a:active { background: rgba(255,255,255,0.04); }
.drawer-nav a[data-active="true"] { background: var(--accent-soft); color: var(--accent); }
.drawer-section { margin-bottom: var(--s-5); }
.drawer-section h6 {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s-3);
  font-weight: 600;
}

/* =========================================================================
   Responsive — Tablet
   ========================================================================= */
@media (max-width: 1100px) {
  .header-inner { gap: var(--s-4); }
  .search-trigger { min-width: 180px; }
  .nav a { padding: 8px 10px; font-size: 12px; }
}

/* =========================================================================
   Responsive — Mobile (<= 720px)
   ========================================================================= */
@media (max-width: 720px) {
  /* Header */
  .nav, .search-trigger, .lang-toggle { display: none; }
  .hamburger { display: inline-flex; }
  .header { height: 60px; }
  :root { --header-h: 60px; }
  .header-inner { padding: 0 var(--s-5); gap: var(--s-3); }
  .brand-wordmark .w2 { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-wordmark .w1 { font-size: 16px; }
  .avatar { width: 32px; height: 32px; font-size: 12px; }
  .icon-btn { width: 34px; height: 34px; }

  /* Type */
  h1 { font-size: var(--t-2xl); }
  h2 { font-size: var(--t-xl); }
  h3 { font-size: var(--t-lg); }

  /* Cards & rows */
  .card { width: 140px; }
  .card-title { font-size: var(--t-sm); }
  .row-head { padding: 0 var(--s-5); flex-direction: column; align-items: flex-start; gap: var(--s-2); }
  .row-head h2 { font-size: var(--t-lg); }
  .scroller { padding: 4px var(--s-5) var(--s-5); gap: var(--s-3); }
  .row { margin: var(--s-8) 0; }
  .row-arrows { display: none; }

  /* Hero — keep content visible without huge vh on tall portrait phones */
  .hero { min-height: 540px; height: auto; max-height: 700px; padding-top: calc(var(--header-h) + 12px); padding-bottom: var(--s-6); }
  .hero-content { padding-bottom: var(--s-8); max-width: 100%; }
  .hero-title { font-size: clamp(24px, 7vw, 34px) !important; line-height: 1.05; overflow-wrap: anywhere; word-break: break-word; }
  .hero-desc { font-size: var(--t-base); margin-bottom: var(--s-5); }
  .hero-actions { gap: var(--s-2); }
  .hero-actions .btn-lg { height: 48px; padding: 0 18px; font-size: var(--t-sm); }
  .hero-actions .btn-ghost { display: none; }
  .hero-dots { display: none; }
  .hero-meta { gap: var(--s-2); font-size: 12px; }
  .hero-channel { font-size: 10px; margin-bottom: var(--s-3); }

  /* Channel strip on home → horizontal scroll */
  .channel-strip-mobile {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: var(--s-3) !important;
    gap: var(--s-2) !important;
  }
  .channel-strip-mobile > button {
    flex: 0 0 auto !important;
    min-width: 200px;
    scroll-snap-align: start;
  }
  .channel-strip-mobile::-webkit-scrollbar { display: none; }
  .channel-strip-mobile { scrollbar-width: none; }

  /* Mission band */
  .mission-band {
    margin: var(--s-10) var(--s-4) var(--s-4) !important;
    padding: var(--s-8) var(--s-5) !important;
    border-radius: var(--r-xl) !important;
  }
  .mission-band h2 { font-size: var(--t-2xl) !important; }
  .mission-band p { font-size: var(--t-base) !important; }

  /* Detail hero — poster on top, stack everything */
  .detail-hero-inner { gap: var(--s-5) !important; }
  .detail-poster { max-width: 200px; margin: 0 auto; }
  .detail-hero .hero-title { font-size: clamp(22px, 6vw, 32px) !important; overflow-wrap: anywhere; word-break: break-word; }
  .detail-hero .hero-actions { flex-direction: column; align-items: stretch; }
  .detail-hero .hero-actions .btn { width: 100%; }
  .detail-hero .hero-actions .btn-secondary { width: auto; flex: 1; }
  .detail-hero .hero-meta { flex-wrap: wrap; }

  /* Detail content two-column → single */
  .detail-two-col { grid-template-columns: 1fr !important; gap: var(--s-8) !important; }
  .reviews-grid { grid-template-columns: 1fr !important; }
  .cast { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important; gap: var(--s-3) !important; }
  .cast-avatar { width: 64px; height: 64px; font-size: 20px; }
  .trailer { width: 220px; }

  /* Player */
  .player { border-radius: var(--r-md); margin: var(--s-6) 0; }
  .player-play { width: 64px; height: 64px; }
  .player-bar { padding: var(--s-3); gap: var(--s-2); flex-wrap: wrap; }
  .player-bar .time { font-size: 11px; }

  /* Catalog */
  .catalog { padding: var(--s-6) 0; gap: var(--s-5); }
  .filters {
    position: static;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-4);
  }
  .filter-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .filter-item { padding: 6px 10px; font-size: 12px; }
  .filter-item .count { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-4) var(--s-3); }
  .grid .card { width: 100%; }
  .catalog-head { gap: var(--s-3); }
  .sort { font-size: 12px; padding: 6px 10px; }

  /* Channel page hero */
  .channel-hero-inner { flex-direction: column; align-items: flex-start; gap: var(--s-4); text-align: left; }
  .channel-hero-inner > div:last-child { margin-left: 0 !important; width: 100%; }
  .channel-mark { width: 64px; height: 64px; font-size: 22px; }
  .channel-meta-row { flex-wrap: wrap; gap: var(--s-4); font-size: 12px; }

  /* Footer */
  .footer { padding: var(--s-10) 0 var(--s-5); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-mission { font-size: 13px; }
  .footer-bottom { flex-direction: column; gap: var(--s-3); align-items: flex-start; }
}

/* Extra-small */
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .card { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}
