:root {
  --bg-dark: #070709;
  --bg-panel: #101116;
  --bg-card: rgba(18, 20, 26, 0.82);
  --orange: #f5c83b;
  --orange-light: #f8d664;
  --orange-glow: rgba(245, 200, 59, 0.45);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-orange: rgba(245, 200, 59, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: auto;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  overflow-x: hidden;
  selection-background-color: var(--orange);
}

::selection {
  background: var(--orange);
  color: #000;
}

h1, h2, h3, .font-display {
  font-family: 'Chakra Petch', sans-serif;
  letter-spacing: -0.01em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #070709;
}
::-webkit-scrollbar-thumb {
  background: #262936;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

/* Top Progress Bar */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #f5c83b, #ffe07d);
  box-shadow: 0 0 12px var(--orange);
  z-index: 9999;
  transition: width 0.06s linear;
}

/* Industrial Grid Background Overlay */
.bg-industrial-grid {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Glass Card */
.glass-panel {
  background: rgba(12, 13, 18, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.glass-panel-orange {
  background: linear-gradient(145deg, rgba(22, 20, 14, 0.9), rgba(12, 13, 18, 0.9));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 200, 59, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(245, 200, 59, 0.14);
}

/* Stage Viewport */
#story-pin-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #161922 0%, #070709 80%);
}

/* Full-Viewport Industrial Garage Door Effect */
#garage-door {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 45;
  background:
    radial-gradient(circle at 50% 85%, rgba(245, 200, 59, 0.14), transparent 60%),
    repeating-linear-gradient(
      to bottom,
      #14161d 0px,
      #14161d 34px,
      #090a0e 34px,
      #090a0e 40px
    );
  border-bottom: 5px solid var(--orange);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 6px 30px var(--orange-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
}

/* Warning hazard stripe at the bottom edge of the garage door */
#garage-door::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14px;
  background: repeating-linear-gradient(
    -45deg,
    #f5c83b,
    #f5c83b 16px,
    #111217 16px,
    #111217 32px
  );
}

/* Car Image Frame Stack - Locked to exact 1366x762 native image aspect ratio */
.car-stage-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.car-frame-wrapper {
  position: relative;
  /* Keeps exact 1366 / 762 ratio on all screens so hotspots never shift */
  width: min(94vw, calc(76vh * (1366 / 762)));
  aspect-ratio: 1366 / 762;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: #0b0c10;
}

.car-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  will-change: clip-path, opacity, transform, filter;
}

/* Vignette on car stage */
.car-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(7, 7, 9, 0.72) 100%),
    linear-gradient(to top, rgba(7, 7, 9, 0.85) 0%, transparent 25%, transparent 80%, rgba(7, 7, 9, 0.55) 100%);
  z-index: 15;
}

/* Wipe Divider Bars */
.wipe-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, #f5c83b, #fff, #f5c83b, transparent);
  box-shadow: 0 0 20px 4px rgba(245, 200, 59, 0.9), 0 0 40px 8px rgba(248, 214, 100, 0.5);
  z-index: 12;
  opacity: 0;
  pointer-events: none;
  will-change: left, opacity;
}

.wipe-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 64px;
  border-radius: 999px;
  background: #f5c83b;
  filter: blur(8px);
}

/* Mechanical Scanner Overlay (Scene 2) */
#mech-scanner-overlay {
  position: absolute;
  inset: 0;
  z-index: 11;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at 45% 58%, rgba(245, 200, 59, 0.16), rgba(6, 12, 24, 0.55) 70%);
}

#mech-laser-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 15%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, #f5c83b 20%, #fff1a8 50%, #f5c83b 80%, transparent);
  box-shadow: 0 0 24px 6px rgba(245, 200, 59, 0.85);
}

/* Pulse Hotspots (Scene 1) */
.hotspot {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 16;
  pointer-events: none;
}

.hotspot-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: var(--orange);
  border: 2px solid #fff;
  box-shadow: 0 0 16px var(--orange);
}

.hotspot-dot::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 9999px;
  border: 2px solid var(--orange);
  animation: pulse-ring 1.8s infinite ease-out;
}

.hotspot-label {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(7, 7, 9, 0.9);
  border: 1px solid rgba(245, 200, 59, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.75);
}

.hotspot-label-top {
  bottom: 14px;
}

.hotspot-label-bottom {
  top: 14px;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.7);
    opacity: 1;
  }
  100% {
    transform: scale(2.1);
    opacity: 0;
  }
}

/* Paint Mist Overlay (Scene 4) */
#paint-mist-overlay {
  position: absolute;
  inset: 0;
  z-index: 11;
  opacity: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 30% 50%, rgba(245, 200, 59, 0.22), transparent 55%),
    radial-gradient(circle at 70% 45%, rgba(37, 99, 235, 0.28), transparent 60%);
  mix-blend-mode: screen;
}

/* Polish Sheen Sweep (Scene 5) */
#polish-sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -35%;
  width: 28%;
  transform: skewX(-28deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(245, 200, 59, 0.28) 60%,
    transparent 100%
  );
  filter: blur(6px);
  z-index: 14;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Headlight Flare (Scene 5 & 6) */
