/* ==========================================================================
   mydragoneggs.com - feuille de style unique
   --------------------------------------------------------------------------
   Direction « Le Parchemin du Gardien ».
   Or #C8A84E en accent unique (repris de Palette.cs du client Godot).

   La page d'accueil est un diorama en couches sur le Lac de Vaedar :
   le décor, la brume, les dragons animés, l'œuf cliquable et la bande
   d'herbes du premier plan pivotent ensemble en profondeur.

   Cadence des animations, relevée dans FirstHatch.cs du jeu :
   Idle = 9 frames à 8 fps (1.125 s), œuf = 17 frames à 10 fps.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */
:root {
  --parchemin:   #F5F0E4;
  --parchemin-2: #E7DFCB;
  --carte:       #FFFCF4;

  --encre:       #22201C;
  --encre-douce: #4A453C;
  --sourdine:    #6E6656;

  --trait:       #DFD5BE;
  --cuir:        #A08268;

  --or:          #C8A84E;
  --or-fonce:    #8A5A14;
  --or-clair:    #FFE29A;

  --nuit:        #0D0D1A;
  --creme:       #E8E4D4;
  --bleu-gris:   #8B9BB4;
  --trait-nuit:  #2A2A4A;

  --t-0:  clamp(1rem, .97rem + .16vw, 1.09rem);
  --t-1:  clamp(1.15rem, 1.08rem + .34vw, 1.38rem);
  --t-2:  clamp(1.5rem, 1.3rem + .95vw, 2.15rem);
  --t-3:  clamp(2rem, 1.2rem + 3.8vw, 5.2rem);

  --marge:   clamp(1.25rem, 4vw, 3.5rem);
  --largeur: 76rem;
  --mesure:  64ch;
}

/* --- 2. Base ------------------------------------------------------------- */
::selection { background: var(--or); color: #1A1206; }

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

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-color: var(--or) #14131A;
}

body {
  margin: 0;
  background: var(--parchemin);
  color: var(--encre);
  font-family: Spectral, Georgia, "Times New Roman", serif;
  font-size: var(--t-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Curseur du gardien : l'œuf. Les liens et boutons gardent la main. */
html.ecran body { cursor: url("../img/cursor.png") 6 6, auto; }
html.ecran a,
html.ecran button { cursor: pointer; }

h1, h2, h3 {
  font-family: Cinzel, "Trajan Pro", Georgia, serif;
  font-weight: 600;
  line-height: 1.14;
  text-wrap: balance;
  margin: 0;
}

p, ul, ol, figure { margin: 0; }
ul { list-style: none; padding: 0; }

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

a { color: var(--or-fonce); }

:where(a, button, input):focus-visible {
  outline: 2px solid var(--or-fonce);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--carte);
  color: var(--encre);
  padding: .75rem 1.25rem;
  border: 1px solid var(--or);
}
.skip:focus { left: .5rem; top: .5rem; }

.wrap {
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--marge);
}

.oeil {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sourdine);
}

/* --- 3. Boutons ---------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: Cinzel, Georgia, serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .9rem 1.6rem;
  border: 1px solid var(--or);
  border-radius: 2px;
  background: var(--or);
  color: #1A1206;
  cursor: pointer;
  box-shadow: 0 10px 24px -14px rgba(34, 32, 28, .7);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover,
.btn:focus-visible { background: var(--or-clair); border-color: var(--or-clair); }
.btn:active { transform: translateY(1px); }

/* ==========================================================================
   4. LA SCÈNE
   ========================================================================== */
.scene {
  position: relative;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  perspective: 1600px;
  background: var(--parchemin);
}

/* Voile de parchemin sur le ciel : le logo reste lisible. Au-dessus du
   décor, sous le contenu. */
.scene::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 30%;
  background: linear-gradient(180deg,
              rgba(245, 240, 228, .6) 0%,
              rgba(245, 240, 228, .26) 45%,
              rgba(245, 240, 228, 0) 100%);
  pointer-events: none;
  z-index: 3;
}

/* Les neuf zones de survol du repli sans JavaScript. */
.survol {
  position: relative;
  z-index: 1;
  display: block;
}

