/**
 * WeDRIVE - Shared Animation & Transition Library
 * shared/css/animation.css
 *
 * USAGE: Add these classes directly in HTML — no JS needed for most effects.
 * For scroll-triggered .slide-* effects, add class "show" via JS or IntersectionObserver.
 *
 * INDEX:
 *   1.  Keyframe Definitions
 *   2.  Fade Effects
 *   3.  Slide Effects
 *   4.  Scale / Zoom Effects
 *   5.  Button Effects
 *   6.  Card Effects
 *   7.  Nav Link Effects
 *   8.  Form / Input Effects
 *   9.  Table Row Effects
 *   10. Loader / Skeleton
 *   11. Stagger Delays
 *   12. Reduced Motion Override
 */

/* ═══════════════════════════════════════════════════════
   1. KEYFRAME DEFINITIONS
   ═══════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes zoomOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.85); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes rippleOut {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35); }
  100% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.5); }
  60%  { opacity: 1; transform: scale(1.08); }
  80%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

@keyframes slideDownOpen {
  from { opacity: 0; transform: translateY(-8px) scaleY(0.95); }
  to   { opacity: 1; transform: translateY(0) scaleY(1); }
}


/* ═══════════════════════════════════════════════════════
   2. FADE EFFECTS
   ═══════════════════════════════════════════════════════ */

/* Instant on load */
.fade-in       { animation: fadeIn      0.45s ease both; }
.fade-in-up    { animation: fadeInUp    0.50s ease both; }
.fade-in-down  { animation: fadeInDown  0.50s ease both; }
.fade-in-left  { animation: fadeInLeft  0.50s ease both; }
.fade-in-right { animation: fadeInRight 0.50s ease both; }
.zoom-in       { animation: zoomIn      0.40s cubic-bezier(.4,0,.2,1) both; }
.bounce-in     { animation: bounceIn    0.55s cubic-bezier(.4,0,.2,1) both; }

/* Scroll-triggered: add .show via JS / IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.reveal-onload {
  opacity: 0; /* Prevents FOUC before JS anime.js starts */
}


.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal-left.show {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal-right.show {
  opacity: 1;
  transform: translateX(0);
}


/* ═══════════════════════════════════════════════════════
   3. SLIDE EFFECTS  (legacy-friendly, JS adds .show)
   ═══════════════════════════════════════════════════════ */

.slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease;
}
.slide-up.show {
  opacity: 1;
  transform: translateY(0);
}

.slide-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.5s ease;
}
.slide-down.show {
  opacity: 1;
  transform: translateY(0);
}

.slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.5s ease;
}
.slide-left.show {
  opacity: 1;
  transform: translateX(0);
}

.slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.5s ease;
}
.slide-right.show {
  opacity: 1;
  transform: translateX(0);
}

/* Dropdown / menu open */
.dropdown-anim {
  animation: slideDownOpen 0.22s cubic-bezier(.4,0,.2,1) both;
  transform-origin: top center;
}


/* ═══════════════════════════════════════════════════════
   4. SCALE / FLOAT EFFECTS
   ═══════════════════════════════════════════════════════ */

.float     { animation: floatY 3s ease-in-out infinite; }
.pulse     { animation: pulse  2s ease-in-out infinite; }
.spin-slow { animation: spin   8s linear infinite; }

.hover-scale {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.hover-scale:hover {
  transform: scale(1.04);
}

.hover-lift {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.13);
}


/* ═══════════════════════════════════════════════════════
   5. BUTTON EFFECTS
   ═══════════════════════════════════════════════════════ */

/* Generic animated button (works alongside existing .btn-primary / .btn-outline) */
.btn-anim {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.22s ease;
}
.btn-anim:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(99,102,241,0.28);
}
.btn-anim:active {
  transform: scale(0.96);
}

/* Ripple click effect (pure CSS — needs overflow:hidden on parent) */
.btn-ripple {
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.25);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-ripple:active::after {
  opacity: 1;
}

/* Glow pulse on hover */
.btn-glow:hover {
  animation: rippleOut 0.5s ease-out;
}

/* Shake — use on form error: element.classList.add('shake') */
.shake { animation: shake 0.45s ease; }


/* ═══════════════════════════════════════════════════════
   6. CARD EFFECTS
   ═══════════════════════════════════════════════════════ */

