/* =========================================================
   HERO — nslabs 2026 (alive edition)
========================================================= */

:root {
  --accent: #4f7df5;
  --accent-secondary: #22d3a7;
  --accent-glow: rgba(79, 125, 245, 0.45);
  --bg-elevated: #161d33;
  --border: rgba(140, 160, 220, 0.12);
}

/* ========== WRAPPER ========== */
.ns-hero-wrapper {
  width: 100%;
  position: relative;
}

.ns-hero {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px clamp(20px, 5vw, 80px) 80px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* ========== BACKGROUND LAYERS ========== */
.ns-hero-bg {
  position: absolute;
  inset: -4%;
  overflow: hidden;
  z-index: 0;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.ns-hero-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Grid overlay */
.ns-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 125, 245, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 125, 245, 0.06) 1px, transparent 1px);
  background-size: 70px 70px;
  z-index: 1;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, black, transparent);
  animation: gridMove 60s linear infinite;
}
@keyframes gridMove {
  from { background-position: 0 0; }
  to { background-position: 70px 70px; }
}

/* Noise for cinematic grain */
.ns-noise {
  position: absolute;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: noiseShift 8s steps(8) infinite;
  mix-blend-mode: overlay;
}
@keyframes noiseShift {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-3%, 2%); }
  50%  { transform: translate(2%, -3%); }
  75%  { transform: translate(-2%, -2%); }
  100% { transform: translate(0,0); }
}

/* Sweeping scanline */
.ns-scanline {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 48%,
    rgba(79,125,245,0.06) 50%,
    transparent 52%,
    transparent 100%
  );
  background-size: 100% 200%;
  animation: scan 9s linear infinite;
  mix-blend-mode: screen;
}
@keyframes scan {
  from { background-position: 0 -100%; }
  to   { background-position: 0 200%; }
}

/* Hero gradient */
.ns-hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 45%, rgba(79, 125, 245, 0.18), transparent 60%),
    radial-gradient(circle at 60% 55%, rgba(34, 211, 167, 0.10), transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(10, 14, 26, 1), transparent 50%);
}

/* Vignette */
.ns-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(10,14,26,0.85) 100%);
}

/* Orbs */
.ns-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  pointer-events: none;
  animation: orbFloat 22s ease-in-out infinite;
  z-index: 0;
}
.orb-1 { width: 360px; height: 360px; background: var(--accent);          top: 8%;  left: 12%; }
.orb-2 { width: 300px; height: 300px; background: var(--accent-secondary); bottom: 10%; right: 8%; animation-delay: 5s; }
.orb-3 { width: 240px; height: 240px; background: #3a6ae0;                 top: 50%; left: 60%; animation-delay: 10s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 40px) scale(0.95); }
}

/* ========== CONTENT ========== */
.ns-hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

/* ========== BADGE (live ticker) ========== */
.ns-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(79,125,245,0.28);
  font-size: 0.72rem;
  font-weight: 500;
  color: #cdd6ee;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: fadeSlideUp 0.8s 0.2s both;
  overflow: hidden;
}

.ns-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 0 0 rgba(34,211,167,0.7);
  animation: dotPulse 1.8s infinite;
}
@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,211,167,0.7); transform: scale(1); }
  70%  { box-shadow: 0 0 0 8px rgba(34,211,167,0);  transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,167,0);    transform: scale(1); }
}

.ns-badge-label { color: var(--accent-secondary); font-weight: 600; }
.ns-badge-sep   { opacity: 0.4; }

.ns-badge-ticker {
  position: relative;
  display: inline-block;
  width: 220px;
  height: 14px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.ns-badge-track {
  display: flex;
  flex-direction: column;
  animation: tickSlide 12s steps(4) infinite;
}
.ns-badge-track > span {
  height: 14px;
  line-height: 14px;
  white-space: nowrap;
}
@keyframes tickSlide {
  0%, 22%   { transform: translateY(0); }
  25%, 47%  { transform: translateY(-14px); }
  50%, 72%  { transform: translateY(-28px); }
  75%, 100% { transform: translateY(-42px); }
}

/* ========== HEADLINE ========== */
.ns-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 700;
  color: #f1f4fb;
  line-height: 1.1;
  letter-spacing: -1.8px;
  margin: 0;
}

.ns-h1-line {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: fadeSlideUp 0.9s cubic-bezier(.2,.8,.2,1) forwards;
}
.ns-h1-line:nth-child(1) { animation-delay: 0.35s; }
.ns-h1-line:nth-child(2) { animation-delay: 0.5s; }

