/* Skaldex : tokens de couleur repris de l'app (apps/ios/Packages/DesignSystem/.../Palette.swift). */
@font-face {
  font-family: "Uncial Antiqua";
  src: url("UncialAntiqua-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f4f0e8;
  --surface: #fffdf8;
  --line: #e2dbcd;
  --text: #1e2226;
  --text-2: #545a60;
  --accent: #9a5418;
  --accent-muted: #f3e3cf;
  --glow: rgb(154 84 24 / 0.45);
  --measure: 38rem;
  --tile: 3.5rem;  /* casques du mur ; bande = (TILE + GAP) / TILE = 1,2 tuile par casque (make_images.py) */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121518;
    --surface: #1b1f24;
    --line: #2f363e;
    --text: #ece6da;
    --text-2: #a9a397;
    --accent: #e0a060;
    --accent-muted: #3a2c1e;
    --glow: rgb(224 160 96 / 0.35);
  }
  /* Le fond des casques (#101418) est un ton sous la page : « lighten » efface les bords des tuiles, il ne reste
     que les casques et leur halo. */
  .wall { background: var(--bg); }
  .row::before { mix-blend-mode: lighten; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.page {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* En-tête : retour à l'accueil (pages secondaires) et autre langue. */
.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 0.9375rem;
}
.top .home {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: "Uncial Antiqua", serif;
  font-size: 1.375rem;
  color: var(--text);
  text-decoration: none;
}
.top .home img { width: 2rem; height: 2rem; border-radius: 22.5%; }
.top .lang { margin-left: auto; color: var(--text-2); }

/* Accueil : le mur de casques défile derrière l'icône, seul élément animé du site. */
.hero { text-align: center; padding-bottom: 3rem; }

.stage {
  position: relative;
  display: grid;
  place-items: center;
  margin: 1rem 0 0;
}

.wall {
  display: grid;
  gap: calc(var(--tile) * 0.2);
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.row { position: relative; height: var(--tile); }
/* Trois copies de la bande, décalées d'une longueur de bande par cycle : la boucle est sans raccord. */
.row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--n) * 1.2 * var(--tile) * 3);
  background: var(--strip) 0 0 / auto 100% repeat-x;
  animation: drift calc(var(--n) * 4s) linear infinite;
  will-change: transform;
}
.armors { --n: 22; --strip: url("wall-armors.webp"); }
.caps { --n: 16; --strip: url("wall-caps.webp"); }
.caps::before { animation-direction: reverse; left: calc(var(--tile) * -0.6); }
@keyframes drift {
  to { transform: translateX(calc(var(--n) * -1.2 * var(--tile))); }
}

.icon {
  position: absolute;
  width: 7rem;
  height: 7rem;
  border-radius: 22.5%;
  box-shadow: 0 0 0 0.625rem var(--bg), 0 1rem 3rem -0.5rem var(--glow);
}

/* Pause sans script : case à cocher + libellé, lisible au clavier (WCAG 2.2.2). */
.pause {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.pause-label {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.8125rem;
  cursor: pointer;
}
.pause-label:hover { color: var(--text); }
.pause:focus-visible ~ .pause-label { outline: 2px solid var(--accent); outline-offset: 2px; }
.pause:checked ~ .stage .row::before { animation-play-state: paused; }
.pause:checked ~ .pause-label { background: var(--accent-muted); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .row::before { animation: none; }
  .pause, .pause-label { display: none; }
}

.wordmark {
  margin: 1.75rem 0 0;
  font: 400 clamp(3.5rem, 16vw, 6.5rem)/0.95 "Uncial Antiqua", serif;
  letter-spacing: -0.01em;
}
.tagline {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
  color: var(--text-2);
}
.lede { margin: 1.25rem auto 0; max-width: 30rem; }

/* Stores. Avant la sortie : <body class="prelaunch">, texte seul (les badges officiels ne sont licenciés que pour
   une app disponible, voir infra/README.md). À la sortie : retirer class="prelaunch" des deux accueils. */
.soon {
  display: inline-block;
  margin: 2rem 0 0;
  color: var(--text-2);
  font-size: 0.9375rem;
}
/* Badges : même hauteur (48 px, minimum Apple 40, Google 28), App Store en premier, espace libre ≥ 1/4 de la
   hauteur tout autour (gap et marges de 12 px). Aucune modification de l'image. */
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0.75rem;
  list-style: none;
}
.badges a { display: block; border-radius: 0.5rem; }
.badges img { display: block; height: 3rem; width: auto; }
.prelaunch .badges, .prelaunch .tm, body:not(.prelaunch) .soon { display: none; }

.features {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  list-style: none;
}
.features h2 { margin: 0 0 0.375rem; font-size: 1.125rem; font-weight: 650; line-height: 1.35; }
.features p { margin: 0; color: var(--text-2); max-width: 30rem; }

/* Pages de texte long (confidentialité, mentions légales, 404) : lecture confortable. */
.doc { padding: 1.5rem 0 3rem; }
.doc h1 {
  margin: 0;
  font: 400 clamp(2.25rem, 9vw, 3.25rem)/1.05 "Uncial Antiqua", serif;
}
.doc .updated { margin: 0.75rem 0 2rem; color: var(--text-2); font-size: 0.9375rem; }
.doc > h1 + h2 { margin-top: 2rem; }
.doc h2 {
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 1.25rem;
  line-height: 1.3;
}
.doc h3 { margin: 1.75rem 0 0.25rem; font-size: 1.0625rem; }
.doc p, .doc li { max-width: var(--measure); line-height: 1.7; }
.doc ul { padding-left: 1.25rem; }
.doc li + li { margin-top: 0.375rem; }
.doc li::marker { color: var(--accent); }
.doc code { font-size: 0.9em; overflow-wrap: anywhere; }
.summary {
  max-width: var(--measure);
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  background: var(--accent-muted);
}
.summary ul { margin: 0.5rem 0 0; }
.doc .summary h2 { margin: 0; padding: 0; border: 0; font-size: 1.0625rem; }

/* 404 */
.lost { text-align: center; padding-top: 3rem; }
.lost img { width: 6rem; height: 6rem; border-radius: 22.5%; margin-bottom: 1.5rem; box-shadow: 0 1rem 3rem -0.5rem var(--glow); }
.lost p { margin-inline: auto; }

.foot {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.875rem;
}
.foot p { margin: 0 0 0.75rem; max-width: var(--measure); }
.foot .disclaimer { font-style: italic; }
.foot .links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

@media (min-width: 48rem) {
  :root { --tile: 5rem; }
  .stage { margin-top: 2.5rem; }
  .icon { width: 10rem; height: 10rem; box-shadow: 0 0 0 0.875rem var(--bg), 0 1.5rem 4rem -0.75rem var(--glow); }
  .wordmark { margin-top: 2.5rem; }
  .hero { padding-bottom: 4rem; }
  .features { grid-template-columns: 1fr 1fr; column-gap: 3rem; row-gap: 2.5rem; padding-top: 3rem; }
}
