/* ============================================
   3DLab - Cinematic Scroll Animations
   ============================================ */

/* ===== Preloader ===== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-logo {
  font-family: 'Space Grotesk', monospace;
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.preloader-bar {
  width: 240px;
  height: 3px;
  background: var(--glass-border);
  border-radius: 999px;
  overflow: hidden;
}
.preloader-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: width 0.2s linear;
}
.preloader-percent {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

/* ===== Scroll progress bar ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent-gradient);
  z-index: 200;
  transition: width 0.05s linear;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

/* ===== Custom cursor ===== */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #fff;
  transition: width 0.2s, height 0.2s, background 0.2s;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s;
}
.cursor-ring.hover {
  width: 64px; height: 64px;
  border-color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
}
.cursor-dot.hover { width: 10px; height: 10px; }

@media (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none; }
}

/* ===== Reveal animations ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal="left"] { transform: translateX(-60px); }
[data-reveal="right"] { transform: translateX(60px); }
[data-reveal="zoom"] { transform: scale(0.85); }
[data-reveal="fade"] { transform: none; }

[data-reveal].in-view {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger children */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-stagger].in-view > * {
  opacity: 1;
  transform: translateY(0);
}

/* Character reveal */
.char-reveal { display: inline-block; overflow: hidden; }
.char-reveal .char {
  transform: translateY(110%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.char-reveal.in-view .char { transform: translateY(0); }

/* ===== Hero section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 140px 40px 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-grid {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-content { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 28px;
  font-family: 'Space Grotesk', sans-serif;
}
.hero-title .line { display: block; }
.hero-title .outlined {
  -webkit-text-stroke: 2px var(--text-primary);
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-title .gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-description {
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 36px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 540px;
}
.stat-card {
  padding: 22px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  text-align: left;
  transition: transform 0.3s, border-color 0.3s;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--accent-cyan); }
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-height: 600px;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.hero-badge {
  position: absolute;
  padding: 10px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  font-size: 0.78rem;
  font-weight: 500;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: badge-float 4s ease-in-out infinite;
}
.hero-badge i { color: var(--accent-cyan); }
.hero-badge-1 { top: 10%; left: -5%; }
.hero-badge-2 { bottom: 20%; right: -5%; animation-delay: -2s; }
.hero-badge-3 { top: 55%; left: 2%; animation-delay: -3s; }
@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ===== Narrative / Story sections ===== */
.story-section {
  position: relative;
  padding: 140px 40px;
}
.story-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.story-section.reverse .story-grid {
  direction: rtl;
}
.story-section.reverse .story-grid > * { direction: ltr; }

.story-content { max-width: 520px; }
.story-heading {
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  margin-bottom: 24px;
  line-height: 1.05;
}
.story-heading .accent {
  display: block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.story-paragraph {
  font-size: 1.02rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.7;
}

/* Checklist */
.check-list {
  list-style: none;
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.98rem;
  color: var(--text-primary);
}
.check-list li i {
  width: 26px; height: 26px;
  min-width: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent-cyan);
  border-radius: 50%;
  font-size: 0.72rem;
  margin-top: 2px;
}

/* Spec tiles */
.spec-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 32px;
  max-width: 440px;
}
.spec-tile {
  padding: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  transition: transform 0.3s, border-color 0.3s;
}
.spec-tile:hover { transform: translateY(-3px); border-color: var(--accent-purple); }
.spec-tile-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.spec-tile-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

/* Media panel */
.story-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.story-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 1.2s ease;
}
.story-media:hover img { transform: scale(1.12); }

.story-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 50%, rgba(8, 9, 13, 0.85) 100%);
  pointer-events: none;
}

