/* BMS Motors Riviera. Noir studio ; rouge = action et étape en cours, vert = étape franchie. */
:root {
  --noir: #000000;
  --carbone: #0D0E10;
  --trait: rgba(255, 255, 255, .12);
  --acier: #9198A1;
  --blanc: #F3F4F5;
  --rouge: #E3262E;
  --rouge-vif: #FF3B42;
  --vert: #2FD67B;
  --gutter: clamp(16px, 4vw, 56px);
  --wide: "wdth" 125;
  --narrow: "wdth" 75;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--noir);
  color: var(--blanc);
  font: 400 1.0625rem/1.6 "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; font-variation-settings: var(--wide); line-height: 1.02; letter-spacing: -.02em; }
h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); max-width: 18ch; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--vert); outline-offset: 3px; }
.wrap { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blanc); color: var(--noir); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 24px;
  font: inherit; font-weight: 600; font-size: .98rem; text-decoration: none;
  border: 1.5px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-red { background: var(--rouge); color: #fff; }
.btn-red:hover { background: var(--rouge-vif); }
.btn-line { border-color: rgba(255,255,255,.45); color: var(--blanc); }
.btn-line:hover { border-color: var(--blanc); background: rgba(255,255,255,.08); }
.btn:disabled { opacity: .6; cursor: wait; }

/* En-tête */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 32px;
  height: 64px; padding-inline: var(--gutter);
  transition: background-color .3s;
}
.top.solid { background: rgba(0, 0, 0, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--trait); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-variation-settings: var(--wide); margin-right: auto; }
.brand img { border-radius: 50%; }
.brand em { font-style: normal; font-weight: 400; color: var(--acier); }
.nav { display: flex; gap: 28px; }
.nav a, .top-call { text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--vert); }
.top-call { font-weight: 600; font-variant-numeric: tabular-nums; }
.burger { display: none; }

/* Showroom 3D */
.show { position: relative; height: 700vh; }
.show-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--noir); }
.show-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.show-canvas.ready { opacity: 1; }
.show-shade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 38%),
  linear-gradient(to bottom, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 18%); }
.show-load { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.08); transition: opacity .6s; }
.show-load i { display: block; height: 100%; width: 0; background: var(--vert); transition: width .3s; }
.show-load.done { opacity: 0; }

.chap {
  position: absolute; z-index: 2;
  opacity: 0; transform: translateY(24px); pointer-events: none;
  transition: opacity .6s ease, transform .6s ease;
}
.chap.is-on, .chap:focus-within { opacity: 1; transform: none; pointer-events: auto; }
.chap-hero { left: var(--gutter); right: var(--gutter); bottom: clamp(32px, 7vh, 72px); }
.hero-title { font-size: clamp(2.6rem, 7.2vw, 8rem); line-height: .92; letter-spacing: -.035em; font-weight: 800; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.hero-title .line span { display: block; animation: rise 1s cubic-bezier(.2,.7,.1,1) both; }
.hero-title .line + .line span { animation-delay: .12s; font-variation-settings: var(--narrow); font-weight: 300; color: var(--acier); }
.hero-sub { margin-top: 24px; max-width: 46ch; color: rgba(243,244,245,.82); animation: fade .8s .5s both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; animation: fade .8s .6s both; }
.scroll-hint { position: absolute; right: 0; bottom: 6px; font-size: .9rem; color: var(--acier); animation: fade .8s 1s both; }
.scroll-hint::after { content: ""; display: inline-block; width: 1px; height: 28px; margin-left: 12px; vertical-align: middle; background: var(--vert); animation: pulse 2s ease-in-out infinite; }
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 50% { transform: scaleY(.3); opacity: .4; } }

