@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg-dark: #06080d;
  --charcoal: #0d111a;
  --navy: #090d16;
  --cyan: #00f0ff;
  --violet: #818cf8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: clip; /* clip prevents horizontal scrollbars without breaking position: sticky */
  min-height: 100vh;
  min-height: 100dvh;
}

/* Hero Scroll Track & Sticky Viewport: Exact 200vh (100vh pinned animation + 100vh scroll duration) */
.hero-scroll-track {
  position: relative;
  width: 100%;
  height: 200vh;
  height: 200dvh;
  margin: 0;
  padding: 0;
}

.hero-sticky-viewport {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
}

/* Custom Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #06080d;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00f0ff88;
}

/* Typography Helpers */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
}
.font-display {
  font-family: 'Space Grotesk', sans-serif;
}

/* Hero Canvas Contrast Scrim (High contrast against bright flare frames) */
.bg-radial-scrim {
  background: radial-gradient(
    ellipse at 35% 50%,
    rgba(6, 8, 13, 0.88) 0%,
    rgba(6, 8, 13, 0.65) 45%,
    rgba(6, 8, 13, 0.3) 75%,
    rgba(6, 8, 13, 0.95) 100%
  );
  pointer-events: none;
}

@media (max-width: 768px) {
  .bg-radial-scrim {
    background: radial-gradient(
      ellipse at 50% 50%,
      rgba(6, 8, 13, 0.92) 0%,
      rgba(6, 8, 13, 0.75) 55%,
      rgba(6, 8, 13, 0.96) 100%
    );
  }
}

/* Text Shadow for Crystal Clear Readability */
.text-glow-contrast {
  text-shadow: 0 2px 20px rgba(6, 8, 13, 0.95), 0 0 40px rgba(6, 8, 13, 0.8);
}

/* Glassmorphism helpers */
.backdrop-blur-md {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Interactive Card Hover Polish */
.interactive-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, border-color, box-shadow;
}

.interactive-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 12px 30px -10px rgba(0, 240, 255, 0.08);
}

/* Interactive Button Micro-Interactions */
.btn-primary {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -5px rgba(0, 240, 255, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Pipeline Animated Trace */
@keyframes pipelinePulse {
  0% {
    left: 0%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 92%;
    opacity: 0;
  }
}

.animate-pipeline-pulse {
  animation: pipelinePulse 3.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* Evolution Stage Indicators */
.evolution-step {
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.evolution-step.active {
  background-color: rgba(3, 31, 40, 0.95) !important;
  color: #00f0ff !important;
  border-color: rgba(0, 240, 255, 0.6) !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.evolution-step.active span:first-child {
  background-color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.9);
}

/* Subtle Scroll Section Reveal Animations */
.reveal-init {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Keyboard accessibility outline */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Hide scrollbar for clean horizontal pipelines while preserving scroll capability */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ACCESSIBILITY: prefers-reduced-motion support */
@media (prefers-reduced-motion: reduce) {
  html, body {
    scroll-behavior: auto !important;
  }
  
  #hero {
    height: auto !important;
  }

  .sticky {
    position: relative !important;
    height: auto !important;
  }

  #scroller-canvas {
    display: none !important;
  }

  #reduced-motion-img {
    display: block !important;
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    opacity: 0.6 !important;
  }

  .animate-spin,
  .animate-ping,
  .animate-pulse,
  .animate-pipeline-pulse {
    animation: none !important;
  }

  .reveal-init {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