.card-hover {
  transition: transform 0.25s ease,
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}
.card-hover:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 16px 40px rgba(0,0,0,0.14);
}

/* Image inside card zoom */
.card-img-zoom img,
.card-img-zoom .card-img {
  transition: transform 0.4s ease;
  overflow: hidden;
}
.card-img-zoom:hover img,
.card-img-zoom:hover .card-img {
  transform: scale(1.08);
}

/* Tilt on hover (subtle) */
.card-tilt {
  transition: transform 0.25s ease;
}
.card-tilt:hover { transform: perspective(600px) rotateX(3deg) rotateY(-3deg); }


/* ═══════════════════════════════════════════════════════
   7. NAV LINK EFFECTS
   ═══════════════════════════════════════════════════════ */

/* Underline slide-in from left */
.nav-underline {
  position: relative;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.28s cubic-bezier(.4,0,.2,1);
  border-radius: 2px;
}
.nav-underline:hover::after,
.nav-underline.active::after { width: 100%; }

/* Color fade */
.nav-color {
  transition: color 0.2s ease, opacity 0.2s ease;
}
.nav-color:hover { opacity: 0.75; }


/* ═══════════════════════════════════════════════════════
   8. FORM / INPUT EFFECTS
   ═══════════════════════════════════════════════════════ */

/* Focus ring animation */
.input-anim {
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.input-anim:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
  outline: none;
}

/* Floating label (pair with JS to add .filled class) */
.form-float {
  position: relative;
}
.form-float label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #94a3b8;
  pointer-events: none;
  transition: all 0.22s ease;
}
.form-float input:focus + label,
.form-float input.filled + label,
.form-float select:focus + label {
  top: 6px;
  font-size: 10px;
  color: #6366f1;
  transform: none;
}

/* Error shake */
.input-error {
  border-color: #ef4444 !important;
  animation: shake 0.4s ease;
}


/* ═══════════════════════════════════════════════════════
   9. TABLE ROW EFFECTS
   ═══════════════════════════════════════════════════════ */

.table-hover-row tbody tr {
  transition: background 0.18s ease, transform 0.18s ease;
}
.table-hover-row tbody tr:hover {
  background: rgba(99,102,241,0.06) !important;
  transform: scaleX(1.002);
}


/* ═══════════════════════════════════════════════════════
   10. LOADER / SKELETON EFFECTS
   ═══════════════════════════════════════════════════════ */

/* Spinning loader */
.loader {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(99,102,241,0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.loader-sm { width: 18px; height: 18px; border-width: 2px; }
.loader-lg { width: 44px; height: 44px; border-width: 4px; }

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-card  { height: 180px; border-radius: 12px; }


/* ═══════════════════════════════════════════════════════
   11. PREMIUM MOTION UTILITIES
   Reusable premium micro-motion for hero bands, cards, and glass surfaces
   ═══════════════════════════════════════════════════════ */

@keyframes sheenSweep {
  0% {
    transform: translateX(-165%) skewX(-18deg);
    opacity: 0;
  }
  20% {
    opacity: 0.08;
  }
  48% {
    opacity: 0.42;
  }
  100% {
    transform: translateX(230%) skewX(-18deg);
    opacity: 0;
  }
}

.motion-sheen {
  position: relative;
  isolation: isolate;
}

.motion-sheen::after {
  content: '';
  position: absolute;
  top: -22%;
  bottom: -22%;
  left: -30%;
  width: 34%;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-165%) skewX(-18deg);
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.03) 18%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.02) 82%,
    rgba(255,255,255,0) 100%
  );
}

.motion-sheen:hover::after,
.motion-sheen:focus-within::after,
.motion-sheen.is-inview::after {
  animation: sheenSweep 1.25s cubic-bezier(.22,1,.36,1) both;
}

.premium-hover {
  --motion-hover-y: 0px;
  --motion-hover-scale: 1;
  --magnetic-x: 0px;
  --magnetic-y: 0px;
  transition:
    transform 0.38s cubic-bezier(.22,1,.36,1),
    box-shadow 0.38s cubic-bezier(.22,1,.36,1),
    border-color 0.28s ease,
    filter 0.28s ease;
  transform: translate3d(var(--magnetic-x), calc(var(--magnetic-y) + var(--motion-hover-y)), 0)
             scale(var(--motion-hover-scale));
  will-change: transform;
}

.premium-hover:hover {
  --motion-hover-y: -8px;
  --motion-hover-scale: 1.01;
  filter: saturate(1.02);
}

