/* fogspace — дизайн в духе Apple: glassmorphism, тёмная тема, синий акцент */

:root {
  --bg: #09090d;
  --bg-elev: #131318;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(18, 20, 28, 0.55);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --muted: #86868b;
  --accent: #0a84ff;
  --accent-strong: #0060df;
  --accent-soft: #64d2ff;
  --gold: #ffd60a;
  --radius: 22px;
  --pad: clamp(16px, 4vw, 76px);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1000px 560px at 82% -12%, rgba(10, 132, 255, 0.12), transparent 60%),
    radial-gradient(820px 520px at -8% 26%, rgba(100, 210, 255, 0.06), transparent 55%),
    radial-gradient(760px 500px at 50% 110%, rgba(10, 132, 255, 0.05), transparent 55%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: rgba(10, 132, 255, 0.35); color: #fff; }

.container {
  width: 100%;
  padding: 0 var(--pad);
}

/* ---------- стеклянная шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(9, 9, 13, 0.6);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  padding-bottom: 14px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--accent-soft), var(--accent) 55%, var(--accent-strong));
  color: #fff;
  font-size: 12px;
  box-shadow: 0 6px 20px -6px rgba(10, 132, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.logo .accent {
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav { display: flex; flex-wrap: wrap; gap: 2px; }

.main-nav a {
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 7px 14px;
  border-radius: 999px;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.main-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

/* ---------- hero (стеклянная панель поверх фона) ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  margin: 0 calc(-1 * var(--pad)) 48px;
  min-height: clamp(460px, 66vh, 700px);
  padding: clamp(24px, 5vw, 64px) var(--pad);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 9, 13, 0.25) 0%, rgba(9, 9, 13, 0.15) 45%, var(--bg) 100%),
    linear-gradient(90deg, rgba(9, 9, 13, 0.4) 0%, transparent 60%);
}

.hero-overlay {
  position: relative;
  z-index: 1;
  max-width: 680px;
  padding: clamp(26px, 4.5vw, 48px);
  border-radius: 30px;
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-overlay h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.06;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-meta {
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 14px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.hero-overview {
  color: #d1d1d6;
  max-width: 600px;
  margin: 0 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- жанры (стеклянные чипы) ---------- */
.genre-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 48px;
}

.genre-chip {
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: 0.87rem;
  color: var(--text-2);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.28s var(--ease);
}

.genre-chip:hover {
  border-color: rgba(10, 132, 255, 0.55);
  color: #fff;
  background: rgba(10, 132, 255, 0.16);
  transform: translateY(-1px);
}

/* ---------- секции / сетка ---------- */
.section { margin: 0 0 52px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-head h1, .section-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.4vw, 1.75rem);
  letter-spacing: -0.02em;
  font-weight: 700;
}

.see-all {
  color: var(--accent-soft);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.25s var(--ease);
}

.see-all:hover { color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 22px;
}

/* ---------- стеклянная карточка ---------- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border-strong);
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(10, 132, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-poster {
  aspect-ratio: 2 / 3;
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
}

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

.card:hover .card-poster img { transform: scale(1.05); }

.rating-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(18, 20, 28, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.no-poster {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: linear-gradient(160deg, #1d1d24, #101014);
}

.no-poster.big { font-size: 1.1rem; }
.no-poster.small { aspect-ratio: 2 / 3; border-radius: var(--radius); }

.card-body { padding: 13px 15px 16px; }

.card-title {
  margin: 0 0 5px;
  font-size: 0.95rem;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- детальная ---------- */
.movie { margin: 0 0 52px; }

.movie-backdrop {
  margin: 0 calc(-1 * var(--pad));
  height: clamp(320px, 52vh, 540px);
  background-size: cover;
  background-position: center 22%;
  background-color: var(--bg-elev);
  position: relative;
}

.movie-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 9, 13, 0.35) 0%, transparent 35%, var(--bg) 98%);
}

.movie-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 32px;
  margin-top: -140px;
  align-items: end;
}

.movie-poster {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.movie-poster img { width: 100%; }

.movie-info { padding-bottom: 6px; }

.movie-info h1 {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-weight: 700;
}

.tagline { color: var(--text-2); font-style: italic; margin: 0 0 20px; }

.facts {
  list-style: none;
  margin: 0 0 24px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.facts li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.facts li > span:first-child {
  color: var(--muted);
  min-width: 110px;
  flex-shrink: 0;
}

.facts a { color: var(--accent-soft); }
.facts a:hover { text-decoration: underline; }

.facts-genres { align-items: flex-start !important; }

.overview { max-width: 800px; color: #d1d1d6; }

.movie-info h2 { font-size: 1.2rem; margin: 28px 0 10px; letter-spacing: -0.01em; }

/* ---------- актёры ---------- */
.cast { margin-top: 40px; }

.cast h2 { font-size: 1.4rem; letter-spacing: -0.02em; }

.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 16px;
}

.cast-item {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.cast-item:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-strong);
}

.cast-item img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--bg-elev);
}

.cast-name {
  margin: 10px 8px 0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
}

.cast-role {
  margin: 2px 8px 12px;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ---------- кнопки / пагинация ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px -10px rgba(10, 132, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
  box-shadow: 0 14px 36px -10px rgba(10, 132, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  margin-top: 34px;
}

.page-info { color: var(--muted); }

/* ---------- футер ---------- */
.site-footer {
  border-top: 1px solid var(--glass-border);
  margin-top: 56px;
  padding: 36px 0 56px;
  background: rgba(255, 255, 255, 0.02);
}

.footer-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 20px;
}

.footer-genres a { color: var(--muted); font-size: 0.88rem; transition: color 0.25s var(--ease); }
.footer-genres a:hover { color: var(--accent-soft); }

.footer-note { color: var(--muted); font-size: 0.82rem; margin: 0; }

.empty { color: var(--muted); }

/* ---------- адаптив ---------- */
@media (max-width: 720px) {
  .hero, .movie-backdrop {
    margin-left: calc(-1 * var(--pad));
    margin-right: calc(-1 * var(--pad));
  }
  .hero { min-height: 520px; }
  .hero-overlay { border-radius: 24px; }
  .movie-layout {
    grid-template-columns: 1fr;
    margin-top: -72px;
    align-items: start;
  }
  .movie-poster { max-width: 190px; }
  .facts { padding: 16px 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px; }
}

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