/* ============================================================
   M31PROD — Console · Test 01
   Feuille de style unique. Sections :
     1. Tokens (couleurs, typos)
     2. Page (fond, nav, hero, panneau, footer)
     3. Console (coque, bezel, écran, boutons)
     4. Contenus de l'écran (menus, fiches, jauges, démo)
     5. Animations (boot, extinction, toast)
     6. Responsive
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --cream:   #f4f1ea;
  --cream-2: #e9e5dc;
  --paper:   #fbfaf6;
  --ink:     #171613;
  --ink-2:   #6a675f;
  --line:    #d9d4c8;

  --pink:    #e5005c;   /* accent M31 */
  --cyan:    #6fd3d7;
  --blue:    #0077ff;

  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-pixel: 'Silkscreen', 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; touch-action: manipulation; }   /* pas de zoom au double tap */

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
  background-image: radial-gradient(ellipse at 50% 35%, var(--paper) 0%, var(--cream) 55%, var(--cream-2) 100%);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain papier : un SVG de bruit en overlay, très discret */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- 2. Page ---------- */
.nav {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.6rem clamp(1.5rem, 5vw, 5rem);
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
}
.nav__logo { color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .32em; }
.nav__links { display: flex; align-items: center; gap: 2.2rem; }
.nav__links a { color: var(--ink-2); text-decoration: none; transition: color .2s; }
.nav__links a:hover { color: var(--ink); }
.nav__tag { color: var(--ink-2); display: inline-flex; align-items: center; gap: .6rem; }
.nav__tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }
.nav__sound {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: .4rem .9rem; cursor: pointer; transition: border-color .2s, background .2s;
}
.nav__sound:hover { border-color: var(--ink); }
.nav__sound[aria-pressed="false"] { color: var(--ink-2); text-decoration: line-through; }

.stage {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) auto minmax(230px, .8fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 1rem clamp(1.5rem, 5vw, 5rem) 3rem;
}

/* Hero — colonne gauche */
.hero__eyebrow { margin: 0 0 1.2rem; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2); }
.hero__title {
  margin: 0 0 1.4rem;
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(2.6rem, 4.3vw, 4.4rem); line-height: 1.02; letter-spacing: -.01em;
}
.hero__title em { font-style: italic; color: var(--ink-2); }
.hero__text { max-width: 36ch; margin: 0 0 2rem; color: var(--ink-2); }
.hero__cta {
  display: inline-flex; align-items: center; gap: .8rem;
  padding: .85rem 1.5rem .85rem 1.1rem; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--cream);
  font: 500 .82rem/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; transition: transform .25s, box-shadow .25s;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.5);
}
.hero__cta:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(0,0,0,.55); }
.hero__cta-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a5750; transition: background .3s, box-shadow .3s; }
.hero__cta.is-on .hero__cta-dot { background: var(--pink); box-shadow: 0 0 10px var(--pink); }
.hero__meta {
  display: flex; gap: 1.6rem; margin: 3rem 0 0; padding: 0; list-style: none;
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2);
}
.hero__meta li::before { content: '—'; margin-right: .6rem; opacity: .5; }

/* Panneau — colonne droite */
.panel { display: flex; flex-direction: column; gap: 2.2rem; max-width: 300px; justify-self: end; font-size: .85rem; }
.panel__label {
  margin: 0 0 .7rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line);
  font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-2);
}
.panel__status { margin: 0; font-family: var(--font-serif); font-size: 1.6rem; line-height: 1.1; }
.panel__sub { margin: .4rem 0 0; color: var(--ink-2); font-size: .8rem; }
.panel__menu { list-style: none; margin: 0; padding: 0; counter-reset: cart; }
.panel__menu li {
  display: flex; align-items: baseline; gap: .7rem; padding: .32rem 0;
  color: var(--ink-2); transition: color .2s;
}
.panel__menu li::before {
  counter-increment: cart; content: counter(cart, decimal-leading-zero);
  font-size: .62rem; letter-spacing: .1em; opacity: .55; width: 1.6rem;
}
.panel__menu li small { margin-left: auto; font-size: .68rem; letter-spacing: .05em; opacity: .7; }
.panel__menu li.is-cursor { color: var(--ink); }
.panel__menu li.is-active { color: var(--ink); font-weight: 500; }
.panel__menu li.is-active::before { content: '●'; color: var(--pink); opacity: 1; font-size: .5rem; }
.panel__keys { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; align-items: center; }
.panel__keys dt { display: flex; gap: .3rem; }
.panel__keys dd { margin: 0; color: var(--ink-2); font-size: .78rem; }
kbd {
  font: 500 .64rem/1.6 var(--font-sans); letter-spacing: .05em;
  padding: 0 .45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  background: var(--paper); color: var(--ink);
}

