/* ==========================================================================
   Magellus — feuille de style du site public
   Les couleurs viennent de la charte graphique Magellus (design system v1).
   Deux thèmes : Nuit (référence) et Jour.
   ========================================================================== */

/* --- Jetons ------------------------------------------------------------- */

:root {
  /* Couleurs — thème Nuit par défaut */
  --ground: #08101f;
  --ground-deep: #0d2433;
  --glass: #1a2638d9;
  --glass-edge: #ffffff26;
  --hairline: #ffffff1f;
  --ink: #eef3fa;
  --ink-muted: #9aa8bd;
  --route: #3fd0c0;
  --route-soft: #0f3a3c;
  --on-route: #04201e;
  --route-alt: #6b7a90;
  --trail: #e8a33d;
  --trail-soft: #3a2a12;
  --stop: #ff6b5e;
  --on-stop: #1a0503;
  --globe: #5e99e6;
  --space: #02040b;

  /* Surfaces propres au site */
  --surface: #131f30;
  --surface-edge: #ffffff14;

  /* Espacements */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 56px;
  --space-16: 80px;
  --space-20: 120px;

  /* Rayons */
  --radius-row: 18px;
  --radius-control: 24px;
  --radius-panel: 28px;
  --radius-full: 9999px;

  /* Typographie */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;

  /* Mise en page */
  --largeur: 1200px;
  --gouttiere: 24px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --ground: #f5f8fb;
  --ground-deep: #e2eef1;
  --glass: #ffffffd1;
  --glass-edge: #0b15261a;
  --hairline: #0b15261f;
  --ink: #0b1526;
  --ink-muted: #4d5b70;
  --route: #0a7770;
  --route-soft: #ddf4f0;
  --on-route: #ffffff;
  --route-alt: #7a8799;
  --trail: #a15f0a;
  --trail-soft: #fdf4e6;
  --stop: #c8321f;
  --on-stop: #ffffff;
  --globe: #3c6fc8;

  --surface: #ffffff;
  --surface-edge: #0b152614;

  color-scheme: light;
}

/* --- Base ---------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 700;
}

h1 { font-size: clamp(38px, 6.2vw, 76px); }
h2 { font-size: clamp(28px, 4vw, 46px); }
h3 { font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.012em; }

p { margin: 0; }

a {
  color: var(--route);
  text-decoration-color: color-mix(in srgb, var(--route) 45%, transparent);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

ul { margin: 0; padding: 0; list-style: none; }

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

:focus-visible {
  outline: 2px solid var(--route);
  outline-offset: 3px;
  border-radius: 4px;
}

.saut {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: var(--space-3) var(--space-5);
  background: var(--route);
  color: var(--on-route);
  border-radius: 0 0 var(--radius-control) 0;
  font-weight: 600;
  z-index: 100;
}
.saut:focus { left: 0; }

/* --- Conteneurs ---------------------------------------------------------- */

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.section { padding-block: clamp(64px, 9vw, 128px); }
.section--serree { padding-block: clamp(48px, 6vw, 80px); }

.section__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 720px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.surtitre {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--route);
}

.chapeau {
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.5;
  color: var(--ink-muted);
}

/* --- Mot-symbole --------------------------------------------------------- */

.motsymbole {
  width: 148px;
  height: auto;
  color: var(--ink);
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 61.44;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.motsymbole--pied { width: 168px; }

/* --- Boutons ------------------------------------------------------------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.bouton:active { transform: translateY(1px); }

.bouton--principal {
  background: var(--route);
  color: var(--on-route);
}
.bouton--principal:hover { background: color-mix(in srgb, var(--route) 85%, var(--ink)); }

.bouton--second {
  background: transparent;
  border-color: var(--glass-edge);
  color: var(--ink);
}
.bouton--second:hover { border-color: var(--route); color: var(--route); }

/* --- En-tête ------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--hairline);
}

.entete__barre {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding: var(--space-4) var(--gouttiere);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.entete__marque { display: flex; flex-shrink: 0; }

.entete__nav { flex-grow: 1; }

.entete__liste {
  display: flex;
  gap: var(--space-6);
}
.entete__liste a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding-block: var(--space-2);
}
.entete__liste a:hover { color: var(--ink); }
.entete__liste a[aria-current="page"] { color: var(--ink); }

.entete__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.entete__menu {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-full);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.entete__menu span {
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

/* --- Sélecteur de thème -------------------------------------------------- */

.theme { position: relative; }

.theme__bouton {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-full);
  color: var(--ink-muted);
  cursor: pointer;
}
.theme__bouton:hover { color: var(--ink); border-color: var(--route); }
.theme__icone { width: 20px; height: 20px; }

