:root {
  --bg: #0B0B0C;
  --ink: #F2ECE2;
  --ink2: rgba(242, 236, 226, .7);
  --ink3: rgba(242, 236, 226, .45);
  --line: rgba(242, 236, 226, .14);
  --red: #FF4A1F;
  --verre: rgba(11, 11, 12, .62);
  --serif: Didot, "Bodoni 72", "Bodoni MT", Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --espacement: .18em;
}

/* Didot n'a ni cyrillique ni idéogrammes : chaque écriture retombe sur une police système de même esprit */
:lang(ru) {
  --serif: Didot, "Bodoni 72", "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "PT Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
:lang(ja) {
  --serif: Didot, "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Noto Serif CJK JP", serif;
  --sans: "Avenir Next", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, "Noto Sans JP", sans-serif;
  --espacement: .08em;
}
:lang(zh-Hans) {
  --serif: Didot, "Songti SC", STSong, "Noto Serif SC", "Noto Serif CJK SC", SimSun, serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --espacement: .08em;
}
:lang(zh-Hant) {
  --serif: Didot, "Songti TC", "Noto Serif TC", "Noto Serif CJK TC", PMingLiU, serif;
  --sans: "Avenir Next", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --espacement: .08em;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  font: 18px/1.6 var(--sans);
}

a {
  color: var(--ink);
  text-decoration-color: var(--red);
  text-underline-offset: .2em;
}

a:hover { color: var(--red); }

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

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.evitement {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 999px; text-decoration: none;
}
.evitement:focus { top: 12px; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ——— Barre du haut ——— */

.barre {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(11, 11, 12, .85), rgba(11, 11, 12, 0));
}
.document .barre { position: static; background: none; }

.marque img { width: 170px; }

.outils { display: flex; align-items: center; gap: 8px; }

.bouton-outil, .langues summary {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--verre); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: .85rem; letter-spacing: .02em; cursor: pointer;
}
.bouton-outil:hover, .langues summary:hover { border-color: var(--red); }
.bouton-outil svg { width: 16px; height: 16px; flex: none; }
.bouton-outil[hidden] { display: none; }
.bouton-outil > span { display: inline-flex; align-items: center; gap: 8px; }
/* le libellé dit l'état ou l'action en cours ; data-actif bascule entre les deux */
.bouton-outil .etat-on, .bouton-outil[data-actif="true"] .etat-off { display: none; }
.bouton-outil[data-actif="true"] .etat-on { display: inline-flex; }
.bouton-son[data-actif="true"] { border-color: var(--red); }

.langues { position: relative; }
.langues summary { list-style: none; text-transform: uppercase; }
.langues summary::-webkit-details-marker { display: none; }
.langues ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 190px; margin: 0; padding: 8px; list-style: none;
  background: rgba(11, 11, 12, .94); border: 1px solid var(--line); border-radius: 18px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.langues a { display: block; padding: 7px 12px; border-radius: 10px; text-decoration: none; }
.langues a:hover { background: rgba(242, 236, 226, .08); color: var(--ink); }
.langues a[aria-current="true"] { color: var(--red); }

/* ——— Accueil : la toile de l'animation est derrière tout ——— */

#champ {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  display: block;
}
.sans-webgl #champ { display: none; }
.sans-webgl body {
  background:
    radial-gradient(60vmax 40vmax at 70% 20%, rgba(255, 74, 31, .16), transparent 70%),
    radial-gradient(70vmax 50vmax at 20% 80%, rgba(90, 120, 255, .14), transparent 70%),
    var(--bg);
}

.accueil main, .accueil footer { position: relative; z-index: 1; }

.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding: 72px 16px 40px;
  text-align: center;
}

/* l'hologramme et l'anneau sont dessinés dans cette zone par experience.js */
.scene { min-height: 46vh; min-height: 46svh; }

.hero-texte {
  max-width: 760px; margin: 0 auto;
  /* un voile sombre sous le texte, pour qu'il se lise sur le champ */
  background: radial-gradient(closest-side, rgba(11, 11, 12, .7), rgba(11, 11, 12, 0));
  padding: 8px 0 0;
}

.hero h1 { margin: 0 auto 6px; max-width: 560px; }
.hero h1 img { width: 100%; filter: drop-shadow(0 2px 18px rgba(11, 11, 12, .9)); }

.slogan {
  margin: 0 0 22px;
  font-size: 1.2rem;
  color: var(--ink2);
}
.slogan b {
  font-weight: 500; color: var(--red);
  transition: text-shadow .8s ease;
}
/* quand le point rouge comble le manque, « You have. » s'allume */
.slogan.touche b { text-shadow: 0 0 18px rgba(255, 74, 31, .9), 0 0 42px rgba(255, 74, 31, .5); }

.intro {
  max-width: 34em; margin: 0 auto;
  font-size: 1.12rem; line-height: 1.55;
}

