/* ════════════════════════════════════════════════════════════
   AICUEVANA HOME PAGE STYLESHEET
   Based on the AICUEVANA design system.
   ════════════════════════════════════════════════════════════ */

/* Fonts (Outfit, Space Grotesk) load async via <link> in home.html head —
   an @import here was render-blocking and cancel-restart-prone on rapid nav. */

/* ── DESIGN TOKENS ── */
:root {
  --bg:          260 30% 4%;
  --surface-1:   260 28% 7%;
  --surface-2:   260 25% 10%;
  --surface-3:   260 20% 13%;
  --fg:          260 10% 97%;
  --fg-muted:    260  8% 65%;
  --fg-subtle:   260  6% 38%;
  --cyan:        180 100% 50%;
  --violet:      280 100% 60%;
  --pink:        320 100% 55%;
  --gold:         43  96% 56%;
  --color-movie:   0  84% 60%;
  --color-series:217  91% 60%;
  --color-short: 280  80% 60%;
  --border-xs:   rgba(255,255,255,0.04);
  --border-sm:   rgba(255,255,255,0.06);
  --border-md:   rgba(255,255,255,0.10);
  --border-lg:   rgba(255,255,255,0.16);
  --border-xl:   rgba(255,255,255,0.24);
  --border-2xl:  rgba(255,255,255,0.35);
  --glass-card:  rgba(14, 6, 34, 0.76);
  --glass-deep:  rgba(5, 3, 14, 0.93);
  --glass-btn:   rgba(18, 9, 38, 0.55);
  --blur-md:     blur(16px);
  --blur-lg:     blur(24px);
  --r-xs:        0.375rem;
  --r-sm:        0.625rem;
  --r-md:        0.875rem;
  --r-base:      1rem;
  --r-lg:        1.25rem;
  --r-xl:        1.5rem;
  --r-pill:      999px;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.35);
  --shadow-hover:0 16px 48px rgba(0,0,0,0.55);
  --glow-cyan-rest:  0 0 15px hsl(var(--cyan) / 0.30);
  --glow-cyan-hover: 0 0 28px hsl(var(--cyan) / 0.55);
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --dur-sm:      0.18s;
  --dur-md:      0.30s;
  --font-ui:     'Outfit', system-ui, -apple-system, sans-serif;
  --font-brand:  'Space Grotesk', system-ui, sans-serif;
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem;
  --sp-4: 1rem;    --sp-5: 1.25rem; --sp-6: 1.5rem;
  --sp-8: 2rem;    --sp-10: 2.5rem; --sp-12: 3rem; --sp-16: 4rem;
  --z-below: -1; --z-base: 0; --z-raised: 10;
  --z-dropdown: 40; --z-fab: 35;
}

/* ── BASE ── */
* { box-sizing: border-box; }
body {
  font-family: var(--font-ui);
  color: hsl(var(--fg));
  background: hsl(var(--bg));
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ── AMBIENT BACKGROUND ── */
.ambient-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-below);
  overflow: hidden;
}
.ambient-blob {
  position: absolute;
  border-radius: var(--r-pill);
  filter: blur(90px);
  will-change: transform;
  animation: ambientDrift 14s ease-in-out infinite;
  opacity: 0.6;
}
.ambient-blob--pink   { background: rgba(255, 20, 147, 0.14); }
.ambient-blob--violet { background: rgba(153, 51, 255, 0.12); }
.ambient-blob--cyan   { background: rgba(0, 255, 255, 0.08); }
@keyframes ambientDrift {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25%      { transform: translate(3%, 5%) scale(1.04) rotate(90deg); }
  50%      { transform: translate(-2%, 3%) scale(0.96) rotate(180deg); }
  75%      { transform: translate(4%, -3%) scale(1.02) rotate(270deg); }
}

/* ── HERO ── */
.hero {
  position: relative;
  width: 100%;
  height: clamp(520px, 70vh, 760px);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}
