/*
  Anvilkin : la page est faite comme l'interface du jeu. Une forge de nuit, charbon et braise ;
  chaque bloc est une plaque d'émail cloisonné, aplat sombre cerné d'un fil d'or. Titres en serif
  gravé or, texte parchemin. Images dessinées par les générateurs du jeu (Art/Vector).
*/
:root {
  --charbon: #1a1210;
  --charbon-deep: #120c0a;
  --email: #241a16;
  --email-nuit: #2e2320;
  --parchemin: #f3e6c8;
  --cendre: #c9b89a;
  --or: #f2c14e;
  --or-pale: #ffe3a3;
  --or-fondu: #f2a93b;
  --laiton: #8a6a2e;
  --braise: #ff6a2a;
  --rubis: #c8401a;
  --wire: 2px;
  --plate-shadow: 0 0 0 1px #3a2a18, 0 10px 28px rgba(0, 0, 0, 0.55);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --text: -apple-system, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--charbon);
  color: var(--parchemin);
  font: 500 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--or); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; height: auto; }

h1, h2, h3, .logo { font-family: var(--display); font-weight: 900; letter-spacing: -0.01em; line-height: 1.05; text-wrap: balance; }
h2 {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem);
  margin: 0 0 clamp(18px, 3vw, 32px);
  color: var(--or);
}

/* Plaque d'émail : aplat sombre, fil d'or, petit reflet en haut. */
.plaque, .pins li, .facts li, .nope li, .doc-head h1 {
  background: linear-gradient(180deg, var(--email-nuit), var(--email));
  border: var(--wire) solid var(--or-fondu);
  border-radius: 20px;
  box-shadow: inset 0 0 0 4px var(--charbon-deep), inset 0 0 0 5px var(--laiton), var(--plate-shadow);
}

/* En-tête : la barre de la forge. */
.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;
  background: var(--charbon-deep);
  border-bottom: var(--wire) solid var(--laiton);
}
.logo { font-size: 1.6rem; color: var(--or); text-decoration: none; }
.logo::before {
  content: "";
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  margin: -0.3em 0.35em -0.3em 0;
  vertical-align: middle;
  background: url("forge-anvil.png") center / contain no-repeat;
}
.top nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-weight: 700; color: var(--cendre); }
.top nav a { text-decoration: none; padding: 10px 0; }
.top nav a:hover, .top nav a[aria-current] {
  color: var(--parchemin);
  text-decoration: underline var(--braise);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.4em;
}
@media (max-width: 560px) {
  .top { gap: 0 14px; }
  .logo { font-size: 1.35rem; }
  .top nav { gap: 0 14px; font-size: 0.95rem; }
}

/* Menu des langues : un <details> dont la liste flotte par-dessus la page, sans rien décaler.
   La liste est une plaque d'émail cernée d'or, comme les fenêtres du jeu. */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--parchemin); }