.consigne {
  margin: 26px auto 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--verre); color: var(--ink2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: .9rem; cursor: pointer;
}
.consigne::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 12px var(--red);
}
.consigne:hover { color: var(--ink); border-color: var(--red); }

/* ——— Sections en verre au-dessus du champ ——— */

.panneau {
  max-width: 760px;
  margin: 0 auto 28px;
  padding: 44px 40px;
  background: var(--verre);
  border: 1px solid var(--line);
  border-radius: 28px;
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
}
main > .panneau:last-child { margin-bottom: 0; }

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.15;
  margin: 0 0 .6em;
}

/* les titres se matérialisent à leur arrivée à l'écran */
.a-reveler h2 { opacity: 0; letter-spacing: .25em; filter: blur(10px); }
.a-reveler.visible h2 { opacity: 1; letter-spacing: 0; filter: blur(0); transition: opacity 1.2s ease, letter-spacing 1.4s cubic-bezier(.2, .7, .2, 1), filter 1.2s ease; }

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 .2em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.etapes {
  list-style: none; counter-reset: etape;
  margin: 0; padding: 0;
  display: grid; gap: 28px;
}
.etapes li {
  counter-increment: etape;
  display: grid; grid-template-columns: 3.2rem 1fr;
}
.etapes li::before {
  content: counter(etape, decimal-leading-zero);
  font-family: var(--serif); font-size: 1.6rem; line-height: 1.1;
  color: var(--ink3);
}
.etapes p { color: var(--ink2); }

.reseaux {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px;
}
.reseaux a {
  display: block; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  text-align: center; text-decoration: none;
}
.reseaux a:hover { border-color: var(--red); color: var(--ink); }

.attenue { color: var(--ink2); }

/* ——— Pied de page ——— */

footer {
  max-width: 760px; margin: 0 auto;
  padding: 36px 16px 48px;
  color: var(--ink2); font-size: .9rem;
}
footer p { margin: 0 0 .4em; }
footer a { color: var(--ink2); }

/* ——— Entrée : avec ou sans son ——— */

.entree {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; padding: 16px;
  background: rgba(11, 11, 12, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.entree[hidden] { display: none; }
.entree-boite {
  max-width: 440px; padding: 34px 30px;
  background: rgba(11, 11, 12, .9); border: 1px solid var(--line); border-radius: 28px;
  text-align: center;
}
.entree-titre { font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; margin-bottom: .5em; }
.entree-boite p { color: var(--ink2); }
.entree-boutons { display: grid; gap: 10px; margin-top: 24px; }
.entree-boutons button {
  padding: 13px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--red); background: var(--red); color: var(--bg); font-weight: 500;
}
.entree-boutons .secondaire { background: transparent; color: var(--ink); border-color: var(--line); }
.entree-boutons .secondaire:hover { border-color: var(--ink2); }

/* ——— Suggestion de langue (accueil anglais seulement) ——— */

.suggestion {
  position: fixed; left: 50%; bottom: 18px; z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 18px;
  background: rgba(11, 11, 12, .92); border: 1px solid var(--line); border-radius: 999px;
  font-size: .9rem; white-space: nowrap;
}
.suggestion[hidden] { display: none; }
.suggestion button {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink2); cursor: pointer; font-size: 1.1rem;
}

/* ——— Pages légales ——— */

.document body, body.document {
  background: radial-gradient(80vmax 40vmax at 85% -10%, rgba(255, 74, 31, .10), transparent 60%), var(--bg);
}
.doc { padding-top: 16px; padding-bottom: 56px; }
.doc h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: 2.4rem; line-height: 1.1;
  margin: 0 0 .3em;
}
.doc h2 { font-size: 1.5rem; margin: 1.8em 0 .5em; }
.doc ul { padding-left: 1.2em; margin: 0 0 1em; }
.doc li { margin-bottom: .4em; }
.date, .note { color: var(--ink2); font-size: .95rem; }
.retour { margin-top: 2.5em; }

.todo { background: var(--red); color: var(--bg); padding: 0 .3em; }

/* ——— Petits écrans ——— */

@media (max-width: 560px) {
  body { font-size: 17px; }
  .marque img { width: 136px; }
  /* sur téléphone, les boutons ne montrent que leur icône ; le libellé reste lu par les lecteurs d'écran */
  .bouton-outil .libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .bouton-outil, .langues summary { padding: 0 12px; }
  .hero { padding-top: 64px; }
  .slogan { font-size: 1.05rem; }
  .intro { font-size: 1.02rem; }
  .panneau { margin: 0 12px 20px; padding: 32px 22px; border-radius: 22px; }
  h2 { font-size: 1.75rem; }
  .doc h1 { font-size: 2rem; }
}

/* ——— Moins d'animation demandée : tout est immédiat ——— */

@media (prefers-reduced-motion: reduce) {
  .a-reveler h2 { opacity: 1; letter-spacing: 0; filter: none; }
  .a-reveler.visible h2, .slogan b { transition: none; }
}