.hero-video.ready { opacity: 1; }
.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    hsl(var(--bg)) 0%,
    hsl(var(--bg) / 0.85) 25%,
    hsl(var(--bg) / 0.35) 55%,
    hsl(var(--bg) / 0.15) 75%,
    transparent 100%
  );
}
.hero-meta {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6) var(--sp-12);
}
.hero-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: hsl(var(--cyan));
  margin-bottom: var(--sp-3);
}
.hero-label .sparkle { animation: float 4s ease-in-out infinite; }
.hero-title {
  font-family: var(--font-ui);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  max-width: 760px;
  margin: 0 0 var(--sp-3);
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.hero-line {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
  font-size: 0.9375rem;
  color: hsl(var(--fg-muted));
}
.hero-line .badge { text-transform: uppercase; font-size: 0.6875rem; }
.hero-genres { color: hsl(var(--fg)); font-weight: 500; }
.hero-synopsis {
  max-width: 620px;
  font-size: 1rem;
  line-height: 1.65;
  color: hsl(var(--fg) / 0.85);
  margin: 0 0 var(--sp-6);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-cta { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.hero-mute {
  position: absolute;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 3;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-ui);
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--r-md);
  transition: all var(--dur-sm) var(--ease);
}
.btn--md { padding: 0.6rem 1.25rem; font-size: 0.9375rem; }
.btn--icon { width: 44px; height: 44px; padding: 0; border-radius: var(--r-pill); }
.btn-ico { font-size: 0.875em; }
.btn--white {
  background: rgba(255,255,255,0.95);
  color: hsl(var(--bg));
  border: 1px solid transparent;
  font-weight: 700;
}
.btn--white:hover { background: white; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255,255,255,0.18); }
.btn--outline-white {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255,255,255,0.55);
  font-weight: 700;
}
.btn--outline-white:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.85); }
.btn--ghost {
  background: hsl(var(--surface-1) / 0.8);
  color: hsl(var(--fg-muted));
  border: 1px solid var(--border-md);
}
.btn--ghost:hover { background: hsl(var(--surface-2) / 1); color: hsl(var(--fg)); border-color: var(--border-lg); }

/* ── SEARCH BAR ── */
.home-search {
  position: relative;
  z-index: var(--z-raised);
  max-width: 760px;
  margin: -28px auto 0;
  padding: 0 var(--sp-6);
}
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(6, 3, 16, 0.82);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-5);
  gap: var(--sp-3);
  border: 1px solid hsl(var(--violet) / 0.35);
  box-shadow:
    0 0 0 1px hsl(var(--cyan) / 0.10),
    inset 0 0 0 1px hsl(var(--violet) / 0.10),
    0 0 24px hsl(var(--violet) / 0.12),
    0 0 48px hsl(var(--cyan) / 0.06);
  transition: all var(--dur-sm) var(--ease);
}
.search-bar:focus-within {
  border-color: hsl(var(--cyan) / 0.45);
  box-shadow:
    0 0 0 3px hsl(var(--cyan) / 0.10),
    0 0 30px hsl(var(--cyan) / 0.15);
}
.search-bar__icon { color: hsl(var(--fg-subtle)); flex-shrink: 0; font-size: 1.125rem; }
.search-bar__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: hsl(var(--fg));
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  min-width: 0;
}
.search-bar__input::placeholder { color: hsl(var(--fg-subtle)); }
.search-bar__dropdown {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.625rem 1rem;
  background: rgba(14, 8, 30, 0.90);
  border: 1px solid var(--border-md);
  border-radius: var(--r-pill);
  color: hsl(var(--fg-muted));
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-bar__dropdown:hover { border-color: var(--border-xl); color: hsl(var(--fg)); }
.search-bar__dropdown button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.search-bar__dropdown ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--glass-deep);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-md);
  border-radius: var(--r-md);
  list-style: none;
  padding: var(--sp-2);
  margin: 0;
  z-index: var(--z-dropdown);
}
.search-bar__dropdown li {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: hsl(var(--fg-muted));
  cursor: pointer;
  font-size: 0.875rem;
}
.search-bar__dropdown li:hover { background: hsl(var(--surface-2) / 1); color: hsl(var(--fg)); }
.search-results {
  position: absolute;
  top: calc(100% + 12px);
  left: var(--sp-6);
  right: var(--sp-6);
  background: var(--glass-deep);
  backdrop-filter: var(--blur-lg);
  border: 1px solid var(--border-md);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-hover);
  z-index: var(--z-dropdown);
}
.search-results .scroller {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
}
.search-results .scroller::-webkit-scrollbar { display: none; }
.search-results .media-card { width: 160px; flex-shrink: 0; }
.search-results .muted { color: hsl(var(--fg-muted)); text-align: center; padding: var(--sp-8); margin: 0; }

