/* ============================================================
   GGFLIX — Netflix-faithful styling (Phase 2)
   ============================================================ */

:root {
  --bg: #000;
  --surface: #141414;
  --card: #181818;
  --card-2: #232323;
  --text: #ffffff;
  --text-dim: #b3b3b3;
  --text-mute: #808080;
  --red: #e50914;
  --red-hover: #f6121d;
  --match: #46d369;        /* Netflix "% Match" green */
  --accent-blue: #5aa9ff;  /* secondary */
  --accent-purple: #b16cff;/* secondary */
  --header-h: 68px;
  --row-gap: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-card: 0 0 2px rgba(0,0,0,.6), 0 24px 36px -12px rgba(0,0,0,.85);
  --shadow-modal: 0 3px 12px rgba(0,0,0,.7), 0 40px 80px -20px rgba(0,0,0,.85);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }
body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Film grain ------------------------------------------------- */
.grain {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
  opacity: .035; mix-blend-mode: overlay;
}

/* ============================================================
   INTRO IDENT  ("6" — Netflix-style cold open, plays once)
   ============================================================ */
.intro {
  position: fixed; inset: 0; z-index: 10001;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: transparent;
}
.intro .curtain {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    radial-gradient(60vw 80vh at var(--gx) 50%, rgba(229,9,20,.16), transparent 60%),
    #050505;
  z-index: 2;
}
.intro .curtain.left  { left: 0;  --gx: 100%; }
.intro .curtain.right { right: 0; --gx: 0%; }

.intro .six-glow {
  position: absolute; width: 60vmin; height: 60vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(229,9,20,.55), rgba(229,9,20,0) 62%);
  filter: blur(28px); z-index: 3; opacity: 0;
}
.intro .six {
  position: relative; z-index: 4;
  font-family: "Bebas Neue", sans-serif;
  font-size: 58vmin; line-height: 1;
  color: transparent;
  background-image:
    linear-gradient(90deg, transparent 42%, rgba(255,235,235,.95) 50%, transparent 58%),
    repeating-linear-gradient(90deg,
      #5e0006 0 16px, #b00710 16px 26px, #e50914 26px 40px,
      #ff5252 40px 44px, #c20812 44px 60px);
  background-size: 220% 100%, 36px 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0; will-change: transform, opacity, filter;
}

.intro .six             { background-position: -120% 0, 0 0; }
.intro.play .six        { animation: six-in 2.85s var(--ease) forwards, six-ribbon 2.85s linear forwards; }
.intro.play .six-glow   { animation: six-glow 2.85s var(--ease) forwards; }
.intro.play .curtain.left  { animation: curtain-l 2.85s cubic-bezier(.66,0,.2,1) forwards; }
.intro.play .curtain.right { animation: curtain-r 2.85s cubic-bezier(.66,0,.2,1) forwards; }

.intro.done { animation: intro-out .4s var(--ease) forwards; }

@keyframes six-in {
  0%   { opacity: 0; transform: scale(1.65); filter: blur(15px) brightness(2.4); letter-spacing: .22em; }
  20%  { opacity: 1; filter: blur(0) brightness(1.45); }
  46%  { transform: scale(1);    letter-spacing: .01em; filter: brightness(1.05); }
  60%  { transform: scale(1.075); filter: brightness(1.75); }
  70%  { transform: scale(1);    filter: brightness(1); }
  86%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(2.35); filter: blur(7px); }
}
@keyframes six-ribbon {
  from { background-position: -120% 0, 0 0; }
  to   { background-position: 130% 0, -340px 0; }
}
@keyframes six-glow {
  0%,30% { opacity: 0; }
  58%    { opacity: .9; }
  72%    { opacity: .35; }
  100%   { opacity: 0; }
}
@keyframes curtain-l {
  0%, 60% { transform: translateX(0); }
  100%    { transform: translateX(-101%); }
}
@keyframes curtain-r {
  0%, 60% { transform: translateX(0); }
  100%    { transform: translateX(101%); }
}
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
}

