/* ==========================================================================
   AMPLENTIX — GROWTH + TECHNOLOGY SYSTEMS
   Awwwards / Production-Grade Design System & Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. DESIGN TOKENS & CSS VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Page & Surface Backgrounds (Light Theme Defaults) */
  --bg-page: #F3F2EE;
  --bg-surface: #E8E7E2;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-subtle: #DEDDD7;

  /* Dark Theme Backgrounds */
  --bg-dark: #0E0F10;
  --bg-dark-surface: #161719;
  --bg-dark-card: #141517;

  /* Typography / Text Colors */
  --text-ink: #101010;             /* Crisp carbon dark text for light surfaces */
  --text-muted: #555550;           /* High-contrast readable muted text */
  --text-muted-dark: #7A7A74;
  --text-light: #F3F2EE;           /* Light text for dark sections */
  --text-light-muted: #9E9E98;     /* Muted text for dark sections */

  /* Accents */
  --accent: #00FF66;               /* Electric Signal Green */
  --accent-amber: #FF5500;
  --accent-blue: #0088FF;
  --accent-glow: rgba(0, 255, 102, 0.3);

  /* Borders */
  --border-light: rgba(16, 16, 16, 0.12);
  --border-medium: rgba(16, 16, 16, 0.22);
  --border-dark: rgba(243, 242, 238, 0.15);

  /* Typography Fonts */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;

  /* Layout & Grid */
  --grid-max-width: 1600px;
  --grid-gap: 2rem;
  --nav-height: 80px;

  /* Animation Easing Tokens */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-cinematic: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --------------------------------------------------------------------------
   02. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-ink);
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-page);
  color: var(--text-ink);
  min-height: 100vh;
}

::selection {
  background: var(--accent);
  color: #000000;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* Typography Utilities */
.font-display { font-family: var(--font-display); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* Text Color Classes */
.text-ink { color: var(--text-ink) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-muted-dark { color: var(--text-muted-dark) !important; }
.text-light { color: var(--text-light) !important; }
.text-light-muted { color: var(--text-light-muted) !important; }
.text-accent { color: var(--accent) !important; }

/* Background Color Classes */
.bg-page { background-color: var(--bg-page) !important; }
.bg-surface { background-color: var(--bg-surface) !important; }
.bg-surface-elevated { background-color: var(--bg-surface-elevated) !important; }
.bg-dark { background-color: var(--bg-dark) !important; }
.bg-dark-surface { background-color: var(--bg-dark-surface) !important; }

/* Border Classes */
.border-border-light { border-color: var(--border-light) !important; }
.border-border-medium { border-color: var(--border-medium) !important; }
.border-border-dark { border-color: var(--border-dark) !important; }

/* Text stroke outline effect for high-contrast kinetic typography */
.text-stroke-effect {
  -webkit-text-stroke: 1.5px rgba(16, 16, 16, 0.85);
  color: transparent !important;
}
.bg-dark .text-stroke-effect,
.text-stroke-light {
  -webkit-text-stroke: 1.5px rgba(243, 242, 238, 0.75);
  color: transparent !important;
}

/* --------------------------------------------------------------------------
   03. CUSTOM CURSOR
   -------------------------------------------------------------------------- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: block;
}

.cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: var(--text-ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.1s ease;
  pointer-events: none;
}

.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(16, 16, 16, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s var(--ease-smooth), height 0.3s var(--ease-smooth), background-color 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
}

.cursor-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #000000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Hover States for Cursor */
body.cursor-hover .cursor-ring {
  width: 68px;
  height: 68px;
  background-color: var(--accent);
  border-color: var(--accent);
}
body.cursor-hover .cursor-label {
  opacity: 1;
}
body.cursor-hover .cursor-dot {
  opacity: 0;
}

@media (pointer: coarse), (max-width: 1024px) {
  .custom-cursor {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   04. GLOBAL TECH GRID & TELEMETRY
   -------------------------------------------------------------------------- */
.global-tech-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.45;
}

.grid-vertical-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--border-light) 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
}

.grid-horizontal-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to bottom, var(--border-light) 1px, transparent 1px);
  background-size: 100% 120px;
}

