/* =========================================================
   FAIL Studio — feuille de style partagée
   Les couleurs et polices se changent ici, dans :root
   ========================================================= */
:root {
  --nuit: #1E2A5A;
  --nuit-2: #172150;
  --nuit-3: #10173A;
  --jaune: #FFD23F;
  --orange: #FF7A3D;
  --creme: #FFF4E6;
  --gris: #B9C0E0;
  --ligne: rgba(255, 244, 230, 0.12);

  --font-titre: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --bloc: 12px;           /* taille d'un bloc dans les petits logos */
  --max: 1240px;
  --rayon: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--nuit-3);
  color: var(--creme);
  font-family: var(--font-titre);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--jaune); color: var(--nuit-3); }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Fond animé (canvas) ---------- */
#fond {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}
main, footer, .nav { position: relative; z-index: 2; }

/* ---------- Barre de progression en blocs ---------- */
.progression {
  position: fixed; top: 30px; left: 0; right: 0; height: 4px; z-index: 60;
  display: grid; grid-template-columns: repeat(40, 1fr); gap: 2px;
}
.progression span { background: var(--jaune); opacity: 0.12; transition: opacity .15s, background .15s; }
.progression span.on { opacity: 1; }
.progression span.last { background: var(--orange); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 34px; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 48px);
  transition: background .3s, backdrop-filter .3s, padding .3s;
}
.nav.scrolled {
  background: rgba(16, 23, 58, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding-top: 12px; padding-bottom: 12px;
}
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.marque svg { width: 74px; height: auto; }
.marque span { font-family: var(--font-mono); font-size: 12px; letter-spacing: 4px; color: var(--jaune); }
.nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; align-items: center; }
.nav a.lien {
  display: inline-block; padding: 10px 14px; text-decoration: none;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gris); border-radius: var(--rayon); position: relative;
}
.nav a.lien:hover { color: var(--creme); }
.nav a.lien[aria-current="page"] { color: var(--jaune); }
.nav a.lien[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; bottom: 4px; width: 8px; height: 8px; background: var(--orange);
}
.nav a.lien.secret { display: none; color: var(--orange); }
body.debloque .nav a.lien.secret { display: inline-block; }
.btn-son {
  width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(16, 23, 58, .7); border: 1px solid var(--ligne); cursor: pointer; color: var(--gris); padding: 0;
  transition: color .15s, border-color .15s, transform .12s;
}
.btn-son:hover { border-color: var(--jaune); color: var(--creme); }
.btn-son:active { transform: scale(.94); }
.btn-son svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-son .hp { fill: currentColor; }
.btn-son .ondes { display: none; }
.btn-son[aria-pressed="true"] { color: var(--jaune); border-color: var(--jaune); }
.btn-son[aria-pressed="true"] .ondes { display: inline; }
.btn-son[aria-pressed="true"] .croix { display: none; }
.btn-son[aria-pressed="true"] .ondes path { animation: onde 1.4s infinite ease-in-out; }
.btn-son[aria-pressed="true"] .ondes path + path { animation-delay: .25s; }
@keyframes onde { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes eq { from { height: 3px; } to { height: 12px; } }

.burger { display: none; background: none; border: 0; padding: 10px; cursor: pointer; min-width: 44px; min-height: 44px; }
.burger i { display: block; width: 22px; height: 3px; background: var(--creme); margin: 4px 0; transition: transform .25s, opacity .25s; }
.nav.ouvert .burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.ouvert .burger i:nth-child(2) { opacity: 0; }
.nav.ouvert .burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .burger { display: block; }
  .nav ul {
    position: fixed; inset: 0; top: 0; flex-direction: column; justify-content: center; gap: 10px;
    background: var(--nuit-3); transform: translateY(-100%); transition: transform .45s cubic-bezier(.7,0,.2,1);
    z-index: -1;
  }
  .nav.ouvert ul { transform: none; }
  .nav a.lien { font-family: var(--font-titre); font-size: 34px; font-weight: 700; text-transform: none; letter-spacing: -1px; color: var(--creme); }
  .nav a.lien[aria-current="page"]::after { left: -18px; bottom: 50%; transform: translateY(50%); }
}