/* ============================================================
   PASSCODE GATE
   ============================================================ */
.passgate {
  position: fixed; inset: 0; z-index: 10002;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 600px at 50% 20%, rgba(229,9,20,.16), transparent 60%),
    #000;
  animation: pg-in .35s var(--ease) both;
}
.passgate.done { animation: pg-out .35s var(--ease) forwards; }
@keyframes pg-in  { from { opacity: 0; } }
@keyframes pg-out { to   { opacity: 0; visibility: hidden; } }

.passgate-card {
  width: min(380px, 100%); text-align: center;
  padding: 28px 28px 24px; border-radius: 10px;
  background: rgba(20, 20, 20, .85);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 30px 80px -20px rgba(229, 9, 20, .25);
}
.passgate-card.shake { animation: pg-shake .35s var(--ease); }
@keyframes pg-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
.passgate-logo { font-size: 30px; margin-bottom: 8px; }
.passgate-hint {
  color: var(--text-dim); font-size: 14px; margin-bottom: 22px;
}
.passgate-form { display: flex; gap: 8px; margin-bottom: 12px; }
.passgate-input {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, .08); color: #fff;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 6px;
  padding: 12px 14px; font: 600 16px/1 "Inter", system-ui;
  letter-spacing: .2em; text-align: center;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.passgate-input:focus {
  outline: none;
  border-color: var(--red); background: rgba(255, 255, 255, .12);
}
.passgate-btn {
  background: var(--red); color: #fff; font-weight: 700;
  padding: 0 18px; border-radius: 6px; font-size: 14px;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.passgate-btn:hover { background: var(--red-hover); }
.passgate-btn:active { transform: scale(.96); }
.passgate-err {
  color: #ff7a85; font-size: 13px; min-height: 16px; margin-bottom: 12px;
}
.passgate-tip {
  color: var(--text-mute); font-size: 12px; letter-spacing: .04em;
}

/* Hide row scrollbars ---------------------------------------- */
.scrollbar-none { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* Wordmark --------------------------------------------------- */
.wordmark {
  font-family: "Bebas Neue", sans-serif;
  color: var(--red);
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

/* ============================================================
   PROFILE GATE  ("Who's watching?")
   ============================================================ */
.gate {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px 80px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(229,9,20,.16), transparent 60%),
    radial-gradient(900px 500px at 85% 110%, rgba(177,108,255,.10), transparent 60%),
    var(--bg);
  animation: fade-in .6s var(--ease);
}
.gate-logo {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: clamp(28px, 6vh, 64px);
}
.gate h1 {
  font-size: clamp(28px, 4.4vw, 56px);
  font-weight: 500;
  letter-spacing: -.01em;
  color: #fff;
  margin-bottom: clamp(28px, 5vh, 56px);
  text-align: center;
}
.gate-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 44px);
  width: min(1040px, 92vw);
}
.gate-grid .profile { width: clamp(110px, 11vw, 168px); }
.profile {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transition: transform .28s var(--ease);
}
.profile:hover, .profile:focus-visible { transform: translateY(-4px); }
.profile-avatar {
  position: relative;
  width: clamp(110px, 11vw, 168px);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid transparent;
  transition: border-color .2s var(--ease), box-shadow .28s var(--ease);
  box-shadow: 0 16px 30px -16px rgba(0,0,0,.8);
}
.profile:hover .profile-avatar,
.profile:focus-visible .profile-avatar {
  border-color: #fff;
  box-shadow: 0 22px 44px -18px rgba(229,9,20,.55);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.78) 100%);
}
.profile-avatar .yr {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: .03em;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.6);
}
.profile-name {
  color: var(--text-mute);
  font-size: 15px; font-weight: 500;
  transition: color .2s var(--ease);
  text-align: center;
}
.profile:hover .profile-name,
.profile:focus-visible .profile-name { color: #fff; }
.gate-tagline {
  margin-top: clamp(36px, 7vh, 72px);
  color: var(--text-mute);
  font-size: 15px; letter-spacing: .02em;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 4vw;
  background: linear-gradient(180deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 100%);
  transition: background-color .3s var(--ease);
}
.header.solid { background: var(--surface); }
.header .wordmark { font-size: 30px; }
.nav { display: flex; gap: 20px; }
.nav button {
  color: #e5e5e5; font-size: 14px; font-weight: 500;
  transition: color .2s var(--ease);
}
.nav button:hover { color: var(--text-dim); }
.nav button.active { color: #fff; font-weight: 700; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.icon-btn { width: 24px; height: 24px; color: #fff; opacity: .9; }
.icon-btn:hover { opacity: 1; }

.profile-menu { position: relative; }
.profile-chip {
  display: flex; align-items: center; gap: 8px;
}
.profile-chip .pa {
  width: 34px; height: 34px; border-radius: 5px; overflow: hidden;
  position: relative;
}
.profile-chip .pa img { width: 100%; height: 100%; object-fit: cover; }
.profile-chip .pa .yr {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: "Bebas Neue"; font-size: 17px; background: rgba(0,0,0,.45);
}
.caret { width: 10px; height: 10px; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(45deg); transition: transform .25s var(--ease); }
.profile-menu.open .caret { transform: rotate(-135deg); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 14px);
  background: rgba(0,0,0,.92); border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px; min-width: 200px; padding: 8px 0;
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.profile-menu.open .dropdown { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown::before {
  content: ""; position: absolute; top: -6px; right: 22px;
  border: 6px solid transparent; border-bottom-color: rgba(255,255,255,.12);
}
.dropdown li > button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 14px; font-size: 13px; color: #e5e5e5;
  transition: color .15s var(--ease);
}
.dropdown li > button:hover { color: #fff; text-decoration: underline; }
.dropdown .mini {
  width: 24px; height: 24px; border-radius: 4px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-family: "Bebas Neue"; font-size: 13px; flex: none;
}
.dropdown .sep { height: 1px; background: rgba(255,255,255,.14); margin: 8px 0; }
.dropdown .manage { color: var(--text-dim); }

/* ============================================================
   HERO BILLBOARD
   ============================================================ */
.browse { animation: fade-in .5s var(--ease); padding-bottom: 60px; }

.hero {
  position: relative;
  height: 82vh; min-height: 560px;
  display: flex; align-items: flex-end;
  padding: 0 4vw 0;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-bg img,
.hero-bg video {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 22%;
  animation: ken-burns 26s ease-in-out infinite alternate;
}
@keyframes ken-burns {
  from { transform: scale(1.04) translate(0, 0); }
  to   { transform: scale(1.16) translate(-1.5%, -1%); }
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(77deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.5) 36%, rgba(0,0,0,0) 68%),
    linear-gradient(0deg, var(--bg) 0%, rgba(0,0,0,.6) 20%, rgba(0,0,0,0) 46%);
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 600px;
  padding-bottom: clamp(60px, 16vh, 150px);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-weight: 700; letter-spacing: .22em;
  font-size: 13px; text-transform: uppercase; margin-bottom: 14px;
}
.hero-kicker .n {
  font-family: "Bebas Neue"; color: var(--red); font-size: 22px; letter-spacing: .06em;
}
.hero-title {
  font-size: clamp(34px, 5.4vw, 76px);
  font-weight: 900; line-height: .98; letter-spacing: -.03em;
  text-shadow: 0 4px 26px rgba(0,0,0,.55);
  margin-bottom: 18px;
}
.hero-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px; color: #ddd; margin-bottom: 16px;
}
.hero-meta .match { color: var(--match); font-weight: 700; }
.hero-meta .pill {
  border: 1px solid rgba(255,255,255,.4); padding: 1px 7px; font-size: 12px;
  border-radius: 3px; color: #ddd;
}
.hero-synopsis {
  font-size: clamp(15px, 1.15vw, 18px); line-height: 1.5;
  color: #e6e6e6; max-width: 540px;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  margin-bottom: 26px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-rating {
  position: absolute; right: 0; bottom: clamp(60px, 16vh, 150px); z-index: 2;
  display: flex; align-items: center;
  background: rgba(51,51,51,.55);
  border-left: 3px solid rgba(255,255,255,.55);
  padding: 8px 26px 8px 14px; font-size: 14px; color: #fff;
}

/* Buttons ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: clamp(14px, 1.1vw, 18px); font-weight: 700;
  padding: 11px 26px; border-radius: 5px;
  transition: transform .15s var(--ease), background-color .2s var(--ease), opacity .2s var(--ease);
}
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: scale(.96); }
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255,255,255,.78); }
.btn-info { background: rgba(109,109,110,.55); color: #fff; }
.btn-info:hover { background: rgba(109,109,110,.35); }

/* circular icon actions (used on cards & modal) */
.round {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(42,42,42,.6); color: #fff;
  transition: transform .15s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.round:hover { border-color: #fff; background: rgba(70,70,70,.7); transform: scale(1.06); }
.round svg { width: 18px; height: 18px; }
.round.on { background: #fff; color: #111; border-color: #fff; }
.round.filled { background: #fff; color: #111; border-color: #fff; }

/* ============================================================
   ROWS
   ============================================================ */
.rows { margin-top: -11vh; position: relative; z-index: 5; }
.row { margin: 0 0 2.2vw; }
.row-head {
  display: flex; align-items: baseline; gap: 14px;
  padding: 0 4vw; margin-bottom: 10px;
}
.row-title { font-size: clamp(15px, 1.5vw, 24px); font-weight: 700; color: #e5e5e5; }
.row-explore {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--accent-blue); opacity: 0;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  letter-spacing: .04em; transform: translateX(-4px);
}
.row-explore svg { width: 12px; height: 12px; }
.row:hover .row-explore { opacity: 1; transform: translateX(0); }

.row-track-wrap { position: relative; }
.row-track {
  display: flex; gap: var(--row-gap);
  overflow-x: auto; scroll-behavior: smooth;
  padding: 30px 4vw;             /* vertical room for hover scale */
  margin: -30px 0;
}
.row-arrow {
  position: absolute; top: 0; bottom: 0; width: 4vw; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: #fff;
  opacity: 0; transition: opacity .2s var(--ease), background-color .2s var(--ease);
}
.row-track-wrap:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgba(0,0,0,.75); }
.row-arrow svg { width: 28px; height: 28px; transition: transform .15s var(--ease); }
.row-arrow:hover svg { transform: scale(1.3); }
.row-arrow.left { left: 0; } .row-arrow.right { right: 0; }

/* Card (16:9 landscape still) -------------------------------- */
.card {
  position: relative; flex: 0 0 auto;
  width: clamp(180px, 16.4vw, 270px);
  border-radius: 5px;
  transition: transform .3s var(--ease);
  will-change: transform;
}
.card-img {
  position: relative; aspect-ratio: 16/9; border-radius: 5px;
  overflow: hidden; background: var(--card);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-fallback-title {
  position: absolute; inset: auto 0 0 0; padding: 10px 12px;
  font-weight: 800; font-size: 15px; letter-spacing: -.01em;
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
}
.card-badge {
  position: absolute; top: 8px; left: 0;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px 3px 7px;
  border-radius: 0 3px 3px 0;
}
.card-tagtype {
  position: absolute; top: 8px; right: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #fff; background: rgba(0,0,0,.55); padding: 3px 7px; border-radius: 3px;
  backdrop-filter: blur(2px);
}

/* Hover preview popover */
.card-pop {
  position: absolute; left: 50%; top: 0;
  width: 0; opacity: 0; pointer-events: none;
  transform: translate(-50%, 0) scale(.85);
  transform-origin: center top;
  border-radius: 6px; overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-card);
  transition: opacity .18s var(--ease), transform .26s var(--ease);
  z-index: 30;
}
.card:hover { z-index: 40; }
.card:hover .card-pop {
  width: 340px; opacity: 1; pointer-events: auto;
  transform: translate(-50%, -22%) scale(1);
  transition-delay: .28s;
}
.card-pop .pop-img { aspect-ratio: 16/9; position: relative; }
.card-pop .pop-img img { width: 100%; height: 100%; object-fit: cover; }
.card-pop .pop-img .grad {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--card) 2%, transparent 38%);
}
.pop-body { padding: 12px 16px 16px; }
.pop-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pop-actions .spacer { flex: 1; }
.pop-meta { display: flex; align-items: center; gap: 9px; font-size: 13px; margin-bottom: 9px; }
.pop-meta .match { color: var(--match); font-weight: 700; }
.pop-meta .pill {
  border: 1px solid rgba(255,255,255,.35); font-size: 11px; padding: 0 6px; border-radius: 3px;
  color: #ccc;
}
.pop-genres {
  display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #ddd;
}
.pop-genres .dot { color: var(--text-mute); }

/* Top 10 variant -------------------------------------------- */
.row.top10 .row-track { padding-left: 5.4vw; }
.card.rank { width: clamp(220px, 21vw, 340px); display: flex; align-items: flex-end; }
.card.rank .rank-num {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(120px, 13vw, 210px);
  line-height: .72; color: #141414;
  -webkit-text-stroke: 4px #636363;
  margin-right: -2vw; flex: none; user-select: none;
  letter-spacing: -.04em;
}
.card.rank .poster {
  flex: 0 0 auto; width: clamp(115px, 11.5vw, 185px);
  aspect-ratio: 2/3; border-radius: 4px; overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .3s var(--ease);
}
.card.rank:hover .poster { transform: scale(1.06); }
.card.rank .poster img { width: 100%; height: 100%; object-fit: cover; }

/* Hover preview popover (fixed, JS-positioned) -------------- */
.hpop {
  position: fixed; z-index: 250;
  border-radius: 6px; overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-card);
  opacity: 0; transform: translateY(8px) scale(.92);
  transform-origin: center bottom;
  transition: opacity .2s var(--ease), transform .26s var(--ease);
}
.hpop.open { opacity: 1; transform: translateY(-26%) scale(1); }
.hpop-img { aspect-ratio: 16/9; position: relative; cursor: pointer; }
.hpop-img img { width: 100%; height: 100%; object-fit: cover; }
.hpop-img .grad {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--card) 2%, transparent 42%);
}
.hpop-body { padding: 4px 16px 16px; }
.hpop-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.hpop-actions .round { width: 36px; height: 36px; }
.hpop-meta { display: flex; align-items: center; gap: 9px; font-size: 13px; margin-bottom: 9px; }
.hpop-meta .match { color: var(--match); font-weight: 700; }
.hpop-meta .pill {
  border: 1px solid rgba(255,255,255,.35); font-size: 11px; padding: 0 6px; border-radius: 3px;
  color: #ccc;
}
.hpop-genres {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13px; color: #ddd;
}
.hpop-genres .dot { color: var(--text-mute); margin: 0 2px; }