.chap-list { position: absolute; inset: 0; pointer-events: none; }
.chap-list .chap { top: 50%; margin-top: -120px; width: min(440px, calc(100% - 2 * var(--gutter))); }
.chap-left { left: var(--gutter); }
.chap-right { right: calc(var(--gutter) + 150px); }
.chap-num { color: var(--rouge-vif); font-weight: 600; font-size: .95rem; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.chap h2 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
.chap-list .chap p:not(.chap-num) { margin-top: 18px; font-size: 1.15rem; color: rgba(243,244,245,.86); max-width: 34ch; }
.chap-end .btn { margin-top: 28px; }
/* halo sombre derrière le texte des étapes, pour la lisibilité sur la carrosserie */
.chap-list .chap::before { content: ""; position: absolute; inset: -60px -80px; z-index: -1; background: radial-gradient(closest-side, rgba(0,0,0,.72), rgba(0,0,0,0)); pointer-events: none; }

.rail {
  position: absolute; z-index: 2; right: var(--gutter); top: 50%; transform: translateY(-50%);
  list-style: none; margin: 0; padding: 0; display: grid; gap: 18px;
  font-size: .88rem; color: rgba(243,244,245,.4);
  opacity: 0; transition: opacity .5s;
}
.rail.is-on { opacity: 1; }
.rail li { display: flex; align-items: center; gap: 12px; transition: color .3s; }
.rail li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; transition: background-color .3s, border-color .3s, box-shadow .3s; }
.rail li.done { color: rgba(243,244,245,.65); }
.rail li.done::before { background: var(--vert); border-color: var(--vert); }
.rail li.now { color: var(--blanc); font-weight: 600; }
.rail li.now::before { background: var(--rouge); border-color: var(--rouge); box-shadow: 0 0 0 4px rgba(227,38,46,.25); }

/* Repli sans WebGL ou mouvement réduit : lecture à plat */
.no3d .show { height: auto; }
.no3d .show-stage { position: static; height: auto; overflow: visible; }
.no3d .show-canvas, .no3d .show-load, .no3d .rail, .no3d .scroll-hint, .no3d .show-shade { display: none; }
.no3d .chap, .no3d .chap-list .chap { position: static; opacity: 1; pointer-events: auto; transform: none; margin: 0; width: auto; }
.no3d .chap-hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 96px var(--gutter) 56px; background: linear-gradient(to top, #000 10%, rgba(0,0,0,.4)), url(/images/vehicules/home.jpg) center / cover; }
.no3d .chap-list { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 40px; padding: 96px var(--gutter); max-width: 1440px; margin-inline: auto; }
.no3d .chap h2 { font-size: 1.8rem; }
.no3d .chap-list .chap::before { display: none; }

/* Véhicules */
.stock { padding-block: clamp(80px, 12vw, 160px) clamp(56px, 8vw, 112px); }
.stock-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 80px); }
.stock-head p { color: var(--acier); max-width: 44ch; }
.car {
  display: grid; grid-template-columns: minmax(240px, 26%) minmax(0, 1fr); gap: 32px;
  padding: 28px 0 28px var(--gutter); border-top: 1px solid var(--trait);
}
.car:last-of-type { border-bottom: 1px solid var(--trait); }
.car-info { display: flex; flex-direction: column; gap: 10px; align-self: start; position: sticky; top: 92px; }
.car-info h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.car-meta { color: var(--acier); }
.car-ask { margin-top: 8px; align-self: flex-start; font-weight: 600; color: var(--rouge-vif); text-underline-offset: 5px; }
.car-ask:hover { color: var(--blanc); }
.car-photos { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-right: var(--gutter); scrollbar-width: thin; scrollbar-color: #444 transparent; }
.car-photos img { height: clamp(340px, 62vh, 640px); width: auto; aspect-ratio: 2 / 3; object-fit: cover; flex: none; scroll-snap-align: start; background: var(--carbone); }
.car-photos img.wide { aspect-ratio: 3 / 2; }
.car-photos img.square { aspect-ratio: 1; }
.car-photos img.crop-top { object-position: top; aspect-ratio: 1024 / 1170; }
.stock-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin-top: 48px; }
.stock-more p { font-size: 1.15rem; max-width: 40ch; }

