/* ============================================================
   OCD — socle
   Tokens, remise à zéro, typographie, composants communs
   ============================================================ */

:root {
  /* Couleurs */
  --papier: #f4f5f2;
  --papier-2: #e8ebe4;
  --encre: #161b18;
  --encre-doux: #4b544d;
  --studio: #0e2e28;
  --studio-2: #17453c;
  --signal: #e8402a;
  --signal-fonce: #c0331c;
  --soleil: #f2a93b;
  --brume: #d5dbd3;
  --blanc: #ffffff;

  /* Typographie */
  --f: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Rayons : hiérarchie volontaire, pas un rayon unique partout */
  --r-panneau: 3px;
  --r-champ: 3px;
  --r-pilule: 999px;

  /* Rythme */
  --e1: 0.25rem;
  --e2: 0.5rem;
  --e3: 0.75rem;
  --e4: 1rem;
  --e5: 1.5rem;
  --e6: 2rem;
  --e7: 3rem;
  --e8: 4.5rem;
  --e9: 6rem;

  --largeur: 1180px;
  --gouttiere: clamp(1rem, 4vw, 2.5rem);
  --header-h: 58px;

  --cible: 48px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--f);
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  font-family: var(--f);
  font-weight: 800;
  font-stretch: 82%;
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  font-stretch: 80%;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.65rem, 4vw, 2.75rem);
}

h3 {
  font-size: 1.15rem;
  font-stretch: 88%;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

a {
  color: inherit;
}

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

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

/* Sur fond sombre, l'anneau rouge reste visible mais on renforce */
.on-dark :focus-visible,
.choice--studio :focus-visible {
  outline-color: var(--soleil);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--encre);
  color: var(--blanc);
  padding: 0.75rem 1rem;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

.section {
  padding-block: clamp(2.75rem, 7vw, 5.5rem);
}

.section + .section {
  border-top: 1px solid var(--brume);
}

.section-head {
  max-width: 60ch;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.section-head p {
  margin-top: 0.9rem;
  color: var(--encre-doux);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  max-width: 58ch;
}

/* ---------- boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--cible);
  padding: 0.7rem 1.3rem;
  border: 2px solid transparent;
  border-radius: var(--r-pilule);
  background: transparent;
  color: var(--encre);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--signal-fonce);
  color: var(--blanc);
}
.btn-primary:hover {
  background: #a52b17;
}
.btn-primary:disabled {
  background: var(--brume);
  color: #6c746d;
  cursor: not-allowed;
}

.btn-ghost {
  border-color: var(--encre);
}
.btn-ghost:hover {
  background: var(--encre);
  color: var(--papier);
}

.btn-quiet {
  border-color: transparent;
  color: var(--encre-doux);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-quiet:hover {
  color: var(--encre);
}

.btn-sm {
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

.btn-short {
  display: none;
}

@media (max-width: 560px) {
  .btn-long {
    display: none;
  }
  .btn-short {
    display: inline;
  }
}

/* ---------- en-tête ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding: 0.5rem var(--gouttiere);
  background: var(--papier);
  border-bottom: 1px solid var(--brume);
}

@supports (backdrop-filter: blur(6px)) {
  .site-head {
    background: rgba(244, 245, 242, 0.88);
    backdrop-filter: blur(10px);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.live-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--signal);
  border-radius: var(--r-pilule);
  color: var(--signal-fonce);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: pulse 2.4s ease-out infinite;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 64, 42, 0.5);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(232, 64, 42, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(232, 64, 42, 0);
  }
}

@media (max-width: 420px) {
  .brand span {
    font-size: 0.78rem;
  }
  .brand svg {
    width: 23px;
    height: 23px;
  }
  .live-flag {
    font-size: 0.62rem;
    padding: 0.25rem 0.45rem;
  }
}

/* ---------- pied de page ---------- */
.site-foot {
  background: var(--studio);
  color: var(--papier);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.site-foot a {
  color: inherit;
  text-decoration-color: rgba(244, 245, 242, 0.45);
  text-underline-offset: 3px;
}
.site-foot a:hover {
  text-decoration-color: var(--soleil);
}

.foot-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 760px) {
  .foot-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem;
  }
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.foot-brand svg {
  width: 32px;
  height: 32px;
}

.foot-note {
  margin-top: 0.9rem;
  max-width: 34ch;
  color: rgba(244, 245, 242, 0.78);
  font-size: 0.9rem;
}

.foot-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soleil);
  margin-bottom: 0.75rem;
}

.foot-list li {
  margin-bottom: 0.55rem;
  font-size: 0.92rem;
  color: rgba(244, 245, 242, 0.9);
}

.foot-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(244, 245, 242, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(244, 245, 242, 0.72);
}

/* ---------- divers ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 1rem);
  z-index: 200;
  max-width: min(92vw, 30rem);
  padding: 0.8rem 1.1rem;
  border-radius: var(--r-champ);
  background: var(--encre);
  color: var(--papier);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
  }
}
