:root {
  --bg: #0b0f14;
  --fg: #e9eef5;
  --muted: rgba(233, 238, 245, 0.72);
  --card: rgba(15, 20, 28, 0.72);
  --stroke: rgba(233, 238, 245, 0.12);

  --container: 1100px;
  --header-h: 72px;

  --radius: 18px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

/* Fonts Serif72 (titres) */
@font-face {
  font-family: "Serif72";
  src: url("../assets/fonts/Serif72Beta-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Serif72";
  src: url("../assets/fonts/Serif72Beta-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: "Serif72";
  src: url("../assets/fonts/Serif72Beta-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "Serif72";
  src: url("../assets/fonts/Serif72Beta-BoldItalic.otf") format("opentype");
  font-weight: 700;
  font-style: italic;
}
@font-face {
  font-family: "Serif72";
  src: url("../assets/fonts/Serif72Beta-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
}
@font-face {
  font-family: "Serif72";
  src: url("../assets/fonts/Serif72Beta-BlackItalic.otf") format("opentype");
  font-weight: 900;
  font-style: italic;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* anti overflow mobile */
html,
body { overflow-x: hidden; }

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  line-height: 1.55;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: inherit; text-decoration: none; }

button,
input,
textarea { font: inherit; }

.container {
  width: min(var(--container), 100%);
  padding-inline: 1rem;
  margin: 0 auto;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

h1, h2, h3, .race-title { font-family: "Serif72", serif; }

section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* Header / Nav */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 20, 0.62);
  border-bottom: 1px solid var(--stroke);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 750; }
.brand-name { color: #e9ce96; font-size: clamp(1rem, 2.2vw, 1.25rem); }

.site-nav { display: flex; align-items: center; gap: 0.8rem; }

.nav-link {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 600;
}

.nav-link:hover { border-color: var(--stroke); color: var(--fg); }

.nav-link.is-active { color: var(--fg); background: rgba(167, 174, 177, 0.38); }

/* Burger */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--fg);
  opacity: 0.9;
}

/* Sections / Parallax */
.section {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: calc(var(--header-h) + 3.5rem) 0 4rem;
  overflow: hidden;
}

.section::before {
  content: "";
  position: absolute;
  inset: -10% 0 -10% 0;
  background:
    radial-gradient(1200px 600px at 20% 30%, rgba(167, 139, 250, 0.25), transparent 55%),
    radial-gradient(1200px 600px at 80% 70%, rgba(125, 211, 252, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
  z-index: 0;
}

.no-glow::before { display: none; }

.parallax {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.35), rgba(11, 15, 20, 0.78));
  z-index: 1;
}

.section-content {
  position: relative;
  z-index: 2;
  overflow-wrap: anywhere;
}

/* Section blanche */
.section-light {
  background: #ffffff;
  color: #403e37;
}

.section-light .lead,
.section-light .muted { color: rgba(64, 62, 55, 0.78); }

.lead-dark { color: rgba(64, 62, 55, 0.85); }

/* Typo */
h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  margin: 0.4rem 0 0.8rem;
  line-height: 1.08;
}
h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  margin: 0 0 0.8rem;
  line-height: 1.15;
}
h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
}
.lead {
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--muted);
  max-width: 68ch;
}

/* Hero */
.hero-center { text-align: center; }
.hero-title { color: #e9ce96; margin-top: 0; }
.hero-subtitle {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0.35rem 0 1rem;
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  opacity: 0.92;
}
.hero-lead { margin-inline: auto; }

.cta-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}
.cta-center { justify-content: center; align-items: center; }

.hero-link {
  text-decoration: underline;
  font-weight: 650;
  letter-spacing: 0.08em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.15rem;
  border: 1px solid rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.12);
  color: var(--fg);
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}
.btn:hover { background: rgba(125, 211, 252, 0.18); }

.btn-ghost {
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.02);
}

/* Bouton PRE-INSCRIPTION */
.btn-preinscription {
  border: none;
  background: url("../assets/btn-main.png") center / 100% 100% no-repeat;
  color: #403e37;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.95rem 1.9rem;
  box-shadow: none;
}
.btn-preinscription:hover { filter: brightness(1.05); }

