/* ═══════════════════════════════════════════════════
   HERO SECTION — Aurora Rift
   ═══════════════════════════════════════════════════ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Background container ── */
.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ══════════ Creative Hero Background ══════════
   Layered approach:
   1. hero-mesh  — slowly rotating conic gradient (color shift)
   2. hero-orb   — three floating blurred orbs (parallax drift)
   3. hero-grid  — subtle perspective grid pulse
   4. hero-grain — film-grain texture (static overlay for depth)
*/

/* 1. Conic mesh — chromatic liquid (rotates + breathes) */
.hero-mesh {
  position: absolute;
  inset: -40%;
  background:
    conic-gradient(
      from 0deg at 50% 50%,
      rgba(224, 64, 251, 0.32) 0deg,
      rgba(124, 77, 255, 0.28) 80deg,
      rgba(6, 6, 14, 0.0)     160deg,
      rgba(251, 4, 144, 0.30) 240deg,
      rgba(124, 77, 255, 0.26) 320deg,
      rgba(224, 64, 251, 0.32) 360deg);
  filter: blur(80px) saturate(1.6);
  animation:
    meshRotate 12s linear infinite,
    meshBreathe 5s ease-in-out infinite;
  will-change: transform, filter;
  opacity: 0.95;
}

@keyframes meshRotate {
  to { transform: rotate(360deg) scale(var(--mesh-scale, 1)); }
}

/* Bolder pulse: changes scale + saturation so the colors feel alive */
@keyframes meshBreathe {
  0%, 100% { --mesh-scale: 1;     filter: blur(80px) saturate(1.4)  brightness(1); }
  50%      { --mesh-scale: 1.25;  filter: blur(110px) saturate(2.1) brightness(1.25); }
}

/* Register the custom prop so it can animate smoothly */
@property --mesh-scale {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

/* 2. Floating orbs — each drifts on a different Lissajous-ish path */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: screen;
  will-change: transform;
  pointer-events: none;
}

.hero-orb-1 {
  width: 52vw; height: 52vw;
  left: 12%; top: 14%;
  background: radial-gradient(circle, rgba(251, 4, 144, 0.75), rgba(251, 4, 144, 0) 65%);
  animation: orbDrift1 10s ease-in-out infinite;
}

.hero-orb-2 {
  width: 44vw; height: 44vw;
  right: 10%; top: 22%;
  background: radial-gradient(circle, rgba(124, 77, 255, 0.70), rgba(124, 77, 255, 0) 65%);
  animation: orbDrift2 12s ease-in-out infinite;
}

.hero-orb-3 {
  width: 38vw; height: 38vw;
  left: 42%; bottom: 4%;
  background: radial-gradient(circle, rgba(224, 64, 251, 0.65), rgba(224, 64, 251, 0) 65%);
  animation: orbDrift3 14s ease-in-out infinite;
}

/* Wider drift paths so motion is clearly visible without feeling jittery */
@keyframes orbDrift1 {
  0%, 100% { transform: translate(0, 0)        scale(1); }
  20%      { transform: translate(22%, -16%)   scale(1.35); }
  40%      { transform: translate(-14%, 20%)  scale(0.75); }
  60%      { transform: translate(-20%, -10%)  scale(1.25); }
  80%      { transform: translate(10%, 18%)    scale(0.9); }
}
@keyframes orbDrift2 {
  0%, 100% { transform: translate(0, 0)        scale(1); }
  25%      { transform: translate(-18%, 16%)   scale(1.35); }
  50%      { transform: translate(16%, -14%)   scale(0.72); }
  75%      { transform: translate(-8%, -12%)  scale(1.2); }
}
@keyframes orbDrift3 {
  0%, 100% { transform: translate(0, 0)        scale(1); }
  30%      { transform: translate(-16%, -20%)  scale(1.4); }
  60%      { transform: translate(18%, 12%)   scale(0.78); }
  90%      { transform: translate(-10%, 18%)  scale(1.15); }
}

/* 3. Perspective grid — removed per design direction (was visually noisy) */
.hero-grid { display: none; }

/* 4. Film grain — procedural via SVG turbulence
   Two layers stacked: rapid jitter (grainShift) + slow shimmer wave (grainShimmer)
   gives the texture a cinema-grade "alive" feel without becoming noisy. */
