/*
  Cendregarde : la page est une nuit de crypte, comme le jeu. Fond d'encre violette, panneaux du HUD
  (plaque sombre, double filet), titres en Source Serif 4 comme en jeu, texte en police système
  (elle couvre le japonais, le coréen et le chinois). Deux lumières seulement : la lune lilas
  et la braise dorée, réservée aux boutons et à ce qu'on peut toucher. Le gardien est l'icône du jeu,
  en pixels nets.
*/
@font-face {
  font-family: "Source Serif 4";
  src: url("SourceSerif4-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0152-0153, U+0178, U+2013-2014, U+2018-201E, U+2022, U+2026, U+202F, U+2039-203A, U+20AC;
}

:root {
  --night: #15131f;
  --night-deep: #0e0c16;
  --plate: #1d1a2a;
  --plate-edge: #3b3552;
  --plate-inner: #2a2640;
  --text: #ede6f5;
  --muted: #a8a0bd;
  --moon: #c9b8ee;
  --moon-soft: #8c7bb8;
  --ember: #e8b765;
  --ember-deep: #c98a3a;
  --fire: #e0782e;
  --serif: "Source Serif 4", "Iowan Old Style", "Hiragino Mincho ProN", "Songti TC", "AppleMyungjo", Georgia, serif;
  --sans: -apple-system, system-ui, "Segoe UI", "Hiragino Sans", "Apple SD Gothic Neo", "PingFang TC", sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--moon-soft); text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--ember); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

h1, h2, h3, .logo { font-family: var(--serif); font-weight: 700; line-height: 1.1; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); margin: 0 0 clamp(18px, 2.5vw, 30px); }
/* Les petits titres dorés et espacés, comme « ÉTAGE 09 · PALIER 2 » dans le HUD. Sans capitales
   forcées : « iPhone » doit rester « iPhone ». */
.kicker {
  margin: 0 0 0.7rem;
  color: var(--ember);
  font: 700 0.9rem/1.35 var(--sans);
  letter-spacing: 0.04em;
}

/* Panneau du HUD : plaque sombre, filet extérieur et filet intérieur. */
.plate {
  background: var(--plate);
  border: 2px solid var(--plate-edge);
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px var(--plate), inset 0 0 0 4px var(--plate-inner), 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* En-tête */
.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  border-bottom: 1px solid var(--plate-edge);
  background: var(--night-deep);
}
.logo { font-size: 1.45rem; text-decoration: none; letter-spacing: 0.01em; }
.logo::before {
  content: "";
  display: inline-block;
  width: 1.6em;
  height: 1.6em;
  margin: -0.3em 0.5em -0.3em 0;
  vertical-align: middle;
  border-radius: 7px;
  background: url("gardien.png") center / cover no-repeat;
  image-rendering: pixelated;
}
.top nav { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; font-weight: 600; }
.top nav a { text-decoration: none; padding: 10px 0; color: var(--muted); }
.top nav a:hover, .top nav a[aria-current] { color: var(--text); text-decoration: underline var(--ember) 2px; text-underline-offset: 0.45em; }
@media (max-width: 560px) {
  .top { gap: 0 14px; }
  .logo { font-size: 1.25rem; }
  .top nav { gap: 0 14px; font-size: 0.95rem; }
}