/* --- 4.1 Les couches ----------------------------------------------------- */
.couches {
  position: absolute;
  inset: 0;
  z-index: 2;               /* au-dessus des zones de survol : l'œuf se clique */
  pointer-events: none;     /* mais tout le reste laisse passer la souris */
  transform-style: preserve-3d;
}
.couches__pivot {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .55s ease;
}

/* Repli sans JavaScript : chaque case incline le diorama dans sa direction.
   Le JavaScript pose un transform en ligne qui prend le dessus. */
.survol:nth-child(1):hover ~ .couches .couches__pivot { transform: rotate3d(1, -1, 0, 2.5deg); }
.survol:nth-child(2):hover ~ .couches .couches__pivot { transform: rotate3d(1,  0, 0, 2.5deg); }
.survol:nth-child(3):hover ~ .couches .couches__pivot { transform: rotate3d(1,  1, 0, 2.5deg); }
.survol:nth-child(4):hover ~ .couches .couches__pivot { transform: rotate3d(0, -1, 0, 5deg); }
.survol:nth-child(5):hover ~ .couches .couches__pivot { transform: rotate3d(0,  0, 0, 5deg); }
.survol:nth-child(6):hover ~ .couches .couches__pivot { transform: rotate3d(0,  1, 0, 5deg); }
.survol:nth-child(7):hover ~ .couches .couches__pivot { transform: rotate3d(-1, -1, 0, 8deg); }
.survol:nth-child(8):hover ~ .couches .couches__pivot { transform: rotate3d(-1, 0, 0, 8deg); }
.survol:nth-child(9):hover ~ .couches .couches__pivot { transform: rotate3d(-1, 1, 0, 8deg); }

.couche {
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  height: calc(var(--t) * var(--echelle, 1));
  transform: translateX(-50%) translateZ(var(--z));
  backface-visibility: hidden;
}

/* Les sprites posés (dragons, œuf, bébé) : boîte carrée de la frame,
   apparition en fondu échelonnée au chargement. */
.couche--pose {
  aspect-ratio: 1 / 1;
  animation: pose .9s ease-out backwards;
  animation-delay: var(--d, 0s);
}
@keyframes pose {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Le décor : plus grand que l'écran pour couvrir les bords en rotation. */
.couche--decor {
  left: 50%;
  top: 50%;
  bottom: auto;
  width: 128%;
  height: 128%;
  transform: translate(-50%, -50%) translateZ(var(--z));
}
.couche--decor img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  image-rendering: pixelated;
}

/* La brume qui dérive au-dessus de l'eau. */
.couche--brume {
  left: 50%;
  bottom: 38%;
  width: 96%;
  height: 13%;
  transform: translateX(-50%) translateZ(var(--z));
  background:
    radial-gradient(42% 58% at 28% 55%, rgba(245, 240, 228, .5) 0%, rgba(245, 240, 228, 0) 70%),
    radial-gradient(36% 52% at 66% 42%, rgba(245, 240, 228, .38) 0%, rgba(245, 240, 228, 0) 70%);
  animation: brume 26s ease-in-out infinite alternate;
  opacity: .8;
}
@keyframes brume {
  from { transform: translateX(-54%) translateZ(var(--z)); }
  to   { transform: translateX(-46%) translateZ(var(--z)); }
}

/* --- 4.2 Les sprites animés --------------------------------------------- */
/* Bande horizontale de 9 frames, jouée à 8 fps comme dans le jeu. */
.sprite {
  display: block;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 14px 12px rgba(20, 16, 10, .45));
  transform: var(--flip, none);
}
.couche--flip .sprite { --flip: scaleX(-1); }

.sprite--idle {
  background-size: 900% 100%;
  animation: idle9 1.125s steps(9, jump-none) infinite;
  animation-delay: calc(var(--d, 0s) * -1.7);   /* désynchronise les dragons */
}
@keyframes idle9 {
  from { background-position-x: 0%; }
  to   { background-position-x: 100%; }
}

/* Variante feuille commune : 9 frames dans une grille de 17 colonnes
   (anim/hero.png). La frame 8 tombe à 50% de la largeur. */
.sprite--h {
  background-size: 1700% 500%;
  animation: idle9-17 1.125s steps(9, jump-none) infinite;
  animation-delay: calc(var(--d, 0s) * -1.7);
}
@keyframes idle9-17 {
  from { background-position-x: 0%; }
  to   { background-position-x: 50%; }
}

