/* CORVO GT — voir ../DESIGN.md pour les tokens et la justification de chaque choix */

:root {
  --ink: #0B0C0E;
  --ash: #17181B;
  --steel: #2B2E33;
  --bone: #EDEAE3;
  --smoke: #8B8D93;
  --smoke-dim: #55575D;
  --accent: #C9703B;
  --accent-bright: #F0A868;

  --font-display: "Big Shoulders Display", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "Space Mono", monospace;

  --space-1: 8px;  --space-2: 16px; --space-3: 24px; --space-4: 32px;
  --space-5: 48px; --space-6: 64px; --space-7: 96px; --space-8: 128px;

  --max-w: 1360px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; color: var(--bone); }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

/* ---------- Fond quadrillé (planche d'ingénieur) ---------- */
.grid-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--steel) 1px, transparent 1px),
    linear-gradient(90deg, var(--steel) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.14;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 90%);
}

#heat-canvas {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 var(--space-4);
  background: transparent;
  transition: background-color 240ms ease, backdrop-filter 240ms ease, border-color 240ms ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 12, 14, 0.88);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--steel);
}
.nav__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--bone);
  text-decoration: none;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav__links a {
  color: var(--smoke);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 160ms ease;
  position: relative;
}
.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--accent-bright);
  transition: width 220ms var(--ease-out-expo);
}
.nav__links a:not(.nav__cta):hover { color: var(--bone); }
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
  color: var(--ink) !important;
  background: var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  font-weight: 600;
  transition: background-color 160ms ease;
}
.nav__cta:hover { background: var(--accent-bright); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span { width: 22px; height: 2px; background: var(--bone); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-7);
  overflow: hidden;
}
.hero__silhouette {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
  will-change: transform;
  transition: transform 500ms var(--ease-out-expo);
}
.car-svg { width: min(1400px, 130vw); height: auto; }
.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 45% at 50% 75%, rgba(201, 112, 59, 0.16), transparent 70%);
  pointer-events: none;
}

.body-path {
  stroke-dasharray: 3200;
  stroke-dashoffset: 3200;
  animation: draw-on 2.2s var(--ease-out-expo) 0.2s forwards;
}
@keyframes draw-on {
  to { stroke-dashoffset: 0; }
}
.wheel { opacity: 0; animation: wheel-in 0.6s var(--ease-out-expo) 1.6s forwards; }
.crease, .splitter { opacity: 0; animation: fade-in 0.8s ease 2s forwards; }
@keyframes wheel-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes fade-in { to { opacity: 1; } }
.wheel { transform-origin: center; transform-box: fill-box; }

/* Reflet au sol : statique, l'oeil ne doit voir que le sweep/shimmer bouger dedans */
.reflection { pointer-events: none; }

/* Reflet lumineux qui balaie la carrosserie (SMIL <animateTransform>, voir le SVG) */
.body-sweep { pointer-events: none; }

/* Rémanence de chaleur à l'échappement : 3 filets qui montent et s'effacent, décalés */
.heat-shimmer rect {
  filter: blur(1.5px);
  transform-box: fill-box;
  transform-origin: bottom center;
  opacity: 0;
  animation: shimmer-rise 2.6s ease-in-out infinite;
}
.heat-shimmer rect:nth-child(1) { animation-delay: 0s; }
.heat-shimmer rect:nth-child(2) { animation-delay: 0.55s; }
.heat-shimmer rect:nth-child(3) { animation-delay: 1.1s; }
@keyframes shimmer-rise {
  0%   { opacity: 0; transform: translateY(0) scaleY(0.6); }
  30%  { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-22px) scaleY(1.3); }
}

/* Feu arrière : légère pulsation, jamais un clignotement franc */
.tail-light {
  animation: tail-pulse 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 4px var(--accent-bright));
}
@keyframes tail-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.hero__content {
  position: relative;
  max-width: 720px;
  margin-top: var(--space-7);
}
.kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-2);
}
.kicker.center { text-align: center; }
.hero__title {
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.hero__title span {
  display: inline-block;
  margin-left: 0.25em;
  color: var(--accent); /* repli si -webkit-text-stroke n'est pas supporté (ex: Firefox) */
}
@supports (-webkit-text-stroke: 1px black) {
  .hero__title span {
    color: transparent;
    -webkit-text-stroke: 2px var(--accent);
  }
}
.hero__sub {
  font-size: 1.15rem;
  color: var(--smoke);
  max-width: 46ch;
  margin: var(--space-3) 0 var(--space-4);
}
.hero__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke-dim);
}
.scroll-cue span {
  width: 1px; height: 28px;
  background: linear-gradient(var(--accent), transparent);
  animation: cue-pulse 1.8s ease-in-out infinite;
}
@keyframes cue-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 2px;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 100ms ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--accent-bright); }
.btn--ghost { background: transparent; color: var(--bone); border: 1px solid var(--steel); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-bright); }