/* Boutons : la plaque de braise du jeu (le bouton des cartes du HUD). */
.store, .prose .button {
  display: inline-block;
  margin: 0;
  padding: 0.85rem 1.5rem;
  border: 2px solid var(--ember-deep);
  border-radius: 6px;
  background: var(--ember);
  color: var(--night-deep);
  font: 700 1.08rem/1.2 var(--sans);
  text-decoration: none;
  box-shadow: inset 0 -3px 0 var(--ember-deep), 0 0 0 4px rgba(232, 183, 101, 0.12);
  transition: background-color 140ms ease-out, box-shadow 140ms ease-out;
}
.store:hover, .prose .button:hover { background: #f1c97f; box-shadow: inset 0 -3px 0 var(--ember-deep), 0 0 0 6px rgba(232, 183, 101, 0.2); }
.store.soon { background: transparent; color: var(--ember); border-color: var(--plate-edge); box-shadow: none; }
.stores { display: flex; flex-wrap: wrap; gap: 12px 14px; margin: 0; }
.stores .store { padding: 0.75rem 1.15rem; font-size: 1rem; white-space: nowrap; }
.stores .store + .store { background: transparent; color: var(--ember); border-color: var(--ember-deep); box-shadow: none; }

/* Scène d'ouverture : le gardien sous la lune, et la plaque du titre. */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(40px, 7vw, 104px) var(--gutter);
  background:
    radial-gradient(circle at 74% 40%, rgba(201, 184, 238, 0.22), transparent 34%),
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 12%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 82%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 94% 14%, #fff7 50%, transparent 51%),
    linear-gradient(var(--night-deep), var(--night) 70%);
  border-bottom: 1px solid var(--plate-edge);
  overflow: hidden;
}
.stage .plate { padding: clamp(24px, 4vw, 44px); container-type: inline-size; }
/* Le titre remplit la plaque sans jamais en sortir (16 % de sa largeur par em, « Cendregarde » fait ~6 em). */
.title { margin: 0; font-size: min(5.8rem, 15.5cqi); line-height: 0.95; letter-spacing: -0.01em; }
.pitch { font-size: clamp(1.1rem, 1rem + 0.45vw, 1.32rem); margin: 1.1rem 0 1.6rem; color: var(--text); }
.stage .note { margin: 1.1rem 0 0; color: var(--muted); font-size: 0.95rem; }
.guardian { justify-self: center; position: relative; width: min(440px, 100%); }
.guardian img {
  display: block;
  width: 100%;
  border-radius: 22%;
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px var(--plate-edge), 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 120px rgba(201, 184, 238, 0.18);
}
/* Quelques braises qui montent devant le gardien ; immobiles si l'on préfère moins d'animation. */
.guardian::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(3px 3px at 18% 80%, var(--fire) 50%, transparent 52%),
    radial-gradient(2px 2px at 82% 62%, var(--ember) 50%, transparent 52%),
    radial-gradient(3px 3px at 70% 88%, var(--fire) 50%, transparent 52%),
    radial-gradient(2px 2px at 30% 54%, var(--ember) 50%, transparent 52%);
  animation: embers 7s ease-in-out infinite alternate;
}
@keyframes embers { from { translate: 0 6px; opacity: 0.55; } to { translate: 0 -14px; opacity: 1; } }
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .guardian { order: -1; width: min(300px, 76%); }
}

/* La boucle : trois temps (descendre, rentrer, recommencer plus bas). */
.loop { padding: clamp(56px, 8vw, 112px) var(--gutter); }
.loop > p { max-width: 38em; font-size: 1.12rem; color: var(--muted); margin: 0 0 clamp(28px, 4vw, 48px); }
.loop ol { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.5vw, 28px); margin: 0; padding: 0; }
.loop li { counter-increment: step; padding: clamp(22px, 3vw, 32px); }
.loop li::before {
  content: counter(step, upper-roman);
  display: block;
  margin-bottom: 0.9rem;
  color: var(--moon);
  font: 700 1.5rem/1 var(--serif);
}
.loop h3 { font-size: 1.5rem; margin: 0 0 0.6rem; }
.loop li p { margin: 0; color: var(--muted); }
@media (max-width: 820px) { .loop ol { grid-template-columns: 1fr; } }