.media-caption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 2;
  padding: 10px 16px;
  background: rgba(8, 9, 13, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.media-caption .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

.media-chip {
  position: absolute;
  z-index: 3;
  padding: 14px 18px;
  background: rgba(14, 16, 22, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: #fff;
}
.media-chip-label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}
.media-chip-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.media-chip.top-right { top: 20px; right: 20px; }
.media-chip.bottom-right { bottom: 80px; right: 20px; }

/* ===== Sticky morphing "How It Works" section ===== */
.process-section {
  position: relative;
  padding: 140px 40px;
}
.process-wrapper {
  max-width: 1280px;
  margin: 0 auto;
}
.process-intro { text-align: center; margin-bottom: 80px; }
.process-sticky-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: flex-start;
}
.process-sticky-col {
  position: sticky;
  top: 120px; /* Pins it below your navbar */
  height: auto;
  display: flex;
  flex-direction: column;
}
.process-canvas-wrap {
  position: relative;
  height: 450px;
  width: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(168, 85, 247, 0.08));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
}
.process-canvas {
  width: 100% !important;
  height: 100% !important;
}
.process-chapters {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 120px;
  padding: 80px 0;
}
.process-chapter {
  transition: opacity 0.5s ease;
}
.chapter-number {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  margin-bottom: 14px;
}
.chapter-heading {
  font-size: 2.2rem;
  margin-bottom: 16px;
}
.chapter-text {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* ===== Services Overview ===== */
.services-section {
  padding: 140px 40px;
}
.services-wrapper {
  max-width: 1280px;
  margin: 0 auto;
}
.services-header {
  text-align: center;
  margin-bottom: 60px;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  padding: 36px 30px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.12), transparent 40%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.service-card:hover::before { opacity: 1; }
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 20px 60px rgba(34, 211, 238, 0.1);
}
.service-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-gradient);
  border-radius: 16px;
  font-size: 1.4rem;
  color: white;
  margin-bottom: 22px;
}
.service-card h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}
.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}
.service-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.25s;
}
.service-card:hover .service-link { gap: 14px; }

/* ===== Trust strip ===== */
.trust-strip {
  padding: 80px 40px;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}
.trust-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: center;
}
.trust-stat .value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  display: block;
}
.trust-stat .label {
  margin-top: 10px;
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===== Marquee ===== */
.marquee-section {
  overflow: hidden;
  padding: 40px 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}
.marquee {
  display: flex;
  gap: 60px;
  animation: marquee 35s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.marquee:hover { animation-play-state: paused; }
.marquee span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 60px;
}
.marquee span::after {
  content: '●';
  color: var(--accent-cyan);
  font-size: 0.8rem;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Final CTA ===== */
.cta-section {
  padding: 120px 40px;
  text-align: center;
}
.cta-box {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 40px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(168, 85, 247, 0.2), transparent 70%);
  pointer-events: none;
}
.cta-heading {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  margin-bottom: 18px;
  position: relative;
}
.cta-heading .accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cta-text {
  color: var(--text-secondary);
  font-size: 1.08rem;
  max-width: 560px;
  margin: 0 auto 32px;
  position: relative;
}
.cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
}

/* Magnetic buttons */
[data-magnetic] { will-change: transform; transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .hero-grid, .story-grid, .process-sticky-grid { grid-template-columns: 1fr; gap: 50px; }
  .hero-visual { max-width: 480px; margin: 0 auto; width: 100%; }
  .story-section.reverse .story-grid { direction: ltr; }
  .process-canvas-wrap { position: relative; top: 0; max-height: 500px; }
  .process-chapters { padding: 0; gap: 40px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { max-width: 100%; }
}
@media (max-width: 700px) {
  .hero, .story-section, .services-section, .process-section { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 120px; padding-bottom: 60px; }
  .story-section { padding-top: 80px; padding-bottom: 80px; }
  .services-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; gap: 30px; }
  .spec-tiles { grid-template-columns: 1fr; }
  .cta-box { padding: 50px 24px; }
  .hero-badge { display: none; }
  .media-chip.top-right { top: 12px; right: 12px; padding: 10px 12px; }
  .media-chip.bottom-right { bottom: 70px; right: 12px; padding: 10px 12px; }
  .media-chip-value { font-size: 1.05rem; }
}
@media (max-width: 900px) {
  .process-sticky-grid {
    grid-template-columns: 1fr;
  }
  .process-sticky-col {
    position: relative;
    top: 0;
  }
  .fleet-track {
    display: flex;
    flex-direction: column; /* Stack cards vertically on small phones */
    width: 100% !important;
    transform: none !important;
    padding: 20px;
    gap: 20px;
  }
  .fleet-section {
    height: auto !important;
  }
}
/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  .char-reveal .char { transform: none !important; }
  .cursor-dot, .cursor-ring { display: none; }
}