/* ---------- Reveal (IntersectionObserver) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out-expo), transform 700ms var(--ease-out-expo);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Layout général des sections ---------- */
main { position: relative; z-index: 1; }
section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-7) var(--space-4);
}
.center { text-align: center; }
section > h2.center { max-width: 46ch; margin-left: auto; margin-right: auto; }

/* ---------- Philosophie ---------- */
.philosophy {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-6);
  align-items: center;
}
.philosophy__text h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin: var(--space-1) 0 var(--space-3);
}
.philosophy__text p { color: var(--smoke); margin: 0 0 var(--space-2); }
.philosophy__text p.body-lg { font-size: 1.1rem; color: var(--bone); }
.philosophy__art { display: flex; justify-content: center; }
.grille-svg { width: 100%; max-width: 380px; }
.grille-slats { transition: filter 400ms ease; }
.philosophy__art:hover .grille-slats { filter: drop-shadow(0 0 6px var(--accent)); }

/* ---------- Specs ---------- */
.specs h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: var(--space-1) auto var(--space-6); }
.specs__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.spec {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2);
  border-top: 1px solid var(--steel);
}
.spec__number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--bone);
  font-variant-numeric: tabular-nums;
}
.spec__unit {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--smoke);
}
.specs__footnote {
  margin-top: var(--space-5);
  text-align: center;
  color: var(--smoke-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ---------- Interactive (traînée de chaleur) ---------- */
.interactive h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: var(--space-1) auto var(--space-5); }
.interactive__stage {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.car-svg--ghost { width: 100%; }
.interactive__hint {
  margin-top: var(--space-4);
  color: var(--smoke-dim);
  font-size: 0.9rem;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Détails (galerie scroll-snap) ---------- */
.details__track {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--space-4) 0 var(--space-2);
  margin: 0 calc(var(--space-4) * -1);
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  scrollbar-width: thin;
  scrollbar-color: var(--steel) transparent;
}
.detail-card {
  flex: 0 0 min(320px, 80vw);
  scroll-snap-align: start;
  background: var(--ash);
  border: 1px solid var(--steel);
  border-radius: 4px;
  padding: var(--space-3);
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.detail-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.detail-svg { width: 100%; margin-bottom: var(--space-2); }
.detail-card h3 {
  font-size: 1.3rem;
  margin-bottom: var(--space-1);
}
.detail-card p { color: var(--smoke); font-size: 0.92rem; margin: 0; }

/* ---------- Teintes ---------- */
.colors h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: var(--space-1) auto var(--space-5); }
.colors__swatches {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  color: var(--smoke);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: var(--space-1);
}
.swatch span {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid var(--steel);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 150ms ease;
}
.swatch:hover span { transform: scale(1.08); }
.swatch[aria-pressed="true"] span {
  border-color: var(--swatch);
  box-shadow: 0 0 24px var(--swatch);
}
.swatch[aria-pressed="true"] { color: var(--bone); }
.colors__note { color: var(--smoke-dim); font-size: 0.9rem; margin-top: var(--space-4); }

/* ---------- CTA ---------- */
.cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin: var(--space-1) auto var(--space-3); }
.cta p.body-lg { color: var(--smoke); max-width: 52ch; margin: 0 auto var(--space-4); }
.cta .btn { margin-top: var(--space-1); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-4);
  border-top: 1px solid var(--steel);
  font-size: 0.82rem;
  color: var(--smoke-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .philosophy { grid-template-columns: 1fr; }
  .philosophy__art { order: -1; }
  .specs__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav__links {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    background: rgba(11, 12, 14, 0.97);
    border-bottom: 1px solid var(--steel);
    padding: var(--space-3) var(--space-4) var(--space-4);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
  }
  .nav__links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav__toggle { display: flex; }
  section { padding-left: var(--space-3); padding-right: var(--space-3); }
  .specs__grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; align-items: flex-start; }
}

/* ---------- Réduction de mouvement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .body-path { stroke-dashoffset: 0; animation: none; }
  .wheel, .crease, .splitter { opacity: 1; animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; opacity: 0.6; }
  #heat-canvas { display: none; }
  .body-sweep, .heat-shimmer { display: none; }
  .tail-light { animation: none; opacity: 0.7; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