/* L'œuf : 17 frames pilotées par le JavaScript, frame 0 au repos. */
.sprite--oeuf {
  filter: drop-shadow(0 18px 18px rgba(20, 16, 10, .5));
  animation: respire 5.5s ease-in-out infinite;
}
@keyframes respire {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-7px) scale(1.012); }
}

/* Le bouton de l'œuf : aucun habillage, seul le sprite se voit. */
.couche--oeuf {
  pointer-events: auto;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.couche--oeuf:focus-visible {
  outline: 2px solid var(--or-fonce);
  outline-offset: 6px;
  border-radius: 12px;
}
.couche--oeuf:hover .sprite--oeuf {
  filter: drop-shadow(0 18px 18px rgba(20, 16, 10, .5))
          drop-shadow(0 0 22px rgba(200, 168, 78, .55));
}

/* Secousse pendant que la coquille craque. */
.couche--oeuf.secoue { animation: secoue .38s linear; }
@keyframes secoue {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  20%      { translate: -4px 0; rotate: -2deg; }
  45%      { translate: 4px 1px; rotate: 2deg; }
  70%      { translate: -3px 0; rotate: -1.4deg; }
  85%      { translate: 3px 1px; rotate: 1.4deg; }
}

/* Naissance du bébé. */
.couche--bebe.nait { animation: nait .7s cubic-bezier(.2, 1.6, .4, 1) backwards; }
@keyframes nait {
  from { opacity: 0; scale: .4; }
  to   { opacity: 1; scale: 1; }
}

/* Étincelles dorées de l'éclosion, posées par le JavaScript. */
.eclat {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--or-clair);
  box-shadow: 0 0 10px 2px rgba(200, 168, 78, .8);
  pointer-events: none;
  animation: eclat .9s ease-out forwards;
}
@keyframes eclat {
  from { opacity: 1; translate: 0 0; scale: 1; }
  to   { opacity: 0; translate: var(--dx) var(--dy); scale: .3; }
}

/* --- 4.4 Les lucioles ----------------------------------------------------- */
.lucioles { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lucioles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--or-clair);
  box-shadow: 0 0 8px 2px rgba(200, 168, 78, .65);
  opacity: 0;
  animation: derive var(--du, 11s) ease-in-out infinite,
             scintille 2.8s ease-in-out infinite;
  animation-delay: var(--de, 0s);
}
.lucioles i:nth-child(1) { left: 16%; top: 42%; --du: 12s; --de: 0s; }
.lucioles i:nth-child(2) { left: 27%; top: 52%; --du: 15s; --de: 1.4s; }
.lucioles i:nth-child(3) { left: 38%; top: 40%; --du: 10s; --de: 2.6s; width: 4px; height: 4px; }
.lucioles i:nth-child(4) { left: 50%; top: 47%; --du: 14s; --de: .8s; }
.lucioles i:nth-child(5) { left: 61%; top: 41%; --du: 11s; --de: 3.4s; width: 4px; height: 4px; }
.lucioles i:nth-child(6) { left: 72%; top: 51%; --du: 16s; --de: 1.9s; }
.lucioles i:nth-child(7) { left: 83%; top: 44%; --du: 12s; --de: 4.2s; }
.lucioles i:nth-child(8) { left: 44%; top: 56%; --du: 13s; --de: 5.1s; width: 4px; height: 4px; }
@keyframes derive {
  0%   { translate: 0 0; }
  25%  { translate: 18px -14px; }
  50%  { translate: -8px -26px; }
  75%  { translate: -22px -8px; }
  100% { translate: 0 0; }
}
@keyframes scintille {
  0%, 100% { opacity: 0; }
  40%, 60% { opacity: .9; }
}

/* --- 4.4 Ce qui est devant ----------------------------------------------- */
.devant {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  padding: clamp(1rem, 3vh, 2.25rem) var(--marge);
}
.devant > * { pointer-events: auto; }

.enseigne {
  position: relative;
  grid-column: 1 / -1;
  font-size: 0;
  line-height: 0;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  display: grid;
  justify-items: center;
  padding-top: clamp(.25rem, 2vh, 1.5rem);
  animation: pose 1s ease-out backwards;
}
.enseigne__logo {
  width: clamp(17rem, 52vw, 44rem);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 10px 22px rgba(34, 32, 28, .28));
}