#headlight-flare {
  position: absolute;
  left: 13.5%;
  top: 52%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(245, 200, 59, 0.55) 30%, transparent 70%);
  mix-blend-mode: screen;
  z-index: 14;
  opacity: 0;
  pointer-events: none;
}

/* Story Narrative Cards */
#scene-cards-stage {
  display: contents;
}

.scene-card {
  position: absolute;
  z-index: 30;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: border-color 0.3s ease;
}

.scene-card.is-active {
  pointer-events: auto;
}

/* Timeline Step Indicator */
.step-pill {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.step-pill.active {
  background: rgba(245, 200, 59, 0.18);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 0 20px rgba(245, 200, 59, 0.25);
}

.step-pill.active .step-num {
  background: var(--orange);
  color: #000;
}

/* Interactive Before/After Comparison Slider */
.compare-container {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 1366 / 762;
  touch-action: pan-y;
}

/* Invisible Range Input Overlay for 100% Reliable Mobile Touch & Desktop Drag */
.compare-range-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 35;
  -webkit-appearance: none;
  appearance: none;
  touch-action: pan-y;
}

.compare-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 48px;
  height: 1000px;
  cursor: ew-resize;
}

.compare-range-input::-moz-range-thumb {
  width: 48px;
  height: 1000px;
  cursor: ew-resize;
  border: none;
  background: transparent;
}

/* FAQ Accordion */
.faq-item {
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.faq-item.open {
  border-color: rgba(245, 200, 59, 0.5);
  background: rgba(245, 200, 59, 0.05);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating WhatsApp Pulse */
@keyframes wa-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55), 0 10px 25px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(37, 211, 102, 0), 0 10px 25px rgba(0, 0, 0, 0.5);
  }
}

.wa-floating-btn {
  animation: wa-pulse 2.4s infinite;
}

/* Responsive adjustments - Non-overlapping 4-row stage grid on mobile */
@media (max-width: 768px) {
  #story-pin-wrapper {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-columns: 100%;
    align-items: center;
    padding-top: 4.35rem;
    padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
    row-gap: 0.4rem;
  }

  #stage-live-pill {
    grid-row: 1;
    grid-column: 1;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    justify-self: start;
    margin: 0 0.75rem;
  }

  .car-stage-container {
    grid-row: 2;
    grid-column: 1;
    position: relative;
    width: 100%;
    height: auto;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem !important;
  }

  .car-frame-wrapper {
    width: min(95vw, calc(34vh * (1366 / 762)));
    width: min(95vw, calc(34svh * (1366 / 762)));
    aspect-ratio: 1366 / 762;
    border-radius: 14px;
  }

  .hotspot-dot {
    width: 12px;
    height: 12px;
  }

  .hotspot-label {
    font-size: 9.5px;
    padding: 2.5px 6px;
    border-radius: 5px;
  }

  .hotspot-label-top {
    bottom: 10px;
  }

  .hotspot-label-bottom {
    top: 10px;
  }

  #scene-cards-stage {
    grid-row: 3;
    grid-column: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 100%;
    align-items: center;
    padding: 0.1rem 0.75rem;
    overflow: hidden;
  }

  .scene-card {
    grid-row: 1;
    grid-column: 1;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0.65rem 0.85rem !important;
    border-radius: 13px !important;
  }

  .scene-card > div:first-child {
    font-size: 0.64rem !important;
    margin-bottom: 0.25rem !important;
    gap: 0.35rem !important;
  }

  .scene-card h1,
  .scene-card h2 {
    font-size: 1rem !important;
    line-height: 1.22 !important;
    margin-bottom: 0.25rem !important;
  }

  .scene-card p {
    font-size: 0.7rem !important;
    line-height: 1.36 !important;
    margin-bottom: 0.45rem !important;
  }

  .scene-card p:last-child {
    margin-bottom: 0 !important;
  }

  .scene-card a {
    padding: 0.38rem 0.75rem !important;
    font-size: 0.7rem !important;
    border-radius: 0.6rem !important;
  }

  #scene-card-2 .grid {
    padding-top: 0.35rem !important;
    gap: 0.35rem !important;
  }

  #scene-card-2 .grid > div {
    padding: 0.25rem 0.35rem !important;
  }

  #story-step-bar {
    grid-row: 4;
    grid-column: 1;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    padding: 0 0.75rem !important;
  }

  /* Hide floating WhatsApp icon while inside pinned story on mobile so it doesn't cover Step 6 or cards */
  body.in-story-stage .wa-floating-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.75);
  }
}

/* Compact mobile adjustments for shorter phone screens (e.g. iPhone SE / browser toolbars expanded) */
@media (max-width: 768px) and (max-height: 660px) {
  #story-pin-wrapper {
    padding-top: 4.15rem;
    row-gap: 0.25rem;
  }

  .car-frame-wrapper {
    width: min(92vw, calc(28vh * (1366 / 762)));
    width: min(92vw, calc(28svh * (1366 / 762)));
  }

  .scene-card {
    padding: 0.55rem 0.75rem !important;
  }

  .scene-card h1,
  .scene-card h2 {
    font-size: 0.92rem !important;
    margin-bottom: 0.2rem !important;
  }

  .scene-card p {
    font-size: 0.66rem !important;
    line-height: 1.32 !important;
    margin-bottom: 0.35rem !important;
  }
}
