/* SPSA — Styles 1/3 : base (identité, reset, animations, header, héro, stats).
   Chargé AVANT annuaire puis carte : la cascade CSS dépend de cet ordre. */

/* ===== Identité SPSA — Navy / Or (design bob 1) ===== */
:root {
  /* Bleu marine — primaire */
  --ocean:        #001f52;  /* primary */
  --ocean-mid:    #0a3478;  /* primary-container */
  --ocean-light:  #3c5ca2;  /* surface-tint / liens */
  --ocean-pale:   #d9e2ff;  /* primary-fixed */
  --ocean-deep:   #001945;  /* on-primary-fixed (hover CTA bob 1) */

  /* Or — accent de marque (navy/or) */
  --gold:         #E9B544;
  --gold-dark:    #7a5900;
  --gold-light:   #fdc754;
  --gold-tint:    rgba(233, 181, 68, 0.16);

  /* Or signature — CTA & accents interactifs (palette bob 1 : navy/or, pas d'orange) */
  --coral:        #E9B544;  /* = or */
  --coral-dark:   #7a5900;  /* secondary bob 1 (or foncé) */
  --coral-light:  #fdc754;  /* or clair */
  --coral-tint:   rgba(233, 181, 68, 0.14);
  --accent-ink:   #5c4200;  /* texte or lisible sur fond clair */

  /* Surfaces — crème chaud */
  --surface:      #fcf9f8;  /* background */
  --surface-low:  #f6f3f2;  /* surface-container-low (héro bob 1) */
  --surface-mid:  #f0eded;  /* surface-container */
  --border:       #c4c6d2;  /* outline-variant */
  --border-light: #e5e2e1;  /* surface-variant */

  /* Texte */
  --text:         #1c1b1b;  /* on-background */
  --text-mid:     #444651;  /* on-surface-variant */
  --text-soft:    #747782;  /* outline */

  --white:        #FFFFFF;

  /* Rayons */
  --r:    4px;
  --r-sm: 2px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Ombres — neutres et douces */
  --sh-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
  --sh:    0 2px 8px rgba(0, 0, 0, 0.06);
  --sh-md: 0 4px 20px rgba(0, 0, 0, 0.09);
  --sh-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  --ease:      0.18s ease;
  --container: 1400px;
  --header-h:  64px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Manrope', system-ui, sans-serif;
  line-height: 1.12;
  font-weight: 800;
}

a {
  color: var(--ocean-light);
  text-decoration: none;
  transition: color var(--ease);
}

a:hover { color: var(--accent-ink); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

img, svg { max-width: 100%; height: auto; display: block; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Animations d'entrée (au chargement de la page) ===== */
@keyframes header-drop {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes enter-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes enter-down {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes enter-left {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes line-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes underline-draw {
  from { background-size: 0% 3px; }
  to   { background-size: 100% 3px; }
}

@keyframes shape-in {
  from { opacity: 0; transform: scale(0.55); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shape-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(26px, 20px) scale(1.06); }
}

@keyframes cta-glow {
  0%, 100% { box-shadow: 0 4px 18px rgba(0, 31, 82, 0.28); }
  50%      { box-shadow: 0 6px 30px rgba(0, 31, 82, 0.55); }
}

/* ===== Header ===== (couleur bob 1 : surface crème, texte navy) */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: background var(--ease), box-shadow var(--ease), backdrop-filter var(--ease);
  animation: header-drop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Liseré or qui se déploie au chargement */
.header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 22%, var(--gold-light) 50%, var(--gold) 78%, transparent);
  transform: scaleX(1);
  transform-origin: center;
  animation: line-grow 0.9s ease both 0.55s;
}

.header--scrolled {
  background: rgba(252, 249, 248, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
          backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.10);
}

.header .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: enter-left 0.6s ease both 0.25s;
}

.header__logo img {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
  transition: transform var(--ease);
}

.header__logo:hover img {
  transform: translateY(-1px) scale(1.02);
}

.header__nav {
  display: flex;
  gap: 2px;
}

.header__toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--ocean);
  cursor: pointer;
  padding: 8px;
}

.header__nav a {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-mid);
  padding: 8px 16px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  position: relative;
  border-radius: var(--r-sm);
  transition: color var(--ease), background var(--ease);
  animation: enter-down 0.55s ease both;
}

.header__nav a:nth-child(1) { animation-delay: 0.42s; }
.header__nav a:nth-child(2) { animation-delay: 0.52s; }
.header__nav a:nth-child(3) { animation-delay: 0.62s; }