/* ── AI SHORTS FAB ── */
.ai-shorts-fab {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: var(--z-fab);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-3);
  background: hsl(var(--cyan) / 0.12);
  border: 1px solid hsl(var(--cyan) / 0.35);
  border-radius: var(--r-pill);
  color: hsl(var(--cyan));
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--glow-cyan-rest);
  backdrop-filter: var(--blur-md);
  transition: all var(--dur-sm) var(--ease);
}
.ai-shorts-fab:hover {
  background: hsl(var(--cyan) / 0.20);
  border-color: hsl(var(--cyan) / 0.60);
  box-shadow: var(--glow-cyan-hover);
  transform: translateY(-2px);
}
.ai-shorts-fab__icon { font-size: 1.25rem; line-height: 1; }

/* ── ROWS ── */
#rows {
  position: relative;
  z-index: var(--z-raised);
  padding: var(--sp-10) 0 var(--sp-16);
}
.row {
  margin-bottom: var(--sp-10);
  padding-left: var(--sp-6);
}
.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: var(--sp-6);
  margin-bottom: var(--sp-4);
}
.section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--fg));
  margin: 0;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 1.1em;
  background: hsl(var(--cyan));
  border-radius: var(--r-pill);
  box-shadow: 0 0 8px hsl(var(--cyan) / 0.55);
  flex-shrink: 0;
}
.section-title--icon::before { display: none; }
.section-title__icon {
  font-size: 1.125rem;
  color: hsl(var(--cyan));
  filter: drop-shadow(0 0 6px hsl(var(--cyan) / 0.55));
  animation: float 4s ease-in-out infinite;
}
.see-more {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--fg-muted));
  transition: color var(--dur-sm) var(--ease);
}
.see-more:hover { color: hsl(var(--cyan)); }
.scroller-wrap { position: relative; display: flex; align-items: center; }
.scroller {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--sp-2) var(--sp-6) var(--sp-4) 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroller::-webkit-scrollbar { display: none; }
.scroller-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--bg) / 0.6);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  color: hsl(var(--fg));
  font-size: 1.75rem;
  opacity: 0;
  transition: opacity var(--dur-sm) var(--ease), background var(--dur-sm) var(--ease);
}
.scroller-wrap:hover .scroller-arrow { opacity: 1; }
.scroller-arrow:hover { background: hsl(var(--surface-2) / 1); border-color: var(--border-xl); }
.scroller-arrow.arrow-l { left: 0; }
.scroller-arrow.arrow-r { right: 0; }