/* Menu et signature : deux coins, rien de plus. */
.menu {
  position: absolute;
  top: clamp(1rem, 3vh, 2.25rem);
  right: var(--marge);
  text-align: right;
}
.menu li + li { margin-top: .1rem; }
.menu a {
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(.78rem, 1.5vw, .95rem);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--encre);
  text-shadow: 2px 2px 0 rgba(200, 168, 78, .55);
  transition: color .18s ease, text-shadow .18s ease;
}
.menu a:hover,
.menu a:focus-visible {
  color: var(--or-fonce);
  text-shadow: 3px 3px 0 rgba(200, 168, 78, .9);
}

.signature {
  grid-row: 2;
  justify-self: start;
  align-self: end;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .64rem;
  letter-spacing: .06em;
  color: var(--sourdine);
  background: rgba(245, 240, 228, .82);
  border-radius: 100px;
  padding: .2rem .7rem;
}

/* Le bouton musique, en bas à droite. */
.musique {
  grid-row: 2;
  justify-self: end;
  align-self: end;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sourdine);
  background: rgba(245, 240, 228, .82);
  border: 1px solid var(--trait);
  border-radius: 100px;
  padding: .38rem .9rem;
  transition: color .18s ease, border-color .18s ease;
}
.musique:hover,
.musique:focus-visible { color: var(--or-fonce); border-color: var(--or); }
.musique[aria-pressed="true"] {
  color: var(--or-fonce);
  border-color: var(--or);
  background: rgba(255, 226, 154, .5);
}

/* L'indice de défilement : un chevron doré qui pulse en bas au centre. */
.defile {
  position: absolute;
  left: 50%;
  bottom: clamp(.7rem, 2vh, 1.5rem);
  translate: -50% 0;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.defile span {
  width: .8rem;
  height: .8rem;
  border-right: 2px solid var(--or-fonce);
  border-bottom: 2px solid var(--or-fonce);
  rotate: 45deg;
  translate: 0 -3px;
  animation: defile 2.2s ease-in-out infinite;
}
@keyframes defile {
  0%, 100% { translate: 0 -3px; opacity: .55; }
  50%      { translate: 0 3px;  opacity: 1; }
}

/* ==========================================================================
   5. LA RUPTURE : le tableau de l'Antre. Miroir sombre du hero : décor
   peint pleine hauteur, Nyragh animé, braises montantes.
   ========================================================================== */
.oeil--nuit { color: #C89A8A; }

.lore {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  color: var(--creme);
  border-top: 5px solid var(--or);
  overflow: hidden;
  isolation: isolate;
  background-color: #1A0D12;
  background-image: url("../img/zones/antre-grand.webp");
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}
/* Voile : assombrit les bords, laisse respirer le centre, fond la base
   au noir pour accueillir la section suivante. */
.lore::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(26, 13, 18, .55) 0%, rgba(26, 13, 18, .18) 30%,
                    rgba(26, 13, 18, .18) 68%, #0D0D1A 100%),
    radial-gradient(90% 70% at 50% 55%, rgba(26, 13, 18, 0) 40%, rgba(26, 13, 18, .55) 100%);
}

.lore__in {
  max-width: var(--largeur);
  width: 100%;
  margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 6rem) var(--marge);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 860px) {
  .lore__in { grid-template-columns: 1fr; }
  .lore__nyragh { order: -1; }
}

.lore h2 {
  font-size: clamp(3rem, 1.6rem + 7.5vw, 7.5rem);
  line-height: .95;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--or-clair);
  text-shadow: 0 4px 30px rgba(0, 0, 0, .6);
  margin-block: .6rem 1.6rem;
}
.lore__corps {
  display: grid;
  gap: 1.15rem;
  max-width: 46ch;
  font-weight: 300;
  font-size: var(--t-1);
  color: var(--creme);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .55);
}
.lore__corps strong {
  color: var(--or-clair);
  font-weight: 600;
}
.lore__chute {
  color: var(--or-clair);
  font-style: italic;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 226, 154, .3);
}