.header__nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--coral);
  transform: scaleX(0);
  transition: transform var(--ease);
  border-radius: 1px;
}

.header__nav a:hover {
  color: var(--ocean);
  background: var(--surface-mid);
}

.header__nav a:hover::after {
  transform: scaleX(1);
}

/* ===== Héro ===== */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--surface-low) 0%, var(--surface) 100%);
  color: var(--text);
  padding: 88px 0 80px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

/* Courbes de niveau de La Réunion (identité locale) */
.hero__topo {
  position: absolute;
  top: 50%;
  right: -9%;
  width: min(760px, 94%);
  height: auto;
  transform: translateY(-50%);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 120% at 62% 50%, #000 68%, transparent 100%);
          mask-image: radial-gradient(120% 120% at 62% 50%, #000 68%, transparent 100%);
}

.hero__topo .topo-island {
  fill: rgba(0, 31, 82, 0.04);
  stroke: rgba(0, 31, 82, 0.34);
  stroke-width: 1.6;
  stroke-dasharray: 4400;
  animation: topo-draw 3s ease both 0.3s;
}

.hero__topo .topo-pin {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: pin-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both 2s;
}

/* 2 couleurs = 2 catégories de partenaires (lisibles sur fond clair) */
.hero__topo .topo-pin--garage  { fill: var(--ocean); }
.hero__topo .topo-pin--vendeur { fill: var(--gold); }

@keyframes topo-draw {
  from { stroke-dashoffset: 4400; }
  to   { stroke-dashoffset: 0; }
}

@keyframes pin-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Lueurs douces */
.hero__shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.hero__shape--1 {
  width: 640px;
  height: 640px;
  top: -240px;
  right: -180px;
  background: rgba(129, 159, 234, 0.22); /* on-primary-container (bob 1) */
  animation: shape-in 1.6s ease both 0.1s, shape-drift 16s ease-in-out infinite 1.6s;
}

.hero__shape--2 {
  width: 360px;
  height: 360px;
  bottom: -120px;
  left: -80px;
  background: rgba(233, 181, 68, 0.18); /* lueur or */
  animation: shape-in 1.6s ease both 0.35s, shape-drift 20s ease-in-out infinite reverse 1.95s;
}

.hero__content {
  position: relative;
  z-index: 1;
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 22px;
  animation: enter-up 0.7s ease both 0.5s;
}

.hero__tag::before,
.hero__tag::after {
  content: '';
  display: block;
  width: 28px;
  height: 1.5px;
  background: var(--gold-dark);
  flex-shrink: 0;
  opacity: 0.7;
  transform: scaleX(1);
  animation: line-grow 0.6s ease both 0.85s;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.08;
  color: var(--ocean);
  animation: enter-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both 0.62s;
}

.hero h1 span {
  color: var(--ocean);
  /* Soulignement or tracé au chargement */
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: left 100%;
  background-size: 100% 3px;
  padding-bottom: 5px;
  animation: underline-draw 0.7s ease both 1.2s;
}

.hero p {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.75;
  font-weight: 400;
  animation: enter-up 0.8s ease both 0.78s;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ocean);
  color: var(--white);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 34px;
  border-radius: var(--r-md);
  min-height: 50px;
  transition: background var(--ease), box-shadow var(--ease), transform var(--ease);
  box-shadow: 0 4px 18px rgba(0, 31, 82, 0.28);
  animation: enter-up 0.7s ease both 0.95s, cta-glow 1.8s ease 1.8s 1;
}

.hero__cta:active { transform: translateY(1px); }

.hero__cta:hover {
  background: var(--ocean-deep);
  color: var(--white);
  box-shadow: 0 6px 26px rgba(0, 31, 82, 0.38);
}

/* ===== Stats ===== */
.stats {
  background: var(--surface);
  padding: 48px 0 24px;
  position: relative;
}

/* Grille stats */
.stats__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  max-width: 900px;
  margin: 0 auto;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.stats__item {
  background: var(--surface-low);
  padding: 28px 24px;
  text-align: center;
  transition: background var(--ease);
}

.stats__item:hover {
  background: var(--surface-mid);
}

.stats__number {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ocean);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stats__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== Vague de transition ===== */
.wave-separator {
  background: var(--surface);
  line-height: 0;
  overflow: hidden;
}

.wave-separator svg {
  display: block;
  width: 100%;
  height: 52px;
}