.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); }
@media (prefers-reduced-motion: reduce) { .lang-menu .chevron { transition: none; } }
.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(--email);
  border: var(--wire) solid var(--or);
  border-radius: 12px;
  box-shadow: var(--plate-shadow);
}
.top nav .lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--parchemin);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.top nav .lang-menu a:hover { background: var(--email-nuit); text-decoration: none; }
.top nav .lang-menu a[aria-current] { font-weight: 700; text-decoration: none; }
.lang-menu .check { flex: none; color: var(--or); }
/* 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); }
}

/* Boutons : le lingot du jeu, or fondu bordé de laiton. */
.store, .prose .button {
  display: inline-block;
  margin: 0;
  padding: 0.8rem 1.5rem;
  border: var(--wire) solid var(--or-pale);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffc25a, var(--or-fondu) 55%, #d9822a);
  color: var(--charbon);
  font: 800 1.12rem/1.2 var(--text);
  text-decoration: none;
  box-shadow: 0 0 0 2px var(--laiton), 0 6px 0 #7a4a18, 0 10px 20px rgba(0, 0, 0, 0.5);
  transition: translate 120ms ease-out, box-shadow 120ms ease-out;
}
.store:hover, .prose .button:hover { translate: 0 3px; box-shadow: 0 0 0 2px var(--laiton), 0 3px 0 #7a4a18, 0 6px 14px rgba(0, 0, 0, 0.5); }
.store.soon {
  background: var(--email-nuit);
  color: var(--cendre);
  border-color: var(--laiton);
  box-shadow: none;
  translate: none;
}

/* Scène d'ouverture : l'intérieur de la forge ; Pico devant, le titre sur une plaque. */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 34rem);
  justify-content: center;
  align-items: center;
  gap: clamp(16px, 4vw, 56px);
  min-height: min(82vh, 760px);
  padding: clamp(28px, 6vw, 88px) var(--gutter);
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 106, 42, 0.35), transparent 60%),
    linear-gradient(180deg, rgba(18, 12, 10, 0.55), rgba(18, 12, 10, 0.85)),
    var(--charbon) url("scene.jpg") center 70% / cover no-repeat;
  border-bottom: var(--wire) solid var(--laiton);
  overflow: hidden;
}
.stage .hero { width: 100%; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.6)); }
.plaque { padding: clamp(22px, 4vw, 40px); }
.title {
  margin: 0;
  font-size: clamp(3rem, 1.8rem + 5vw, 5.6rem);
  line-height: 0.95;
  background: linear-gradient(180deg, var(--or-pale), var(--or-fondu) 60%, var(--braise));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pitch { font-size: clamp(1.08rem, 1rem + 0.4vw, 1.3rem); margin: 1rem 0 1.5rem; }
.stage .note { margin: 1rem 0 0; color: var(--cendre); font-size: 0.95rem; }
@media (max-width: 760px) {
  .stage { grid-template-columns: 1fr; min-height: 0; }
  .stage .hero { width: min(220px, 60%); justify-self: center; margin-bottom: -28px; position: relative; z-index: 1; }
}

/* La boucle : trois étapes numérotées comme des médailles. */
.loop { padding: clamp(56px, 8vw, 112px) var(--gutter); }
.loop ol { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); margin: 0; padding: 0; }
.loop li { counter-increment: step; }
.loop li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--or-pale), var(--or-fondu) 55%, #b06a1e);
  border: var(--wire) solid var(--or-pale);
  box-shadow: 0 0 0 3px var(--laiton), 0 6px 14px rgba(0, 0, 0, 0.5);
  color: var(--charbon);
  font: 900 1.4rem/1 var(--round);
}
.loop h3 { font-size: 1.6rem; margin: 0 0 0.5rem; color: var(--parchemin); }
.loop p { margin: 0; color: var(--cendre); max-width: 26em; }
@media (max-width: 760px) { .loop ol { grid-template-columns: 1fr; } }

/* Captures : des écrans du jeu, légèrement de biais. */
.shots { padding: clamp(40px, 6vw, 80px) var(--gutter); background: var(--charbon-deep); border-block: var(--wire) solid var(--laiton); overflow: hidden; }
.shots ul { list-style: none; margin: 0 auto; padding: 0; max-width: 1100px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); align-items: start; }
.shots li { margin: 0; }
.shots img { display: block; width: 100%; border: var(--wire) solid var(--or-fondu); border-radius: 28px; box-shadow: 0 0 0 4px var(--charbon), 0 0 0 5px var(--laiton), 0 18px 36px rgba(0, 0, 0, 0.6); }
.shots li:nth-child(1) { rotate: -2deg; }
.shots li:nth-child(2) { rotate: 1.5deg; translate: 0 28px; }
.shots li:nth-child(3) { rotate: -1deg; }
.shots p { margin: 0.9rem 0 0; text-align: center; font-weight: 700; color: var(--cendre); }
@media (max-width: 760px) {
  .shots ul { grid-template-columns: 1fr; max-width: 320px; }
  .shots li:nth-child(n) { rotate: 0deg; translate: none; }
}