.hero-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation:
    grainShift 0.6s steps(5) infinite,
    grainShimmer 9s ease-in-out infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-2%, 1%); }
  40%  { transform: translate(1%, -2%); }
  60%  { transform: translate(-1%, 2%); }
  80%  { transform: translate(2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* Slow wave that pulses opacity + contrast — micro-detail readers can feel */
@keyframes grainShimmer {
  0%, 100% { opacity: 0.08; filter: contrast(1)    brightness(1); }
  50%      { opacity: 0.22; filter: contrast(1.55) brightness(1.25); }
}

/* Second grain layer — finer, slower drift, opposite phase shimmer.
   Produces an interference pattern so the texture never feels static. */
.hero-grain::after {
  content: '';
  position: absolute;
  inset: -10%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='340' height='340'><filter id='n2'><feTurbulence type='fractalNoise' baseFrequency='0.55' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n2)'/></svg>");
  mix-blend-mode: soft-light;
  opacity: 0.5;
  animation: grainDrift 14s linear infinite, grainShimmer 9s ease-in-out infinite reverse;
  pointer-events: none;
}

@keyframes grainDrift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-3%, 2%); }
  100% { transform: translate(0, 0); }
}

/* ── Hero Content ── */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 var(--container-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.hero-title,
.hero-subtitle {
  text-align: center;
  width: 100%;
}

/* Reserved space for the morphing logo */
.hero-logo-slot {
  width: clamp(300px, 46vw, 480px);
  aspect-ratio: 449 / 182;
  margin-bottom: 36px;
  pointer-events: none;
}

/* ── Title — whispered, single line ── */
.hero-title {
  font-family: var(--font-ar);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  opacity: 0.88;
  margin-bottom: 12px;
  color: var(--text-primary, #f4f4ff);
}

.hero-subtitle {
  font-size: clamp(0.9rem, 1.4vw, 1.05rem);
  letter-spacing: 0.05em;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
  opacity: 0.75;
}

/* ── Scroll indicator ── */
.hero-scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0.5;
  animation: scrollBounce 2s ease-in-out infinite;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1), opacity 0.6s ease;
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--neon-primary), transparent);
  transition: box-shadow 0.6s ease, height 0.6s cubic-bezier(.2,.7,.2,1);
}

.hero-scroll-indicator span {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(6px); opacity: 0.65; }
}

/* When user makes their first scroll, indicator briefly pulses & glows */
.hero-scroll-indicator.is-pulsing {
  animation: scrollHintPulse 1.1s cubic-bezier(.2,.7,.2,1) 1;
}
.hero-scroll-indicator.is-pulsing .hero-scroll-line {
  height: 60px;
  box-shadow: 0 0 18px var(--neon-primary), 0 0 36px rgba(224, 64, 251, 0.5);
}
.hero-scroll-indicator.is-pulsing span {
  color: #fff;
  text-shadow: 0 0 12px rgba(224, 64, 251, 0.7);
}

@keyframes scrollHintPulse {
  0%   { transform: translateY(0)   scale(1);    opacity: 0.5; }
  35%  { transform: translateY(-6px) scale(1.18); opacity: 1;   }
  100% { transform: translateY(0)   scale(1);    opacity: 0.5; }
}

/* ── Scroll hint glow — full-screen radial flash on first scroll ── */
.hero-scroll-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%,
      rgba(224, 64, 251, 0.55) 0%,
      rgba(124, 77, 255, 0.30) 35%,
      rgba(6, 6, 14, 0)        70%);
  mix-blend-mode: screen;
  filter: blur(40px);
  will-change: opacity, transform;
}

.hero-scroll-glow.is-flashing {
  animation: scrollGlowFlash 1.4s cubic-bezier(.2,.7,.2,1) 1;
}

@keyframes scrollGlowFlash {
  0%   { opacity: 0;    transform: translateY(20%) scale(0.85); }
  35%  { opacity: 1;    transform: translateY(0)   scale(1.05); }
  100% { opacity: 0;    transform: translateY(-15%) scale(1.15); }
}

/* ── Particles (kept) ── */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--neon-primary);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
  0%   { opacity: 0;    transform: translateY(110vh) scale(0); }
  8%   { opacity: 0.55; }
  92%  { opacity: 0.55; }
  100% { opacity: 0;    transform: translateY(-25vh) scale(1.4); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh,
  .hero-orb,
  .hero-grid,
  .hero-grain,
  .hero-grain::after { animation: none; }
  .hero-scroll-indicator,
  .hero-scroll-indicator.is-pulsing,
  .hero-scroll-glow.is-flashing { animation: none; }
  .hero-scroll-glow { display: none; }
  .particle { animation: none; display: none; }
}

/* Mobile: freeze all hero background animations — saves battery + GPU on the
   most thermally-constrained devices, and matches user request for a static
   hero on phones. Desktop keeps the full cinematic background. */
@media (max-width: 767px) {
  .hero-mesh,
  .hero-orb,
  .hero-grid,
  .hero-grain,
  .hero-grain::after { animation: none !important; }
  .particle { animation: none !important; display: none !important; }
}