.premium-hover-soft {
  transition:
    transform 0.32s cubic-bezier(.22,1,.36,1),
    box-shadow 0.32s cubic-bezier(.22,1,.36,1);
}

.premium-hover-soft:hover {
  transform: translateY(-4px);
}

.magnetic-hover,
[data-magnetic] {
  --magnetic-x: 0px;
  --magnetic-y: 0px;
  transform: translate3d(var(--magnetic-x), var(--magnetic-y), 0);
  transition: transform 0.28s cubic-bezier(.22,1,.36,1),
              box-shadow 0.28s cubic-bezier(.22,1,.36,1);
  will-change: transform;
}

.magnetic-hover.is-magnetic,
[data-magnetic].is-magnetic {
  transition-duration: 0.08s;
}

.motion-nav-scrolled {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(15,23,42,0.10);
}

.wedrive-cursor-dot,
.wedrive-cursor-ring,
.wedrive-cursor-label {
  position: fixed;
  left: 50%;
  top: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.wedrive-cursor-dot {
  z-index: 100002;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 0 16px rgba(96,165,250,0.42);
  transition: width 0.24s cubic-bezier(.22,1,.36,1), height 0.24s cubic-bezier(.22,1,.36,1), opacity 0.2s ease, background 0.2s ease;
  mix-blend-mode: difference;
}

.wedrive-cursor-ring {
  z-index: 100001;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,0.44);
  background: rgba(96,165,250,0.04);
  box-shadow: 0 0 30px rgba(96,165,250,0.14);
  transition: width 0.42s cubic-bezier(.22,1,.36,1), height 0.42s cubic-bezier(.22,1,.36,1), border-color 0.24s ease, background 0.24s ease, border-radius 0.34s cubic-bezier(.22,1,.36,1), opacity 0.2s ease;
}

.wedrive-cursor-label {
  z-index: 100003;
  padding-top: 1px;
  color: #0F172A;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(.22,1,.36,1);
}

body.motion-cursor-visible .wedrive-cursor-dot,
body.motion-cursor-visible .wedrive-cursor-ring {
  opacity: 1;
}

body.motion-cursor-hover .wedrive-cursor-dot,
body.motion-cursor-magnetic .wedrive-cursor-dot,
body.motion-cursor-link .wedrive-cursor-dot {
  width: 0;
  height: 0;
  opacity: 0;
}

body.motion-cursor-hover .wedrive-cursor-ring {
  width: 58px;
  height: 58px;
  border-color: rgba(96,165,250,0.58);
  background: rgba(96,165,250,0.10);
}

body.motion-cursor-magnetic .wedrive-cursor-ring {
  width: 86px;
  height: 86px;
  border-color: rgba(255,255,255,0);
  background: linear-gradient(135deg, rgba(219,234,254,0.94) 0%, rgba(96,165,250,0.84) 100%);
  box-shadow: 0 22px 54px rgba(37,99,235,0.28);
}

body.motion-cursor-media .wedrive-cursor-dot,
body.motion-cursor-drag .wedrive-cursor-dot {
  width: 9px;
  height: 9px;
  background: #FACC15;
  opacity: 1;
  mix-blend-mode: normal;
}

body.motion-cursor-media .wedrive-cursor-ring {
  width: 84px;
  height: 84px;
  border-color: rgba(250,204,21,0.58);
  background: rgba(250,204,21,0.06);
}

body.motion-cursor-drag .wedrive-cursor-ring {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border-color: rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.08);
}

body.motion-cursor-link .wedrive-cursor-ring {
  width: 24px;
  height: 24px;
  border-color: rgba(96,165,250,0.74);
  background: rgba(96,165,250,0.16);
}

body.motion-cursor-click .wedrive-cursor-ring {
  width: 22px;
  height: 22px;
  border-color: rgba(250,204,21,0.92);
  background: rgba(250,204,21,0.20);
}

