/* ============================================
   Carpilot — Custom Styles
   ============================================ */

:root {
  --base:          #0f1729;
  --base-light:    #1a2744;
  --base-dark:     #080e1c;
  --primary:       #6F814F;
  --primary-light: #AEB49D;
  --primary-dark:  #3F5548;
  --secondary:     #C8963E;
  --gray-warm:     #9ca3af;

  /* RGB variants for rgba() usage */
  --primary-rgb:    111, 129, 79;
  --base-light-rgb: 26, 39, 68;
  --base-dark-rgb:  8, 14, 28;
}

/* ========== GLOBAL RESETS ========== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: auto; /* GSAP handles smooth scrolling */
}

body {
  overflow-x: hidden;
}

::selection {
  background: rgba(var(--primary-rgb), 0.3);
  color: #fff;
}

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--base-dark); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ========== SCROLL PROGRESS BAR ========== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  z-index: 100;
  background: transparent;
}
.scroll-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.05s linear;
}

/* ========== PAGE LOADER ========== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--base-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(var(--primary-rgb), 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== NAVBAR ========== */
.navbar.scrolled {
  background: rgba(var(--base-dark-rgb), 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(var(--primary-rgb), 0.12), 0 8px 32px rgba(0,0,0,0.28);
}

.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width 0.3s ease;
}
.nav-link.active::after,
.nav-link:hover::after {
  width: 100%;
}
.nav-link.active {
  color: #fff;
}

/* ========== MOBILE MENU ========== */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}
.mobile-menu.open {
  transform: translateX(0);
  pointer-events: auto;
}

/* Hamburger animation */
#menuToggle.active .menu-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#menuToggle.active .menu-bar:nth-child(2) {
  opacity: 0;
}
#menuToggle.active .menu-bar:nth-child(3) {
  width: 1.5rem;
  transform: translateY(-8px) rotate(-45deg);
}

/* ========== HERO ========== */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hero content per-slide */
.hero-content {
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.hero-content.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}
.hero-content-wrapper {
  position: relative;
}

.hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.hero-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.4);
}

/* Hero Phone Mockup */
.hero-phone {
  animation: heroPhoneFloat 6s ease-in-out infinite;
  will-change: transform;
  cursor: pointer;
}
@keyframes heroPhoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Scroll Indicator */
.scroll-indicator {
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(1.5); opacity: 0.4; }
}

/* ========== GRADIENT TEXT ========== */
.gradient-text {
  background: linear-gradient(110deg, var(--primary-light) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== SECTION SYSTEM ========== */
.sp-section {
  position: relative;
  will-change: clip-path;
}

.section-bg-number {
  position: absolute;
  top: 2.5rem; right: 1.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(7rem, 16vw, 18rem);
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--primary-rgb), 0.07);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.section-eyebrow {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-rule {
  width: 56px; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 1px;
  margin-top: 1rem;
}

/* ========== FEATURE CARDS ========== */
.feature-card {
  background: rgba(var(--base-light-rgb), 0.6);
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  transition: border-color 0.35s, transform 0.35s, background 0.35s;
}
.feature-card:hover {
  border-color: rgba(var(--primary-rgb), 0.5);
  transform: translateY(-6px);
  background: rgba(var(--base-light-rgb), 0.85);
}

/* ========== 3D TILT CARDS ========== */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,0.35),
              0 0 0 1px rgba(var(--primary-rgb), 0.05) inset;
}
.tilt-card:hover {
  box-shadow: 0 20px 50px -10px rgba(var(--primary-rgb), 0.2),
              0 8px 20px -4px rgba(0,0,0,0.4),
              0 0 0 1px rgba(var(--primary-rgb), 0.15) inset;
}

.card-texture {
  position: absolute; inset: 0;
  opacity: 0.03;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(var(--primary-rgb), 0.8) 1px, transparent 1px),
    radial-gradient(circle at 70% 60%, rgba(var(--primary-rgb), 0.6) 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(var(--primary-rgb), 0.4) 0.5px, transparent 0.5px);
  background-size: 30px 30px, 45px 45px, 20px 20px;
  transition: opacity 0.3s;
}
.tilt-card:hover .card-texture { opacity: 0.06; }

/* ========== JOURNEY TIMELINE — HOW IT WORKS ========== */
.journey-timeline {
  position: relative;
}

/* Central line */
.journey-line {
  overflow: hidden;
}
.journey-line-bg {
  border-radius: 1px;
}
.journey-line-fill {
  border-radius: 1px;
  transition: height 0.05s linear;
}

/* Dashed overlay on the line */
.journey-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 6px,
    var(--base-dark) 6px,
    var(--base-dark) 12px
  );
  z-index: 1;
}

/* Icon ring pulsing */
.journey-icon-ring {
  position: relative;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.journey-icon-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  animation: ringPulse 3s ease-in-out infinite;
}
.journey-icon-ring::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 1px solid rgba(var(--primary-rgb), 0.07);
  animation: ringPulse 3s ease-in-out 0.6s infinite;
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.3; }
}

/* Steps entrance */
.journey-step {
  opacity: 0;
  transform: translateY(40px);
}

/* Finished step states — added by JS */

/* ========== SECTION SIDE DOTS ========== */
.dot-btn {
  position: relative;
  padding: 6px;
  cursor: pointer;
  background: none;
  border: none;
}
.dot-btn::before {
  content: attr(data-label);
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--primary-light);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.dot-btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(-8px);
}
.dot {
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}
.dot.active {
  background: var(--primary);
  box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
  transform: scale(1.3);
}

/* ========== WORD SPLIT TEXT ========== */
.txt-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.txt-word-inner {
  display: inline-block;
}

/* ========== STAT ITEMS ========== */
.stat-item {
  transform: scale(0.88);
  opacity: 0;
}

/* ========== RESPONSIVE HERO HEIGHT ========== */
@supports (height: 100svh) {
  #hero { height: 100svh; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-indicator { animation: none; }
  .hero-slide { transition: opacity 0.01ms; }
}

/* ========== MOBILE ADJUSTMENTS ========== */
@media (max-width: 639px) {
  .section-bg-number {
    opacity: 0.5;
    top: 1rem; right: 0.75rem;
  }
}