/* Nyragh : sa vraie spritesheet Adulte (9 frames à 8 fps), frames 249x238. */
.lore__nyragh {
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 1rem;
}
.sprite--nyragh {
  width: clamp(15rem, 34vw, 24rem);
  aspect-ratio: 249 / 238;
  background-size: 900% 100%;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  animation: idle9 1.125s steps(9, jump-none) infinite,
             menace 7s ease-in-out infinite;
  filter: drop-shadow(0 0 55px rgba(200, 60, 40, .45))
          drop-shadow(0 24px 30px rgba(0, 0, 0, .6));
}
@keyframes menace {
  0%, 100% { scale: 1; }
  50%      { scale: 1.04; }
}
.lore__nom {
  font-family: Cinzel, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-align: center;
  color: var(--or-clair);
}
.lore__nom span {
  display: block;
  margin-top: .3rem;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .22em;
  color: #C89A8A;
}

/* Les braises : elles montent du sol de l'Antre. */
.braises { position: absolute; inset: 0; pointer-events: none; }
.braises i {
  position: absolute;
  bottom: -2%;
  left: var(--bx, 50%);
  width: var(--bt, 5px);
  height: var(--bt, 5px);
  border-radius: 50%;
  background: var(--bc, #FF8A50);
  box-shadow: 0 0 9px 2px rgba(255, 120, 60, .55);
  opacity: 0;
  animation: braise var(--bd, 9s) linear infinite;
  animation-delay: var(--be, 0s);
}
.braises i:nth-child(1)  { --bx: 8%;  --bd: 10s; --be: 0s;   --bt: 4px; }
.braises i:nth-child(2)  { --bx: 18%; --bd: 13s; --be: 2.2s; --bc: #FFB46A; }
.braises i:nth-child(3)  { --bx: 29%; --bd: 9s;  --be: 4.8s; --bt: 3px; }
.braises i:nth-child(4)  { --bx: 41%; --bd: 12s; --be: 1.1s; }
.braises i:nth-child(5)  { --bx: 52%; --bd: 10s; --be: 6.4s; --bc: #FFD98A; --bt: 4px; }
.braises i:nth-child(6)  { --bx: 63%; --bd: 14s; --be: 3.3s; }
.braises i:nth-child(7)  { --bx: 72%; --bd: 9s;  --be: 7.6s; --bt: 3px; }
.braises i:nth-child(8)  { --bx: 81%; --bd: 12s; --be: .6s;  --bc: #FFB46A; }
.braises i:nth-child(9)  { --bx: 90%; --bd: 11s; --be: 5.2s; --bt: 4px; }
.braises i:nth-child(10) { --bx: 96%; --bd: 13s; --be: 8.4s; --bt: 3px; }
@keyframes braise {
  0%   { translate: 0 0; opacity: 0; }
  8%   { opacity: .95; }
  70%  { opacity: .55; }
  100% { translate: calc((var(--bx) - 50%) * -.25) -104vh; opacity: 0; }
}

/* ==========================================================================
   6. EN JEU : trois volets illustrés en sprites, dans la charte UI du client
   ========================================================================== */
.jeu {
  background:
    radial-gradient(46% 30% at 12% 0%, rgba(200, 168, 78, .09) 0%, rgba(200, 168, 78, 0) 100%),
    radial-gradient(46% 30% at 88% 100%, rgba(124, 58, 237, .08) 0%, rgba(124, 58, 237, 0) 100%),
    var(--nuit);
  color: var(--creme);
  overflow: hidden;
}
.jeu .oeil { color: var(--bleu-gris); }
.jeu__in {
  max-width: var(--largeur);
  margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--marge) clamp(4rem, 10vw, 7rem);
}
.jeu__titre {
  font-size: clamp(2rem, 1.2rem + 4vw, 4.2rem);
  color: var(--or-clair);
  margin-block: .55rem .9rem;
}

/* L'ornement du jeu : deux filets d'or et le losange des menus v1. */
.ornement {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
  color: var(--or);
}
.ornement::before,
.ornement::after {
  content: "";
  height: 1px;
  flex: 0 1 9rem;
  background: linear-gradient(90deg, rgba(200, 168, 78, 0), var(--or));
}
.ornement::after { background: linear-gradient(90deg, var(--or), rgba(200, 168, 78, 0)); }
.ornement span { font-size: .9rem; line-height: 1; }

/* --- 6.1 Le combat --------------------------------------------------------
   Pas de cadre, pas de barres de vie : les deux dragons s'affrontent
   directement sur la page. Seuls restent la charge, l'impact et les
   dégâts qui volent. */
.combat {
  position: relative;
  height: clamp(15rem, 32vw, 22rem);
  margin-top: clamp(.5rem, 2vw, 1.5rem);
}

.combat { container-type: inline-size; }

.combattant {
  position: absolute;
  bottom: 4%;
  height: 78%;
  display: grid;
  align-items: end;
  z-index: 1;
  /* Repli des trajets : le JavaScript ajuste durée et courbe par phase. */
  transition: translate .3s ease;
}
/* L'ombre d'assise voyage avec son dragon. */
.combattant::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3%;
  translate: -50% 0;
  width: 92%;
  height: 11%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 72%);
  z-index: -1;
}
.combattant--g { left: 21%; translate: -50% 0; }
.combattant--d { left: 79%; translate: -50% 0; }
.combattant--d .combat__sprite { transform: scaleX(-1); }

/* Les trois phases du trajet, appliquées par le JavaScript :
   recul d'élan bref, ruée vers l'adversaire, retour au camp.
   L'attaquant en mouvement passe au premier plan. */
.combattant.elan   { transition: translate .12s ease-out; }
.combattant.ruee   { transition: translate .22s cubic-bezier(.5, 0, .9, .6); }
.combattant.retour { transition: translate .45s cubic-bezier(.2, .7, .4, 1); }

/* L'attaquant du tour en cours reste devant, du premier pas au retour. */
.combattant.devant { z-index: 2; }

/* La traînée de vitesse : des images fantômes semées pendant la ruée. */
.fantome {
  position: absolute;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 1;
  opacity: .4;
  animation: fantome .32s ease-out forwards;
}
@keyframes fantome {
  to { opacity: 0; }
}

/* La secousse de l'écran à l'impact. */
.combat.secousse { animation: secousse-scene .32s linear; }
@keyframes secousse-scene {
  15%      { translate: 5px 3px; }
  35%      { translate: -5px -2px; }
  60%      { translate: 3px 2px; }
  80%      { translate: -2px -1px; }
  100%     { translate: 0 0; }
}

.combat__sprite {
  position: relative;
  height: 100%;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55));
}
/* Les trois calques (idle, coup, impact) sont tous peints dès le
   chargement : la bascule d'opacité n'a jamais rien à décoder. */