body.motion-cursor-has-label .wedrive-cursor-label {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (pointer: fine) and (min-width: 821px) {
  body.motion-cursor-ready,
  body.motion-cursor-ready a,
  body.motion-cursor-ready button,
  body.motion-cursor-ready [role="button"],
  body.motion-cursor-ready input,
  body.motion-cursor-ready select,
  body.motion-cursor-ready textarea,
  body.motion-cursor-ready label,
  body.motion-cursor-ready [data-cursor],
  body.motion-cursor-ready [data-vehicle-stage] {
    cursor: none !important;
  }
}

.motion-ripple-host {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.motion-ripple {
  position: absolute;
  z-index: 0;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(255,255,255,0.28);
  transform: scale(0);
  animation: motionRippleOut 0.72s cubic-bezier(.22,1,.36,1) forwards;
}

.motion-ripple-host > * {
  position: relative;
  z-index: 1;
}

@keyframes motionRippleOut {
  to {
    opacity: 0;
    transform: scale(3.8);
  }
}

.motion-spotlight,
[data-spotlight] {
  --spotlight-x: 50%;
  --spotlight-y: 50%;
}

.motion-spotlight::after,
[data-spotlight]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle 360px at var(--spotlight-x) var(--spotlight-y), rgba(96,165,250,0.12) 0%, rgba(96,165,250,0) 70%);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.motion-spotlight:hover::after,
[data-spotlight]:hover::after {
  opacity: 1;
}

[data-tilt-card] {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --tilt-glare-x: 50%;
  --tilt-glare-y: 50%;
  transform:
    perspective(1100px)
    rotateX(var(--tilt-y))
    rotateY(var(--tilt-x))
    translate3d(0, 0, 0);
  transform-style: preserve-3d;
  transition:
    transform 0.42s cubic-bezier(.22,1,.36,1),
    box-shadow 0.32s ease,
    border-color 0.28s ease;
  will-change: transform;
}

[data-tilt-card].is-tilting {
  transition-duration: 0.08s;
}

[data-tilt-layer] {
  transform: translateZ(var(--tilt-depth, 20px));
  transform-style: preserve-3d;
}

[data-tilt-glare] {
  background: radial-gradient(circle at var(--tilt-glare-x) var(--tilt-glare-y), rgba(255,255,255,0.46) 0%, rgba(255,255,255,0) 48%);
}

.kinetic-text {
  --motion-progress: 0;
  --kinetic-active: var(--text-primary, #0F172A);
  --kinetic-muted: rgba(100,116,139,0.42);
  color: var(--kinetic-muted);
  background-image: linear-gradient(
    90deg,
    var(--kinetic-active) 0%,
    var(--kinetic-active) calc(var(--motion-progress) * 100%),
    var(--kinetic-muted) calc(var(--motion-progress) * 100%),
    var(--kinetic-muted) 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kinetic-light {
  --kinetic-active: #FFFFFF;
  --kinetic-muted: rgba(226,232,240,0.36);
}

.kinetic-ready {
  --kinetic-stagger: 42ms;
  overflow-wrap: anywhere;
}

.motion-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.motion-word,
.motion-char {
  display: inline-block;
  will-change: transform, opacity, filter;
  transition:
    opacity 0.78s cubic-bezier(.22,1,.36,1),
    transform 0.78s cubic-bezier(.22,1,.36,1),
    filter 0.78s cubic-bezier(.22,1,.36,1);
  transition-delay: calc(var(--i, 0) * var(--kinetic-stagger));
}

.kinetic-words-ready .motion-word {
  opacity: 0;
  transform: translateY(112%) rotate(2deg);
  filter: blur(8px);
}

.kinetic-chars-ready .motion-char {
  opacity: 0;
  transform: translateY(104%) scale(0.96);
  filter: blur(6px);
}

.kinetic-visible .motion-word,
.kinetic-visible .motion-char {
  opacity: 1;
  transform: translateY(0) rotate(0) scale(1);
  filter: blur(0);
}

[data-scramble] {
  display: inline-flex;
  min-height: 1em;
}

.motion-depth {
  --motion-progress: 0;
  transform:
    translate3d(0, calc((1 - var(--motion-progress)) * 18px), 0)
    scale(calc(0.985 + (var(--motion-progress) * 0.015)));
  transition: box-shadow 0.28s ease, border-color 0.28s ease;
}

.sequence-canvas,
canvas[data-image-sequence],
canvas[data-motion-canvas] {
  display: block;
  width: 100%;
  height: 100%;
}

.premium-scrolly {
  --scrolly-progress: 0;
  position: relative;
  min-height: 360vh;
  overflow: visible;
  background: #020617;
  color: #FFFFFF;
}

.premium-scrolly-sticky {
  position: sticky;
  top: 0;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.premium-scrolly-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.premium-scrolly-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2,6,23,0.78) 0%, rgba(2,6,23,0.28) 48%, rgba(2,6,23,0.74) 100%),
    radial-gradient(circle at 50% 52%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 36%);
}

.premium-scrolly-stage {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: center;
  gap: 40px;
  padding: 92px 0;
}

.premium-scrolly-phase-wrap {
  position: relative;
  min-height: 360px;
}

.premium-scrolly-phase {
  position: absolute;
  inset: 0 auto auto 0;
  max-width: 720px;
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  filter: blur(10px);
  transition:
    opacity 0.62s cubic-bezier(.22,1,.36,1),
    transform 0.62s cubic-bezier(.22,1,.36,1),
    filter 0.62s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}

.premium-scrolly-phase.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.premium-scrolly-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  color: #BFDBFE;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(14px);
}

.premium-scrolly-title {
  margin: 20px 0 18px;
  color: #FFFFFF;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 24px 54px rgba(2,6,23,0.36);
}

.premium-scrolly-copy {
  max-width: 610px;
  margin: 0;
  color: rgba(226,232,240,0.88);
  font-size: 18px;
  line-height: 1.72;
}

.premium-scrolly-meter {
  align-self: center;
  justify-self: end;
  width: min(100%, 330px);
  padding: 20px;
  border-radius: 26px;
  background: rgba(15,23,42,0.42);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 26px 70px rgba(2,6,23,0.34);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(16px);
}

.premium-scrolly-meter-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.12);
}

