/* Portfolio éditorial sobre, avec une couche « RPG rétro » originale :
   police pixel pour les repères, cadres à coins crantés, curseur de menu ▶,
   boîte de dialogue. Trois chapitres ; l'IA bascule en univers sombre. */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations"), url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-var.woff2") format("woff2-variations"), url("../fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700; font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("../fonts/silkscreen.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}

:root {
  /* Palette « ruines violettes » : pierre lavande, violet profond, or des pièces */
  --paper: #F3EFF7;
  --paper-2: #E6DDF0;
  --ink: #1E1330;
  --ink-2: #554A66;
  --rule: #D2C6E0;
  --accent: #6A35B4;
  --accent-ink: #58299A;
  --gold: #F4C430;
  --night: #2A1745;
  --night-2: #3A2259;
  --night-ink: #F3EFF7;
  --night-ink-2: #B7A8CC;
  --window: linear-gradient(180deg, #3D2466 0%, #261540 100%);
  --bricks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='2'%3E%3Cpath d='M0 1H48M0 25H48M1 0V24M25 24V48'/%3E%3C/g%3E%3C/svg%3E");

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-pixel: "Silkscreen", ui-monospace, "Courier New", monospace;

  --s-1: clamp(.78rem, .76rem + .1vw, .84rem);
  --s0: clamp(1rem, .97rem + .15vw, 1.08rem);
  --s1: clamp(1.15rem, 1.05rem + .4vw, 1.4rem);
  --s2: clamp(1.9rem, 1.4rem + 2vw, 3.2rem);
  --s3: clamp(2.6rem, 1.5rem + 4.6vw, 5.6rem);

  --px: 4px;                  /* taille d'un « pixel » des cadres */
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--s0)/1.6 var(--f-body); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-stretch: 72%; line-height: .98; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--max); margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 16px; }

/* ---------- Éléments « pixel » ---------- */
.pixel-label { font: 400 .72rem/1.3 var(--f-pixel); letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); }
/* cadre aux coins crantés, façon interface de jeu */
.px { position: relative; background: var(--paper); margin: var(--px);
  box-shadow: 0 calc(var(--px) * -1) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink), calc(var(--px) * -1) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink); }
/* curseur de menu */
.cursor::before { content: ""; display: inline-block; width: 0; height: 0; margin-right: 0; vertical-align: .08em;
  border-left: 0 solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transition: border-left-width .15s steps(2), margin-right .15s steps(2); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; min-height: 46px; padding: 0 1.3em; background: var(--ink); color: var(--paper);
  text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font-family: var(--f-body); font-size: 1rem;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink); margin: 3px;
  transition: transform .15s steps(2), background .15s; }
.btn:hover { background: var(--accent-ink); box-shadow: 0 -3px 0 0 var(--accent-ink), 0 3px 0 0 var(--accent-ink), -3px 0 0 0 var(--accent-ink), 3px 0 0 0 var(--accent-ink); transform: translateY(-2px); }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink); }
.btn--small { min-height: 36px; padding: 0 1em; font-size: .9rem; }

/* ---------- En-tête ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.top__in { display: flex; align-items: center; gap: 18px; padding-block: 10px; }
.brand { font: 800 1.15rem/1 var(--f-display); font-stretch: 75%; text-transform: uppercase; text-decoration: none; margin-right: auto; }
.nav { display: flex; gap: 20px; }
.nav a { text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; }
.nav a::before { content: ""; width: 0; height: 0; border-left: 0 solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent; margin-right: 0; transition: border-left-width .12s steps(2), margin-right .12s steps(2); }
.nav a:hover::before, .nav a:focus-visible::before { border-left-width: 7px; margin-right: 6px; }
@media (max-width: 680px) { .nav { gap: 12px; font-size: .9rem; } .nav a:first-child { display: none; } }
@media (max-width: 520px) { .nav { display: none; } }

/* ---------- Ouverture ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 80px); align-items: center; padding-block: clamp(36px, 6vw, 88px); }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.hero__text { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero__title { font-size: var(--s3); font-weight: 850; font-stretch: 66%; text-transform: uppercase; line-height: .9; letter-spacing: -.01em; }
.hero__title span { display: block; }
.hero__title span + span { color: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 4px; }

/* boîte de dialogue */
.dialog { position: relative; background: var(--ink); color: var(--paper); padding: 26px 22px 22px; margin: 4px 4px 4px 4px; max-width: 58ch;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--paper); }
.dialog__name { position: absolute; top: -14px; left: 16px; font: 400 .72rem/1 var(--f-pixel); text-transform: uppercase; background: var(--accent); color: #fff; padding: 6px 8px; }
.dialog__text { font-size: var(--s1); line-height: 1.45; min-height: 4.4em; }
.dialog__next { position: absolute; right: 16px; bottom: 10px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--paper); }
@media (prefers-reduced-motion: no-preference) { .dialog__next { animation: bob 1s steps(2) infinite; } @keyframes bob { 50% { transform: translateY(3px); } } }