.theme__menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  min-width: 168px;
  padding: var(--space-2);
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-control);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme__menu[hidden] { display: none; }

.theme__menu button {
  width: 100%;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: 0;
  border-radius: var(--radius-row);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.theme__menu button:hover { background: var(--hairline); }
.theme__menu button[aria-checked="true"] {
  background: var(--route-soft);
  color: var(--route);
  font-weight: 600;
}

/* --- Navigation mobile --------------------------------------------------- */

.navmobile {
  border-top: 1px solid var(--hairline);
  padding: var(--space-4) var(--gouttiere) var(--space-6);
}
.navmobile[hidden] { display: none; }
.navmobile ul { display: flex; flex-direction: column; }
.navmobile a {
  display: block;
  padding: var(--space-4) 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 19px;
  font-weight: 600;
  border-bottom: 1px solid var(--hairline);
}

/* --- Héros --------------------------------------------------------------- */

.heros {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--ground) 0%, var(--ground-deep) 100%);
  border-bottom: 1px solid var(--hairline);
}

.heros__contenu {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  align-items: flex-start;
  max-width: 780px;
  padding-block: clamp(72px, 11vw, 148px);
}

.heros__titre { max-width: 14ch; }

.heros__chapeau {
  font-size: clamp(19px, 2.4vw, 25px);
  line-height: 1.45;
  color: var(--ink-muted);
  max-width: 48ch;
}

.heros__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.heros__mention {
  font-size: 14px;
  color: var(--ink-muted);
}

/* --- Grille de cartes ---------------------------------------------------- */

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.carte {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--surface-edge);
  border-radius: var(--radius-panel);
}

.carte__icone {
  width: 40px;
  height: 40px;
  color: var(--route);
}
.carte__icone--trail { color: var(--trail); }

.carte p { color: var(--ink-muted); }

.carte--large { grid-column: 1 / -1; }

/* --- Bandeau ------------------------------------------------------------- */

.bandeau {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: clamp(32px, 4vw, 56px);
  background: var(--route-soft);
  border: 1px solid color-mix(in srgb, var(--route) 30%, transparent);
  border-radius: var(--radius-panel);
}
.bandeau__texte { display: flex; flex-direction: column; gap: var(--space-3); max-width: 56ch; }
.bandeau__texte p { color: var(--ink-muted); }

/* --- Pied de page -------------------------------------------------------- */

.pied {
  border-top: 1px solid var(--hairline);
  background: var(--ground);
}

.pied__haut,
.pied__bas {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.pied__haut {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  padding-block: clamp(48px, 6vw, 80px) var(--space-12);
}

.pied__marque { display: flex; flex-direction: column; gap: var(--space-4); }
.pied__baseline { color: var(--ink-muted); font-size: 15px; max-width: 34ch; }

.pied__colonnes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  flex-grow: 1;
}

.pied__colonne h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-4);
}
.pied__colonne ul { display: flex; flex-direction: column; gap: var(--space-3); }
.pied__colonne a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}
.pied__colonne a:hover { color: var(--route); }

.pied__bas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  justify-content: space-between;
  padding-block: var(--space-6) var(--space-10);
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--ink-muted);
}

/* --- Pages de texte ------------------------------------------------------ */

.texte {
  max-width: 68ch;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.texte h2 { margin-top: var(--space-8); font-size: clamp(24px, 3vw, 32px); }
.texte h3 { margin-top: var(--space-5); }
.texte p, .texte li { color: var(--ink-muted); }
.texte ul { display: flex; flex-direction: column; gap: var(--space-3); padding-left: var(--space-5); list-style: disc; }
.texte__date { font-size: 14px; color: var(--ink-muted); }

/* --- Adaptations ---------------------------------------------------------- */

@media (max-width: 900px) {
  .entete__nav { display: none; }
  .entete__menu { display: flex; }
  .entete__cta { display: none; }
  .entete__barre { gap: var(--space-4); justify-content: space-between; }
  .pied__haut { gap: var(--space-10); flex-direction: column; }
  .pied__colonnes { gap: var(--space-10); }
}

@media (max-width: 560px) {
  :root { --gouttiere: 16px; }
  .carte { padding: var(--space-6); }
  .heros__actions { width: 100%; }
  .heros__actions .bouton { flex-grow: 1; }
}