/* ── MEDIA CARD ── */
.media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  cursor: pointer;
  flex-shrink: 0;
  width: clamp(140px, 16vw, 200px);
  scroll-snap-align: start;
  transition: transform var(--dur-md) var(--ease);
}
.media-card:hover { transform: translateY(-6px); }
.media-card__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-base);
  overflow: hidden;
  background: hsl(var(--surface-2) / 1);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-md) var(--ease);
}
.media-card:hover .media-card__poster {
  box-shadow: var(--shadow-hover), 0 0 30px hsl(var(--cyan) / 0.10);
}
.media-card__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.media-card:hover .media-card__poster img { transform: scale(1.08); }
.media-card__poster video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--dur-md) var(--ease);
}
.media-card.previewing .media-card__poster video { opacity: 1; }
.media-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.80) 0%, rgba(0,0,0,0.30) 40%, transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-md) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-card:hover .media-card__overlay { opacity: 1; }
.media-card__play {
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  background: hsl(var(--cyan));
  color: hsl(var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  box-shadow: var(--glow-cyan-rest);
  transform: scale(0.8);
  transition: transform var(--dur-md) var(--ease-out);
}
.media-card:hover .media-card__play { transform: scale(1); }
.media-card__rating {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  z-index: var(--z-raised);
}
.media-card__episode {
  position: absolute;
  bottom: var(--sp-2);
  left: var(--sp-2);
  z-index: var(--z-raised);
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  border-radius: var(--r-xs);
  padding: 0.1875rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--fg));
}
.media-card__progress {
  position: absolute;
  bottom: var(--sp-2);
  left: var(--sp-2);
  right: var(--sp-2);
  z-index: var(--z-raised);
}
.media-card__body { padding: 0 var(--sp-1); }
.media-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--fg));
  margin-bottom: var(--sp-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card__meta {
  font-size: 0.75rem;
  color: hsl(var(--fg-subtle));
  margin-bottom: var(--sp-2);
}
.media-card__badges { display: flex; gap: var(--sp-1); flex-wrap: wrap; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.1875rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge--movie   { background: hsl(var(--color-movie) / 0.18); color: hsl(var(--color-movie));   border-color: hsl(var(--color-movie) / 0.30); }
.badge--series  { background: hsl(var(--color-series) / 0.18); color: hsl(var(--color-series));  border-color: hsl(var(--color-series) / 0.30); }
.badge--short   { background: hsl(var(--color-short) / 0.18); color: hsl(var(--color-short));   border-color: hsl(var(--color-short) / 0.30); }
.badge--genre   { background: rgba(255,255,255,0.08); color: hsl(var(--fg-muted)); border-color: var(--border-md); }
.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  border-radius: var(--r-xs);
  padding: 0.1875rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: hsl(var(--gold));
}

/* ── PROGRESS ── */
.progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--r-pill);
  transition: width 0.6s var(--ease-out);
}
.progress-fill--cyan {
  background: linear-gradient(90deg, hsl(var(--cyan) / 0.7), hsl(var(--cyan)));
  box-shadow: 0 0 6px hsl(var(--cyan) / 0.5);
}

/* ── SKELETON ── */
.skeleton-rows { padding: var(--sp-10) var(--sp-6); }
.skeleton-row { margin-bottom: var(--sp-10); }
.skeleton-row__title {
  width: 180px;
  height: 1.25rem;
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-4);
  background: linear-gradient(90deg, hsl(var(--surface-1) / 1) 0%, hsl(var(--surface-2) / 1) 50%, hsl(var(--surface-1) / 1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-row__cards { display: flex; gap: var(--sp-4); }
.skeleton-card {
  width: clamp(140px, 16vw, 200px);
  aspect-ratio: 2 / 3;
  border-radius: var(--r-base);
  background: linear-gradient(90deg, hsl(var(--surface-1) / 1) 0%, hsl(var(--surface-2) / 1) 50%, hsl(var(--surface-1) / 1) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position: 200% center; }
}

/* ── ANIMATIONS ── */
.anim-fade-in-up { animation: fadeInUp 0.6s var(--ease-out) both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero { height: clamp(620px, 88vh, 860px); }
  .hero-meta { padding: var(--sp-8) var(--sp-4) var(--sp-10); }
  .hero-title { font-size: 2rem; }
  .home-search { margin-top: -20px; padding: 0 var(--sp-4); }
  .search-bar__dropdown { display: none; }
  .search-results { left: var(--sp-4); right: var(--sp-4); }
  main { max-width: none !important; padding-left: 0 !important; padding-right: 0 !important; }
  #rows { padding-left: 0; padding-right: 0; }
  .row { padding-left: 0; margin-bottom: var(--sp-8); }
  .row-header { padding-right: 0; }
  .scroller { padding-right: 0; }
  .media-card { width: 130px; }
  .scroller-arrow { display: none; }
  .ai-shorts-fab { bottom: var(--sp-4); right: var(--sp-4); }
  .ai-shorts-fab__label { display: none; }
}
@media (max-width: 480px) {
  .media-card { width: 110px; }
  .hero-synopsis { -webkit-line-clamp: 2; }
  .hero-cta .btn { width: 100%; }
}