/* fiche de stats */
.sheet-card { padding: 22px; display: flex; flex-direction: column; gap: 18px; background: var(--paper); }
.sheet-card__head { display: flex; gap: 16px; align-items: center; }
.sheet-card__photo { width: 84px; height: 105px; object-fit: cover; image-rendering: auto; background: var(--paper-2);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink); margin: 3px; }
.sheet-card__name { font: 850 1.6rem/1 var(--f-display); font-stretch: 70%; text-transform: uppercase; }
.sheet-card__job { font-size: .9rem; color: var(--ink-2); margin-top: 4px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 2px dashed var(--rule); }
.stat { padding: 14px 0 12px; border-bottom: 2px dashed var(--rule); display: flex; flex-direction: column-reverse; gap: 2px; }
.stat:nth-child(odd) { padding-right: 12px; border-right: 2px dashed var(--rule); }
.stat:nth-child(even) { padding-left: 14px; }
.stat dd { margin: 0; font: 850 clamp(2rem, 1.6rem + 1.4vw, 2.8rem)/1 var(--f-display); font-stretch: 64%; font-variant-numeric: tabular-nums; }
.stat dt { font-size: .84rem; color: var(--ink-2); line-height: 1.3; }
.stat:first-child dd { color: var(--accent-ink); }
.sheet-card__dispo { display: flex; gap: 10px; align-items: center; font-size: .92rem; font-weight: 600; }
.blip { width: 10px; height: 10px; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) { .blip { animation: blink 1.2s steps(1) infinite; } @keyframes blink { 50% { opacity: .25; } } }

/* ---------- Têtes de chapitre ---------- */
.chap-head { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; margin-bottom: clamp(24px, 4vw, 40px); border-bottom: 2px solid currentColor; }
.chap-head h2 { font-size: var(--s2); font-weight: 850; font-stretch: 66%; text-transform: uppercase; }
.chap-head__intro { max-width: 62ch; font-size: var(--s1); line-height: 1.5; color: var(--ink-2); }
.chap-head__row { display: flex; align-items: center; gap: 14px; }
.progress { display: inline-flex; gap: 4px; }
.progress i { width: 10px; height: 10px; border: 2px solid currentColor; display: block; }
.progress i.on { background: currentColor; }