/* Layout */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.two-col > * { min-width: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

/* Features */
.section-title-center { text-align: center; }
.section-lead-center { text-align: center; margin-inline: auto; }

.feature-stack {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.feature {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: rgba(15, 20, 28, 0.45);
}
.feature-img { width: 100%; max-width: 260px; margin-inline: auto; }
.feature-text { min-width: 0; }
.feature-text p { margin: 0.35rem 0 0; overflow-wrap: anywhere; }

/* Carousel */
.races-carousel {
  position: relative;
  margin-top: 1.4rem;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
}
.carousel-viewport {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: rgba(15, 20, 28, 0.45);
  touch-action: pan-y;
}
.carousel-track {
  display: flex;
  transform: translateX(0px);
  transition: transform 320ms ease;
  will-change: transform;
}
.race-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 1.2rem 3.4rem 1.6rem;
  display: grid;
  gap: 0.9rem;
  justify-items: center;
  text-align: center;
}
.race-title {
  margin: 0.2rem 0 0;
  font-size: clamp(1.4rem, 4.5vw, 2rem);
}
.race-img {
  width: min(420px, 72vw);
  height: min(320px, 52vw);
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(11, 15, 20, 0.65);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3;
}
.carousel-btn img { width: 22px; height: 22px; }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.carousel-btn:hover { border-color: rgba(233, 206, 150, 0.45); }
.carousel-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.carousel-dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.9rem;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.carousel-dot.is-active {
  background: rgba(233, 206, 150, 0.55);
  border-color: rgba(233, 206, 150, 0.75);
}

/* ✅ Gallery full width */
.section-gallery {
  min-height: auto;
  padding: 0;
  align-items: stretch;
}
.gallery-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ✅ CTA (visuel à gauche / texte à droite, sans overlay sur mobile) */
.section-cta {
  min-height: 70vh;
}
.cta-layout {
  display: grid;
  /* ✅ texte plus large : 60% environ */
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 1.6rem;
  align-items: center;
}
.cta-visual {
  width: 100%;
  min-height: 420px;
  background: url("../assets/CTA-bg.png") left center / contain no-repeat;
}
.cta-copy {
  text-align: left;
  justify-self: stretch;
}
.section-cta .cta-lead {
  max-width: none; /* ✅ utilise la largeur dispo */
}
.cta-actions { margin-top: 1rem; }

/* ✅ SECTION "NUIT" (v3) */
.section-night {
  padding: 0 !important;     /* enlève le padding haut/bas de .section */
  min-height: 70vh;
  display: block;            /* override le grid de .section */
}

.night-wrap {
  position: relative;
  width: 100%;
  min-height: 70vh;
  overflow: hidden;
  display: flex;
  align-items: center;       /* centre verticalement le texte */
}

/* TEXTE (✅ pas de padding-right) */
.night-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 80ch;
  margin-inline: auto;

  /* juste une respiration interne, sans padding de section */
  padding: clamp(2rem, 6vh, 4rem) 1rem;
}

/* images décoratives */
.night-illus {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;

  transition: opacity 220ms ease, visibility 220ms ease;
}

.night-illus.is-hidden {
  opacity: 0;
  visibility: hidden;
}

/* ✅ GAUCHE : pleine hauteur, pas déformée, peu décalée */
.night-illus-left {
  top: 0;
  bottom: 0;

  /* IMPORTANT: garder le ratio, éviter toute déformation */
  height: 100% !important;
  width: auto !important;
  max-width: none !important;

  /* décalage léger (tronquage à gauche quand l'écran rétrécit) */
  left: 0;

  /* optionnel, juste esthétique */
  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.10));
}

/* ✅ DROITE : collée en bas à droite, pas zoomée/coupée */
.night-illus-right {
  right: 0;
  bottom: 0;

  height: clamp(220px, 55vh, 520px);
  width: auto !important;

  object-fit: contain;
  object-position: right bottom;

  filter: drop-shadow(0 10px 26px rgba(0,0,0,0.10));
}


/* Footer */
.site-footer {
  background: #070a0f;
  border-top: 1px solid var(--stroke);
}

.footer-bar { background: #bdbdbd; }

.footer-links { list-style: none; padding: 0; margin: 0; }

.footer-links--bar {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.footer-links--bar a {
  color: #0b0f14;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.footer-links--bar a:hover { text-decoration: underline; }

.footer-bottom {
  padding: 1.4rem 0 2rem;
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.social {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}
.social-link:hover {
  color: var(--fg);
  border-color: rgba(125, 211, 252, 0.35);
}

.footer-note { color: var(--muted); margin: 0; }

/* Responsive */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; text-align: center; }

  /* CTA : visuel AU-DESSUS du texte, jamais derrière */
  .cta-layout {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .cta-visual {
    min-height: 260px;
    background-position: center;
  }
  .cta-copy { text-align: center; }

  /* Nuit : images plus discrètes + pas d’overlap agressif */
  .night-illus-left {
    width: min(420px, 70vw);
    left: -10%;
    transform: translateY(-50%) translateX(10%);
    opacity: 0.85;
  }
  .night-illus-right {
    width: min(360px, 64vw);
    right: -12%;
    opacity: 0.75;
  }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .parallax { background-attachment: scroll; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: calc(var(--header-h) + 10px);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    padding: 0.8rem;
    gap: 0.3rem;
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: rgba(11, 15, 20, 0.92);
    backdrop-filter: blur(10px);
  }

  .site-nav.is-open { display: flex; }
  .nav-link { width: 100%; text-align: left; }

  .carousel-btn { width: 44px; height: 44px; }
  .race-slide { padding: 1.05rem 3.1rem 1.35rem; }
  .race-img { width: min(360px, 78vw); height: min(260px, 58vw); }

  /* Nuit : priorité à la lisibilité */
  .night-illus-left,
  .night-illus-right {
    opacity: 0.35;
    filter: saturate(0.95);
  }
  .night-content {
    max-width: 60ch;
    padding-inline: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .parallax { background-attachment: scroll; }
  .carousel-track { transition: none; }
}
