/**
 * ============================================
 * AI Agency Framework — HERO SECTION STYLES
 * ============================================
 * Cinematic Pinned Hero Experience
 * Full viewport, 5-phase scroll animation
 * ============================================
 */

/* ============================================
   1. HERO CONTAINER
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-space-500);
  /* GPU layer */
  transform: translateZ(0);
}

/* ============================================
   2. PARALLAX LAYERS SYSTEM
   ============================================ */
.hero__layers {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.hero__layer {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  will-change: transform;
  transform: translateZ(0);
}

.hero__layer-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

/* Layer-specific opacity for depth */
.hero__layer:nth-child(1) .hero__layer-img { opacity: 0.4; }
.hero__layer:nth-child(2) .hero__layer-img { opacity: 0.5; }
.hero__layer:nth-child(3) .hero__layer-img { opacity: 0.7; }
.hero__layer:nth-child(4) .hero__layer-img { opacity: 0.6; }
.hero__layer:nth-child(5) .hero__layer-img { opacity: 0.5; }

/* ============================================
   3. VIGNETTE OVERLAY
   ============================================ */
.hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, transparent 0%, rgba(10, 10, 15, 0.7) 100%),
    radial-gradient(ellipse 60% 50% at 50% 40%, transparent 30%, rgba(10, 10, 15, 0.9) 100%);
  pointer-events: none;
}

/* ============================================
   4. HERO CONTENT
   ============================================ */
.hero__content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--section-px);
  max-width: 1400px;
  width: 100%;
}

/* ============================================
   5. SPLIT HEADLINE
   ============================================ */
.hero__headline {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.hero__headline-text {
  display: block;
  font-family: var(--font-headline);
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-primary);
  white-space: nowrap;
  will-change: transform;
  transform: translateZ(0);
}

/* Left and right halves */
.hero__headline-left,
.hero__headline-right {
  position: relative;
  z-index: 5;
  will-change: transform;
  transform: translateZ(0);
}

.hero__headline-left {
  padding-right: 0.15em;
}

.hero__headline-right {
  padding-left: 0.15em;
}

/* Center area with hidden image */
.hero__headline-center {
  position: relative;
  width: 0;
  height: clamp(3rem, 10vw, 9rem);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* Central reveal image */
.hero__central-image {
  position: absolute;
  width: clamp(120px, 25vw, 300px);
  height: clamp(120px, 25vw, 300px);
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.6);
  will-change: transform, opacity;
  box-shadow:
    0 0 60px rgba(0, 240, 255, 0.2),
    0 0 120px rgba(0, 240, 255, 0.1),
    inset 0 0 60px rgba(0, 240, 255, 0.05);
}

.hero__central-image::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-cyan-500), var(--gradient-neural-2), var(--gradient-neural-3));
  z-index: -1;
  opacity: 0.6;
  filter: blur(8px);
}

.hero__central-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.3);
  box-shadow: inset 0 0 30px rgba(0, 240, 255, 0.1);
}

.hero__central-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ============================================
   6. SUBHEADLINE & TYPEWRITER
   ============================================ */
.hero__subheadline {
  margin-top: var(--space-8);
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: var(--weight-regular);
  color: var(--text-secondary);
  max-width: 640px;
  min-height: 2em;
  opacity: 0;
  will-change: opacity;
}

.hero__typewriter {
  display: inline;
}

.hero__cursor {
  display: inline-block;
  color: var(--accent-primary);
  font-weight: var(--weight-light);
  animation: cursorBlink 0.8s step-end infinite;
  margin-left: 2px;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================
   7. CTA BUTTON
   ============================================ */
.hero__cta {
  margin-top: var(--space-10);
  opacity: 0;
  transform: translateY(30px);
  will-change: transform, opacity;
}

/* ============================================
   8. SCROLL INDICATOR
   ============================================ */
.hero__scroll-indicator {
  position: absolute;
  bottom: var(--space-10);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  opacity: 0;
  will-change: opacity;
}

.hero__scroll-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--text-muted);
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--border-default), transparent);
  position: relative;
  overflow: hidden;
}

.hero__scroll-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 16px;
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {
  0% { top: -16px; opacity: 0; }
  30% { opacity: 1; }
  70% { opacity: 1; }
  100% { top: 48px; opacity: 0; }
}

/* ============================================
   9. CUSTOM CURSOR
   ============================================ */
.cursor,
.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  will-change: transform;
}

/* Small dot cursor */
.cursor {
  width: 8px;
  height: 8px;
  background: var(--color-cyan-500);
  transition: width 0.3s var(--ease-cinematic),
              height 0.3s var(--ease-cinematic),
              background 0.3s var(--ease-smooth);
}

/* Expanded state on hoverables */
.cursor--expanded {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1.5px solid var(--color-cyan-500);
}

/* Follower ring */
.cursor-follower {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  transition: width 0.4s var(--ease-cinematic),
              height 0.4s var(--ease-cinematic),
              border-color 0.3s var(--ease-smooth);
}

.cursor-follower--expanded {
  width: 64px;
  height: 64px;
  border-color: rgba(0, 240, 255, 0.4);
}

/* Hide default cursor on desktop */
@media (pointer: fine) {
  body:has(.cursor) {
    cursor: none;
  }

  body:has(.cursor) a,
  body:has(.cursor) button,
  body:has(.cursor) [data-magnetic] {
    cursor: none;
  }
}

/* Hide custom cursor on touch devices */
@media (pointer: coarse) {
  .cursor,
  .cursor-follower {
    display: none !important;
  }
}

/* ============================================
   10. PARTICLE CANVAS
   ============================================ */
.particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.6;
}

/* ============================================
   11. RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero__headline {
    flex-direction: column;
    gap: var(--space-2);
  }

  .hero__headline-text {
    font-size: clamp(2rem, 12vw, 4rem);
  }

  .hero__headline-center {
    width: auto;
    height: auto;
    order: -1;
    margin-bottom: var(--space-4);
  }

  .hero__central-image {
    position: relative;
    width: clamp(100px, 30vw, 180px);
    height: clamp(100px, 30vw, 180px);
    opacity: 0.8;
    transform: scale(1);
  }

  .hero__headline-left,
  .hero__headline-right {
    padding: 0;
  }

  .hero__subheadline {
    font-size: var(--text-base);
    margin-top: var(--space-6);
  }

  .hero__cta {
    margin-top: var(--space-8);
  }

  .hero__scroll-indicator {
    bottom: var(--space-6);
  }
}

/* ============================================
   12. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .hero__layer,
  .hero__central-image,
  .hero__subheadline,
  .hero__cta,
  .hero__scroll-indicator {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__central-image {
    transform: scale(1) !important;
  }

  .hero__cursor {
    animation: none;
    opacity: 0;
  }

  .cursor,
  .cursor-follower {
    display: none !important;
  }

  .particle-canvas {
    display: none !important;
  }
}