/* ---------- Parcours ---------- */
.parcours { padding-block: clamp(56px, 8vw, 104px); background: var(--paper-2); }
.parcours__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .parcours__grid { grid-template-columns: minmax(0, 1fr); } }
.parcours__text { display: flex; flex-direction: column; gap: 16px; font-size: var(--s1); line-height: 1.5; max-width: 46ch; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 110px 20px minmax(0, 1fr); gap: 0 14px; position: relative; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline__year { font: 400 .72rem/1.6 var(--f-pixel); text-transform: uppercase; color: var(--accent-ink); padding-top: 3px; }
.timeline__node { position: relative; }
.timeline__node::before { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 12px; background: var(--paper-2); border: 3px solid var(--ink); }
.timeline li:last-child .timeline__node::before { background: var(--accent); border-color: var(--accent); }
.timeline__node::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: -22px; width: 2px; background: repeating-linear-gradient(var(--ink) 0 4px, transparent 4px 8px); }
.timeline li:last-child .timeline__node::after { display: none; }
.timeline strong { display: block; font: 800 1.2rem/1.1 var(--f-display); font-stretch: 72%; text-transform: uppercase; }
.timeline p { color: var(--ink-2); font-size: .95rem; margin-top: 2px; }
@media (max-width: 480px) { .timeline li { grid-template-columns: 20px minmax(0, 1fr); } .timeline__year { grid-column: 2; grid-row: 1; } .timeline__node { grid-column: 1; grid-row: 1 / span 2; } .timeline__body { grid-column: 2; } }
.parcours__cv { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Chapitres ---------- */
.chap { padding-block: clamp(56px, 8vw, 104px); }
.chap--night { background: var(--night); color: var(--night-ink); }
.chap--night .chap-head__intro, .chap--night .bloc__text { color: var(--night-ink-2); }
.chap--night .pixel-label { color: var(--accent); }
.bloc + .bloc { margin-top: clamp(48px, 7vw, 80px); }
.bloc__head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.bloc__head h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); font-weight: 800; text-transform: uppercase; }
.bloc__text { max-width: 70ch; color: var(--ink-2); }

/* réseaux */
.nets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .nets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .nets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.net { padding: 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; height: calc(100% - 8px); transition: transform .15s steps(2); }
.net:hover { transform: translateY(-3px); }
.nets li:first-child .net { background: var(--ink); color: var(--paper); }
.net__pf { font: 400 .68rem/1 var(--f-pixel); text-transform: uppercase; color: var(--accent-ink); }
.nets li:first-child .net__pf { color: var(--accent); }
.net__n { font: 850 2.1rem/1 var(--f-display); font-stretch: 64%; font-variant-numeric: tabular-nums; }
.net__name { font-weight: 600; }
.net__role { font-size: .85rem; color: var(--ink-2); line-height: 1.35; }
.nets li:first-child .net__role { color: var(--night-ink-2); }
.nets li { display: flex; }
.nets li .net { flex: 1; height: auto; }
.nets__unit { margin-top: 16px; font-size: var(--s-1); color: var(--ink-2); }