/* Animated gradient highlight */
.ns-highlight {
  background: linear-gradient(
    90deg,
    #4f7df5 0%,
    #22d3a7 40%,
    #4f7df5 60%,
    #22d3a7 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  animation: gradientShift 6s linear infinite;
}
.ns-highlight::after {
  content: "";
  position: absolute;
  inset: -10% -5%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  filter: blur(22px);
  opacity: 0.55;
  z-index: -1;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes gradientShift {
  to { background-position: -200% center; }
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(1.08); }
}

/* Shimmer sweep on second line */
.ns-shimmer {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    100deg,
    #f1f4fb 30%,
    #ffffff 45%,
    #4f7df5 50%,
    #ffffff 55%,
    #f1f4fb 70%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ========== SUBTEXT ========== */
.ns-hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.7;
  color: #a4adc6;
  max-width: 580px;
  font-weight: 300;
  opacity: 0;
  animation: fadeSlideUp 0.9s 0.65s both;
}

/* ========== CTAs ========== */
.ns-hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeSlideUp 0.9s 0.8s both;
}

.ns-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  font-family: 'Sora', sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1),
              box-shadow .35s ease,
              background .35s ease,
              border-color .35s ease;
  will-change: transform;
}
.ns-btn:active { transform: scale(0.97); }

.ns-btn-primary {
  background: linear-gradient(135deg, #4f7df5, #22d3a7);
  background-size: 200% 200%;
  color: #fff;
  box-shadow:
    0 8px 30px rgba(79,125,245,0.45),
    inset 0 1px 0 rgba(255,255,255,0.25);
  animation: btnGradient 6s ease infinite;
}
@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.ns-btn-primary:hover {
  box-shadow: 0 14px 44px rgba(79,125,245,0.55),
              inset 0 1px 0 rgba(255,255,255,0.3);
}

.ns-btn-secondary {
  background: rgba(255,255,255,0.03);
  color: #f1f4fb;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.ns-btn-secondary:hover {
  border-color: rgba(79, 125, 245, 0.45);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  background: rgba(79,125,245,0.06);
}
.ns-btn-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-secondary);
  box-shadow: 0 0 10px var(--accent-secondary);
  animation: dotPulse 1.8s infinite;
}

.ns-btn-arrow {
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.ns-btn:hover .ns-btn-arrow { transform: translateX(4px); }

/* Shine sweep on primary button */
.ns-btn-shine {
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255,255,255,0.35) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left .8s cubic-bezier(.2,.8,.2,1);
}
.ns-btn-primary:hover .ns-btn-shine { left: 130%; }

/* ========== STATS ========== */
.ns-stats {
  display: flex;
  gap: 20px;
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeSlideUp 0.9s 0.95s both;
}

.ns-stat {
  position: relative;
  padding: 16px 26px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(79,125,245,0.15);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
  transition: transform .4s cubic-bezier(.2,.8,.2,1),
              border-color .3s ease,
              box-shadow .4s ease;
  overflow: hidden;
}
.ns-stat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(79,125,245,0.12), transparent 60%);
  opacity: 0;
  transition: opacity .4s ease;
}
.ns-stat:hover {
  transform: translateY(-6px);
  border-color: rgba(79,125,245,0.5);
  box-shadow: 0 14px 40px rgba(79,125,245,0.25);
}
.ns-stat:hover::before { opacity: 1; }

.ns-stat-num {
  font-family: 'Space Mono', 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: #f1f4fb;
  background: linear-gradient(135deg, #f1f4fb, #4f7df5);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.ns-stat-label {
  font-size: 0.7rem;
  color: #8a93ad;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  position: relative;
}

/* ========== SCROLL CUE ========== */
.ns-scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeSlideUp 1s 1.4s both;
}
.ns-scroll-line {
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  background-size: 100% 200%;
  animation: scrollLine 1.8s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { background-position: 0 -100%; }
  100% { background-position: 0 100%; }
}
.ns-scroll-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #5b6480;
}

/* ========== KEYFRAMES ========== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 840px) {
  .ns-stats { gap: 12px; }
  .ns-stat  { padding: 14px 20px; }
}

@media (max-width: 500px) {
  .ns-hero { padding: 100px 20px 60px; min-height: 100svh; }
  .ns-hero-content { gap: 26px; }
  .ns-hero-ctas { flex-direction: column; align-items: stretch; width: 100%; }
  .ns-btn { justify-content: center; padding: 14px 22px; }
  .ns-stats { flex-direction: column; gap: 12px; width: 100%; }
  .ns-stat { width: 100%; }
  .ns-badge-ticker { width: 150px; }
  .ns-scroll-cue { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
