/* Mon Podium — socle commun (tokens, typo, matières, composants partagés).
   Les styles propres à chaque page vivent dans home.css / result.css / legal.css. */

@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url("/assets/fonts/bigshoulders-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Big Shoulders Display";
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url("/assets/fonts/bigshoulders-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrumentsans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrumentsans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  /* Palette */
  --nuit: #04130C;
  --pelouse: #0C2A1C;
  --pelouse-2: #164331;
  --or: #D8B56A;
  --or-clair: #F4E2B0;
  --or-sombre: #8A6A2F;
  --projecteur: #FFF4E0;
  --carton: #E0303F;

  /* Dérivés */
  --texte: var(--projecteur);
  --texte-2: rgba(255, 244, 224, 0.72);
  --texte-3: rgba(255, 244, 224, 0.5);
  --filet: rgba(255, 244, 224, 0.12);
  --filet-or: rgba(216, 181, 106, 0.45);
  --voile: rgba(4, 19, 12, 0.72);

  /* Matières */
  --metal: linear-gradient(100deg, #7A5B26 0%, #C9A45C 16%, #F4E2B0 30%, #D8B56A 44%, #9C7A3A 60%, #EBD39A 78%, #8A6A2F 100%);
  --metal-vertical: linear-gradient(180deg, #F4E2B0 0%, #D8B56A 22%, #A8853F 58%, #7A5B26 100%);
  --brossage: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0 1px, rgba(0, 0, 0, 0.05) 1px 2px, transparent 2px 3px);
  --lumiere: rgba(255, 240, 210, 0.16);

  /* Typo */
  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Gabarits */
  --gouttiere: 20px;
  --largeur: 480px;
  --r: 12px;
  --r-sm: 8px;
  --tap: 48px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--nuit);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  color: var(--texte);
  background-color: var(--nuit);
  /* Pelouse de nuit : halo bas, bandes de tonte, grain. */
  background-image:
    radial-gradient(130% 55% at 50% 108%, rgba(22, 67, 49, 0.55), transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 44px, transparent 44px 88px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed, scroll, scroll;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--or-clair); text-underline-offset: 3px; }
a:hover { color: var(--projecteur); }
p { margin: 0 0 0.75em; }
h1, h2, h3 { margin: 0; font-weight: inherit; }

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

::selection { background: var(--or); color: var(--nuit); }

/* ---------- Mise en page ---------- */

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

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

/* ---------- Typographie ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--or);
  text-decoration: none;
}
.wordmark:hover { color: var(--or-clair); }

.or-texte {
  /* Texte au rendu métal (titres, nom du n°1). */
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--or);
  -webkit-text-fill-color: transparent;
}

.muted { color: var(--texte-2); }
.faint { color: var(--texte-3); }
.small { font-size: 14px; line-height: 1.45; }
.tiny { font-size: 13px; line-height: 1.4; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 22px;
  border: 0;
  border-radius: var(--r);
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 120ms var(--ease), filter 120ms var(--ease), background-color 120ms var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
  color: var(--nuit);
  background: var(--brossage), var(--metal);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 230, 0.75),
    inset 0 -2px 0 rgba(90, 64, 20, 0.45),
    0 10px 30px -12px rgba(216, 181, 106, 0.55);
}
.btn-primary:hover { filter: brightness(1.06); color: var(--nuit); }

.btn-secondary {
  color: var(--or-clair);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--filet-or);
}
.btn-secondary:hover { color: var(--projecteur); box-shadow: inset 0 0 0 1.5px var(--or); }