/* Bestiaire : les familiers en insignes, puis les chiffres. */
.bestiary { padding: clamp(56px, 8vw, 112px) var(--gutter); }
.bestiary > p { max-width: 36em; font-size: 1.12rem; color: var(--cendre); margin: 0 0 clamp(28px, 4vw, 44px); }
.pins { list-style: none; margin: 0 0 clamp(28px, 4vw, 44px); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 3vw, 28px); }
.pins li { padding: 16px 12px 18px; text-align: center; }
.pins img { display: block; width: min(150px, 86%); margin: 0 auto 6px; transition: rotate 220ms cubic-bezier(0.3, 1.6, 0.5, 1); }
.pins li:nth-child(odd) img { rotate: -6deg; }
.pins li:nth-child(even) img { rotate: 5deg; }
.pins li:hover img { rotate: 0deg; }
.pins span { font: 800 1.15rem/1.2 var(--display); color: var(--parchemin); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.facts li { padding: 0.9rem 1.1rem; font-weight: 600; line-height: 1.35; color: var(--cendre); }
.facts strong { display: block; font: 900 1.9rem/1.1 var(--round); color: var(--or); }
@media (max-width: 760px) {
  .pins, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Ce qu'on paie : les promesses en pastilles émaillées. */
.deal { padding: clamp(56px, 8vw, 112px) var(--gutter); background: var(--charbon-deep); border-block: var(--wire) solid var(--laiton); }
.deal > p { max-width: 38em; font-size: 1.12rem; color: var(--cendre); margin: 0 0 1.6rem; }
.nope { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 14px; }
.nope li { padding: 0.55rem 1.1rem; border-radius: 999px; font-weight: 700; }
.nope li:nth-child(odd) { rotate: -1.5deg; }
.nope li:nth-child(even) { rotate: 1.2deg; }

.last {
  display: flex;
  align-items: center;
  gap: clamp(20px, 5vw, 64px);
  padding: clamp(56px, 8vw, 112px) var(--gutter) clamp(24px, 4vw, 48px);
}
.last img { width: clamp(140px, 20vw, 220px); flex: none; rotate: -6deg; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.6)); }
.last h2 { margin: 0 0 0.3rem; }
.last p { margin: 0 0 1.4rem; font-size: 1.12rem; color: var(--cendre); }
@media (max-width: 560px) { .last { flex-direction: column; align-items: flex-start; } }

/* Pages longues : l'en-tête sur la forge, puis une colonne de lecture. */
.doc-head {
  padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(28px, 4vw, 48px);
  background:
    linear-gradient(180deg, rgba(18, 12, 10, 0.6), rgba(18, 12, 10, 0.9)),
    var(--charbon) url("scene.jpg") center 60% / cover no-repeat;
  border-bottom: var(--wire) solid var(--laiton);
}
.doc-head h1 {
  display: inline-block;
  margin: 0;
  padding: 0.35em 0.6em 0.4em;
  font-size: clamp(1.7rem, 1rem + 3.6vw, 4.2rem);
  line-height: 0.95;
  color: var(--or);
  max-width: 100%;
  hyphens: auto;
}
.updated { display: table; margin: 0.9rem 0 0; padding: 0.2rem 0.8rem; border: 1.5px solid var(--laiton); border-radius: 999px; background: var(--email); color: var(--cendre); 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; font: 900 1.1rem var(--display); color: var(--or); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: var(--wire) solid var(--laiton); }
.toc a { display: block; padding: 0.3rem 0 0.3rem 0.9rem; color: var(--cendre); text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.toc a:hover { color: var(--parchemin); box-shadow: inset 3px 0 0 var(--braise); }
@media (max-width: 860px) {
  .reading { grid-template-columns: 1fr; }
  .toc { position: static; }
}
.prose { font-size: 1.06rem; line-height: 1.72; color: var(--parchemin); }
.prose > :first-child { margin-top: 0; }
.prose .lede { font-size: 1.24rem; line-height: 1.5; font-weight: 600; }
.prose h2 { font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem); margin: 2.6rem 0 0.7rem; scroll-margin-top: 20px; }
.prose p { color: #e6d8b8; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose li::marker { color: var(--or-fondu); }
.prose strong { font-weight: 800; }
.prose a { color: var(--or-pale); text-decoration-color: var(--or-fondu); }
.prose .button { color: var(--charbon); }
.prose .hint { color: var(--cendre); font-size: 0.98rem; }
.prose .contact { margin: 1.8rem 0 0.8rem; }

/* Pied de page : le charbon referme la page ; le renard passe la tête par-dessus. */
.bottom {
  position: relative;
  margin-top: 64px;
  padding: 56px var(--gutter) max(32px, env(safe-area-inset-bottom));
  background: var(--charbon-deep);
  border-top: var(--wire) solid var(--or-fondu);
  color: var(--parchemin);
}
.bottom::before {
  content: "";
  position: absolute;
  right: 10%;
  top: -70px;
  width: 110px;
  height: 110px;
  rotate: 10deg;
  background: url("pet-fox.png") center / contain no-repeat;
}
.bottom nav { display: flex; flex-wrap: wrap; gap: 6px 32px; font: 900 1.25rem/1.3 var(--display); color: var(--or); }
.bottom nav a { text-decoration: none; padding: 6px 0; }
.bottom nav a:hover { color: var(--or-pale); }
.bottom p { margin: 1.4rem 0 0; color: var(--cendre); font-size: 0.92rem; }

@media (prefers-reduced-motion: reduce) {
  .store, .pins img { transition: none; }
}
