/* ============================================================
   CODEXPERIA — HERO
   hero.css
   ============================================================ */

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  background-color: var(--color-bg-base);
  padding-top: 110px;
  padding-bottom: var(--space-12);
}


/* ============================================================
   HERO BACKGROUND
   ============================================================ */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

/* Ambient gradient orbs — atmospheric depth */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-orb--1 {
  width: 600px;
  height: 600px;
  top: -100px;
  right: -80px;
  background: radial-gradient(circle,
    rgba(56, 189, 248, 0.07) 0%,
    rgba(14, 165, 233, 0.03) 50%,
    transparent 70%
  );
}

.hero-orb--2 {
  width: 500px;
  height: 500px;
  bottom: 0px;
  left: -100px;
  background: radial-gradient(circle,
    rgba(129, 140, 248, 0.05) 0%,
    rgba(99, 102, 241, 0.02) 50%,
    transparent 70%
  );
}

.hero-orb--3 {
  width: 400px;
  height: 400px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(56, 189, 248, 0.04) 0%,
    transparent 60%
  );
}

/* SVG canvas — fills the entire hero */
.hero-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0; /* GSAP fades this in */
  transition: opacity 0.1ms; /* Prevent flash */
}

.hero-svg.is-visible {
  /* Will be handled by GSAP */
}

/* Flow line animation */
.hero-flow-line {
  stroke-dashoffset: 0;
  will-change: stroke-dashoffset;
}

/* Node pulse animation */
@keyframes node-pulse {
  0%   { r: 36; opacity: 0.15; }
  50%  { r: 48; opacity: 0.05; }
  100% { r: 36; opacity: 0.15; }
}

/* CSS fallback pulse for non-GSAP environments */
@media (prefers-reduced-motion: no-preference) {
  .node-pulse {
    animation: node-pulse 3s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .node-pulse {
    display: none;
  }
  .hero-flow-line {
    stroke-dasharray: none;
  }
}


/* ============================================================
   HERO CONTENT
   ============================================================ */
.hero-content {
  position: relative;
  z-index: 1;
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
  max-width: 820px;
}


/* Eyebrow label */
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  opacity: 0; /* GSAP reveals */
}

.eyebrow-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary), 0 0 16px rgba(56, 189, 248, 0.5);
  flex-shrink: 0;
  position: relative;
}

.eyebrow-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Pulse animation for eyebrow dot */
@media (prefers-reduced-motion: no-preference) {
  .eyebrow-dot {
    animation: eyebrow-pulse 2.5s ease-in-out infinite;
  }

  @keyframes eyebrow-pulse {
    0%, 100% { box-shadow: 0 0 8px var(--color-primary), 0 0 16px rgba(56, 189, 248, 0.5); }
    50%       { box-shadow: 0 0 12px var(--color-primary), 0 0 24px rgba(56, 189, 248, 0.3); }
  }
}

.eyebrow-text {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.85;
}


/* ============================================================
   HERO HEADLINE
   ============================================================ */
.hero-headline {
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 4.5vw, 4.5rem);
  font-weight: var(--weight-extrabold);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
  margin-bottom: var(--space-8);
  overflow: hidden;
}

/* Each line clips for reveal animation */
.headline-line {
  display: block;
  overflow: hidden;
  transform: translateY(100%); /* GSAP starting state */
  opacity: 0;
}

/* Italic accent word */
.headline-accent {
  font-style: italic;
  color: transparent;
  background: linear-gradient(135deg,
    var(--color-primary) 0%,
    var(--color-primary-bright) 50%,
    var(--color-primary) 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
}

/* Subtle background shimmer on accent — reduced motion off */
@media (prefers-reduced-motion: no-preference) {
  .headline-accent {
    animation: shimmer-text 4s linear infinite;
  }

  @keyframes shimmer-text {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
  }
}


/* ============================================================
   HERO SUBTEXT
   ============================================================ */
.hero-subtext {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  max-width: 580px;
  margin-bottom: var(--space-10);
  opacity: 0; /* GSAP reveals */

  strong {
    color: var(--color-text-primary);
    font-weight: var(--weight-semibold);
  }
}


/* ============================================================
   HERO CTA GROUP
   ============================================================ */
.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  opacity: 0; /* GSAP reveals */
}

/* Primary hero CTA — slightly larger with glow */
#cta-services {
  background: var(--color-primary);
  color: var(--color-text-inverted);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  transition:
    background-color var(--duration-base) var(--ease-out),
    box-shadow var(--duration-slow) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}

#cta-services:hover {
  background: var(--color-primary-bright);
  border-color: var(--color-primary-bright);
  box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.1), var(--shadow-glow-primary);
  transform: translateY(-2px);
}

#cta-services svg {
  transition: transform var(--duration-base) var(--ease-spring);
}

#cta-services:hover svg {
  transform: translateX(3px);
}


/* ============================================================
   SCROLL INDICATOR
   ============================================================ */
.hero-scroll-hint {
  position: absolute;
  bottom: var(--space-8);
  right: var(--container-px);
  left: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 0; /* GSAP reveals after delay */
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg,
    var(--color-primary) 0%,
    transparent 100%
  );
  opacity: 0.4;
  position: relative;
  overflow: hidden;
}

/* Animated shimmer */
@media (prefers-reduced-motion: no-preference) {
  .scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg,
      transparent 0%,
      var(--color-primary) 50%,
      transparent 100%
    );
    animation: scroll-shimmer 1.8s ease-in-out infinite;
  }

  @keyframes scroll-shimmer {
    0%   { transform: translateY(0%); }
    100% { transform: translateY(200%); }
  }
}

.scroll-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  writing-mode: vertical-lr;
  text-orientation: mixed;
}


/* ============================================================
   HERO BOTTOM FADE
   ============================================================ */
.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(5, 12, 26, 0.6) 50%,
    var(--color-bg-base) 100%
  );
  pointer-events: none;
  z-index: 1;
}


/* ============================================================
   PLACEHOLDER SECTIONS (temporary until phases 1B–1F)
   ============================================================ */
.section-placeholder {
  padding: var(--space-20) 0;
  border-top: 1px solid var(--color-border-subtle);
}

.placeholder-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  opacity: 0.5;
  padding: var(--space-6);
  border: 1px dashed rgba(56, 189, 248, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
}

/* Footer placeholder */
.site-footer {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--color-border);
}

.footer-placeholder-note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  opacity: 0.4;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  text-align: center;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero-content {
    max-width: 680px;
    padding-top: var(--space-12);
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 100dvh;
  }

  .hero-content {
    max-width: 100%;
    padding-top: var(--space-8);
    padding-bottom: var(--space-12);
  }

  .hero-headline {
    font-size: clamp(1.875rem, 8.5vw, 3rem);
  }

  .hero-subtext {
    font-size: var(--text-base);
    max-width: 100%;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .hero-ctas .btn--lg {
    width: 100%;
    justify-content: center;
  }

  /* Simplify SVG on mobile — keep it but fade it further */
  .hero-svg {
    opacity: 0.5;
  }

  .hero-scroll-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: clamp(1.875rem, 10vw, 2.5rem);
  }

  .eyebrow-text {
    font-size: 9px;
    letter-spacing: 0.1em;
  }
}
