/* LeoLav motion layer — tech atmosphere + neural sphere */

:root {
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-fast: 180ms;
  --motion-med: 480ms;
  --tech: 14, 116, 144;
  --spot-x: 70%;
  --spot-y: 20%;
}

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

  .reveal,
  .reveal-line {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }

  .hero-bg::before,
  .hero-bg::after,
  .tech-scan {
    animation: none !important;
  }
}

/* ========== HERO atmosphere ========== */
.hero-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 85%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      520px 380px at var(--spot-x) var(--spot-y),
      rgba(var(--tech), 0.2),
      transparent 70%
    ),
    radial-gradient(ellipse 50% 40% at 12% 55%, rgba(56, 189, 248, 0.1), transparent 70%);
  animation: hero-glow 14s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 1px 1px, rgba(14, 116, 144, 0.16) 1px, transparent 0);
  background-size: 56px 56px, 56px 56px, 28px 28px;
  mask-image: radial-gradient(ellipse 85% 75% at 55% 28%, #000 15%, transparent 78%);
}

.hero-bg > * {
  position: relative;
  z-index: 1;
}

.tech-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 28%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(14, 116, 144, 0.07),
    transparent
  );
  animation: scan-down 7.5s linear infinite;
  mix-blend-mode: multiply;
}

@keyframes hero-glow {
  from {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.8;
  }
  to {
    transform: translate3d(-2.5%, 4%, 0) scale(1.08);
    opacity: 1;
  }
}

@keyframes scan-down {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  88% {
    opacity: 0.55;
  }
  100% {
    transform: translate3d(0, 420%, 0);
    opacity: 0;
  }
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--tech), 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(var(--tech), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--tech), 0);
  }
}

.eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgb(var(--tech));
  box-shadow: 0 0 0 0 rgba(var(--tech), 0.45);
  animation: status-pulse 2.2s ease-out infinite;
  flex-shrink: 0;
}

.num {
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, rgb(var(--tech)), #0f172a 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(2px);
  transition:
    opacity var(--motion-med) var(--motion-ease),
    transform var(--motion-med) var(--motion-ease),
    filter var(--motion-med) var(--motion-ease);
  will-change: opacity, transform, filter;
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.reveal-delay-1 { transition-delay: 50ms; }
.reveal-delay-2 { transition-delay: 100ms; }
.reveal-delay-3 { transition-delay: 150ms; }
.reveal-delay-4 { transition-delay: 200ms; }

.reveal-line {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 700ms var(--motion-ease);
}

.reveal-line.is-visible {
  transform: scaleX(1);
}

.panel,
.service-card,
.case-card,
.process-stage,
.impact-item,
.hero-ui-card {
  position: relative;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    background-color var(--motion-fast) ease;
}

.panel::before,
.service-card::before,
.case-card::before,
.process-stage::before,
.impact-item::before,
.hero-ui-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-fast) ease;
  background:
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) left top / 14px 1.5px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) left top / 1.5px 14px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) right top / 14px 1.5px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) right top / 1.5px 14px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) left bottom / 14px 1.5px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) left bottom / 1.5px 14px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) right bottom / 14px 1.5px no-repeat,
    linear-gradient(rgba(var(--tech), 0.9), rgba(var(--tech), 0.9)) right bottom / 1.5px 14px no-repeat;
}

@media (hover: hover) and (pointer: fine) {
  .panel:hover,
  .service-card:hover,
  .case-card:hover,
  .process-stage:hover,
  .impact-item:hover,
  .hero-ui-card:hover {
    transform: translate3d(0, -4px, 0);
    border-color: rgba(var(--tech), 0.42);
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.04),
      0 16px 36px rgba(var(--tech), 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.65);
  }

  .panel:hover::before,
  .service-card:hover::before,
  .case-card:hover::before,
  .process-stage:hover::before,
  .impact-item:hover::before,
  .hero-ui-card:hover::before {
    opacity: 1;
  }

  .btn {
    position: relative;
    overflow: hidden;
    transition:
      transform var(--motion-fast) var(--motion-ease),
      background var(--motion-fast) ease,
      border-color var(--motion-fast) ease,
      box-shadow var(--motion-fast) ease;
  }

  .btn:hover {
    transform: translate3d(0, -1px, 0);
  }

  .btn-primary {
    box-shadow: 0 8px 20px rgba(var(--tech), 0.18);
  }

  .btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      110deg,
      transparent 25%,
      rgba(255, 255, 255, 0.28) 48%,
      transparent 70%
    );
    transform: translate3d(-120%, 0, 0);
    transition: transform 650ms var(--motion-ease);
  }

  .btn-primary:hover::after {
    transform: translate3d(120%, 0, 0);
  }

  .btn-primary:hover {
    box-shadow: 0 12px 28px rgba(var(--tech), 0.32);
  }
}

header.fixed {
  transition:
    background-color var(--motion-fast) ease,
    backdrop-filter var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    border-color var(--motion-fast) ease;
}

header.fixed.is-scrolled {
  background-color: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow:
    0 1px 0 rgba(15, 23, 42, 0.06),
    0 10px 30px rgba(15, 23, 42, 0.04);
}

.section {
  position: relative;
}

.section::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: min(72rem, 92vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--tech), 0.28),
    transparent
  );
  opacity: 0.7;
  pointer-events: none;
}

#security {
  background:
    radial-gradient(600px 280px at 80% 0%, rgba(var(--tech), 0.06), transparent 70%),
    transparent;
}

/* ========== Hero neural sphere — no card, only animation ========== */
.hero-network {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

.hero-network .neural-sphere {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.hero-network .neural-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
}