.premium-scrolly-meter-fill {
  display: block;
  width: calc(var(--scrolly-progress) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60A5FA 0%, #FACC15 100%);
  box-shadow: 0 0 28px rgba(96,165,250,0.38);
}

.premium-scrolly-dots {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.premium-scrolly-dot {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: rgba(226,232,240,0.62);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  transition: color 0.28s ease, transform 0.28s ease;
}

.premium-scrolly-dot::before {
  content: attr(data-step);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: rgba(226,232,240,0.74);
  font-size: 11px;
  font-weight: 900;
}

.premium-scrolly-dot.is-active {
  color: #FFFFFF;
  transform: translateX(4px);
}

.premium-scrolly-dot.is-active::before {
  background: #DBEAFE;
  color: #1D4ED8;
}

.premium-marquee {
  overflow: hidden;
  border-top: 1px solid rgba(148,163,184,0.16);
  border-bottom: 1px solid rgba(148,163,184,0.16);
}

.premium-marquee-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: premiumMarquee 24s linear infinite;
}

.premium-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 28px;
  color: rgba(148,163,184,0.42);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.premium-marquee-item::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60A5FA;
  box-shadow: 0 0 20px rgba(96,165,250,0.7);
}

@keyframes premiumMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.premium-vehicle-showcase {
  --vehicle-accent: #60A5FA;
  --vehicle-accent-rgb: 96,165,250;
  --vehicle-body: #F8FBFF;
  --vehicle-body-dark: #AFC5E8;
  --vehicle-glass: rgba(37,99,235,0.22);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 18%, rgba(96,165,250,0.18) 0%, rgba(96,165,250,0) 34%),
    linear-gradient(135deg, #EEF6FF 0%, #FFFFFF 46%, #E6F0FF 100%);
  color: #0F172A;
  border-top: 1px solid rgba(148,163,184,0.18);
  border-bottom: 1px solid rgba(148,163,184,0.18);
}

.premium-vehicle-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(460px, 1.12fr);
  gap: 48px;
  align-items: center;
  padding: 112px 0;
}

.premium-vehicle-copy {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.premium-vehicle-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(96,165,250,0.18);
  color: #2563EB;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 14px 30px rgba(37,99,235,0.08);
}

.premium-vehicle-copy h2 {
  margin: 20px 0 16px;
  color: #0F172A;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.premium-vehicle-copy p {
  margin: 0;
  color: #475569;
  font-size: 17px;
  line-height: 1.78;
}