.btn-link {
  min-height: var(--tap);
  padding: 12px 8px;
  background: none;
  color: var(--texte-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.btn-link:hover { color: var(--projecteur); }

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: tourne 700ms linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Faisceaux de projecteurs ---------- */
/* <div class="beams" aria-hidden="true"></div> en position absolue dans un parent relatif. */

.beams {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.beams::before,
.beams::after {
  content: "";
  position: absolute;
  top: -6%;
  width: 100%;
  height: 112%;
  filter: blur(5px);
  opacity: 0.95;
}
.beams::before {
  left: -8%;
  background: conic-gradient(from 138deg at 0% 0%,
    transparent 0deg, rgba(255, 240, 210, 0) 4deg,
    var(--lumiere) 12deg, rgba(255, 240, 210, 0.05) 20deg,
    transparent 26deg, transparent 360deg);
}
.beams::after {
  right: -8%;
  background: conic-gradient(from 196deg at 100% 0%,
    transparent 0deg, rgba(255, 240, 210, 0.05) 6deg,
    var(--lumiere) 14deg, rgba(255, 240, 210, 0) 22deg,
    transparent 26deg, transparent 360deg);
}

/* ---------- Podium (landing, reveal, carte) ---------- */
/*
  <div class="podium">
    <div class="podium-step step-2"><span class="step-mark">?</span><span class="step-rank">2</span></div>
    <div class="podium-step step-1">…</div>
    <div class="podium-step step-3">…</div>
  </div>
  La hauteur se règle via --podium-h sur .podium.
*/

.podium {
  --podium-h: 200px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.08fr 1fr;
  align-items: end;
  gap: 6px;
  height: var(--podium-h);
  isolation: isolate;
}
.podium::after {
  /* Ligne de pelouse éclairée sous les marches. */
  content: "";
  position: absolute;
  left: -12%; right: -12%;
  bottom: -10px;
  height: 22px;
  background: radial-gradient(50% 100% at 50% 0%, rgba(255, 240, 210, 0.22), transparent 70%);
  z-index: -1;
}

.podium-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10%;
  border-radius: 6px 6px 2px 2px;
  background: var(--brossage), var(--metal-vertical);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 230, 0.9),
    inset 1px 0 0 rgba(255, 250, 230, 0.25),
    inset -1px 0 0 rgba(60, 40, 10, 0.35),
    0 18px 40px -18px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.podium-step::before {
  /* Reflet de projecteur sur le métal. */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.28) 45%, transparent 58%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.step-1 { height: 100%; }
.step-2 { height: 74%; }
.step-3 { height: 58%; }

.step-mark,
.step-rank {
  position: relative;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.9;
  /* Gravure dans le métal */
  color: #6E5020;
  text-shadow: 0 1px 0 rgba(255, 244, 210, 0.65), 0 -1px 0 rgba(40, 25, 5, 0.35);
}
.step-mark { font-size: calc(var(--podium-h) * 0.3); }
.step-rank { font-size: calc(var(--podium-h) * 0.14); margin-top: auto; padding-bottom: 8%; opacity: 0.85; }
.step-1 .step-mark { font-size: calc(var(--podium-h) * 0.36); }

/* ---------- Cadenas ---------- */

.lock {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--carton);
  color: var(--projecteur);
  box-shadow: 0 6px 18px -6px rgba(224, 48, 63, 0.7);
}
.lock svg { width: 22px; height: 22px; }

/* ---------- Champs ---------- */

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: var(--tap);
  padding: 12px 14px;
  border-radius: var(--r);
  background: rgba(12, 42, 28, 0.7);
  box-shadow: inset 0 0 0 1px var(--filet);
  font-size: 14px;
  line-height: 1.45;
  color: var(--texte-2);
  cursor: pointer;
}
.check input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 24px; height: 24px;
  margin: 0;
  border-radius: 6px;
  background: var(--nuit);
  box-shadow: inset 0 0 0 1.5px var(--filet-or);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.check input::after {
  content: "";
  width: 12px; height: 7px;
  border-left: 2.5px solid var(--nuit);
  border-bottom: 2.5px solid var(--nuit);
  transform: translateY(-2px) rotate(-45deg) scale(0);
  transition: transform 120ms var(--ease);
}
.check input:checked { background: var(--or); box-shadow: none; }
.check input:checked::after { transform: translateY(-2px) rotate(-45deg) scale(1); }
.check.is-error { box-shadow: inset 0 0 0 1.5px var(--carton); }

.error-text {
  color: #FF8C95; /* rouge carton éclairci pour rester lisible sur fond nuit */
  font-size: 14px;
  font-weight: 600;
}

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  padding: 12px var(--gouttiere) calc(12px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--texte-3);
  text-align: center;
}
.site-footer a { color: var(--texte-3); text-decoration: none; padding: 6px 0; }
.site-footer a:hover { color: var(--texte-2); text-decoration: underline; }

/* ---------- Mouvement réduit ---------- */

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