.foot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between;
  padding: 1.5rem clamp(1.5rem, 5vw, 5rem) 2rem;
  font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
}

/* ---------- 3. Console ----------
   Toutes les dimensions de la console sont en `em` :
   changer `.gb { font-size }` redimensionne l'objet entier. */
.console-wrap { position: relative; display: flex; justify-content: center; padding: 2.5rem 1rem 3rem; }
.console-wrap::after {                       /* ombre portée au sol */
  content: ''; position: absolute; left: 50%; bottom: .6rem; width: 62%; height: 46px;
  transform: translateX(-50%); border-radius: 50%; filter: blur(12px);
  background: radial-gradient(ellipse, rgba(35,28,20,.28), transparent 70%);
}

.gb {
  --body-1: #dfd9cd; --body-2: #cfc8ba; --body-3: #bfb7a8;
  font-size: 10px;
  position: relative; width: 40em;
  padding: 2.6em 2.4em 3em;
  background: linear-gradient(160deg, var(--body-1) 0%, var(--body-2) 60%, var(--body-3) 100%);
  border-radius: 1.6em 1.6em 6.5em 1.6em;
  transform: rotate(-2deg);
  transition: transform .7s cubic-bezier(.2,.7,.2,1);
  box-shadow:
    0 1px 0 rgba(255,255,255,.75) inset,
    0 -3px 0 rgba(0,0,0,.07) inset,
    0 44px 70px -30px rgba(40,30,20,.45),
    0 14px 26px -14px rgba(40,30,20,.25);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.gb button { touch-action: none; }            /* un doigt sur un bouton ne fait ni défiler ni zoomer */
.gb:hover { transform: rotate(-1deg) translateY(-4px); }
.gb::before {                                 /* fine rainure en haut de la coque */
  content: ''; position: absolute; top: 1.1em; left: 2em; right: 2em; height: 1px;
  background: rgba(0,0,0,.1); box-shadow: 0 1px 0 rgba(255,255,255,.5);
}

.gb__bezel {
  position: relative;
  padding: 2.6em 2.6em 2em;
  background: linear-gradient(180deg, #2c2d31, #1e1f22);
  border-radius: 1em 1em 3.4em 1em;
  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 4px 8px rgba(0,0,0,.35);
}
.gb__led {
  position: absolute; left: .55em; top: 9.5em;
  display: flex; flex-direction: column; align-items: center; gap: .5em;
  font: .62em var(--font-pixel); color: #7b7c82; letter-spacing: .05em;
}
.gb__led i {
  width: 1em; height: 1em; border-radius: 50%; background: #4a1c2c;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset; transition: background .3s, box-shadow .3s;
}
.gb.is-on .gb__led i { background: var(--pink); box-shadow: 0 0 .8em var(--pink), 0 0 .2em #fff inset; }

.gb__screen {
  /* palette LCD par défaut — modifiée en JS (Select) */
  --lcd-bg: #eef0e6; --lcd-ink: #1d1f1a; --lcd-mid: #8d9484; --lcd-accent: #e5005c;
  position: relative; overflow: hidden;
  width: 30em; height: 27em; margin: 0 auto;  /* ratio 160×144, centré dans le bezel */
  background: #141815;
  border-radius: .3em;
  box-shadow: 0 0 0 .25em #0c0d0f, 0 0 0 .4em #36373c, 0 0 1.2em rgba(0,0,0,.6) inset;
  transition: background .25s;
}
.gb__screen.is-on { background: var(--lcd-bg); }
.screen__content {
  position: absolute; inset: 0; opacity: 0;
  font-family: var(--font-pixel); font-size: .9em; line-height: 1.5; color: var(--lcd-ink);
  transition: opacity .2s;
}
.gb__screen.is-on .screen__content { opacity: 1; }
.screen__scanlines {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.07) 0 1px, transparent 1px 3px);
}
.screen__glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.05) 32%, transparent 52%);
}
.gb__brand {
  margin: 1.3em 0 0; display: flex; align-items: center; gap: .4em;
  font: .8em var(--font-pixel); letter-spacing: .25em; color: #8f9096;
}
.gb__brand i { width: .55em; height: .55em; border-radius: 50%; }
.gb__brand i:nth-of-type(1) { background: var(--pink); margin-left: .6em; }
.gb__brand i:nth-of-type(2) { background: var(--cyan); }
.gb__brand i:nth-of-type(3) { background: var(--blue); }
.gb__brand span { font-family: var(--font-serif); font-style: italic; font-size: 1.5em; letter-spacing: .05em; text-transform: none; margin-left: .3em; }