.premium-vehicle-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.premium-vehicle-stat {
  min-height: 104px;
  padding: 18px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(148,163,184,0.20);
  box-shadow: 0 16px 34px rgba(15,23,42,0.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.premium-vehicle-stat strong {
  display: block;
  color: #0F172A;
  font-size: 34px;
  line-height: 1;
}

.premium-vehicle-stat span {
  display: block;
  margin-top: 9px;
  color: #64748B;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.38;
  text-transform: uppercase;
}

.premium-vehicle-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.premium-vehicle-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(148,163,184,0.20);
  box-shadow: 0 14px 28px rgba(15,23,42,0.06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.premium-vehicle-colours {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.premium-vehicle-colours span {
  color: #64748B;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-swatch {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: var(--swatch, #60A5FA);
  box-shadow: inset 0 0 0 1px rgba(15,23,42,0.10), 0 10px 20px rgba(15,23,42,0.10);
  transform: translateZ(0);
  transition: transform 0.24s cubic-bezier(.22,1,.36,1), box-shadow 0.24s ease;
}

.vehicle-swatch:hover,
.vehicle-swatch.is-active {
  transform: translateY(-2px) scale(1.08);
  box-shadow: inset 0 0 0 3px #FFFFFF, 0 14px 28px rgba(37,99,235,0.22);
}

.premium-vehicle-view {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
}

.vehicle-viewer-card {
  position: relative;
  width: min(100%, 620px);
  min-height: 500px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(219,234,254,0.72) 100%),
    radial-gradient(circle at 50% 28%, rgba(var(--vehicle-accent-rgb),0.20) 0%, rgba(var(--vehicle-accent-rgb),0) 56%);
  border: 1px solid rgba(96,165,250,0.20);
  box-shadow: 0 34px 80px rgba(37,99,235,0.16), inset 0 1px 0 rgba(255,255,255,0.74);
  overflow: hidden;
  isolation: isolate;
}

.vehicle-viewer-card > * {
  position: relative;
  z-index: 1;
}

.vehicle-viewer-card::before {
  content: '';
  position: absolute;
  inset: 14% 10% auto;
  height: 54%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--vehicle-accent-rgb),0.28) 0%, rgba(var(--vehicle-accent-rgb),0) 68%);
  filter: blur(28px);
  opacity: 0.82;
}

.vehicle-floor {
  position: absolute;
  inset: auto 8% 10%;
  height: 42%;
  background-image:
    linear-gradient(rgba(37,99,235,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.42) 0%, rgba(0,0,0,0) 100%);
  transform: perspective(520px) rotateX(62deg);
  transform-origin: bottom center;
}

.vehicle-orbit {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,0.18);
  animation: vehicleOrbit 22s linear infinite;
}

.vehicle-orbit::after {
  content: '';
  position: absolute;
  inset: 24px;
  border-radius: inherit;
  border: 1px dashed rgba(250,204,21,0.26);
  animation: vehicleOrbit 30s linear infinite reverse;
}

.vehicle-shadow {
  position: absolute;
  left: 50%;
  bottom: 26%;
  width: 54%;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(15,23,42,0.22) 0%, rgba(15,23,42,0) 72%);
  filter: blur(10px);
  transform: translateX(-50%);
}

@keyframes vehicleOrbit {
  to { transform: rotate(360deg); }
}

.vehicle-3d-stage {
  position: relative;
  width: 360px;
  height: 230px;
  perspective: 980px;
  touch-action: pan-y;
}

.vehicle-sequence-stage {
  width: min(500px, 90%);
  height: 300px;
  perspective: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vehicle-3d-stage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -34px;
  transform: translateX(-50%);
  width: 74px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96,165,250,0.18) 0%, rgba(250,204,21,0.54) 50%, rgba(96,165,250,0.18) 100%);
  box-shadow: 0 12px 30px rgba(37,99,235,0.18);
}

.vehicle-sequence-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 24px;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.36s ease, transform 0.36s cubic-bezier(.22,1,.36,1);
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(241,245,249,0.94) 100%);
  box-shadow:
    0 18px 46px rgba(15,23,42,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.78);
  filter: drop-shadow(0 28px 48px rgba(15,23,42,0.14));
}

