/* ==========================================================================
   CINEMA — design tokens
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
  --bg-0:#08090d;          /* самый глубокий фон */
  --bg-1:#0e1117;          /* базовый фон страницы */
  --bg-2:#151923;          /* поверхности / карточки */
  --bg-3:#1c212e;          /* приподнятые поверхности, hover */
  --border:#232838;
  --border-soft:#1a1f2b;

  --gold:#d4a054;
  --gold-bright:#f0c375;
  --gold-dim:#8a6a3a;

  --text-0:#f3f4f7;
  --text-1:#c7cad3;
  --text-2:#8a90a0;
  --text-3:#565c6c;

  --danger:#e0605a;
  --success:#5ec98f;

  --radius-s:6px;
  --radius-m:10px;
  --radius-l:16px;

  --font-display:'Bebas Neue', sans-serif;
  --font-body:'Manrope', system-ui, -apple-system, sans-serif;

  --shadow-card: 0 8px 24px rgba(0,0,0,.35);
  --shadow-pop: 0 20px 60px rgba(0,0,0,.55);
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg-1);
  color:var(--text-0);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }
ul{ list-style:none; margin:0; padding:0; }

::selection{ background:var(--gold-dim); color:var(--text-0); }

::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:var(--bg-1); }
::-webkit-scrollbar-thumb{ background:var(--bg-3); border-radius:10px; border:2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover{ background:var(--gold-dim); }

.icon{ width:1em; height:1em; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; vertical-align:-0.15em; }

/* film-strip signature motif — perforated divider used across the site */
.filmstrip{
  height:14px;
  background-image:
    radial-gradient(circle, var(--bg-0) 3px, transparent 3.2px);
  background-size:22px 14px;
  background-position:center;
  background-repeat:repeat-x;
  background-color:var(--gold-dim);
  opacity:.5;
}
.filmstrip.thin{ height:8px; background-size:16px 8px; }

/* ==========================================================================
   Layout shells
   ========================================================================== */
.container{ max-width:1400px; margin:0 auto; padding:0 32px; }
@media (max-width:768px){ .container{ padding:0 18px; } }

.header{
  position:sticky; top:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 32px;
  background:linear-gradient(180deg, rgba(8,9,13,.95), rgba(8,9,13,.75) 70%, transparent);
  backdrop-filter:blur(6px);
  transition:background .3s ease, padding .3s ease;
}
.header.scrolled{ background:rgba(8,9,13,.96); padding:12px 32px; border-bottom:1px solid var(--border-soft); }
@media (max-width:768px){ .header{ padding:14px 18px; } }

.logo{
  display:flex; align-items:center; gap:8px;
  font-family:var(--font-display);
  font-size:26px; letter-spacing:1px;
  color:var(--text-0);
}
.logo .icon{ color:var(--gold); width:24px; height:24px; }
.logo b{ color:var(--gold); font-weight:400; }

.nav{ display:flex; align-items:center; gap:28px; }
.nav a{
  font-size:14px; font-weight:600; color:var(--text-2);
  letter-spacing:.3px; transition:color .2s;
  position:relative; padding:6px 0;
}
.nav a:hover, .nav a.active{ color:var(--text-0); }
.nav a.active::after{
  content:''; position:absolute; left:0; right:0; bottom:-2px; height:2px; background:var(--gold);
}
@media (max-width:900px){ .nav{ display:none; } }

.header-actions{ display:flex; align-items:center; gap:14px; }
.search-toggle, .menu-toggle{
  display:flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:50%;
  background:transparent; border:1px solid var(--border);
  color:var(--text-1); transition:all .2s;
}
.search-toggle:hover, .menu-toggle:hover{ border-color:var(--gold); color:var(--gold); }
.menu-toggle{ display:none; }
@media (max-width:900px){ .menu-toggle{ display:flex; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero{
  position:relative;
  min-height:88vh;
  display:flex; align-items:flex-end;
  padding:0 0 64px;
  margin-top:-82px;
}
.hero-bg{
  position:absolute; inset:0; z-index:0;
  background-size:cover; background-position:center top;
}
.hero-bg::after{
  content:'';
  position:absolute; inset:0;
  background:
    linear-gradient(180deg, rgba(8,9,13,.15) 0%, rgba(8,9,13,.55) 55%, var(--bg-1) 100%),
    linear-gradient(90deg, rgba(8,9,13,.92) 0%, rgba(8,9,13,.35) 45%, rgba(8,9,13,.05) 70%);
}
.hero-content{ position:relative; z-index:1; max-width:640px; padding:0 32px; }
@media (max-width:768px){ .hero-content{ padding:0 18px; } .hero{ min-height:76vh; } }

.hero-eyebrow{
  display:flex; align-items:center; gap:8px;
  font-size:13px; font-weight:700; letter-spacing:2px; text-transform:uppercase;
  color:var(--gold); margin-bottom:14px;
}
.hero-title{
  font-family:var(--font-display);
  font-size:clamp(42px, 7vw, 84px);
  line-height:.95; letter-spacing:.5px;
  margin:0 0 18px;
  color:var(--text-0);
}
.hero-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-bottom:18px; color:var(--text-1); font-size:14px; font-weight:600; }
.hero-meta .rating{ display:flex; align-items:center; gap:5px; color:var(--gold-bright); }
.hero-meta .dot{ width:4px; height:4px; border-radius:50%; background:var(--text-3); }
.badge{
  display:inline-flex; align-items:center; padding:3px 9px;
  border:1px solid var(--border); border-radius:4px;
  font-size:11px; font-weight:700; letter-spacing:.5px; color:var(--text-2);
}
.hero-desc{ color:var(--text-1); font-size:16px; line-height:1.6; margin-bottom:28px; max-width:560px; }
.hero-actions{ display:flex; gap:14px; flex-wrap:wrap; }

.btn{
  display:inline-flex; align-items:center; gap:9px;
  padding:14px 26px; border-radius:var(--radius-s);
  font-size:14px; font-weight:700; letter-spacing:.3px;
  border:1px solid transparent; transition:all .2s ease;
}
.btn-primary{ background:var(--gold); color:#1a1206; }
.btn-primary:hover{ background:var(--gold-bright); transform:translateY(-1px); }
.btn-ghost{ background:rgba(255,255,255,.06); color:var(--text-0); border-color:var(--border); backdrop-filter:blur(4px); }
.btn-ghost:hover{ background:rgba(255,255,255,.12); border-color:var(--text-2); }
.btn-danger{ background:transparent; color:var(--danger); border-color:rgba(224,96,90,.4); }
.btn-danger:hover{ background:rgba(224,96,90,.12); }
.btn-sm{ padding:9px 16px; font-size:13px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ==========================================================================
   Sections & rows
   ========================================================================== */
.section{ padding:52px 0; }
.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin-bottom:22px; }
.section-title{ font-family:var(--font-display); font-size:30px; letter-spacing:.5px; }
.section-title .accent{ color:var(--gold); }
.section-link{ font-size:13px; font-weight:700; color:var(--text-2); display:flex; align-items:center; gap:5px; transition:color .2s; }
.section-link:hover{ color:var(--gold); }

.row-scroll{
  display:flex; gap:18px; overflow-x:auto; padding:6px 32px 20px;
  scroll-snap-type:x proximity;
  margin:0 -32px;
}
.row-scroll::-webkit-scrollbar{ height:6px; }
@media (max-width:768px){ .row-scroll{ padding:6px 18px 20px; margin:0 -18px; gap:12px; } }

/* ==========================================================================
   Movie card
   ========================================================================== */
.card{
  position:relative;
  flex:0 0 200px;
  scroll-snap-align:start;
  border-radius:var(--radius-m);
  overflow:hidden;
  background:var(--bg-2);
  border:1px solid var(--border-soft);
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor:pointer;
}
.card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-card); border-color:var(--gold-dim); }
.card-poster{ position:relative; aspect-ratio:2/3; background:var(--bg-3); overflow:hidden; }
.card-poster img{ width:100%; height:100%; object-fit:cover; transition:transform .4s ease; }
.card:hover .card-poster img{ transform:scale(1.06); }
.card-play{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  background:rgba(8,9,13,0); opacity:0; transition:all .25s ease;
}
.card:hover .card-play{ opacity:1; background:rgba(8,9,13,.35); }
.card-play .icon{ width:42px; height:42px; color:var(--gold-bright); filter:drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.card-quality{ position:absolute; top:8px; left:8px; padding:2px 7px; font-size:10px; font-weight:800; background:var(--bg-0); color:var(--gold); border-radius:4px; letter-spacing:.4px; }
.card-rating{ position:absolute; top:8px; right:8px; display:flex; align-items:center; gap:3px; padding:2px 7px; font-size:11px; font-weight:700; background:rgba(8,9,13,.75); border-radius:4px; color:var(--gold-bright); }
.card-rating .icon{ width:11px; height:11px; }
.card-body{ padding:12px 12px 14px; }
.card-title{ font-size:14px; font-weight:700; color:var(--text-0); margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.card-sub{ font-size:12px; color:var(--text-3); display:flex; gap:6px; align-items:center; }

/* grid layout for catalog page */
.grid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr));
  gap:20px 18px;
}
@media (max-width:520px){ .grid{ grid-template-columns:repeat(2, 1fr); gap:14px 10px; } .card{ flex-basis:auto; } }