.combat__sprite .anim {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: 0 0;
  image-rendering: pixelated;
  opacity: 0;
}
.combat__sprite .anim.actif { opacity: 1; }
/* L'impact : flash blanc et secousse. */
.combattant.touche .combat__sprite {
  animation: touche .5s linear;
}
@keyframes touche {
  0%, 45%  { filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)) brightness(2.4) saturate(.3); }
  10%      { translate: -5px 0; }
  25%      { translate: 5px 0; }
  40%      { translate: -3px 0; }
  55%      { translate: 0 0; }
  100%     { filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)); }
}

/* Les dégâts qui volent. */
.degats {
  position: absolute;
  z-index: 3;
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 3.4cqw, 1.9rem);
  color: #FFFFFF;
  text-shadow: 0 0 6px rgba(0, 0, 0, .9), 0 2px 2px rgba(0, 0, 0, .8);
  pointer-events: none;
  animation: degats 1s ease-out forwards;
}
.degats--crit {
  color: var(--or-clair);
  font-size: clamp(1.4rem, 4.4cqw, 2.5rem);
}
@keyframes degats {
  0%   { opacity: 0; translate: 0 8px; scale: .7; }
  15%  { opacity: 1; scale: 1.15; }
  30%  { scale: 1; }
  100% { opacity: 0; translate: 0 -46px; }
}

/* --- 6.2 Les volets ------------------------------------------------------- */
.volet {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(2.25rem, 6vw, 4rem);
}
.volet + .volet { border-top: 1px solid var(--trait-nuit); }
.volet--inverse .volet__texte { order: 2; }
.volet--large { grid-template-columns: 1fr; gap: clamp(1.25rem, 3vw, 2rem); }
@media (max-width: 860px) {
  .volet { grid-template-columns: 1fr; }
  .volet--inverse .volet__texte { order: 0; }
}