.vehicle-sequence-stage.is-ready .vehicle-sequence-canvas {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.has-real-sequence .vehicle-floor {
  opacity: 0.22;
}

.has-real-sequence .vehicle-shadow {
  opacity: 0.08;
}

.vehicle-3d-scene {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.05s linear;
}

.vehicle-model,
.vehicle-body,
.vehicle-cabin {
  position: absolute;
  transform-style: preserve-3d;
}

.vehicle-model {
  inset: 0;
}

.vehicle-body {
  left: 42px;
  bottom: 44px;
  width: 276px;
  height: 76px;
}

.vehicle-face {
  position: absolute;
  display: block;
  backface-visibility: visible;
}

.vehicle-body-front,
.vehicle-body-back {
  width: 276px;
  height: 76px;
  border-radius: 16px 20px 12px 12px;
  background: linear-gradient(180deg, var(--vehicle-body) 0%, var(--vehicle-body-dark) 100%);
  border: 1px solid rgba(15,23,42,0.12);
  box-shadow: inset 0 16px 34px rgba(255,255,255,0.28);
}

.vehicle-body-front {
  transform: translateZ(54px);
}

.vehicle-body-back {
  transform: rotateY(180deg) translateZ(54px);
}

.vehicle-body-top,
.vehicle-body-bottom {
  width: 276px;
  height: 108px;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--vehicle-body-dark) 100%);
  border: 1px solid rgba(15,23,42,0.10);
}

.vehicle-body-top {
  transform: rotateX(-90deg) translateZ(-54px);
}

.vehicle-body-bottom {
  background: #1E293B;
  transform: rotateX(90deg) translateZ(-22px);
}

.vehicle-body-left,
.vehicle-body-right {
  width: 108px;
  height: 76px;
  background: linear-gradient(90deg, var(--vehicle-body-dark) 0%, var(--vehicle-body) 100%);
  border: 1px solid rgba(15,23,42,0.12);
}

.vehicle-body-left {
  transform: rotateY(-90deg) translateZ(54px);
}

.vehicle-body-right {
  transform: rotateY(90deg) translateZ(222px);
}

.vehicle-lightbar {
  position: absolute;
  left: 64px;
  bottom: 122px;
  width: 232px;
  height: 5px;
  border-radius: 999px;
  background: var(--vehicle-accent);
  box-shadow: 0 0 18px rgba(var(--vehicle-accent-rgb),0.84), 0 0 34px rgba(var(--vehicle-accent-rgb),0.42);
  transform: translateZ(56px);
}

.vehicle-cabin {
  left: 86px;
  bottom: 120px;
  width: 172px;
  height: 66px;
}

.vehicle-cabin-front,
.vehicle-cabin-back {
  width: 172px;
  height: 66px;
  border-radius: 18px 20px 8px 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 45%),
    var(--vehicle-glass);
  border: 1px solid rgba(37,99,235,0.18);
}

.vehicle-cabin-front {
  transform: translateZ(52px);
}

.vehicle-cabin-back {
  transform: rotateY(180deg) translateZ(52px);
}

.vehicle-cabin-top {
  width: 172px;
  height: 104px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.62) 0%, var(--vehicle-glass) 100%);
  border: 1px solid rgba(37,99,235,0.12);
  transform: rotateX(-90deg) translateZ(-52px);
}

.vehicle-cabin-left,
.vehicle-cabin-right {
  width: 104px;
  height: 66px;
  background: var(--vehicle-glass);
  border: 1px solid rgba(37,99,235,0.12);
}

.vehicle-cabin-left {
  transform: rotateY(-90deg) translateZ(52px);
}

.vehicle-cabin-right {
  transform: rotateY(90deg) translateZ(120px);
}