/* ==========================================================================
   Filters
   ========================================================================== */
.filters{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:28px; }
.filter-select, .search-input{
  background:var(--bg-2); border:1px solid var(--border);
  color:var(--text-0); padding:10px 14px; border-radius:var(--radius-s);
  font-size:13px; font-weight:600; outline:none; transition:border-color .2s;
}
.filter-select:focus, .search-input:focus{ border-color:var(--gold-dim); }
.search-wrap{ position:relative; flex:1; min-width:220px; }
.search-wrap .icon{ position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--text-3); width:16px; height:16px; }
.search-wrap input{ width:100%; padding-left:36px; }

/* ==========================================================================
   Movie detail page
   ========================================================================== */
.detail-hero{ position:relative; min-height:64vh; display:flex; align-items:flex-end; margin-top:-82px; }
.detail-grid{ display:grid; grid-template-columns:260px 1fr; gap:36px; position:relative; z-index:1; padding:0 32px 40px; width:100%; }
@media (max-width:900px){ .detail-grid{ grid-template-columns:1fr; padding:0 18px 32px; } }
.detail-poster{ border-radius:var(--radius-m); overflow:hidden; border:1px solid var(--border); box-shadow:var(--shadow-pop); aspect-ratio:2/3; background:var(--bg-2); }
.detail-poster img{ width:100%; height:100%; object-fit:cover; }
@media (max-width:900px){ .detail-poster{ width:160px; } }