/* Captures : quatre écrans du jeu, dans leur cadre de téléphone. */
.shots { padding: clamp(48px, 7vw, 96px) var(--gutter); background: var(--night-deep); border-block: 1px solid var(--plate-edge); overflow: hidden; }
.shots ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 32px); align-items: start; }
.shots li { margin: 0; }
.shots li:nth-child(even) { translate: 0 clamp(0px, 3vw, 36px); }
.shots img { display: block; width: 100%; border-radius: clamp(14px, 2.2vw, 26px); border: 2px solid var(--plate-edge); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.shots p { margin: 0.9rem 0 0; text-align: center; font-weight: 600; color: var(--text); font-size: 0.98rem; line-height: 1.4; }
@media (max-width: 820px) {
  .shots ul { grid-template-columns: repeat(4, 68%); overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 20px; }
  .shots li { scroll-snap-align: center; }
  .shots li:nth-child(even) { translate: none; }
}

/* Ce que contient le jeu : quelques chiffres dans des plaques. */
.depth { padding: clamp(56px, 8vw, 112px) var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.depth > div > p { max-width: 34em; font-size: 1.1rem; margin: 0; color: var(--muted); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.facts li { padding: 1rem 1.1rem; line-height: 1.35; color: var(--muted); }
.facts strong { display: block; margin-bottom: 0.25rem; color: var(--moon); font: 700 2rem/1 var(--serif); }
@media (max-width: 820px) { .depth { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .facts { grid-template-columns: 1fr; } }

/* Ce qui est payant : la règle dite simplement, et ce qu'il n'y a pas. */
.deal { padding: 0 var(--gutter) clamp(56px, 8vw, 112px); }
.deal .plate { padding: clamp(24px, 4vw, 48px); }
.deal p { max-width: 40em; font-size: 1.1rem; margin: 0 0 1.6rem; }
.nope { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 12px; }
.nope li { padding: 0.45rem 0.95rem; border: 1px solid var(--plate-edge); border-radius: 999px; background: var(--night); font-weight: 600; font-size: 0.97rem; }
.nope li::before { content: "✦"; margin-right: 0.5em; color: var(--ember); font-size: 0.8em; }

.last { display: flex; align-items: center; gap: clamp(20px, 4vw, 48px); padding: clamp(40px, 6vw, 88px) var(--gutter); border-top: 1px solid var(--plate-edge); }
.last img { width: clamp(110px, 14vw, 160px); flex: none; border-radius: 22%; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--plate-edge); }
.last h2 { margin: 0 0 0.4rem; }
.last p { margin: 0 0 1.4rem; color: var(--muted); font-size: 1.08rem; }
@media (max-width: 560px) { .last { flex-direction: column; align-items: flex-start; } }

/* Pages longues : en-tête sous la lune, puis la lecture. */
.doc-head {
  padding: clamp(36px, 6vw, 80px) var(--gutter) clamp(28px, 4vw, 48px);
  background: radial-gradient(circle at 85% 30%, rgba(201, 184, 238, 0.16), transparent 40%), var(--night-deep);
  border-bottom: 1px solid var(--plate-edge);
}
.doc-head h1 { margin: 0; font-size: clamp(2.2rem, 1.3rem + 4vw, 4.2rem); hyphens: auto; overflow-wrap: break-word; }
/* Japonais, coréen, chinois : pas d'espaces entre les mots, donc pas d'équilibrage des lignes
   (il couperait « プライバシーポリシー » au milieu) ; un corps un peu plus petit pour tenir sur une ligne. */
:lang(ja) .doc-head h1, :lang(ko) .doc-head h1, :lang(zh-Hant) .doc-head h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3.4rem); text-wrap: wrap; }
.updated { margin: 0.9rem 0 0; color: var(--ember); font-weight: 600; font-size: 0.95rem; }
.reading {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 40rem);
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(32px, 5vw, 56px) var(--gutter) clamp(56px, 8vw, 112px);
}
.toc { position: sticky; top: 20px; align-self: start; }
.toc > p { margin: 0 0 0.6rem; color: var(--ember); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--plate-edge); }
.toc a { display: block; padding: 0.32rem 0 0.32rem 0.9rem; color: var(--muted); text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.toc a:hover { color: var(--text); box-shadow: inset 2px 0 0 var(--ember); }
@media (max-width: 860px) {
  .reading { grid-template-columns: 1fr; }
  .toc { position: static; }
}
.prose { font-size: 1.06rem; line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose .lede { font-size: 1.24rem; line-height: 1.55; color: var(--text); }
.prose p, .prose li { color: #d9d2e6; }
.prose h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.95rem); margin: 2.6rem 0 0.7rem; scroll-margin-top: 20px; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--ember); }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { text-decoration-color: var(--ember); }
.prose .hint { color: var(--muted); font-size: 0.97rem; }
.prose .contact { margin: 1.8rem 0 0.8rem; }

/* Pied de page */
.bottom {
  margin-top: 0;
  padding: 48px var(--gutter) max(32px, env(safe-area-inset-bottom));
  background: var(--night-deep);
  border-top: 1px solid var(--plate-edge);
}
.bottom nav { display: flex; flex-wrap: wrap; gap: 6px 28px; font: 700 1.2rem/1.3 var(--serif); }
.bottom nav a { text-decoration: none; padding: 6px 0; }
.bottom nav a:hover { color: var(--ember); }
.bottom p { margin: 1.3rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* Menu des langues : un <details> dont la liste flotte par-dessus la page, sans rien décaler. */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu .globe { flex: none; }
.lang-menu .chevron { flex: none; transition: transform 0.15s ease; }
.lang-menu[open] .chevron { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 210px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--plate);
  border: 2px solid var(--plate-edge);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.top nav .lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 5px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.top nav .lang-menu a:hover { background: var(--plate-inner); text-decoration: none; }
.top nav .lang-menu a[aria-current] { font-weight: 700; text-decoration: none; }
.lang-menu .check { flex: none; color: var(--ember); }
/* Sur téléphone, le menu passe à la ligne sous le logo : la liste s'aligne sur la marge droite de
   l'en-tête, pour ne jamais dépasser de l'écran. */
@media (max-width: 560px) {
  .top { position: relative; }
  .lang-menu { position: static; }
  .lang-menu ul { top: calc(100% - 8px); right: var(--gutter); }
}

@media (prefers-reduced-motion: reduce) {
  .lang-menu .chevron, .store, .prose .button { transition: none; }
  .guardian::after { animation: none; }
}