.grid-crosshairs .crosshair {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.5;
  user-select: none;
}
.cross-tl { top: 20px; left: 24px; }
.cross-tr { top: 20px; right: 24px; }
.cross-bl { bottom: 20px; left: 24px; }
.cross-br { bottom: 20px; right: 24px; }
.cross-c { top: 50%; left: 50%; transform: translate(-50%, -50%); }

.grid-coordinates {
  position: absolute;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  user-select: none;
}
.coord-tl { top: 24px; left: 48px; }
.coord-tr { top: 24px; right: 150px; }
.coord-bl { bottom: 24px; left: 48px; }
.coord-br { bottom: 24px; right: 48px; }

/* Scroll Progress indicator */
.global-scroll-telemetry {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.scroll-track {
  width: 2px;
  height: 90px;
  background-color: var(--border-medium);
  position: relative;
  overflow: hidden;
}
.scroll-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: var(--accent);
  transition: height 0.05s linear;
}
.scroll-readout {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .global-scroll-telemetry, .grid-coordinates {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   05. CINEMATIC PRELOADER
   -------------------------------------------------------------------------- */
.preloader-curtain {
  position: fixed;
  inset: 0;
  background-color: var(--bg-dark);
  color: var(--text-light);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: clip-path 1.2s var(--ease-cinematic), opacity 0.6s ease;
  clip-path: inset(0 0 0 0);
}

.preloader-curtain.loaded {
  clip-path: inset(100% 0 0 0);
  pointer-events: none;
}

.preloader-digits {
  font-size: clamp(64px, 12vw, 160px);
  line-height: 1;
  color: var(--text-light) !important;
}

.pulse-led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse-glow 1.5s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Sound Wave bars in top nav */
.sound-wave .bar {
  width: 2px;
  background-color: var(--text-ink);
  border-radius: 1px;
  transition: height 0.2s ease;
}
.sound-wave .bar-1 { height: 4px; }
.sound-wave .bar-2 { height: 8px; }
.sound-wave .bar-3 { height: 6px; }

.sound-active .sound-wave .bar-1 { animation: wave-anim 0.6s infinite alternate ease-in-out; }
.sound-active .sound-wave .bar-2 { animation: wave-anim 0.8s infinite alternate ease-in-out 0.2s; }
.sound-active .sound-wave .bar-3 { animation: wave-anim 0.7s infinite alternate ease-in-out 0.4s; }

@keyframes wave-anim {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* Glass Pill button */
.glass-pill {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(243, 242, 238, 0.85);
  color: var(--text-ink);
}

/* --------------------------------------------------------------------------
   06. NAVIGATION & HEADER
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: transform 0.4s var(--ease-smooth), background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
  color: var(--text-ink);
}

.site-header.sticky {
  background-color: rgba(243, 242, 238, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.site-header.nav-hidden {
  transform: translateY(-100%);
}

.header-container {
  max-width: var(--grid-max-width);
  margin: 0 auto;
  padding: 1.25rem 2.5rem;
  height: var(--nav-height);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px var(--accent);
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  transition: color 0.3s ease;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--text-ink);
}
.nav-link span {
  color: var(--accent);
  margin-right: 4px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: var(--text-ink);
  transition: width 0.3s var(--ease-smooth);
}
.nav-link:hover::after {
  width: 100%;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  background-color: var(--bg-dark);
  color: var(--text-light);
  z-index: 99;
  transform: translateY(-100%);
  transition: transform 0.6s var(--ease-cinematic);
  pointer-events: none;
}
.mobile-nav-drawer.open {
  transform: translateY(0);
  pointer-events: auto;
}

.burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-ink);
  transition: transform 0.3s ease, background-color 0.3s ease;
}
#mobile-menu-trigger.active .line-1 {
  transform: translateY(4px) rotate(45deg);
  background-color: var(--text-light);
}
#mobile-menu-trigger.active .line-2 {
  transform: translateY(-4px) rotate(-45deg);
  background-color: var(--text-light);
}

/* --------------------------------------------------------------------------
   07. BUTTONS & MAGNETIC INTERACTION
   -------------------------------------------------------------------------- */
.magnetic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1.6rem;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-smooth), background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  will-change: transform;
}

.btn-primary {
  background-color: var(--text-ink) !important;
  color: var(--text-light) !important;
  border: 1px solid var(--text-ink) !important;
}
.btn-primary:hover {
  background-color: var(--accent) !important;
  color: #000000 !important;
  border-color: var(--accent) !important;
}
.btn-primary:hover .btn-arrow {
  transform: translate(3px, -3px);
}

.btn-secondary {
  background-color: transparent !important;
  color: var(--text-ink) !important;
  border: 1.5px solid var(--border-medium) !important;
}
.btn-secondary:hover {
  border-color: var(--text-ink) !important;
  background-color: rgba(16, 16, 16, 0.06) !important;
}

.btn-accent {
  background-color: var(--accent) !important;
  color: #000000 !important;
  border: 1px solid var(--accent) !important;
  font-weight: 700;
}
.btn-accent:hover {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  color: #000000 !important;
}

.btn-dark-outline {
  background-color: transparent !important;
  color: var(--text-light) !important;
  border: 1.5px solid var(--border-dark) !important;
}
.btn-dark-outline:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.btn-arrow {
  transition: transform 0.25s var(--ease-smooth);
}

/* --------------------------------------------------------------------------
   08. HERO SECTION
   -------------------------------------------------------------------------- */
.hero-section {
  min-height: 100vh;
  padding-bottom: 2rem;
  color: var(--text-ink);
}

.hero-headline {
  font-size: clamp(56px, 9vw, 140px);
  letter-spacing: -0.04em;
  color: var(--text-ink);
}

.hero-line-inner {
  display: block;
  color: var(--text-ink);
}

.scroll-line-anim {
  width: 40px;
  height: 2px;
  background-color: var(--border-medium);
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  background-color: var(--text-ink);
  animation: scroll-slide 1.8s infinite cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes scroll-slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(250%); }
  100% { transform: translateX(250%); }
}