.volet__titre {
  font-size: clamp(1.9rem, 1.2rem + 3.4vw, 3.6rem);
  line-height: 1.05;
  color: var(--creme);
}
.volet__titre span {
  color: var(--or);
  margin-inline: .16em;
  font-weight: 500;
}
.volet__texte p {
  margin-top: .9rem;
  max-width: 52ch;
  font-weight: 300;
  font-size: var(--t-1);
  color: var(--bleu-gris);
}
.volet__texte--centre {
  text-align: center;
  justify-self: center;
}
.volet__texte--centre p { margin-inline: auto; }

/* La vitrine : une composition de sprites sur un halo d'or. */
.vitrine {
  position: relative;
  min-height: clamp(15rem, 34vw, 21rem);
  isolation: isolate;
}
.vitrine::before {
  content: "";
  position: absolute;
  inset: 6% 2%;
  z-index: -1;
  background: radial-gradient(52% 52% at 50% 58%, rgba(200, 168, 78, .17) 0%, rgba(200, 168, 78, 0) 70%);
}
/* L'étagère d'ombre sous la composition. */
.vitrine::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 2%;
  height: 10%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 72%);
}

.flotteur {
  position: absolute;
  left: var(--fx);
  bottom: var(--fy);
  height: var(--ft);
  aspect-ratio: 1 / 1;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, .5));
  animation: leve 5.2s ease-in-out infinite;
  animation-delay: var(--fd, 0s);
}
@keyframes leve {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}
/* Les petits objets brillent en flottant plus haut. */
.flotteur--haut {
  animation-name: leve-haut;
  filter: drop-shadow(0 0 12px rgba(200, 168, 78, .55));
}
@keyframes leve-haut {
  0%, 100% { translate: 0 0; opacity: .9; }
  50%      { translate: 0 -16px; opacity: 1; }
}
/* Le personnage posé (bébé, Corbak) ne flotte pas : il se balance. */
.flotteur--ne {
  animation-name: none;
}


/* Apparition au défilement : le JavaScript pose .vu quand l'élément entre
   à l'écran. Sans JavaScript, tout est visible d'emblée. */
.js .devoile {
  opacity: 0;
  translate: 0 22px;
  transition: opacity .7s ease, translate .7s ease;
}
.js .devoile.vu { opacity: 1; translate: 0 0; }
.js .devoile:nth-child(2) { transition-delay: .1s; }
.js .devoile:nth-child(3) { transition-delay: .2s; }