.player-wrap{ background:#000; border-radius:var(--radius-m); overflow:hidden; aspect-ratio:16/9; margin:36px 0; border:1px solid var(--border); }
.player-wrap video, .player-wrap iframe{ width:100%; height:100%; border:0; }
.player-placeholder{
  width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; color:var(--text-2); background:radial-gradient(circle at center, var(--bg-3), var(--bg-0));
}
.player-placeholder .icon{ width:56px; height:56px; color:var(--gold); }

.meta-table{ display:grid; grid-template-columns:auto 1fr; gap:8px 20px; font-size:14px; margin:22px 0; }
.meta-table dt{ color:var(--text-3); font-weight:600; }
.meta-table dd{ margin:0; color:var(--text-1); }

.genre-tags{ display:flex; gap:8px; flex-wrap:wrap; }
.genre-tag{ padding:4px 11px; border:1px solid var(--border); border-radius:20px; font-size:12px; color:var(--text-2); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer{ border-top:1px solid var(--border-soft); padding:40px 0; margin-top:60px; color:var(--text-3); font-size:13px; }
.footer-row{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:14px; }
.footer a{ color:var(--text-2); transition:color .2s; }
.footer a:hover{ color:var(--gold); }

/* ==========================================================================
   Empty / loading states
   ========================================================================== */
.empty-state{ text-align:center; padding:80px 20px; color:var(--text-2); }
.empty-state .icon{ width:44px; height:44px; color:var(--text-3); margin-bottom:16px; }
.empty-state h3{ color:var(--text-0); font-size:18px; margin:0 0 6px; }
.skeleton{ background:linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:var(--radius-m); }
@keyframes shimmer{ 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }

/* ==========================================================================
   Mobile nav drawer
   ========================================================================== */
.mobile-nav{
  position:fixed; inset:0; z-index:200; display:none;
  background:rgba(8,9,13,.7); backdrop-filter:blur(4px);
}
.mobile-nav.open{ display:block; }
.mobile-nav-panel{
  position:absolute; top:0; right:0; bottom:0; width:78%; max-width:320px;
  background:var(--bg-1); border-left:1px solid var(--border); padding:24px;
  display:flex; flex-direction:column; gap:6px;
  animation:slideIn .25s ease;
}
@keyframes slideIn{ from{ transform:translateX(100%); } to{ transform:translateX(0); } }
.mobile-nav a{ padding:14px 4px; font-size:16px; font-weight:700; color:var(--text-1); border-bottom:1px solid var(--border-soft); }
.mobile-nav .close-btn{ align-self:flex-end; margin-bottom:12px; }

/* reduced motion */
@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}