/* ---------- Rideau de transition entre pages ---------- */
.rideau {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  display: grid; grid-template-columns: repeat(var(--cols, 12), 1fr); grid-auto-rows: 1fr;
}
.rideau i { background: var(--jaune); transform: scale(0); transition: transform .28s cubic-bezier(.6,0,.3,1); }
.rideau i.o { background: var(--orange); }
.rideau.plein i { transform: scale(1.02); }
.rideau.sortie i { transform: scale(0); }

/* ---------- Mise en page ---------- */
.wrap { width: min(var(--max), 100% - clamp(36px, 8vw, 96px)); margin-inline: auto; }
section { position: relative; }
.etiquette {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--jaune);
}
.etiquette::before { content: ""; width: 10px; height: 10px; background: var(--orange); }
.titre-xxl {
  font-size: clamp(56px, 11vw, 168px); line-height: .9; letter-spacing: -0.045em; font-weight: 700; margin: 0;
}
.titre-xl { font-size: clamp(42px, 7vw, 104px); line-height: .95; letter-spacing: -0.04em; font-weight: 700; margin: 0; }
.titre-l { font-size: clamp(30px, 4vw, 56px); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin: 0; }
.chapo { font-size: clamp(19px, 1.6vw, 24px); color: var(--gris); max-width: 640px; }
.jaune { color: var(--jaune); }
.orange { color: var(--orange); }

.bouton {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 26px;
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; text-decoration: none;
  border: 2px solid var(--jaune); background: var(--jaune); color: var(--nuit-3); font-weight: 600;
  cursor: pointer; position: relative; transition: transform .15s, box-shadow .15s;
  box-shadow: 6px 6px 0 var(--orange);
}
.bouton:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--orange); }
.bouton:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--orange); }
.bouton.fantome { background: transparent; color: var(--jaune); box-shadow: none; }
.bouton.fantome:hover { background: rgba(255, 210, 63, .1); box-shadow: none; transform: none; }

/* ---------- Apparitions au scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
[data-reveal].vu { opacity: 1; transform: none; }
[data-reveal="2"] { transition-delay: .12s; }
[data-reveal="3"] { transition-delay: .24s; }
[data-reveal="4"] { transition-delay: .36s; }

/* Titres découpés en lettres qui tombent comme des blocs */
.split .l { display: inline-block; transform: translateY(110%) rotate(8deg); opacity: 0; transition: transform .7s cubic-bezier(.2,1.4,.4,1), opacity .4s; }
.split.vu .l { transform: none; opacity: 1; }
.split .mot { display: inline-block; white-space: nowrap; overflow: hidden; padding-bottom: .06em; vertical-align: bottom; }

/* Texte qui s'allume mot par mot en scrollant */
[data-scrub] .w { opacity: .14; transition: opacity .25s, color .25s; }
[data-scrub] .w.on { opacity: 1; }
[data-scrub] .w.hl.on { color: var(--jaune); }

/* ---------- Héros (accueil) ---------- */
.heros { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 120px 0 80px; }
.logo-blocs { position: relative; width: min(880px, 92vw); aspect-ratio: 440 / 200; }
.logo-blocs .b {
  position: absolute; width: calc(24 / 440 * 100%); aspect-ratio: 1; background: var(--jaune);
  transform: translateY(-40px) scale(.2); opacity: 0;
  transition: transform .5s cubic-bezier(.2,1.6,.4,1), opacity .2s;
}
.logo-blocs .b.on { transform: none; opacity: 1; }
.logo-blocs .fente {
  position: absolute; width: calc(24 / 440 * 100%); aspect-ratio: 1;
  outline: 2px dashed var(--jaune); outline-offset: -2px; opacity: 0; transition: opacity .4s;
}
.logo-blocs .fente.on { opacity: .9; }
.logo-blocs .chute {
  position: absolute; width: calc(24 / 440 * 100%); aspect-ratio: 1; background: var(--orange); opacity: 0;
}
.heros .studio { font-size: clamp(22px, 3.4vw, 44px); font-weight: 700; letter-spacing: .55em; padding-left: .55em; margin: 34px 0 10px; color: var(--jaune); }
.heros .devise { font-family: var(--font-mono); font-size: clamp(13px, 1.3vw, 17px); letter-spacing: .3em; color: var(--jaune); opacity: .85; }
.heros .apparait { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s; }
.heros .apparait.on { opacity: 1; transform: none; }
.heros .actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 44px; }
.indice-scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 3px; color: var(--gris);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.indice-scroll i { width: 8px; height: 8px; background: var(--orange); animation: tombe 1.6s infinite cubic-bezier(.5,0,.8,.4); }
@keyframes tombe { 0% { transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(22px) rotate(30deg); opacity: 0; } }