/* Concession */
.house { padding-block: clamp(72px, 11vw, 150px); background: var(--carbone); }
.house-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.house-photo { margin: 0; }
.house-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 60%; }
.house-text > p { margin-top: 20px; max-width: 52ch; color: rgba(243,244,245,.86); }
.house-facts { margin: 32px 0 0; display: grid; gap: 14px; }
.house-facts div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding-top: 14px; border-top: 1px solid var(--trait); }
.house-facts dt { color: var(--acier); }
.house-facts dd { margin: 0; }
.quotes { margin-top: 56px; display: grid; gap: 36px; }
.quotes blockquote { margin: 0; padding-left: 20px; border-left: 2px solid var(--vert); }
.quotes p { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.45; font-weight: 300; max-width: 46ch; }
.quotes footer { margin-top: 12px; color: var(--acier); font-size: .95rem; }

/* Contact */
.contact { padding-block: clamp(72px, 11vw, 150px); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(40px, 6vw, 96px); }
.contact-side > p { margin-top: 18px; color: var(--acier); }
.contact-lines { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 10px; }
.contact-lines a { font-size: clamp(1.1rem, 1.8vw, 1.4rem); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact-lines a:hover { color: var(--vert); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 24px; align-content: start; }
.field { display: grid; gap: 6px; }
.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--acier); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--blanc); width: 100%;
  padding: 12px 0; background: transparent;
  border: 0; border-bottom: 1.5px solid rgba(255,255,255,.22); border-radius: 0;
}
.field select option { background: var(--carbone); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--vert); }
.field input::placeholder, .field textarea::placeholder { color: #5F656C; }
.field :user-invalid { border-bottom-color: var(--rouge-vif); }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--acier); }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--vert); flex: none; }
.form-end { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form-message:empty { display: none; }
.form-message.success { color: var(--vert); font-weight: 600; }
.form-message.error { color: var(--rouge-vif); font-weight: 600; }

/* Pied de page */
.foot { border-top: 1px solid var(--trait); color: var(--acier); padding-block: 56px 32px; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 32px; }
.foot-brand { color: var(--blanc); font-weight: 700; font-variation-settings: var(--wide); font-size: 1.2rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--blanc); text-decoration: underline; }
.foot-links { display: grid; gap: 6px; align-content: start; }
.foot-credit { margin-top: 40px; font-size: .8rem; color: #5F656C; }

/* Responsive */
@media (max-width: 960px) {
  .nav { position: fixed; inset: 64px 0 auto; flex-direction: column; gap: 0; background: #000; border-bottom: 1px solid var(--trait); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 16px var(--gutter); border-top: 1px solid var(--trait); font-size: 1.1rem; }
  .burger { display: grid; place-content: center; gap: 6px; width: 44px; height: 44px; background: none; border: 0; color: inherit; cursor: pointer; }
  .burger span { display: block; width: 22px; height: 2px; background: currentColor; transition: transform .2s; }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .stock-head, .house-grid, .contact-grid { grid-template-columns: 1fr; }
  .car { grid-template-columns: 1fr; gap: 18px; }
  .car-info { position: static; padding-right: var(--gutter); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  /* sur mobile, le texte des étapes passe en bas, la voiture reste visible au-dessus */
  .chap-list .chap { top: auto; bottom: 64px; margin-top: 0; left: var(--gutter); right: var(--gutter); width: auto; }
  .chap-list .chap p:not(.chap-num) { font-size: 1.05rem; }
  .show-shade { background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,0) 55%), linear-gradient(to bottom, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 18%); }
  .rail { top: auto; bottom: 20px; left: var(--gutter); right: var(--gutter); transform: none; display: flex; gap: 6px; }
  .rail li { flex: 1; font-size: 0; gap: 0; }
  .rail li::before { width: 100%; height: 3px; border-radius: 0; border: 0; background: rgba(255,255,255,.18); box-shadow: none !important; }
  .rail li.done::before { background: var(--vert); }
  .rail li.now::before { background: var(--rouge); }
  .scroll-hint { display: none; }
}
@media (max-width: 600px) {
  .top-call { display: none; }
  .form { grid-template-columns: 1fr; }
  .car-photos img { height: 58vh; max-height: 520px; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