/* Molette de volume, sur la tranche gauche (comme sur la Game Boy) */
.gb__dial {
  --vol: .22;
  position: absolute; left: -.95em; top: 13.5em; z-index: 2;
  width: 1.5em; height: 6.4em; padding: 0; border: 0; cursor: ns-resize;
  border-radius: .5em 0 0 .5em; touch-action: none;
  background: repeating-linear-gradient(180deg, #4a4b52 0 .32em, #2c2d32 .32em .64em);
  background-position: 0 calc(var(--vol) * -3em);
  box-shadow: -1px 0 0 rgba(255,255,255,.12) inset, .2em 0 .4em rgba(0,0,0,.25);
  transition: background-position .15s;
}
.gb__dial::after {                           /* zone tactile élargie, invisible */
  content: ''; position: absolute; inset: -1em -1.4em;
}
.gb__dial::before {                          /* témoin lumineux */
  content: ''; position: absolute; left: .45em; top: -.9em; width: .5em; height: .5em; border-radius: 50%;
  background: #4a1c2c; transition: background .3s, box-shadow .3s;
}
.gb__dial.is-playing::before { background: var(--cyan); box-shadow: 0 0 .5em var(--cyan); }
.gb__dial.is-playing.is-muted::before { background: #6d5a2a; box-shadow: none; }
.gb__dial i {                               /* trait repère */
  position: absolute; left: .25em; right: .25em; top: calc(88% - var(--vol) * 76%); height: .15em;
  background: var(--pink); opacity: .9; transition: top .15s;
}
.gb__dial.is-muted i { background: #8a8b90; }
.gb__dial span {
  position: absolute; left: 50%; bottom: -1.5em; transform: translateX(-50%);
  font: .6em var(--font-pixel); color: #8f9096; letter-spacing: .1em;
}
.gb__dial:hover { background-position: 0 calc(var(--vol) * -3em + .1em); }

/* Boutons physiques */
.gb__controls { display: flex; justify-content: space-between; align-items: center; margin-top: 2.6em; padding: 0 .4em; }

.dpad { position: relative; width: 10.2em; height: 10.2em; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.dpad__btn {
  position: relative; border: 0; cursor: pointer; padding: 0;
  background: linear-gradient(180deg, #35363b, #232428);
  box-shadow: 0 .28em 0 #111214, 0 1px 0 rgba(255,255,255,.12) inset;
  transition: transform .06s, box-shadow .06s;
}
.dpad__btn::after {                          /* petite flèche */
  content: ''; position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  border: .45em solid transparent; transform: translate(-50%, -50%);
}
.dpad__btn--up    { grid-area: 1 / 2; border-radius: .6em .6em 0 0; }
.dpad__btn--left  { grid-area: 2 / 1; border-radius: .6em 0 0 .6em; }
.dpad__btn--right { grid-area: 2 / 3; border-radius: 0 .6em .6em 0; }
.dpad__btn--down  { grid-area: 3 / 2; border-radius: 0 0 .6em .6em; }
.dpad__btn--up::after    { border-bottom-color: #4b4c52; transform: translate(-50%, -70%); }
.dpad__btn--down::after  { border-top-color: #4b4c52;    transform: translate(-50%, -30%); }
.dpad__btn--left::after  { border-right-color: #4b4c52;  transform: translate(-70%, -50%); }
.dpad__btn--right::after { border-left-color: #4b4c52;   transform: translate(-30%, -50%); }
.dpad__center { grid-area: 2 / 2; background: #232428; box-shadow: 0 .28em 0 #111214; position: relative; }
.dpad__center::after {
  content: ''; position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2f3035, #1b1c1f);
}
.dpad__btn.is-pressed { transform: translateY(.18em); box-shadow: 0 .1em 0 #111214; }

.ab { display: flex; align-items: flex-start; gap: 1.5em; transform: rotate(-24deg); margin: .4em .6em 0 0; }
.ab__btn {
  position: relative; width: 5em; height: 5em; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 35% 30%, #ff5f98, #d80b5a 58%, #a40840);
  box-shadow: 0 .32em 0 #6a0429, 0 .6em 1.2em rgba(0,0,0,.28), 0 1px 0 rgba(255,255,255,.35) inset;
  transition: transform .06s, box-shadow .06s;
}
.ab__btn--b { margin-top: 2.6em; }
.ab__btn span {
  position: absolute; left: 50%; bottom: -2.1em; transform: translateX(-50%);
  font: .85em var(--font-pixel); color: #6d6e74;
}
.ab__btn.is-pressed { transform: translateY(.22em); box-shadow: 0 .1em 0 #6a0429, 0 .2em .5em rgba(0,0,0,.25); }

.gb__pills { display: flex; gap: 2.6em; margin: 3.4em 0 0 6.5em; }
.pill {
  position: relative; width: 5.6em; height: 1.5em; border: 0; border-radius: 1em; cursor: pointer; padding: 0;
  background: linear-gradient(180deg, #5a5b62, #3a3b41);
  box-shadow: 0 .22em 0 #1a1b1e, 0 1px 0 rgba(255,255,255,.2) inset;
  transform: rotate(-24deg); transition: transform .06s, box-shadow .06s;
}
.pill span {
  position: absolute; left: 50%; top: 1.9em; transform: translateX(-50%);
  font: .7em var(--font-pixel); letter-spacing: .1em; color: #6d6e74;
}
.pill.is-pressed { transform: rotate(-24deg) translateY(.15em); box-shadow: 0 .06em 0 #1a1b1e; }

.gb__speaker { position: absolute; right: 3.2em; bottom: 3.6em; display: flex; gap: .75em; transform: rotate(-24deg); }
.gb__speaker i {
  width: .7em; height: 5.2em; border-radius: 1em; background: #b3ab9c;
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 0 0 1px rgba(0,0,0,.06);
}
.gb__speaker i:nth-child(even) { height: 4.4em; margin-top: .4em; }

/* ---------- 4. Contenus de l'écran ---------- */
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; padding: .9em 1.1em; text-transform: uppercase; }
.scr__hdr {
  display: flex; justify-content: space-between; gap: 1em;
  padding-bottom: .4em; margin-bottom: .7em; border-bottom: .22em solid var(--lcd-ink);
  font-size: .82em; letter-spacing: .08em;
}
.scr__hdr b { font-weight: 700; }
.scr__hdr span { color: var(--lcd-mid); }
.scr__body { flex: 1; min-height: 0; overflow: hidden; }
.scr__ftr {
  display: flex; justify-content: space-between; gap: 1em;
  padding-top: .5em; margin-top: .5em; border-top: .12em dotted var(--lcd-mid);
  font-size: .68em; letter-spacing: .06em; color: var(--lcd-mid);
}
.scr__ftr b { color: var(--lcd-ink); font-weight: 400; }

/* Listes avec curseur */
.row { display: flex; align-items: center; gap: .6em; padding: .22em .35em; letter-spacing: .05em; }
.row__cur { flex: none; width: 1em; }
.row.is-sel { background: var(--lcd-ink); color: var(--lcd-bg); }
.row.is-sel .row__cur::before { content: '>'; animation: blink 1s steps(2) infinite; }
.row__sub { margin-left: auto; font-size: .72em; color: var(--lcd-mid); }
.row.is-sel .row__sub { color: var(--lcd-bg); opacity: .75; }
.row svg { width: 1.7em; height: auto; flex: none; }

/* Accueil */
.home { display: flex; flex-direction: column; height: 100%; }
.home__logo { font-size: 2.3em; line-height: 1; letter-spacing: .04em; margin: .35em 0 .15em; }
.home__logo b { color: var(--lcd-accent); font-weight: 400; }
.home__tag { font-size: .72em; letter-spacing: .25em; color: var(--lcd-mid); margin-bottom: 1.2em; }
.home__lines { font-size: .78em; line-height: 1.55; text-transform: none; }
.home__lines p { margin: 0 0 .5em; }
.home__stats { display: flex; gap: .6em; margin-top: auto; }
.home__stats div { flex: 1; border: .15em solid var(--lcd-ink); padding: .35em .4em; font-size: .68em; line-height: 1.35; }
.home__stats small { display: block; color: var(--lcd-mid); }

/* Le trio en bas à droite de l'accueil : entrée glissée, puis flottement en pas de pixel */
.home { position: relative; }
.home__lines { padding-right: 40%; }
.home__stats { max-width: 57%; }
.home__crew {
  position: absolute; right: -.5em; bottom: -.3em; width: 13.5em; height: auto;
  image-rendering: pixelated; pointer-events: none;
  filter: drop-shadow(0 .2em 0 var(--lcd-mid));
  animation: crewIn .5s steps(5) both, crewBob 2.4s steps(2) 0.5s infinite;
}
@keyframes crewIn  { from { transform: translate(40%, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes crewBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.25em); } }

/* Équipe */
.card { display: flex; gap: 1em; height: 100%; }
.card__avatar { flex: none; }
.card__avatar svg { width: 7em; height: auto; }
.card__avatar img { width: 7em; height: 8.2em; object-fit: cover; image-rendering: pixelated; border: .15em solid var(--lcd-ink); }
.card__body { min-width: 0; display: flex; flex-direction: column; }
.card__name { font-size: 1em; line-height: 1.2; }
.card__role { font-size: .7em; letter-spacing: .1em; color: var(--lcd-accent); margin: .3em 0 .8em; }
.card__bio { font-size: .72em; line-height: 1.55; text-transform: none; }
.card__nav { margin-top: auto; font-size: .7em; color: var(--lcd-mid); letter-spacing: .1em; }

/* Clients */
.grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: .5em; height: 100%; }
.tile {
  display: flex; flex-direction: column; justify-content: center; min-height: 3.9em;
  padding: .45em .5em; border: .16em solid var(--lcd-mid); font-size: .74em; line-height: 1.25;
}
.tile small { display: block; margin-top: .2em; font-size: .85em; color: var(--lcd-mid); }
.tile.is-sel { border-color: var(--lcd-ink); background: var(--lcd-ink); color: var(--lcd-bg); }
.tile.is-sel small { color: var(--lcd-bg); opacity: .7; }
.tile img { max-width: 100%; max-height: 2.4em; object-fit: contain; image-rendering: pixelated; }

/* Skills */
.skill { display: flex; align-items: center; gap: .5em; padding: .18em .35em; font-size: .72em; }
.skill__name { flex: none; width: 9.6em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { flex: 1; display: flex; gap: .15em; }
.bar i { flex: 1; height: .95em; border: .12em solid var(--lcd-ink); }
.bar i.on { background: var(--lcd-ink); }
.skill__lv { flex: none; width: 2.2em; text-align: right; }
.skill.is-sel { background: var(--lcd-ink); color: var(--lcd-bg); }
.skill.is-sel .bar i { border-color: var(--lcd-bg); }
.skill.is-sel .bar i.on { background: var(--lcd-bg); }
.skill.is-lvup .bar i.on { animation: pulse .35s steps(2) 2; }
.opt__val { flex: 1; text-align: right; letter-spacing: .1em; }
.skills__desc { margin-top: .6em; padding-top: .5em; border-top: .12em dotted var(--lcd-mid); font-size: .7em; line-height: 1.5; text-transform: none; }
.skills__desc b { display: block; text-transform: uppercase; color: var(--lcd-accent); font-weight: 400; }

/* Démo vidéo */
.demo { position: absolute; inset: 0; background: #000; }
.demo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.demo canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.demo__ui {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: .9em 1.1em; color: #fff; text-shadow: 0 0 .3em #000; font-size: .78em; letter-spacing: .1em;
}
.demo__ui .top, .demo__ui .bottom { display: flex; justify-content: space-between; }
.demo__ui .rec { color: var(--lcd-accent); }
.demo__ui .rec::before { content: '●'; margin-right: .4em; animation: blink 1s steps(2) infinite; }
.demo__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); color: #fff; font-size: 1em; letter-spacing: .15em; text-shadow: 0 0 .3em #000;
}
.demo__play { flex-direction: column; gap: .6em; }
.demo__play small { font-size: .7em; opacity: .75; }
.demo__title { max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo.is-playing .demo__play { display: none; }
.demo__placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6em;
  background: repeating-linear-gradient(90deg, #444 0 12.5%, #666 0 25%, #888 0 37.5%, #aaa 0 50%, #888 0 62.5%, #666 0 75%, #444 0 87.5%, #222 0 100%);
  color: #fff; text-shadow: 0 0 .3em #000; font-size: .8em; letter-spacing: .15em;
}
.demo__placeholder b { background: #000; padding: .3em .6em; font-weight: 400; }

/* Démo : repère de cadrage vertical (flèches haut / bas) */
.demo__pan { position: absolute; right: .5em; top: 3em; bottom: 3em; width: .35em; background: rgba(255,255,255,.25); border-radius: 1em; }
.demo__pan i { position: absolute; left: 0; right: 0; height: 25%; top: calc(var(--pan, .5) * 75%); background: #fff; border-radius: 1em; box-shadow: 0 0 .3em #000; transition: top .15s; }
.demo.is-playing .demo__pan { opacity: .5; }

/* Mini-jeu */
.game { position: absolute; inset: 0; }
.game canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.game__hud {
  position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between;
  padding: .4em 1em; font-size: .7em; letter-spacing: .1em; color: var(--lcd-ink);
}
.game__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6em;
  text-align: center; background: color-mix(in srgb, var(--lcd-bg) 80%, transparent);
}
.game__overlay.is-hidden { display: none; }
.game__overlay b { font-size: 1.4em; font-weight: 400; letter-spacing: .12em; }
.game__overlay small { font-size: .7em; color: var(--lcd-mid); letter-spacing: .1em; }

/* Contact */
.contact { font-size: .78em; line-height: 1.6; text-transform: none; }
.contact p { margin: 0 0 .7em; }
.contact b { display: block; font-weight: 400; text-transform: uppercase; font-size: .78em; letter-spacing: .15em; color: var(--lcd-mid); }
.contact .big { font-size: 1.15em; }

/* ---------- 5. Animations ---------- */
.boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.boot__logo { font-size: 2.4em; letter-spacing: .08em; line-height: 1; animation: bootDrop 1.3s cubic-bezier(.2,.9,.25,1) both; }
.boot__logo b { color: var(--lcd-accent); font-weight: 400; }
.boot__sub { margin-top: .8em; font-size: .75em; letter-spacing: .45em; color: var(--lcd-mid); animation: fadeIn .3s 1.35s both; }
.boot__copy { position: absolute; bottom: 1em; font-size: .62em; letter-spacing: .1em; color: var(--lcd-mid); animation: fadeIn .3s 1.6s both; }

.gb__screen.is-dying .screen__content { animation: crtOff .42s ease-in both; transform-origin: 50% 50%; }
.screen__content.is-swap { animation: swap .18s steps(3) both; }

.toast {
  position: absolute; left: 50%; bottom: 3.2em; transform: translateX(-50%);
  padding: .4em .9em; background: var(--lcd-ink); color: var(--lcd-bg);
  font: .72em var(--font-pixel); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  animation: toastIn .12s steps(2) both;
}

@keyframes blink    { 50% { opacity: 0; } }
@keyframes pulse    { 50% { opacity: .2; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes bootDrop { from { transform: translateY(-14em); } to { transform: translateY(0); } }
@keyframes crtOff   { 0% { transform: scaleY(1); } 55% { transform: scaleY(.01); opacity: 1; } 100% { transform: scaleY(.01) scaleX(0); opacity: 0; } }
@keyframes swap     { from { opacity: 0; transform: translateX(-.4em); } to { opacity: 1; transform: none; } }
@keyframes toastIn  { from { opacity: 0; transform: translate(-50%, .5em); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  .gb, .gb:hover { transform: none; transition: none; }
  .boot__logo { animation-duration: .01s; }
}

/* ---------- 6. Responsive ---------- */
@media (min-width: 1280px) {
  .gb { font-size: 11px; }
}
@media (max-width: 1180px) {
  .stage { grid-template-columns: 1fr auto; }
  .panel { grid-column: 1 / -1; justify-self: start; max-width: none; flex-direction: row; flex-wrap: wrap; gap: 2rem 4rem; }
  .panel__block { min-width: 200px; }
}
@media (max-width: 860px) {
  .nav__tag { display: none; }
  .stage { grid-template-columns: 1fr; text-align: center; min-height: 0; gap: 1rem; }
  .hero__text { margin-inline: auto; }
  .hero__meta { justify-content: center; }
  .console-wrap { padding-top: 1rem; }
  .gb { font-size: 9px; transform: none; }
  .panel { text-align: left; justify-content: center; }
}
@media (max-width: 420px) {
  .gb { font-size: 8px; }
  .hero__title { font-size: 2.3rem; }
}