/* ---------- Défilement horizontal épinglé ---------- */
.hscroll { height: 340vh; }
.hscroll .colle { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.hscroll .piste { display: flex; gap: 4vw; padding-left: 8vw; padding-right: 8vw; will-change: transform; }
.panneau {
  flex: 0 0 auto; width: min(78vw, 980px); height: min(70vh, 620px);
  border: 1px solid var(--ligne); background: rgba(16, 23, 58, .78);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; position: relative;
}
.panneau .txt { padding: clamp(28px, 4vw, 64px); display: flex; flex-direction: column; justify-content: space-between; }
.panneau .num { font-family: var(--font-mono); color: var(--gris); font-size: 14px; letter-spacing: 3px; }
.panneau .mot-geant { font-size: clamp(64px, 10vw, 150px); font-weight: 700; letter-spacing: -.05em; line-height: .85; }
.panneau p { color: var(--gris); max-width: 420px; margin: 0; }
.panneau .scene { position: relative; border-left: 1px solid var(--ligne); background: var(--nuit-2); overflow: hidden; }
.panneau.p2 .mot-geant { color: var(--jaune); }
.panneau.p3 { background: var(--jaune); color: var(--nuit-3); border-color: var(--jaune); }
.panneau.p3 p, .panneau.p3 .num { color: var(--nuit); }
.panneau.p3 .scene { background: var(--orange); border-color: rgba(16,23,58,.2); }
.panneau.intro { background: transparent; border: 0; backdrop-filter: none; width: min(60vw, 720px); display: flex; align-items: center; }

/* scènes animées des panneaux */
.scene .bk { position: absolute; width: 56px; height: 56px; background: var(--jaune); }
.scene-fail .bk.tombe { background: var(--orange); animation: sceneFail 2.6s infinite cubic-bezier(.5,0,.75,0); }
@keyframes sceneFail {
  0%, 30% { transform: translate(0, 0) rotate(0); }
  38% { transform: translate(0, 0) rotate(-6deg); }
  44% { transform: translate(0, 0) rotate(5deg); }
  70%, 100% { transform: translate(30px, 260px) rotate(70deg); }
}
.scene-retry .anneau { position: absolute; inset: 0; margin: auto; width: 220px; height: 220px; animation: tourne 4s infinite linear; }
.scene-retry .anneau i { position: absolute; width: 30px; height: 30px; background: var(--jaune); left: 95px; top: 95px; }
.scene-retry .anneau i:last-child { background: var(--orange); }
@keyframes tourne { to { transform: rotate(-360deg); } }
.scene-ship .fusee { position: absolute; left: 50%; bottom: 20%; width: 56px; height: 56px; background: var(--nuit-3); margin-left: -28px; animation: decolle 2.4s infinite cubic-bezier(.6,0,.4,1); }
.scene-ship .trainee i { position: absolute; left: 50%; width: 14px; height: 14px; background: var(--creme); margin-left: -7px; animation: fume 2.4s infinite; }
@keyframes decolle { 0%, 25% { transform: translateY(0); } 90%, 100% { transform: translateY(-120vh); } }
@keyframes fume { 0%, 30% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(40px) scale(1.4); } }

