/* ─────────────────────────────────────────────
   CAR SHOWCASE — STYLESHEET
   Aesthetic: Luxury Editorial Dark
   Fonts: Bebas Neue (display) + Outfit (body)
───────────────────────────────────────────── */

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

:root {
  --accent: #e8c97a;
  --text: #f0ece3;
  --dim: rgba(240, 236, 227, 0.4);
  --dark: #080808;
  --nav-h: 88px;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--dark);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: default;
}

/* ── Custom cursor ─────────────────────────── */
body::after {
  content: '';
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  transition: transform 0.1s, opacity 0.2s;
  left: var(--cx, -100px);
  top: var(--cy, -100px);
}

/* ── Background gradient ───────────────────── */
#bg-gradient {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: background 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: radial-gradient(ellipse 80% 60% at 60% 50%, #1a0a00 0%, #050505 70%);
}

/* ── Noise overlay ─────────────────────────── */
#noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── Canvas ────────────────────────────────── */
#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 2;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Top bar ───────────────────────────────── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 48px;
  background: linear-gradient(to bottom, rgba(8, 8, 8, 0.7) 0%, transparent 100%);
}

#logo {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  color: var(--accent);
  font-weight: 800;
}

#back-to-main {
  min-width: 74px;
  height: 36px;
  border: 1px solid rgba(240, 236, 227, 0.22);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

#back-to-main:hover,
#back-to-main:focus-visible {
  border-color: var(--accent);
  outline: none;
}

#car-counter {
  font-size: 13px;
  color: var(--dim);
  font-weight: 300;
}

#car-counter .sep {
  margin: 0 6px;
  opacity: 0.4;
}

#current-index {
  color: var(--text);
}

/* ── Car info ──────────────────────────────── */
#car-info {
  position: fixed;
  left: 48px;
  bottom: calc(var(--nav-h) + 80px);
  pointer-events: none;
  /* no z-index here — avoids stacking context that traps mix-blend-mode */
}

#car-brand {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 6px;
  position: relative;
  z-index: 10;
}

#car-name {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(52px, 8vw, 96px);
  line-height: 0.92;
  color: var(--accent);
  /* color: aquamarine; */
  mix-blend-mode: difference;
  position: relative;
  z-index: 10;
  isolation: auto;
  filter: invert() hue-rotate(45deg);
}

#car-tagline {
  margin-top: 14px;
  font-size: 13px;
  color: var(--dim);
  font-weight: 300;
  font-style: italic;
  max-width: 280px;
  line-height: 1.6;
  position: relative;
  z-index: 10;
}

/* ── Specs ─────────────────────────────────── */
#car-specs {
  position: fixed;
  right: 48px;
  bottom: calc(var(--nav-h) + 80px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  pointer-events: none;
}

.spec {
  text-align: center;
}

.spec-value {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 36px;
  color: var(--text);
  line-height: 1;
}

.spec-label {
  margin-top: 5px;
  font-size: 9px;
  color: var(--dim);
  font-weight: 500;
}

.spec-divider {
  width: 1px;
  height: 40px;
  background: rgba(240, 236, 227, 0.15);
}

/* ── Accent line ───────────────────────────── */
#accent-line {
  position: fixed;
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  height: 1px;
  z-index: 9;
  background: rgba(240, 236, 227, 0.08);
  transition: background 1s ease;
}

/* ── Bottom nav ────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: linear-gradient(to top, rgba(8, 8, 8, 0.85) 0%, transparent 100%);
  backdrop-filter: blur(8px);
  padding: 0 48px;
}

.nav-arrow {
  background: none;
  border: none;
  color: var(--dim);
  cursor: pointer;
  padding: 8px;
  transition: color 0.25s, transform 0.25s;
  flex-shrink: 0;
}

.nav-arrow svg {
  width: 22px;
  height: 22px;
  display: block;
}

.nav-arrow:hover {
  color: var(--text);
  transform: scale(1.15);
}

#nav-track {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  max-width: calc(100vw - 200px);
  scrollbar-width: none;
  padding: 6px 0;
}

#nav-track::-webkit-scrollbar {
  display: none;
}

/* Nav dot (default — no model) */
.nav-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(240, 236, 227, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.nav-dot:hover {
  background: rgba(240, 236, 227, 0.5);
  transform: scale(1.4);
}

.nav-dot.active {
  width: 28px;
  border-radius: 4px;
  background: var(--accent);
}

/* Nav pill (named — shows label on hover) */
.nav-pill {
  flex-shrink: 0;
  position: relative;
  padding: 5px 14px;
  border: 1px solid rgba(240, 236, 227, 0.15);
  border-radius: 100px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--dim);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  color: var(--text);
  border-color: rgba(240, 236, 227, 0.4);
}

.nav-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #080808;
}

/* ── Loading screen ────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#loading-inner {
  width: 200px;
}

#loading-label {
  font-size: 10px;
  color: var(--dim);
  margin-bottom: 12px;
  text-align: center;
}

#loading-bar-track {
  width: 100%;
  height: 1px;
  background: rgba(240, 236, 227, 0.1);
  overflow: hidden;
}

#loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

/* ── Transition veil ───────────────────────── */
#transition-veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #080808;
  opacity: 0;
  pointer-events: none;
}

/* ── Vignette overlay ──────────────────────── */
/* Strength and softness are driven by CSS vars set from JS per-car.
   z-index 3 = above canvas, below all UI elements.              */
#vignette-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  /* Default radial gradient — JS overrides via style.background */
  background: radial-gradient(
    ellipse var(--vignette-size, 80%) var(--vignette-size, 70%) at 50% 50%,
    transparent 0%,
    var(--vignette-color, #000) 100%
  );
  opacity: var(--vignette-strength, 0.72);
  transition: opacity 1s ease, background 1s ease;
}

/* ── Per-car colour tint overlay ───────────── */
/* Used for cinematic colour grading effects (e.g. cold blue tint,
   warm amber grade). JS sets background + opacity + mix-blend-mode. */
#color-tint {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;           /* default hidden — JS drives this per car */
  transition: background 1s ease, opacity 1s ease;
}

/* ── Canvas visual filter ──────────────────── */
/* JS applies per-car CSS filter string to the canvas container.
   The transition makes filter changes smooth on car switch.    */
#canvas-container {
  transition: filter 1s cubic-bezier(0.4, 0, 0.2, 1);
}