@import url('./variables.css');

/* ==========================================================================
   BASE & RESET STYLES
   ========================================================================== */
@layer base {
  html, body {
    margin: 0;
    padding: 0;
  }
  
  body {
    overscroll-behavior: none;
    background-color: var(--color-surface);
    color: var(--color-on-surface);
    font-family: var(--font-body);
  }

  main > :first-child {
    margin-top: 0 !important;
  }

  main > :last-child {
    margin-bottom: 0 !important;
  }
}

/* Hide scrollbars while maintaining scroll functionality */
::-webkit-scrollbar {
  display: none;
}

* {
  scrollbar-width: none;
}

/* Selection colors */
::selection {
  background-color: var(--color-secondary-container);
  color: var(--color-on-secondary-container);
}

/* ==========================================================================
   PERFORMANCE & HARDWARE ACCELERATION
   ========================================================================== */
.hw-accel {
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ==========================================================================
   CUSTOM UTILITIES & MICRO-INTERACTIONS
   ========================================================================== */

/* Ambient technical glow effect */
.glow-primary {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, rgba(37, 99, 235, 0) 70%);
}

.glow-secondary {
  background: radial-gradient(circle, rgba(0, 245, 255, 0.25) 0%, rgba(0, 245, 255, 0) 70%);
}

/* Gradient Headlines */
.text-gradient-hero {
  background: linear-gradient(to right, #ffffff, #67e8f9, #00f5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Button & Interactive Glows */
.btn-electric {
  background-color: var(--color-secondary-fixed);
  color: var(--color-on-secondary-fixed);
  box-shadow: var(--shadow-glow-cyan);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-electric:hover {
  box-shadow: var(--shadow-glow-cyan-hover);
  transform: scale(1.02);
}

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

/* Glassmorphism & Surface Insets */
.glass-panel {
  background: rgba(224, 227, 229, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-panel-hover:hover {
  background: rgba(224, 227, 229, 0.15);
}

/* ==========================================================================
   MICRO-DIAGRAMS & KINETIC GRAPHICS
   ========================================================================== */

/* Code box typing cursor */
.code-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background-color: var(--color-secondary-fixed);
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Stream Router connector pulses */
.stream-connector {
  position: relative;
  overflow: hidden;
}

.stream-pulse {
  animation: streamFlow 1.8s infinite linear;
}

@keyframes streamFlow {
  0% { transform: translateX(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* Funnel row scale expansion */
.funnel-row {
  transform-origin: left center;
  will-change: transform, opacity;
}

/* Card Hover Elevation & Corner Arrow Kinetic Glide */
/* NOTE: transition-all has been removed from card elements in HTML.
   GSAP handles entrance (opacity, y/x, scale) with clearProps:'all'.
   CSS only handles the hover lift (transform) and box-shadow here.
   The two layers never fight because clearProps:'all' removes the
   GSAP inline style before any hover is possible. */
.interactive-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.interactive-card:hover {
  transform: translateY(-4px);
}

.corner-arrow {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.interactive-card:hover .corner-arrow {
  transform: translate(3px, -3px);
}

/* Gantt Progress Bars */
.gantt-bar-fill {
  transform-origin: left center;
  will-change: transform, width;
}

/* Giant Footer Watermark */
.footer-watermark {
  font-family: var(--font-headline);
  font-size: clamp(6rem, 22.8vw, 23vw);
  letter-spacing: -0.04em;
  line-height: 0.75;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.05);
  user-select: none;
  white-space: nowrap;
  display: block;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

/* SVG Line Draw Utility */
.path-draw {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  will-change: stroke-dashoffset;
}

/* ==========================================================================
   REDUCED MOTION PREFERENCES (ACCESSIBILITY)
   ========================================================================== */
@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;
  }

  .footer-watermark {
    transform: translateY(20%) !important;
  }

  .interactive-card:hover {
    transform: none !important;
  }
}