/* --------------------------------------------------------------------------
   09. PINNED STORY ENGINE
   -------------------------------------------------------------------------- */
.story-step {
  opacity: 0.35;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(20px);
}
.story-step.active {
  opacity: 1;
  transform: translateY(0);
}

.status-tag {
  padding: 4px 8px;
  background: rgba(16, 16, 16, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. INTERACTIVE PARAMETER SANDBOX
   -------------------------------------------------------------------------- */
.custom-range {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: var(--border-medium);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
}
.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-ink);
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}
.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--accent);
}

.risk-pill-btn {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}
.risk-pill-btn.active {
  background: var(--text-ink);
  color: var(--text-light);
  border-color: var(--text-ink);
}

/* --------------------------------------------------------------------------
   11. MARQUEE & PARTNERS
   -------------------------------------------------------------------------- */
.marquee-strip-infinite {
  display: flex;
  animation: infinite-scroll 24s linear infinite;
}
@keyframes infinite-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-strip-infinite:hover {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   12. MODALS & POPUPS
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(14, 15, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s var(--ease-smooth);
}
.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE BREAKPOINTS & ACCESSIBILITY
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-headline {
    font-size: clamp(48px, 11vw, 84px);
  }
  .header-container {
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }
  .hero-headline {
    font-size: clamp(42px, 12vw, 68px);
  }
  .cases-sticky-container {
    position: relative !important;
    height: auto !important;
  }
  .cases-horizontal-track {
    flex-direction: column !important;
    transform: none !important;
    padding: 0 !important;
    gap: 1.5rem !important;
  }
  .case-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  .story-visualizer-container {
    display: none;
  }
}

@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;
  }
  .custom-cursor {
    display: none !important;
  }
}