/* cartes */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.cards--v { grid-template-columns: repeat(3, minmax(0, 300px)); }
.cards--n2.cards--v { grid-template-columns: repeat(2, minmax(0, 300px)); }
.cards--n2:not(.cards--v) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .cards, .cards--n2:not(.cards--v) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards, .cards--n2:not(.cards--v) { grid-template-columns: minmax(0, 1fr); } .cards--v, .cards--n2.cards--v { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card__open { all: unset; position: absolute; inset: 0; cursor: pointer; z-index: 3; }
.card__open:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
.media { position: relative; overflow: hidden; background: var(--night-2); aspect-ratio: 16 / 9; max-width: 100%; }
.media--v { aspect-ratio: 9 / 16; }
.media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.media--fit img { object-fit: contain; background: var(--night-2); }
.card:hover .media img { transform: scale(1.04); }
.badge { position: absolute; z-index: 2; left: 0; top: 0; background: var(--accent); color: #fff; font: 400 .74rem/1 var(--f-pixel); text-transform: uppercase; padding: 7px 9px; display: flex; gap: 6px; align-items: baseline; }
.badge b { font-weight: 400; font-size: 1.15rem; }
.play { position: absolute; z-index: 2; right: 10px; bottom: 10px; width: 40px; height: 40px; background: var(--paper); display: grid; place-items: center; transition: background .15s; }
.play::before { content: ""; margin-left: 3px; border: 7px solid transparent; border-left: 11px solid var(--ink); border-right: 0; }
.card:hover .play { background: var(--accent); }
.card:hover .play::before { border-left-color: #fff; }
.card__title { font: 600 1.06rem/1.3 var(--f-body); display: flex; align-items: baseline; }
.card__title::before { content: ""; flex: none; width: 0; height: 0; border-left: 0 solid var(--accent); border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-right: 0; transition: border-left-width .12s steps(2), margin-right .12s steps(2); }
.card:hover .card__title::before, .card:focus-within .card__title::before { border-left-width: 8px; margin-right: 8px; }
.card__ctx { font-size: .9rem; color: var(--ink-2); line-height: 1.4; }
.chap--night .card__ctx { color: var(--night-ink-2); }

/* affiche quand il n'y a pas d'image */
.poster { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px; color: var(--night-ink);
  background: repeating-linear-gradient(0deg, transparent 0 7px, rgb(255 255 255 / .035) 7px 8px), linear-gradient(160deg, #3B2063, var(--night-2) 60%); }
.poster__t { font: 850 clamp(1.1rem, .8rem + 1vw, 1.6rem)/1 var(--f-display); font-stretch: 66%; text-transform: uppercase; }
.poster--quote { background: var(--accent); color: #fff; justify-content: center; }
.poster--quote .poster__t { font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); }

/* outil NaneCut */
.tool { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
@media (max-width: 860px) { .tool { grid-template-columns: minmax(0, 1fr); } }
.tool__steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: step; }
.tool__step { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 12px; padding: 14px; cursor: pointer; border-left: 3px solid transparent; }
.tool__step:hover { background: var(--night-2); }
.tool__step[aria-selected="true"] { background: var(--night-2); border-left-color: var(--accent); }
.tool__step:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.tool__num { grid-row: span 2; font: 400 .9rem/1.4 var(--f-pixel); color: var(--accent); }
.tool__name { font: 800 1.2rem/1.1 var(--f-display); font-stretch: 72%; text-transform: uppercase; }
.tool__desc { font-size: .9rem; color: var(--night-ink-2); line-height: 1.4; }
.tool__screen { margin: 0; background: #120A1E; padding: 8px; box-shadow: 0 -4px 0 0 #3A2752, 0 4px 0 0 #3A2752, -4px 0 0 0 #3A2752, 4px 0 0 0 #3A2752; margin: 4px; }
.tool__screen img { width: 100%; height: auto; aspect-ratio: 1200 / 631; object-fit: cover; object-position: top left; }
.tool__screen figcaption { font-size: .78rem; color: var(--night-ink-2); padding: 8px 4px 2px; }

/* ---------- Fiche (modale) ---------- */
.sheet { width: min(1000px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; background: var(--paper); color: var(--ink);
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink); overflow: visible; }
.sheet::backdrop { background: rgb(26 16 41 / .8); }
.sheet__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); max-height: calc(100dvh - 24px); }
.sheet__in.is-vertical { grid-template-columns: minmax(0, .75fr) minmax(0, 1fr); }
@media (max-width: 760px) { .sheet__in, .sheet__in.is-vertical { grid-template-columns: minmax(0, 1fr); overflow-y: auto; } }
.sheet__close { position: absolute; right: 10px; top: 10px; z-index: 5; width: 40px; height: 40px; border: 0; background: var(--ink); color: var(--paper); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.sheet__media { background: var(--night); display: flex; flex-direction: column; justify-content: center; }
.player { position: relative; aspect-ratio: 16/9; width: 100%; background: var(--night); overflow: hidden; }
.player--v { aspect-ratio: 9/16; }
.sheet .player--v { width: auto; height: min(76dvh, 660px); max-width: 100%; margin-inline: auto; }
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; z-index: 1; }
.player__btn { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; text-decoration: none; }
.player__btn span { font: 400 .8rem/1 var(--f-pixel); text-transform: uppercase; background: var(--accent); color: #fff; padding: 12px 14px; }
.player__fallback { display: block; padding: 10px 14px; color: var(--night-ink); font-size: .88rem; }
.sheet__body { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.sheet__body h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 850; font-stretch: 68%; text-transform: uppercase; padding-right: 44px; }
.sheet__body h3 { font: 400 .7rem/1.3 var(--f-pixel); text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.sheet__links { display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; list-style: none; }
.sheet__links a { color: var(--accent-ink); font-weight: 600; }
.result { border-left: 4px solid var(--accent); padding-left: 12px; }
.result p { font: 850 1.5rem/1.1 var(--f-display); font-stretch: 70%; }
.result small { display: block; color: var(--ink-2); font-size: var(--s-1); margin-top: 4px; }

/* ---------- Contact ---------- */
.contact { background: var(--paper); padding-block: clamp(64px, 9vw, 120px); }
.contact__in { display: flex; flex-direction: column; gap: 26px; }
.contact__title { font-size: var(--s3); font-weight: 850; font-stretch: 66%; text-transform: uppercase; line-height: .92; max-width: 15ch; }
.contact__mail { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.contact__addr { font: 600 var(--s1) var(--f-body); user-select: all; overflow-wrap: anywhere; }
.contact__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.contact__links a { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

.foot { border-top: 1px solid var(--rule); font-size: var(--s-1); color: var(--ink-2); }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 22px; }

/* apparition au défilement : mouvement seul, contenu toujours visible */
@media (prefers-reduced-motion: no-preference) {
  .hero__text > *, .sheet-card { animation: rise .6s var(--ease) both; }
  .hero__text > :nth-child(2) { animation-delay: .05s; } .hero__text > :nth-child(3) { animation-delay: .1s; } .hero__text > :nth-child(4) { animation-delay: .15s; }
  .sheet-card { animation-delay: .2s; }
  @keyframes rise { from { transform: translateY(14px); opacity: .001; } }
  @supports (animation-timeline: view()) {
    .card, .net { animation: lift linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    @keyframes lift { from { transform: translateY(20px); } }
  }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
h4 { margin: 0; }

/* blocs verticaux : texte à gauche, vidéos à droite */
.bloc--side { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 4vw, 56px); align-items: start; }
.bloc--side .bloc__head { position: sticky; top: 90px; margin: 0; }
.bloc--side .cards--v { grid-template-columns: repeat(3, minmax(0, 250px)); }
.bloc--side .cards--n2.cards--v { grid-template-columns: repeat(2, minmax(0, 250px)); }
@media (max-width: 980px) { .bloc--side { grid-template-columns: minmax(0, 1fr); } .bloc--side .bloc__head { position: static; } }
@media (max-width: 560px) { .bloc--side .cards--v, .bloc--side .cards--n2.cards--v { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.poster { padding-right: 60px; }
.net__n small { font: 600 .8rem/1 var(--f-body); font-stretch: 100%; margin-left: 6px; letter-spacing: 0; }
.net__total { font: 400 .68rem/1.2 var(--f-pixel); text-transform: uppercase; padding: 4px 6px; background: var(--paper-2); color: var(--ink); align-self: flex-start; }
.nets li:first-child .net__total { background: var(--accent); color: #fff; }
.card__brand { font: 850 clamp(1.4rem, 1.1rem + 1vw, 1.9rem)/1 var(--f-display); font-stretch: 66%; text-transform: uppercase; color: var(--accent-ink); margin-top: 4px; }
.card__brand + .card__title { font-weight: 500; font-size: .98rem; }

/* ===== Écrans de chapitre : même traitement pour Prologue, Chapitres et Fin ===== */
.parcours { background: none; padding: 0; }
.chap { padding: 0 0 clamp(56px, 8vw, 104px); }
.chap__body { padding-top: clamp(48px, 7vw, 88px); }
.screen { position: relative; background: var(--ink); color: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgb(255 255 255 / .025) 3px 4px); }
.screen::after { content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%) 0 0 / 24px 12px repeat-x; }
.screen__in { padding-block: clamp(44px, 6vw, 72px) clamp(36px, 5vw, 56px); display: flex; flex-direction: column; gap: 14px; }
.screen h2 { font-size: var(--s2); font-weight: 850; font-stretch: 66%; text-transform: uppercase; max-width: 22ch; }
.screen .pixel-label { color: var(--accent); }
.screen__intro { max-width: 62ch; font-size: var(--s1); line-height: 1.5; color: var(--night-ink-2); }
.screen .progress i { border-color: var(--paper); }
.screen .progress i.on { background: var(--accent); border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .screen .pixel-label::after { content: "_"; margin-left: 2px; animation: blink 1s steps(1) infinite; }
}
/* NaneCut sur fond clair */
.tool__step:hover, .tool__step[aria-selected="true"] { background: var(--paper-2); }
.tool__desc { color: var(--ink-2); }
.tool__num { color: var(--accent-ink); }
.tool__screen { box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink); }
.tool__screen figcaption { color: var(--night-ink-2); }
/* Fin : écran de clôture */
.contact { background: var(--ink); color: var(--paper); background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgb(255 255 255 / .025) 3px 4px); position: relative; }
.contact::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
  background: linear-gradient(90deg, var(--ink) 50%, transparent 50%) 12px 0 / 24px 12px repeat-x; }
.contact .pixel-label { color: var(--accent); }
.contact .btn { background: var(--paper); color: var(--ink); box-shadow: 0 -3px 0 0 var(--paper), 0 3px 0 0 var(--paper), -3px 0 0 0 var(--paper), 3px 0 0 0 var(--paper); }
.contact .btn:hover { background: var(--accent); color: #fff; box-shadow: 0 -3px 0 0 var(--accent), 0 3px 0 0 var(--accent), -3px 0 0 0 var(--accent), 3px 0 0 0 var(--accent); }
.contact .btn--ghost { background: var(--ink); color: var(--paper); }
.foot { border-top: 0; }
/* cartes : déplacement « au pixel » */
.card { transition: transform .12s steps(2); }
.card:hover { transform: translate(-2px, -2px); }
.card:hover .media { box-shadow: 4px 4px 0 0 var(--ink); }
.nets__unit { margin-top: 24px; }

/* Compétences */
.skills { margin-top: clamp(40px, 6vw, 64px); padding-top: 28px; border-top: 2px dashed var(--rule); }
.skills__title { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); font-weight: 800; text-transform: uppercase; margin-bottom: 20px; }
.skills__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 980px) { .skills__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .skills__grid { grid-template-columns: minmax(0, 1fr); } }
.skills__group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: .9rem; padding: 5px 10px; background: var(--paper-2); border: 2px solid var(--ink); }
.contact__lead { max-width: 60ch; font-size: var(--s1); line-height: 1.5; color: var(--night-ink-2); }
span.btn[aria-disabled="true"] { cursor: default; }

/* Atouts */
.assets-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .assets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .assets-grid { grid-template-columns: minmax(0, 1fr); } }
.atout { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.atout h4 { font: 800 1.35rem/1.05 var(--f-display); font-stretch: 72%; text-transform: uppercase; }
.atout > p:not(.pixel-label) { color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
.atout .chips { margin-top: auto; padding-top: 6px; }
.chips--small li { font-size: .8rem; padding: 3px 8px; border-width: 1.5px; }
.bloc__skills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 4px; }
.bloc--side .bloc__skills { flex-direction: column; align-items: flex-start; }
.sheet .chips--small li { background: var(--paper-2); }

/* ===== Palette RPG : or sur fonds sombres, bleu de fenêtre de dialogue ===== */
.screen .pixel-label, .contact .pixel-label, .chap--night .pixel-label { color: var(--gold); }
.screen .progress i.on { background: var(--gold); border-color: var(--gold); }
.screen .progress i { border-color: var(--night-ink-2); }
.dialog { background: var(--window); }
.dialog__name { background: var(--gold); color: var(--ink); }
.badge { background: var(--gold); color: var(--ink); }
.nets li:first-child .net { background: var(--window); }
.nets li:first-child .net__pf { color: var(--gold); }
.nets li:first-child .net__role { color: #DCCEF0; }
.nets li:first-child .net__total { background: var(--gold); color: var(--ink); }
.blip { background: var(--gold); box-shadow: 0 0 0 2px var(--ink); }
.timeline li:last-child .timeline__node::before { background: var(--gold); border-color: var(--ink); }
.player__btn span { background: var(--gold); color: var(--ink); }
.contact .btn:hover { background: var(--gold); color: var(--ink); box-shadow: 0 -3px 0 0 var(--gold), 0 3px 0 0 var(--gold), -3px 0 0 0 var(--gold), 3px 0 0 0 var(--gold); }
.contact__links a { border-bottom-color: var(--gold); }
.screen .pixel-label::after { color: var(--gold); }
.card:hover .play { background: var(--gold); }
.card:hover .play::before { border-left-color: var(--ink); }
.stat:first-child dd { color: var(--accent-ink); }

/* Briques en pixel sur les écrans sombres */
.screen, .contact { background-color: var(--night); background-image: var(--bricks); background-size: 48px 48px; }

.screen::after { background: linear-gradient(90deg, var(--night) 50%, transparent 50%) 0 0 / 24px 12px repeat-x; }
.contact::before { background: linear-gradient(90deg, var(--night) 50%, transparent 50%) 12px 0 / 24px 12px repeat-x; }

/* Lierre */
.screen, .contact { position: relative; }
.screen__in, .contact__in { position: relative; z-index: 2; }
.ivy { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.ivy__wrap { position: absolute; top: 0; display: block; transform-origin: 50% 0; }
.ivy__strand { display: block; image-rendering: pixelated; }
@media (prefers-reduced-motion: no-preference) {
  .ivy__wrap { animation: sway 7s ease-in-out infinite alternate; }
  @keyframes sway { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
}
@media (max-width: 1100px) { .ivy--wide { display: none; } }
@media (max-width: 700px) { .ivy--edge { display: none; } .ivy__strand { transform: scale(.75); transform-origin: 50% 0; } }
.ivy::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: repeating-linear-gradient(90deg, #1C0F30 0 22px, #140A24 22px 24px); }
@media (max-width: 700px) { .ivy__wrap:nth-child(6) { display: none; } .ivy__strand { transform: scale(.6); } .screen__in, .contact__in { padding-top: 96px; } }

/* Finitions */
.poster--quote { background: var(--window); color: var(--gold); }
.chips li { background: #FBF9FD; border: 1.5px solid #BBAAD3; color: var(--ink); }
.chips--small li { border-width: 1.5px; }
.atout { background: #FBF9FD; }
.sheet-card { background: #FBF9FD; }
.net { background: #FBF9FD; }
.dialog__text { color: #F3EFF7; }
.hero__title span + span { color: var(--accent); }

/* ===== Couche « jeu » ===== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* barre d'XP sous l'en-tête */
.top { position: sticky; }
.xp { position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--paper-2); overflow: hidden; }
.xp__fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent) 0%, #9B6BDF 70%, var(--gold) 100%); }
.xp::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, var(--paper) 10px 12px); }
/* compteur de succès */
.hud { display: inline-flex; align-items: baseline; gap: 3px; font: 400 .72rem/1 var(--f-pixel); text-transform: uppercase; padding: 7px 9px;
  background: var(--ink); color: var(--paper); white-space: nowrap; }
.hud b { font-weight: 400; color: var(--gold); font-size: .9rem; }
.hud__star { color: var(--gold); margin-right: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .hud.is-pop { animation: pop .45s steps(3); }
  @keyframes pop { 40% { transform: scale(1.25); } }
}
/* notifications */
.toasts { position: fixed; z-index: 60; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--window); color: var(--paper);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 2px #6E54A0; margin: 3px; }
.toast__star { flex: none; width: 30px; height: 30px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-size: 1.05rem; }
.toast__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.toast__label { font: 400 .66rem/1 var(--f-pixel); text-transform: uppercase; color: var(--gold); }
.toast__t { font-size: .9rem; line-height: 1.35; }
.toast--secret .toast__star { background: var(--paper); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toastIn .35s steps(4) both; }
  .toast.is-out { animation: toastOut .3s steps(3) both; }
  @keyframes toastIn { from { transform: translateX(-24px); opacity: 0; } }
  @keyframes toastOut { to { transform: translateX(-24px); opacity: 0; } }
}
.toast.is-out { opacity: 0; }
/* apparitions */
.anim .reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.anim .reveal.is-in { opacity: 1; transform: none; }
.anim .screen h2.reveal { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); transition: clip-path .7s steps(14); }
.anim .screen h2.reveal.is-in { clip-path: inset(0 0 0 0); }
/* lucioles */
.motes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
/* curseur de sélection sur les vignettes */
.media::after { content: ""; position: absolute; inset: 10px; z-index: 2; pointer-events: none; opacity: 0;
  --c: var(--gold);
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 4px no-repeat, linear-gradient(var(--c), var(--c)) top left / 4px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 16px 4px no-repeat, linear-gradient(var(--c), var(--c)) top right / 4px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 4px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 4px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 4px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 4px 16px no-repeat;
  transition: opacity .12s steps(2), inset .2s steps(3); }
.card:hover .media::after, .card:focus-within .media::after { opacity: 1; inset: 6px; }
.badge, .play { z-index: 3; }
/* réseaux : petit saut au survol */
.net { transition: transform .15s steps(2), box-shadow .15s steps(2); }
.net:hover { transform: translate(-2px, -3px); }
/* démo de la chaîne IA */
.pipe { margin-top: 18px; background: var(--window); color: var(--paper); padding: 16px 16px 14px; max-width: 420px;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink); margin-left: 4px; }
.pipe__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.pipe__label { font: 400 .68rem/1.2 var(--f-pixel); text-transform: uppercase; color: var(--gold); }
.pipe__replay { all: unset; cursor: pointer; font: 400 .64rem/1 var(--f-pixel); text-transform: uppercase; padding: 6px 8px; border: 2px solid #8E76B8; color: var(--paper); }
.pipe__replay:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.pipe__replay:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pipe__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pipe__list li { display: grid; grid-template-columns: minmax(0, 1fr) 72px 40px; gap: 10px; align-items: center; font-size: .88rem; opacity: .45; transition: opacity .2s; }
.pipe__list li.is-run, .pipe__list li.is-ok { opacity: 1; }
.pipe__bar { height: 8px; background: #1C0F30; position: relative; overflow: hidden; }
.pipe__bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: var(--gold); }
.pipe__list li.is-run .pipe__bar i { transform: scaleX(1); transition: transform .6s steps(8); }
.pipe__list li.is-ok .pipe__bar i { transform: scaleX(1); background: #9BE38B; }
.pipe__who { font: 400 .62rem/1 var(--f-pixel); text-transform: uppercase; text-align: center; padding: 4px 0; background: #1C0F30; color: #C9A8F5; }
.pipe__who.is-me { background: var(--gold); color: var(--ink); }
.pipe__done { margin-top: 12px; font: 400 .68rem/1.4 var(--f-pixel); text-transform: uppercase; color: #9BE38B; visibility: hidden; }
.pipe.is-done .pipe__done { visibility: visible; }
@media (prefers-reduced-motion: no-preference) { .pipe.is-done .pipe__done { animation: blink 1s steps(1) 3; } }
/* code secret */
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.foot__hint { font-family: var(--f-pixel); font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
@media (max-width: 420px) { .hud span:not(.hud__star):not(.sr) { display: none; } }
/* étoiles cachées */
.gem { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 30px; height: 30px; cursor: pointer; opacity: .7; z-index: 4; }
.gem svg { image-rendering: pixelated; transition: transform .12s steps(2); }
.gem:hover { opacity: 1; } .gem:hover svg { transform: scale(1.3); }
.gem:focus-visible { outline: 3px solid var(--gold); outline-offset: 0; opacity: 1; }
.gem--corner { position: absolute; top: 6px; right: 6px; }
.gem--inline { vertical-align: middle; margin-left: 6px; }
.gem--screen { position: absolute; right: 7%; bottom: 26px; }
.gem--end { position: absolute; right: max(16px, 4vw); bottom: 28px; }
@media (prefers-reduced-motion: no-preference) {
  .gem { animation: twinkle 2.6s steps(1) infinite; }
  @keyframes twinkle { 0%, 80% { opacity: .65; } 85% { opacity: 1; } 90% { opacity: .4; } 95% { opacity: 1; } }
  .gem.is-found { animation: grab .45s steps(5) forwards; }
  @keyframes grab { 40% { transform: scale(1.6) translateY(-6px); opacity: 1; } 100% { transform: scale(.2) translateY(-24px); opacity: 0; } }
}
.gem.is-found { pointer-events: none; }