/* ============================================================
   DETAIL MODAL
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.7);
  display: flex; justify-content: center;
  overflow-y: auto; padding: 50px 0 80px;
  opacity: 0; transition: opacity .25s var(--ease);
}
.scrim.show { opacity: 1; }
.scrim::-webkit-scrollbar { width: 0; }

.modal {
  width: min(900px, 92vw);
  background: var(--card);
  border-radius: 8px; overflow: hidden;
  box-shadow: var(--shadow-modal);
  transform: translateY(28px) scale(.98);
  transition: transform .3s var(--ease);
  height: max-content;
}
.scrim.show .modal { transform: translateY(0) scale(1); }

.modal-hero { position: relative; aspect-ratio: 16/9; }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.modal-hero .grad {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, var(--card) 1%, transparent 36%),
    linear-gradient(77deg, rgba(20,20,20,.7) 0%, transparent 45%);
}
.modal-close {
  position: absolute; top: 18px; right: 18px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: #181818; color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s var(--ease), background-color .2s var(--ease);
}
.modal-close:hover { background: #2a2a2a; transform: rotate(90deg); }
.modal-close svg { width: 18px; height: 18px; }

.modal-hero-text {
  position: absolute; left: 48px; bottom: 36px; right: 48px; z-index: 4;
}
.modal-hero-text h2 {
  font-size: clamp(26px, 3.4vw, 46px); font-weight: 900;
  letter-spacing: -.03em; line-height: 1; margin-bottom: 18px;
  text-shadow: 0 3px 18px rgba(0,0,0,.6);
}
.modal-hero-actions { display: flex; align-items: center; gap: 12px; }

.modal-body { padding: 26px 48px 40px; }
.modal-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 28px; }
.modal-meta-line {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px; color: #ddd; margin-bottom: 16px;
}
.modal-meta-line .match { color: var(--match); font-weight: 700; }
.modal-meta-line .pill {
  border: 1px solid rgba(255,255,255,.35); padding: 0 7px; border-radius: 3px;
  font-size: 12px;
}
.modal-meta-line .hd {
  font-size: 10px; font-weight: 800; border: 1px solid rgba(255,255,255,.35);
  padding: 0 5px; border-radius: 3px; letter-spacing: .06em;
}
.modal-synopsis { font-size: 15px; line-height: 1.55; color: #f3f3f3; }
.modal-side { font-size: 14px; line-height: 1.7; }
.modal-side .lbl { color: var(--text-mute); }
.modal-side .val { color: #e5e5e5; }
.modal-side a { color: #e5e5e5; }
.modal-side a:hover { text-decoration: underline; }

/* Episodes list */
.episodes { margin-top: 38px; }
.episodes-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.episodes-head h3 { font-size: 22px; font-weight: 700; }
.episode {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 10px; border-top: 1px solid rgba(255,255,255,.12);
  cursor: pointer; border-radius: 6px;
  transition: background-color .18s var(--ease);
}
.episode:hover { background: var(--card-2); }
.episode .ep-n { font-size: 22px; color: var(--text-dim); width: 26px; text-align: center; flex: none; }
.episode .ep-thumb {
  width: 146px; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; flex: none;
  position: relative; background: var(--surface);
}
.episode .ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode .ep-thumb .play-mini {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; background: rgba(0,0,0,.35); transition: opacity .2s var(--ease);
}
.episode:hover .ep-thumb .play-mini { opacity: 1; }
.episode .ep-thumb .play-mini svg { width: 30px; height: 30px; }
.ep-text { flex: 1; min-width: 0; }
.ep-text .ep-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.ep-text .ep-title { font-size: 16px; font-weight: 600; }
.ep-text .ep-dur { color: var(--text-dim); font-size: 14px; flex: none; }
.ep-text .ep-desc { color: var(--text-dim); font-size: 14px; line-height: 1.45; }

