:root {
  --bg: #0a0e13;
  --panel: #101720;
  --viewer: #d6dbe2;
  --line: #263442;
  --text: #e8eef5;
  --muted: #93a4b5;
  --accent: #5aa7b5;
  --accent-dim: #2f6d78;
  --active: #8fd0db;
  --touch: 2.75rem;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #15202c 0%, transparent 55%),
    var(--bg);
  color: var(--text);
}

.page {
  width: min(100% - 2rem, 1200px);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.page-header { margin-bottom: 1.25rem; }

.brand {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 650;
  line-height: 1.15;
}

.lede {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
  line-height: 1.5;
}

.visualizer {
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--panel);
}

.vehicle-picker {
  padding: 1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.vehicle-scroller {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.vehicle-card {
  appearance: none;
  display: grid;
  gap: 0.45rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #121a23;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.vehicle-card:hover { border-color: var(--accent-dim); }

.vehicle-card.active {
  border-color: var(--accent);
  background: #16303a;
}

.vehicle-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 0.4rem;
  background: var(--viewer);
}

.vehicle-card .card-label {
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.2;
}

.vehicle-card .card-desc {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.vehicle-card.active .card-label { color: var(--active); }

.visualizer-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  min-height: 28rem;
}

.preview-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  background: #0d141c;
}

.vehicle-preview {
  position: relative;
  aspect-ratio: 3 / 2;
  min-height: 20rem;
  overflow: hidden;
  background: #9aa3ae;
}

.preview-stage {
  position: absolute;
  inset: 0;
  transform-origin: 55% 32%;
  transition: transform 0.35s ease;
  will-change: transform;
}

.vehicle-preview .layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.layer-bg {
  z-index: 0;
  object-fit: cover;
  object-position: center 65%;
}

.vehicle-base { z-index: 1; }
.vehicle-tint {
  z-index: 2;
  opacity: 0.5;
  transition: opacity 0.28s ease;
}

.vehicle-reflections {
  z-index: 3;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.preview-tools {
  position: absolute;
  z-index: 5;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}

.zoom-controls,
.bg-switcher {
  display: inline-flex;
  gap: 0.3rem;
  pointer-events: auto;
  padding: 0.25rem;
  border-radius: 0.55rem;
  background: rgba(10, 14, 19, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.zoom-controls button {
  appearance: none;
  min-height: 2.1rem;
  min-width: 2.4rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.zoom-controls button.active {
  background: var(--accent);
  color: #061014;
}

.bg-swatch {
  appearance: none;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.4rem;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background-size: cover;
  background-position: center;
}

.bg-swatch.active {
  border-color: var(--active);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.bg-studio {
  background:
    radial-gradient(ellipse 70% 50% at 50% 70%, #cfd5dc 0%, #aeb6c0 55%, #9aa3ae 100%);
}

.bg-highway {
  background-image: url('/assets/backgrounds/highway.webp');
}

.bg-city {
  background-image: url('/assets/backgrounds/city.webp');
}

.compare-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.75rem 1rem 1rem;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.compare-toggle button,
.tint-list button {
  appearance: none;
  border: 1px solid var(--line);
  background: #121a23;
  color: var(--text);
  border-radius: 0.5rem;
  min-height: var(--touch);
  padding: 0.55rem 0.7rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.compare-toggle button {
  text-align: center;
  font-weight: 600;
}

.compare-toggle button:hover,
.tint-list button:hover { border-color: var(--accent-dim); }

.compare-toggle button.active,
.tint-list button.active {
  border-color: var(--accent);
  background: #16303a;
  color: var(--active);
}

.controls-panel {
  padding: 1.15rem;
  border-left: 1px solid var(--line);
  overflow: auto;
}

.tint-slider-block {
  display: none;
  margin-bottom: 0.85rem;
}

.tint-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

#tint-slider-label {
  font-weight: 650;
  font-size: 1rem;
}

#tint-slider-vlt {
  color: var(--muted);
  font-size: 0.82rem;
}

#tint-slider {
  width: 100%;
  accent-color: var(--accent);
  height: 1.5rem;
  cursor: pointer;
}

.tint-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.tint-list {
  display: grid;
  gap: 0.4rem;
}

.tint-list button {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
}

.tint-list .tint-meta {
  display: grid;
  gap: 0.1rem;
}

.tint-list .tint-label { font-weight: 650; }

.tint-list .tint-vlt {
  color: var(--muted);
  font-size: 0.78rem;
}

.tint-list button.active .tint-vlt { color: var(--active); }

.tint-list .badge {
  justify-self: end;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
}

.swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.3rem;
  border: 1px solid #5a6a7a;
  flex-shrink: 0;
}

.cta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--line);
  background: #0d141c;
}

.selection-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0.65rem 1.1rem;
  border-radius: 0.55rem;
  background: var(--accent);
  color: #061014;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s;
}

.cta-button:hover { filter: brightness(1.08); }

@media (max-width: 760px) {
  .page {
    width: min(100% - 1rem, 1200px);
    padding-top: 0.85rem;
  }

  .page-header { margin-bottom: 0.85rem; }

  .lede { font-size: 0.92rem; }

  .vehicle-picker {
    padding: 0.75rem 0.75rem 0.55rem;
  }

  .vehicle-scroller {
    display: flex;
    overflow-x: auto;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .vehicle-card {
    position: relative;
    flex: 0 0 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    gap: 0;
    padding: 0.18rem;
    scroll-snap-align: start;
    align-content: center;
  }

  .vehicle-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 55% 42%;
  }

  .vehicle-card .card-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .vehicle-card .card-desc { display: none; }

  .visualizer-body {
    display: block;
    min-height: 0;
  }

  .vehicle-preview {
    aspect-ratio: 5 / 4;
    min-height: 14.5rem;
  }

  .preview-tools {
    left: 0.45rem;
    right: 0.45rem;
    bottom: 0.45rem;
  }

  .zoom-controls button {
    min-height: 2rem;
    min-width: 2.15rem;
    font-size: 0.72rem;
    padding: 0.25rem 0.45rem;
  }

  .bg-swatch {
    width: 1.65rem;
    height: 1.65rem;
  }

  .controls-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 0.9rem 0.85rem 1rem;
  }

  .tint-slider-block { display: block; }

  .tint-list { display: none; }

  .cta-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
  }

  .cta-button { width: 100%; }
}

@media (min-width: 761px) {
  .tint-slider-block { display: none; }
  .tint-list { display: grid; }
}