/* --- 4.5 Mouvement réduit ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .couches__pivot { transition: none; }
  .survol:hover ~ .couches .couches__pivot { transform: none; }
  .couche--pose, .enseigne { animation: none; }
  .sprite--idle { animation: none; }             /* frame 0, figée */
  .sprite--oeuf { animation: none; }
  .couche--brume { animation: none; }
  .lucioles { display: none; }
  .couche--oeuf.secoue { animation: none; }
  .defile span { animation: none; }
  .sprite--nyragh { animation: none; }
  .braises { display: none; }
  .combattant, .combattant.touche .combat__sprite { animation: none; transition: none; }
  .flotteur { animation: none; }
  .js .devoile { opacity: 1; translate: 0 0; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- 4.6 Petits écrans ----------------------------------------------------
   En portrait, la scène se réorganise : sprites réduits et resserrés vers
   les bords (--xm), diorama remonté au-dessus de la zone de texte, et le
   menu, la signature et la musique empilés au centre en bas. */
@media (max-width: 700px) {
  .scene { perspective: 1200px; }

  /* Sprites : position mobile dédiée, échelle réduite, diorama remonté. */
  .couche--pose {
    left: var(--xm, var(--x));
    bottom: calc(var(--y) + 15%);
    --echelle: .55;
  }
  .couche--brume { bottom: 48%; height: 10%; }

  /* L'œuf garde la vedette : un peu plus grand que les dragons. */
  .couche--oeuf, .couche--bebe { --echelle: .52; }

  /* Moins de lucioles : les écrans étroits saturent vite. */
  .lucioles i:nth-child(n+6) { display: none; }

  /* Le voile couvre un peu plus : le logo descend moins bas qu'en large. */
  .scene::before { height: 34%; }

  /* Contenu : logo en haut, puis tout le reste empilé en bas au centre. */
  .devant {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto auto auto;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .enseigne { grid-column: 1; }
  .enseigne__logo { width: clamp(13rem, 84vw, 21rem); }

  .menu { position: static; grid-row: 2; justify-self: center; text-align: center; }
  .menu ul { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; justify-content: center; }
  .menu li + li { margin-top: 0; }
  .menu a { font-size: .8rem; }

  .signature { grid-row: 3; justify-self: center; text-align: center; margin-top: .55rem; }
  .musique { grid-row: 4; justify-self: center; margin-top: .55rem; }
}

/* Paysage bas (téléphone couché) : le diorama redescend, le menu retourne
   dans son coin pour ne pas manger la hauteur. */
@media (max-height: 480px) and (orientation: landscape) {
  .couche--pose { bottom: var(--y); --echelle: .7; }
  .scene { min-height: 100svh; }
  .enseigne__logo { width: clamp(11rem, 30vw, 17rem); }
}

/* ==========================================================================
   5. Pages de texte (mentions légales, confidentialité) et 404
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 240, 228, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--trait);
}
.topbar__in {
  max-width: var(--largeur);
  margin-inline: auto;
  padding: .7rem var(--marge);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}
.topbar__brand { display: block; line-height: 0; }
.topbar__brand img { width: clamp(120px, 16vw, 172px); }
.topbar .btn { margin-left: auto; }

.btn--sm { padding: .55rem 1rem; font-size: .72rem; }

.page-texte { padding-block: clamp(3rem, 8vw, 5.5rem); }
.page-texte .wrap { max-width: 48rem; }
.page-texte h1 { font-size: var(--t-2); margin-block: .7rem 1.75rem; }
.page-texte h2 { font-size: var(--t-1); margin-block: 2.25rem .7rem; }
.page-texte p,
.page-texte li { color: var(--encre-douce); font-weight: 300; }
.page-texte p + p { margin-top: .9rem; }
.page-texte ul {
  list-style: disc;
  padding-left: 1.2rem;
  display: grid;
  gap: .4rem;
  margin-top: .7rem;
}
.page-texte dl { margin: .7rem 0 0; display: grid; gap: .55rem; }
.page-texte dt {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sourdine);
}
.page-texte dd { margin: 0; color: var(--encre-douce); font-weight: 300; }

.erreur {
  min-height: 68vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 1rem;
  padding: var(--marge);
}
.erreur img {
  width: clamp(9rem, 24vw, 14rem);
  margin-inline: auto;
  image-rendering: pixelated;
}
.erreur h1 { font-size: var(--t-2); }
.erreur p {
  color: var(--encre-douce);
  font-weight: 300;
  max-width: 42ch;
  margin-inline: auto;
}
.erreur .cta { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.btn--ghost {
  background: transparent;
  color: var(--or-fonce);
  border-color: var(--trait);
  box-shadow: none;
}
.btn--ghost:hover,
.btn--ghost:focus-visible { background: transparent; border-color: var(--or); }

/* --- Le pied des pages intérieures --------------------------------------- */
.pied {
  background: var(--nuit);
  color: var(--creme);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}
.pied__in {
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--marge);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: start;
}
.pied__marque img { width: 150px; opacity: .9; }
.pied__marque p {
  margin-top: .75rem;
  font-size: .88rem;
  font-weight: 300;
  color: var(--bleu-gris);
  max-width: 32ch;
}
.pied__liens { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.pied__liens a {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--creme);
  border-bottom: 1px solid transparent;
  padding-bottom: .15rem;
  transition: color .18s ease, border-color .18s ease;
}
.pied__liens a:hover,
.pied__liens a:focus-visible { color: var(--or-clair); border-bottom-color: var(--or); }
.pied__copy {
  max-width: var(--largeur);
  margin: 2.5rem auto 0;
  padding-inline: var(--marge);
  padding-top: 1.5rem;
  border-top: 1px solid var(--trait-nuit);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--bleu-gris);
}