/* ---------- Mini-jeu ---------- */
.jeu { padding: 6vh 0 16vh; }
.jeu .tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.plateau {
  position: relative; border: 1px solid var(--ligne); background: rgba(16,23,58,.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: clamp(24px, 5vw, 64px); touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.plateau .hud { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; letter-spacing: 2px; color: var(--gris); margin-bottom: 30px; gap: 12px; flex-wrap: wrap; }
.plateau .hud b { color: var(--jaune); font-weight: 600; }
.zone { position: relative; width: min(640px, 100%); margin: 0 auto; aspect-ratio: 440 / 300; }
.zone .pince { z-index: 3; box-shadow: 0 0 0 3px rgba(255,210,63,.25), 0 0 18px rgba(255,210,63,.45); }
.zone .pince::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 34px; margin-left: -1px; background: linear-gradient(to top, rgba(255,210,63,.6), rgba(255,210,63,0)); }
.zone .b { position: absolute; width: calc(24 / 440 * 100%); aspect-ratio: 1; background: var(--jaune); transition: background .3s, transform .3s; }
.zone .b.prenable { cursor: grab; touch-action: none; }
.zone .b.prenable:hover { filter: brightness(1.12); box-shadow: 0 0 0 3px rgba(255,210,63,.35); }
.zone .b.prise { cursor: grabbing; z-index: 4; box-shadow: 0 16px 26px rgba(0,0,0,.45); transition: none; }
.zone .fente { position: absolute; width: calc(24 / 440 * 100%); aspect-ratio: 1; outline: 2px dashed var(--jaune); outline-offset: -2px; transition: left .5s cubic-bezier(.3,1.5,.5,1), top .5s cubic-bezier(.3,1.5,.5,1); }
.zone .fente.chaude { outline-color: var(--orange); background: rgba(255,122,61,.18); }
.piece {
  position: absolute; width: calc(24 / 440 * 100%); aspect-ratio: 1; background: var(--orange);
  cursor: grab; z-index: 3; box-shadow: 0 0 0 0 rgba(255,122,61,.6); animation: pulse 1.8s infinite;
  touch-action: none; border: 0; padding: 0;
}
.piece:active { cursor: grabbing; }
.piece.prise { animation: none; box-shadow: 0 18px 30px rgba(0,0,0,.4); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,210,63,.5); } 100% { box-shadow: 0 0 0 22px rgba(255,210,63,0); } }
.plateau .message { min-height: 64px; text-align: center; margin-top: 30px; font-size: clamp(20px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.plateau .message small { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 400; letter-spacing: 1px; color: var(--gris); margin-top: 6px; }
.plateau .alt { display: flex; justify-content: center; margin-top: 14px; }
.plateau .alt button { background: none; border: 1px solid var(--ligne); color: var(--gris); font-family: var(--font-mono); font-size: 12px; padding: 10px 14px; cursor: pointer; min-height: 44px; }
.plateau .alt button:hover { color: var(--creme); border-color: var(--jaune); }
.plateau.gagne .zone .b { animation: flash .7s steps(2) 3; }
@keyframes flash { 50% { background: var(--orange); } }
.secoue { animation: secoue .4s; }
@keyframes secoue { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

.confetti { position: fixed; width: 12px; height: 12px; z-index: 90; pointer-events: none; }

/* Section secrète */
.coulisses { display: none; padding: 10vh 0 16vh; }
body.debloque .coulisses { display: block; }
.coulisses .carte-secrete {
  border: 2px dashed var(--orange); padding: clamp(28px, 5vw, 64px); background: rgba(16,23,58,.9);
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.coulisses ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.coulisses li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; color: var(--gris); }
.coulisses li::before { content: ""; width: 14px; height: 14px; background: var(--jaune); margin-top: 6px; }
.coulisses li b { color: var(--creme); }

/* ---------- Cartes de jeux ---------- */
.grille-jeux { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.carte {
  position: relative; display: flex; flex-direction: column; text-align: left; width: 100%;
  background: var(--nuit-2); border: 1px solid var(--ligne); color: var(--creme); cursor: pointer; padding: 0;
  transform-style: preserve-3d; transition: transform .25s ease-out, border-color .2s; overflow: hidden;
}
.carte:hover { border-color: var(--jaune); }
.carte .couv { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--nuit-3); }
.carte .couv canvas, .carte .couv img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.carte .couv canvas, .fiche .couv canvas { image-rendering: pixelated; }
.carte:hover .couv canvas, .carte:hover .couv img { transform: scale(1.06); }
.carte .statut {
  position: absolute; top: 14px; left: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  background: var(--nuit-3); color: var(--jaune); padding: 6px 10px; display: inline-flex; align-items: center; gap: 8px;
}
.carte .statut::before { content: ""; width: 8px; height: 8px; background: var(--orange); animation: clignote 1.2s steps(2) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
.carte .corps { padding: 24px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.carte .genre { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--jaune); }
.carte h3 { margin: 0; font-size: 34px; line-height: 1; letter-spacing: -.03em; }
.carte p { margin: 0; color: var(--gris); font-size: 16px; }
.carte .plats { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.carte .plats span { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--ligne); padding: 4px 8px; color: var(--gris); }
.carte .plus { position: absolute; right: 18px; bottom: 20px; width: 36px; height: 36px; background: var(--jaune); color: var(--nuit-3); display: grid; place-items: center; font-weight: 700; transition: transform .25s; }
.carte:hover .plus { transform: rotate(90deg); background: var(--orange); }
.carte.mystere { cursor: default; border-style: dashed; }
.carte.mystere:hover { border-color: var(--orange); }
.carte.mystere h3 { color: var(--gris); }

.filtres { display: flex; gap: 10px; flex-wrap: wrap; margin: 40px 0 36px; }
.filtres button {
  min-height: 44px; padding: 0 18px; background: transparent; border: 1px solid var(--ligne); color: var(--gris);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
}
.filtres button[aria-pressed="true"] { background: var(--jaune); color: var(--nuit-3); border-color: var(--jaune); }

/* Fiche détaillée */
.fiche { position: fixed; inset: 0; z-index: 80; display: none; }
.fiche.ouverte { display: block; }
.fiche .voile { position: absolute; inset: 0; background: rgba(10, 14, 36, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.fiche.ouverte .voile { opacity: 1; }
.fiche .panneau-fiche {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--nuit-2); overflow-y: auto;
  transform: translateX(100%); transition: transform .45s cubic-bezier(.7,0,.2,1); border-left: 2px solid var(--jaune);
}
.fiche.ouverte .panneau-fiche { transform: none; }
.fiche .couv { aspect-ratio: 16 / 9; }
.fiche .couv canvas, .fiche .couv img { width: 100%; height: 100%; object-fit: cover; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.galerie img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--ligne); background: var(--nuit-3); }
.galerie.portrait img { aspect-ratio: 9 / 16; object-fit: cover; object-position: top; }
.epoque .couv img { width: 100%; height: 100%; object-fit: cover; }
.fiche .contenu { padding: 36px clamp(24px, 5vw, 48px) 60px; display: grid; gap: 18px; }
.fiche h2 { margin: 0; font-size: clamp(40px, 6vw, 64px); letter-spacing: -.04em; line-height: .95; }
.fiche ul { padding: 0; margin: 0; list-style: none; display: grid; gap: 12px; }
.fiche li { display: grid; grid-template-columns: 12px 1fr; gap: 14px; color: var(--gris); }
.fiche li::before { content: ""; width: 12px; height: 12px; background: var(--orange); margin-top: 7px; }
.fiche .fermer {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 48px; height: 48px; background: var(--jaune); color: var(--nuit-3);
  border: 0; cursor: pointer; font-size: 24px; font-weight: 700;
}

/* ---------- Manifeste / Philosophie ---------- */
.manifeste { padding: 20vh 0; }
.manifeste p { font-size: clamp(30px, 4.6vw, 68px); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; margin: 0 0 .6em; max-width: 1100px; }
.principes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--ligne); border: 1px solid var(--ligne); }
.principe { background: var(--nuit-3); padding: 36px 32px 40px; min-height: 320px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; transition: background .3s; }
.principe:hover { background: var(--nuit-2); }
.principe .n { font-family: var(--font-mono); font-size: 13px; color: var(--orange); letter-spacing: 2px; }
.principe h3 { margin: 0; font-size: 30px; line-height: 1.05; letter-spacing: -.02em; }
.principe p { margin: 0; color: var(--gris); }
.principe .pix { position: absolute; right: 22px; top: 26px; display: grid; grid-template-columns: repeat(3, 10px); gap: 3px; }
.principe .pix i { width: 10px; height: 10px; background: var(--jaune); opacity: .2; transition: opacity .2s, transform .3s; }
.principe:hover .pix i { opacity: 1; }
.principe:hover .pix i:last-child { background: var(--orange); transform: translate(8px, 16px) rotate(25deg); }

.bandeau { overflow: hidden; border-block: 1px solid var(--ligne); padding: 26px 0; background: var(--jaune); color: var(--nuit-3); }
.bandeau .defile { display: flex; gap: 60px; width: max-content; animation: defile 22s linear infinite; font-size: clamp(36px, 6vw, 80px); font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.bandeau .defile span { display: inline-flex; align-items: center; gap: 60px; }
.bandeau .defile span::after { content: ""; width: .5em; height: .5em; background: var(--orange); }
@keyframes defile { to { transform: translateX(-50%); } }

/* ---------- Vision ---------- */
.epoque { flex: 0 0 auto; width: min(72vw, 560px); height: min(66vh, 560px); position: relative; border: 1px solid var(--ligne); background: var(--nuit-2); display: flex; flex-direction: column; overflow: hidden; }
.epoque .couv { flex: 1; position: relative; }
.epoque .couv canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.epoque .bas { padding: 22px 26px 26px; display: grid; gap: 6px; }
.epoque .date { font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px; color: var(--jaune); text-transform: uppercase; }
.epoque h3 { margin: 0; font-size: 36px; letter-spacing: -.03em; line-height: 1; }
.epoque p { margin: 0; color: var(--gris); font-size: 16px; }
.epoque .badge { position: absolute; top: 14px; right: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; padding: 6px 10px; background: var(--jaune); color: var(--nuit-3); }
.epoque.idee .badge { background: transparent; color: var(--gris); border: 1px dashed var(--gris); }
.epoque.idee .couv { filter: saturate(.55) brightness(.8); }
.frise { position: absolute; left: 8vw; right: 8vw; bottom: 8vh; display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; }
.frise i { height: 8px; background: var(--jaune); opacity: .15; transition: opacity .2s; }
.frise i.on { opacity: 1; }
.frise i:last-child.on { background: var(--orange); }

.familles { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.famille { border: 1px solid var(--ligne); background: rgba(16,23,58,.85); padding: clamp(28px, 4vw, 52px); display: grid; gap: 18px; align-content: start; }
.famille h3 { margin: 0; font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -.03em; line-height: 1; }
.famille p { margin: 0; color: var(--gris); }
.famille .icone { display: grid; grid-template-columns: repeat(4, 16px); gap: 4px; }
.famille .icone i { width: 16px; height: 16px; background: var(--jaune); }
.famille .icone i.v { background: transparent; }
.famille .icone i.o { background: var(--orange); }

.grosse-phrase { padding: 22vh 0; text-align: center; }
.grosse-phrase .titre-xl { max-width: 1100px; margin-inline: auto; }

/* ---------- Pied de page ---------- */
footer { border-top: 1px solid var(--ligne); background: var(--nuit-3); padding: 90px 0 40px; overflow: hidden; }
footer .geant { font-size: clamp(48px, 13vw, 200px); font-weight: 700; letter-spacing: -.05em; line-height: .85; color: var(--jaune); margin: 0 0 40px; word-break: break-word; }
footer .geant span { color: var(--orange); }
footer .bas { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; font-family: var(--font-mono); font-size: 13px; color: var(--gris); }
footer .bas a { color: var(--creme); }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- En-têtes de pages intérieures ---------- */
.entete { min-height: 82vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 140px 0 10vh; }
.entete .titre-xxl { margin: 22px 0 28px; }

.section { padding: 14vh 0; }
.section .tete { margin-bottom: 56px; display: grid; gap: 18px; }

@media (max-width: 820px) {
  body { font-size: 17px; }
  .panneau { grid-template-columns: 1fr; grid-template-rows: auto 1fr; width: 84vw; height: 72vh; }
  .panneau .scene { border-left: 0; border-top: 1px solid var(--ligne); min-height: 180px; }
  .panneau.intro { width: 84vw; }
  .coulisses .carte-secrete, .familles, .principes { grid-template-columns: 1fr; }
  .grille-jeux { grid-template-columns: 1fr; }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .principes { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  [data-reveal], .split .l { opacity: 1 !important; transform: none !important; }
}

/* ---------- Sélecteur de langue : bouton globe + liste ---------- */
.nav-droite { display: flex; align-items: center; gap: 10px; }
.langue { position: relative; }
.btn-langue {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  background: var(--jaune); color: var(--nuit-3); border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 3px 3px 0 var(--orange); transition: transform .12s, box-shadow .12s;
}
.btn-langue:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--orange); }
.btn-langue .globe { width: 17px; height: 17px; }
.btn-langue .fleche { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform .2s; }
.langue.ouvert .btn-langue .fleche { transform: rotate(180deg); }
.nav ul.menu-langue {
  position: absolute; right: 0; top: calc(100% + 10px); list-style: none; margin: 0; padding: 8px;
  display: none; flex-direction: column; align-items: stretch; gap: 2px; min-width: 190px;
  background: var(--nuit-2); border: 1px solid var(--ligne); box-shadow: 6px 6px 0 rgba(0,0,0,.35); z-index: 80;
}
.nav .langue.ouvert ul.menu-langue { display: flex; }
.titre-langue { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gris); padding: 4px 10px 8px; }
.opt-langue {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 44px;
  background: transparent; border: 0; cursor: pointer; color: var(--creme); font-family: var(--font-titre); font-size: 15px; text-align: left;
}
.opt-langue:hover { background: rgba(255,210,63,.08); }
.pix-code {
  display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 5px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1px;
  background: var(--nuit-3); color: var(--jaune); box-shadow: 3px 3px 0 rgba(255,210,63,.25);
}
.opt-langue.active .pix-code { background: var(--jaune); color: var(--nuit-3); box-shadow: 3px 3px 0 var(--orange); }
@media (max-width: 820px) {
  .nav-droite { flex-direction: row-reverse; gap: 6px; }
  .btn-langue { min-height: 40px; padding: 0 10px; }
  /* menu mobile fermé : vraiment caché, même si son contenu dépasse */
  .nav ul:not(.menu-langue) { visibility: hidden; overflow-y: auto; justify-content: safe center; padding: 90px 0 40px; transition: transform .45s cubic-bezier(.7,0,.2,1), visibility 0s .45s; }
  .nav.ouvert ul:not(.menu-langue) { visibility: visible; transition: transform .45s cubic-bezier(.7,0,.2,1), visibility 0s; }
  .nav ul.menu-langue { position: absolute; inset: calc(100% + 10px) 0 auto auto; transform: none; z-index: 80; }
  /* le flou de l'en-tête empêcherait le menu de couvrir tout l'écran */
  .nav.scrolled { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(16, 23, 58, .96); }
}

/* ---------- Chinois et japonais ---------- */
html.cjk body { font-family: "Space Grotesk", "Noto Sans JP", "Noto Sans SC", "Hiragino Sans", "PingFang SC", "Microsoft YaHei", sans-serif; }
html.cjk .titre-xxl, html.cjk .titre-xl, html.cjk .titre-l, html.cjk .manifeste p, html.cjk .mot-geant { letter-spacing: 0; line-height: 1.15; }
html.cjk .titre-xxl { font-size: clamp(48px, 9vw, 140px); }
html.cjk .split .mot { overflow: visible; }

/* Phrase de fin de l'accueil : deux lignes nettes, même sur mobile */
.grosse-phrase .titre-xl { font-size: clamp(42px, 6vw, 88px); }
@media (max-width: 600px) {
  .grosse-phrase .titre-xl { font-size: 7.4vw; }
}

/* Le point final de l'accueil : un petit bloc orange qui tombe du ciel */
.split .l.l-point { transform: none; opacity: 1; transition: none; }
.point-tombe { display: inline-block; width: .16em; height: .16em; margin: 0 .02em 0 .09em; background: var(--orange); vertical-align: baseline; opacity: 0; }
.point-tombe.pose { opacity: 1; }

/* Mini carrousel des cartes de jeux */
.carte .couv img.diapo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.carte .couv img.diapo.on { opacity: 1; }
.carte .couv img.diapo.portrait { object-position: top; }
.carte .couv .points { position: absolute; right: 14px; top: 16px; display: flex; gap: 5px; z-index: 2; }
.carte .couv .points i { width: 8px; height: 8px; background: rgba(255,244,230,.45); box-shadow: 0 0 0 1px rgba(16,23,58,.5); transition: background .3s; }
.carte .couv .points i.on { background: var(--jaune); }

/* ---------- Passerelle univers FAIL ---------- */
.passerelle {
  position: fixed; top: 0; left: 0; right: 0; height: 30px; z-index: 61;
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(18px, 4vw, 48px);
  background: #0A0F28; border-bottom: 1px solid var(--ligne);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
}
.passerelle .univers { color: var(--gris); opacity: .8; }
.passerelle a { color: var(--gris); text-decoration: none; padding: 3px 8px; border-radius: var(--rayon); }
.passerelle a:hover { color: var(--creme); }
.passerelle a { white-space: nowrap; }
.passerelle .court { display: none; }
.passerelle a.ici { background: var(--jaune); color: var(--nuit); font-weight: 700; }
@media (max-width: 600px) { .passerelle .univers, .passerelle .long { display: none; } .passerelle .court { display: inline; } .passerelle { gap: 6px; font-size: 10px; } }

/* ---------- Nos autres projets ---------- */
.projets { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.projet { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--creme); background: #17204A; border: 2px solid var(--ligne); overflow: hidden; transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s, box-shadow .25s; }
.projet:hover { transform: translateY(-6px); }
.projet-visu { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.projet-visu img { width: 100%; height: 100%; object-fit: cover; display: block; image-rendering: pixelated; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.projet:hover .projet-visu img { transform: scale(1.05); }
.projet-visu::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(23,32,74,.95) 100%); }
.projet-live { position: absolute; top: 14px; left: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(10,15,40,.82); font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--creme); }
.projet-live i { width: 8px; height: 8px; background: #4ADE80; animation: clignote 1.6s infinite; }
@keyframes clignote { 50% { opacity: .25; } }
.projet-corps { padding: 6px 28px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; margin-top: -28px; position: relative; z-index: 1; }
.projet .tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--jaune); }
.projet h3 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; }
.projet p { margin: 0; color: var(--gris); line-height: 1.55; }
.puces { list-style: none; margin: 2px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.puces li { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding: 5px 9px; border: 1px solid var(--ligne); color: var(--creme); }
.btn-projet { margin-top: auto; align-self: flex-start; font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; padding: 13px 18px; transition: background .2s, color .2s; }
/* FAIL Games : jaune FAIL */
.projet-fg:hover { border-color: var(--jaune); box-shadow: 8px 8px 0 var(--jaune); }
.projet-fg h3 span { color: var(--jaune); }
.projet-fg .btn-projet { background: var(--jaune); color: var(--nuit); }
.projet-fg:hover .btn-projet { background: var(--orange); }
/* Bible GTA 6 : coucher de soleil */
.projet-bible { background: linear-gradient(160deg, #2A0F3D 0%, #4A1650 55%, #7A2A2A 100%); border-color: rgba(255,122,61,.35); }
.projet-bible .projet-visu::after { background: linear-gradient(180deg, transparent 55%, rgba(42,15,61,.95) 100%); }
.projet-bible:hover { border-color: #FF7A3D; box-shadow: 8px 8px 0 #FF4FA3; }
.projet-bible .tag { color: #FFD9C2; }
.projet-bible h3 { background: linear-gradient(90deg, #FFD23F, #FF7A3D, #FF4FA3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.projet-bible p { color: #F3D6E4; }
.projet-bible .puces li { border-color: rgba(255,255,255,.2); }
.projet-bible .btn-projet { background: linear-gradient(90deg, #FFD23F, #FF7A3D); color: #1A0A26; }
.projet-bible:hover .btn-projet { background: #fff; }
.projet-bible .projet-live i { background: #FF4FA3; }
@media (max-width: 760px) { .projets { grid-template-columns: 1fr; } .projet-corps { padding: 6px 20px 22px; } }
@media (prefers-reduced-motion: reduce) { .projet, .projet-visu img { transition: none; } .projet-live i { animation: none; } }
