/* BBX motion & "premium" visual layer (pairs with static/js/motion.js). Loads after bbx.css.
   Effects inspired by React Bits (ShinyText, StarBorder, SpotlightCard, TiltedCard, Noise, Aurora),
   rebuilt in CSS. Everything degrades to the plain design on touch / reduced motion. */

/* ---------- Lenis */
html.lenis-on, html.lenis-on body { height: auto; }
/* bbx.css sets html { scroll-behavior: smooth }: fighting Lenis' own interpolation caused stutter */
html.lenis-on { scroll-behavior: auto !important; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- film grain (Noise) — very subtle, fixed, no layout cost */
/* static on purpose: an animated full-screen grain layer repainted every frame and made scrolling stutter */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.admin::after { display: none; }

/* ---------- Aurora: soft brand glow behind pages without a hero */
.aurora { position: absolute; inset: 0 0 auto; height: 520px; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: .35;
  animation: aurora 18s ease-in-out infinite alternate; will-change: transform;
}
.aurora::before { background: radial-gradient(circle, #FF5900 0%, transparent 60%); left: -20vmax; top: -40vmax; }
.aurora::after { background: radial-gradient(circle, #55B7E8 0%, transparent 60%); right: -25vmax; top: -45vmax; animation-delay: -9s; opacity: .28; }
@keyframes aurora { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.1); } 100% { transform: translate(-4vmax, 6vmax) scale(.95); } }
.page { position: relative; }
.page > *:not(.aurora) { position: relative; z-index: 1; }

/* ---------- ShinyText: light sweep on display text / badges */
.shiny {
  background: linear-gradient(110deg, currentColor 35%, #fff 50%, currentColor 65%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shiny 4.5s linear infinite;
}
@keyframes shiny { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.badge-brand { position: relative; overflow: hidden; }
.badge-brand::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  animation: badge-sheen 3.8s ease-in-out infinite;
}
@keyframes badge-sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- StarBorder: travelling light on the primary CTA */
@property --sb-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.btn-primary { position: relative; isolation: isolate; box-shadow: 0 8px 28px -10px rgba(255, 89, 0, .7); }
.btn-primary::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; padding: 2px;
  background: conic-gradient(from var(--sb-angle), transparent 0 70%, #FFD2B0 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: star-border 3.2s linear infinite; opacity: .9;
}
@keyframes star-border { to { --sb-angle: 360deg; } }
.btn-primary:hover { box-shadow: 0 12px 34px -8px rgba(255, 89, 0, .85); }

/* ---------- glass header refinement */
.site-header.scrolled { background: rgba(5, 15, 36, .72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.btn-ghost { border: 1px solid rgba(255,255,255,.14); }

/* ---------- hero parallax hook (motion.js animates --hero-shift) */
.hero-slide > img, .hero-slide > video { transform-origin: 60% 40%; }
.hero-content h1 { perspective: 600px; }
/* no permanent will-change: hundreds of chars/posters each got their own GPU layer (memory + scroll jank) */
.is-split .char, .is-split .word { display: inline-block; }

/* ---------- TiltedCard */
.tilt { transform-style: preserve-3d; }
.tilt:hover { will-change: transform; }
.tilt-glare {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.28), transparent 55%);
  mix-blend-mode: soft-light;
}
.tilt:hover .tilt-glare, .glare-only:hover .tilt-glare { opacity: 1; }
/* kept inside the carousel's 18px bottom padding so it is never clipped */
.card:hover .card-poster { box-shadow: 0 0 0 2px var(--sky), 0 12px 22px -12px rgba(0,0,0,.85), 0 0 18px -6px rgba(85,183,232,.5); }

/* ---------- SpotlightCard */
.spotlight { position: relative; isolation: isolate; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(85, 183, 232, .12), transparent 45%);
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

/* ---------- ClickSpark particles */
.spark { position: fixed; z-index: 120; width: 10px; height: 2px; margin: -1px 0 0 -5px; border-radius: 2px; background: var(--brand-glow); pointer-events: none; }

/* ---------- section titles: subtle accent bar */
.row-head h2 { display: inline-flex; align-items: center; gap: 10px; }
.row-head h2::before { content: ""; width: 4px; height: 1em; border-radius: 2px; background: var(--grad-brand); }

/* ---------- motion-ready: initial states are owned by GSAP (from-tweens), nothing hidden by CSS
   so content is never invisible if a script fails. */

@media (hover: none) {
  .tilt-glare, .spotlight::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body::after, .aurora::before, .aurora::after, .shiny, .badge-brand::after, .btn-primary::before { animation: none !important; }
}