/* Photos gallery (movie) */
.gallery-h { font-size: 22px; font-weight: 700; margin: 38px 0 16px; }
.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.gallery .g-cell {
  aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; background: var(--surface);
  cursor: pointer; position: relative;
}
.gallery .g-cell img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s var(--ease);
}
.gallery .g-cell:hover img { transform: scale(1.06); }

/* More like this */
.more-h { font-size: 22px; font-weight: 700; margin: 40px 0 16px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.more-card {
  background: var(--card-2); border-radius: 6px; overflow: hidden; cursor: pointer;
  transition: background-color .2s var(--ease);
}
.more-card:hover { background: #2f2f2f; }
.more-card .mc-img { aspect-ratio: 16/9; position: relative; }
.more-card .mc-img img { width: 100%; height: 100%; object-fit: cover; }
.more-card .mc-body { padding: 12px 14px 16px; }
.more-card .mc-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; margin-bottom: 8px;
}
.more-card .mc-top .yr { color: var(--text-dim); }
.more-card .mc-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.more-card .mc-desc { font-size: 13px; color: var(--text-dim); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Letters & Notes (Gmail) ----------------------------------- */
.letters { margin: 40px 0 8px; }
.letters-h { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.letters-h span { color: var(--text-mute); font-weight: 500; }
.letter {
  background: var(--card-2); border-radius: 8px;
  padding: 16px 20px; margin-bottom: 12px;
  border-left: 3px solid var(--red);
}
.letter.her { border-left-color: var(--accent-purple); }
.letter.you { border-left-color: var(--accent-blue); }
.letter-top {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.letter-who {
  font-weight: 800; font-size: 14px; letter-spacing: .02em;
  color: #fff;
}
.letter.her .letter-who { color: #d6b3ff; }
.letter.you .letter-who { color: #b9d8ff; }
.letter-sub {
  flex: 1; min-width: 120px; color: #e8e8e8; font-size: 14px;
  font-weight: 600; font-style: italic;
}
.letter-date { color: var(--text-mute); font-size: 12px; flex: none; }
.letter-body {
  color: #dcdcdc; font-size: 14.5px; line-height: 1.75;
  white-space: normal; max-height: 320px; overflow-y: auto;
}
.letter-body.muted { color: var(--text-mute); font-style: italic; }
.letter-body::-webkit-scrollbar { width: 6px; }
.letter-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.18); border-radius: 3px;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .25s var(--ease);
}
.lightbox.show { opacity: 1; }
.lightbox figure { max-width: 86vw; max-height: 86vh; text-align: center; }
.lightbox img {
  max-width: 86vw; max-height: 76vh; border-radius: 6px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
  transform: scale(.96); transition: transform .3s var(--ease);
}
.lightbox.show img { transform: scale(1); }
.lightbox figcaption { margin-top: 16px; color: #ddd; font-size: 15px; }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-btn:active { transform: translateY(-50%) scale(.92); }
.lb-btn svg { width: 26px; height: 26px; }
.lb-prev { left: 3vw; } .lb-next { right: 3vw; }
.lb-close { position: absolute; top: 26px; right: 3vw; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255,255,255,.1); color: #fff;
  display: flex; align-items: center; justify-content: center; }
.lb-close:hover { background: rgba(255,255,255,.22); }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  padding: 50px 4vw 40px; color: var(--text-mute); font-size: 13px;
  text-align: center; line-height: 1.7;
}
.foot .wordmark { font-size: 22px; display: inline-block; margin-bottom: 10px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hero-bg img, .hero-bg video { animation: none; }
  * { transition-duration: .001ms !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* Mobile tab bar (Netflix-app style): hidden by default. */
.mobile-tabs { display: none; }

@media (max-width: 900px) {
  .modal-grid { grid-template-columns: 1fr; gap: 14px; }
  .gallery, .more-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-rating { display: none; }
  .nav { display: none; }                       /* inline nav off on mobile */
  .modal-body { padding: 22px 24px 32px; }
  .modal-hero-text { left: 24px; right: 24px; bottom: 22px; }

  .mobile-tabs {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    padding: 8px 4px calc(env(safe-area-inset-bottom, 0px) + 8px);
    background: rgba(0, 0, 0, .92);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid rgba(255, 255, 255, .07);
  }
  .mobile-tabs button {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: #9a9a9a; padding: 4px 4px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
    transition: color .15s var(--ease);
  }
  .mobile-tabs button svg { width: 22px; height: 22px; opacity: .85; }
  .mobile-tabs button.active { color: #fff; }
  .mobile-tabs button.active svg { opacity: 1; }
  .browse { padding-bottom: 86px; }              /* clear the bottom bar */
}
@media (max-width: 600px) {
  .hero { height: 72vh; min-height: 460px; }
  .card { width: 62vw; }
  .card:hover .card-pop { width: 78vw; }
  .gallery, .more-grid { grid-template-columns: 1fr; }
  .episode .ep-thumb { width: 104px; }
  .header { gap: 14px; padding: 0 5vw; }
}