.vehicle-wheel {
  position: absolute;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: radial-gradient(circle at 36% 32%, #64748B 0%, #1E293B 42%, #020617 100%);
  border: 7px solid #0F172A;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.14), 0 14px 24px rgba(15,23,42,0.22);
}

.vehicle-wheel::before,
.vehicle-wheel::after {
  content: '';
  position: absolute;
  border-radius: inherit;
}

.vehicle-wheel::before {
  inset: 11px;
  border: 3px solid rgba(var(--vehicle-accent-rgb),0.42);
}

.vehicle-wheel::after {
  inset: 21px;
  background: var(--vehicle-accent);
  box-shadow: 0 0 18px rgba(var(--vehicle-accent-rgb),0.58);
}

.vehicle-wheel-front-left {
  left: 62px;
  bottom: 18px;
  transform: translateZ(58px);
}

.vehicle-wheel-front-right {
  right: 62px;
  bottom: 18px;
  transform: translateZ(58px);
}

.vehicle-wheel-back-left {
  left: 62px;
  bottom: 18px;
  transform: translateZ(-54px);
}

.vehicle-wheel-back-right {
  right: 62px;
  bottom: 18px;
  transform: translateZ(-54px);
}

.vehicle-controls {
  position: absolute;
  left: 50%;
  bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  transform: translateX(-50%);
  width: calc(100% - 40px);
}

.vehicle-control {
  min-width: 72px;
  padding: 9px 14px;
  border: 1px solid rgba(96,165,250,0.20);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  transition: background 0.24s ease, color 0.24s ease, transform 0.24s cubic-bezier(.22,1,.36,1), border-color 0.24s ease;
}

.vehicle-control:hover,
.vehicle-control.is-active {
  transform: translateY(-2px);
  border-color: rgba(var(--vehicle-accent-rgb),0.46);
  background: rgba(var(--vehicle-accent-rgb),0.13);
  color: #1D4ED8;
}

@media (max-width: 820px) {
  .premium-scrolly {
    min-height: 330vh;
  }

  .premium-scrolly-stage {
    width: min(100% - 32px, 620px);
    grid-template-columns: 1fr;
    align-content: center;
    gap: 24px;
    padding: 92px 0 74px;
  }

  .premium-scrolly-phase-wrap {
    min-height: 390px;
  }

  .premium-scrolly-title {
    font-size: 48px;
  }

  .premium-scrolly-copy {
    font-size: 16px;
  }

  .premium-scrolly-meter {
    justify-self: stretch;
    width: 100%;
    padding: 16px;
    border-radius: 22px;
  }

  .premium-vehicle-shell {
    width: min(100% - 32px, 680px);
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 78px 0;
  }

  .premium-vehicle-copy {
    max-width: none;
  }

  .premium-vehicle-stats {
    grid-template-columns: 1fr;
  }

  .premium-vehicle-badges {
    gap: 8px;
  }

  .premium-vehicle-view {
    min-height: 430px;
  }

  .vehicle-viewer-card {
    min-height: 420px;
    border-radius: 28px;
  }

  .vehicle-3d-stage {
    width: min(320px, 82vw);
    height: 210px;
    transform: scale(0.88);
  }

  .vehicle-sequence-stage {
    width: min(360px, 86vw);
    height: 236px;
    transform: none;
  }
}

.reveal-blur {
  opacity: 0;
  filter: blur(10px);
}

[data-parallax] {
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform;
}


/* ═══════════════════════════════════════════════════════
   12. STAGGER DELAYS  (pair with .fade-in / .reveal)
   ═══════════════════════════════════════════════════════ */

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }
.delay-6 { animation-delay: 0.50s; }


/* ═══════════════════════════════════════════════════════
   13. REDUCED MOTION OVERRIDE
   Respect user OS preference — disable animations
   ═══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════
   14. BACKGROUND PARTICLES  (opt-in: add data-particles on <body>)
   ═══════════════════════════════════════════════════════
   Shapes are injected by main.js Section 4.
   To enable on any page, add:
     <body data-particles>
   ─────────────────────────────────────────────────────── */

.bg-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  animation: particleFloat var(--dur, 12s) ease-in-out infinite,
             particleFadeIn 1.2s ease forwards;
  will-change: transform;
  filter: blur(1px);
}

@keyframes particleFloat {
  0%   { transform: translate(0, 0)     scale(1); }
  33%  { transform: translate(var(--tx1, 30px), var(--ty1, -40px)) scale(1.05); }
  66%  { transform: translate(var(--tx2, -20px), var(--ty2, 20px)) scale(0.97); }
  100% { transform: translate(0, 0)     scale(1); }
}

@keyframes particleFadeIn {
  to { opacity: var(--max-opacity, 0.18); }
}

@keyframes stitchFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Day-mode particles */
[data-particles] .bg-particle {
  background: radial-gradient(circle at 40% 40%,
    rgba(59, 130, 246, 0.6),
    rgba(139, 92, 246, 0.2));
}

/* Night-mode particles — injected theme class will override */
body.night-mode .bg-particle,
[data-particles].night-bg .bg-particle {
  background: radial-gradient(circle at 40% 40%,
    rgba(96, 165, 250, 0.5),
    rgba(167, 139, 250, 0.15));
}

/* Gradient animated background (optional, apply via .grad-bg class on body) */
@keyframes gradientShift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

body.grad-bg {
  background: linear-gradient(135deg,
    var(--hero-bg-start, #1E293B),
    var(--hero-bg-mid,   #0F172A),
    var(--hero-bg-end,   #1D4ED8),
    var(--hero-bg-start, #1E293B));
  background-size: 300% 300%;
  animation: gradientShift 18s ease infinite;
}
