/* Laboratoire audio. Direction artistique de style.css, en Light et en Dark : le cahier est en papier, l'établi en bakélite. */
:root {
    color-scheme: light;
    --ground: #e4c681;
    --ink: #1b1610;
    --on-ink: #fbe4a6;
    --surface: #fbe4a6;
    --border: #86651a;
    --text: #1b1610;
    --text-muted: #4f3f16;
    --danger: #9c1f12;
    --bakelite: #1f1a17;
    --ring: #0f4f5a;
    --paper-line: #86651a24; /* papier millimétré */

    /* L'établi garde son éclairage : ces couleurs ne changent pas avec le thème */
    --hollow: #0f0c0a;
    --panel-line: #453a31;
    --dim: #6d6152;
    --on-panel: #f9e7b8;
    --on-panel-muted: #cbb78e;
    --led-rare: #58bcc4;
    --led-epic: #f190b4;
    --led-jaune: #f3c34b;
    --led-crete: #ff5a3a;
    --led-ok: #86bd92;
    --led-started: #f0a04b;

    --display: "Anybody", "Arial Black", sans-serif;
    --body: "Atkinson Hyperlegible Next", "Segoe UI", sans-serif;
    --radius: 6px;
    --gutter: clamp(1rem, 4vw, 4rem);
    --tap: 44px;
}
[data-theme="dark"] {
    color-scheme: dark;
    --ground: #15110e;
    --ink: #f6dfa8;
    --on-ink: #15110e;
    --surface: #241c16;
    --border: #8d7750;
    --text: #f6dfa8;
    --text-muted: #c2a976;
    --danger: #ff8a6b;
    --bakelite: #2e2620;
    --ring: #79c9cf;
    --paper-line: #8d775014;
}
[data-led="rare"] { --led: var(--led-rare); }
[data-led="epic"] { --led: var(--led-epic); }
[data-led="jaune"] { --led: var(--led-jaune); }
[data-led="crete"] { --led: var(--led-crete); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: repeating-linear-gradient(var(--paper-line) 0 1px, transparent 1px 1.5rem), repeating-linear-gradient(90deg, var(--paper-line) 0 1px, transparent 1px 1.5rem), var(--ground);
    color: var(--text);
    font: 400 1.0625rem/1.55 var(--body);
    overflow-x: clip;
}
main:focus { outline: none; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; cursor: pointer; }
a { color: inherit; }
canvas, svg { display: block; }
::selection { background: var(--ink); color: var(--on-ink); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.bench :focus-visible { outline-color: var(--led-rare); }

.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 30; padding: 0.75rem 1rem; background: var(--ink); color: var(--on-ink); }
.skip-link:focus { top: 1rem; }

/* ---------- En-tête ---------- */

.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.5rem 1.5rem; height: 4rem; padding-inline: var(--gutter); background: var(--ground); border-bottom: 2px solid var(--ink); }
.back { display: inline-flex; flex: none; align-items: center; gap: 0.625rem; min-height: var(--tap); font: 650 1rem/1 var(--display); font-variation-settings: "wdth" 88; text-decoration: none; }
.back__arrow { width: 0.75rem; height: 0.75rem; border: solid currentColor; border-width: 0 0 3px 3px; rotate: 45deg; transition: translate 0.15s; }
.back:hover .back__arrow { translate: -4px 0; }
.volume { display: flex; align-items: center; gap: 0.75rem; font-size: 0.9375rem; font-weight: 600; }
.volume input { width: 8rem; min-height: var(--tap); margin: 0; accent-color: var(--ink); cursor: pointer; }
.volume output { min-width: 3.25rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Progression, à droite du retour au portfolio : un voyant par expérience (lien vers elle), puis le compte */
.progress { display: flex; align-items: center; gap: 0.875rem; min-width: 0; margin-right: auto; padding-left: 1.25rem; border-left: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); font-size: 0.9375rem; font-weight: 600; }
.progress__count { white-space: nowrap; }
.progress__count strong { font: 800 1.0625rem/1 var(--display); font-variation-settings: "wdth" 92; }
.lamps { display: flex; gap: 0.375rem; }
.lamp { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); font: 750 0.9375rem/1 var(--display); text-decoration: none; transition: background-color 0.3s, color 0.3s, box-shadow 0.3s; }
.lamp::before { content: ""; position: absolute; inset: -0.375rem -0.1875rem; } /* zone de clic de 44 px */
.lamp:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
/* Voyant de mise sous tension du moteur audio, à gauche du volume */
.power { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.2; }
.power .status { white-space: nowrap; }
:is(.theme, .lang) { display: flex; padding: 3px; border-radius: var(--radius); box-shadow: inset 0 0 0 2px var(--ink); }
:is(.theme, .lang) button { display: grid; place-items: center; width: 2.5rem; min-height: 2.375rem; border-radius: 4px; font: 650 0.9375rem/1 var(--display); font-variation-settings: "wdth" 88; }
.theme svg { width: 1.375rem; height: 1.375rem; }
:is(.theme, .lang) button[aria-pressed="true"] { color: var(--on-ink); }
.theme + .lang { margin-left: -0.75rem; } /* les deux interrupteurs vont ensemble */
/* Le curseur glisse d'un choix à l'autre, et le choix fait s'anime. :root.is-ready (theme.js) : le curseur ne glisse pas au chargement. .is-switching : posée au clic, elle anime le nouveau choix. */
:is(.theme, .lang) { position: relative; isolation: isolate; }
:is(.theme, .lang)::before { content: ""; position: absolute; z-index: -1; inset: 3px auto 3px 3px; width: calc(50% - 3px); border-radius: 4px; background: var(--ink); }
:is(.theme, .lang):has(> :last-child[aria-pressed="true"])::before { translate: 100% 0; }
:root.is-ready :is(.theme, .lang)::before { transition: translate 0.35s cubic-bezier(0.3, 1.4, 0.5, 1); }
:root.is-ready :is(.theme, .lang) button { transition: color 0.25s; }
.lang.is-switching button[aria-pressed="true"] { animation: switch-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
.theme.is-switching [data-set-theme="light"][aria-pressed="true"] svg { animation: sun-in 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
.theme.is-switching [data-set-theme="dark"][aria-pressed="true"] svg { animation: moon-in 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes sun-in { from { rotate: -90deg; scale: 0.6; } }
@keyframes moon-in { from { rotate: 40deg; scale: 0.6; } 60% { rotate: -12deg; } }
@keyframes switch-pop { from { scale: 0.7; } }
@media (prefers-reduced-motion: reduce) { :root.is-ready :is(.theme, .lang)::before, :is(.theme, .lang) * { transition: none !important; animation: none !important; } }

/* ---------- Console : le titre ---------- */

.console { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(1.5rem, 5vh, 3.5rem) var(--gutter); background: var(--bakelite); color: var(--on-panel); }
.console__name { margin-bottom: 0.75rem; font-weight: 600; color: var(--on-panel-muted); }
.console h1 { font: 850 clamp(2.5rem, 5.6vw, 5.25rem)/0.92 var(--display); font-variation-settings: "wdth" 104; letter-spacing: -0.015em; text-wrap: balance; }
.console__intro { max-width: 34rem; margin-top: 1.25rem; font-size: 1.25rem; line-height: 1.4; }

/* Deux couleurs seulement : orange pour une expérience commencée, vert pour une expérience menée */
.lamp.is-started { --lamp: var(--led-started); }
.lamp.is-on { --lamp: var(--led-ok); }
.lamp:is(.is-started, .is-on) { background: var(--lamp); box-shadow: 0 0 1rem color-mix(in srgb, var(--lamp) 55%, transparent); color: #15110e; }
/* État du moteur : une ligne droite tant qu'il n'est pas chargé ; sous tension, la ligne se gonfle en une onde qui défile. */
.engine { flex: none; display: block; width: 2.5rem; height: 1rem; overflow: hidden; color: var(--ink); }
.engine svg { width: 100%; height: 100%; overflow: visible; }
.engine__wave { transform-box: view-box; transform-origin: 50% 50%; transform: scaleY(0.01); transition: transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1); }
.engine path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: engine-scroll 1.1s linear infinite; }
.engine[data-state="ready"] .engine__wave { transform: scaleY(1); animation: engine-swell 2.6s 0.45s ease-in-out infinite; } /* après le gonflement */
.engine:not([data-state="ready"]) path { animation-play-state: paused; }
.engine:is([data-state="locked"], [data-state="error"]) { color: var(--danger); }
@keyframes engine-scroll { to { transform: translateX(-10px); } }
@keyframes engine-swell { 0%, 100% { transform: scaleY(1); } 30% { transform: scaleY(0.55); } 55% { transform: scaleY(0.9); } 80% { transform: scaleY(0.45); } }
/* Le texte d'état n'est affiché que s'il faut agir : son bloqué ou erreur */
.power .status:not([data-state="locked"], [data-state="error"]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.status[data-state="error"] { color: var(--danger); }
.status[data-state="locked"] { color: var(--danger); }

@keyframes blink { to { opacity: 0.3; } }

/* ---------- Écrans ---------- */

.screen { --grid: #6d6152; position: relative; min-height: 7rem; overflow: hidden; border-radius: 4px; background: var(--hollow); box-shadow: inset 0 0 0 2px var(--panel-line); }
.scope { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--led, var(--led-rare)); }
.screen__title { position: absolute; left: 0.625rem; top: 0.375rem; font-size: 0.875rem; font-weight: 600; line-height: 1.3; color: var(--on-panel-muted); pointer-events: none; }
.curve { --text: var(--on-panel); position: absolute; inset: 1.5rem 0 0; width: 100%; height: calc(100% - 1.5rem); color: var(--led); }

.notice { margin: 2rem var(--gutter); padding: 1rem 1.25rem; border: 2px solid var(--danger); border-radius: var(--radius); background: var(--surface); color: var(--danger); white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Expériences : le cahier et l'établi ---------- */

.demos { display: grid; grid-template-columns: minmax(0, 1fr); padding: clamp(2rem, 6vh, 4rem) var(--gutter) 0; }
.exp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.5rem clamp(1.5rem, 3vw, 3rem); }
.notes { position: sticky; top: 5.5rem; align-self: start; }
.notes__number { font: 850 clamp(3.5rem, 6vw, 5.5rem)/0.8 var(--display); font-variation-settings: "wdth" 74; letter-spacing: -0.02em; color: var(--border); transition: color 0.3s; }
:is(.is-tried, .is-live) .notes__number { color: var(--ink); }
.notes__title { margin-top: 1rem; font: 800 clamp(1.5rem, 2.5vw, 2.25rem)/1.02 var(--display); font-variation-settings: "wdth" 100; letter-spacing: -0.01em; text-wrap: balance; }
.notes__text { max-width: 34rem; margin-top: 0.875rem; font-size: 1.125rem; line-height: 1.45; }
.notes__project { margin-top: 1rem; font-size: 0.9375rem; font-weight: 600; color: var(--text-muted); }
.protocol { max-width: 34rem; margin-top: 1.5rem; padding: 1.25rem; border-radius: var(--radius); background: var(--surface); }
.protocol__title { font: 750 1.125rem/1 var(--display); font-variation-settings: "wdth" 92; }
.steps { display: grid; gap: 0.75rem; margin-top: 1rem; }
.step { position: relative; padding-left: 2.25rem; line-height: 1.4; color: var(--text-muted); }
.step::before { content: ""; position: absolute; left: 0; top: 0.0625rem; width: 1.375rem; height: 1.375rem; border: 2px solid var(--border); border-radius: 4px; transition: background-color 0.2s, border-color 0.2s; }
.step::after { content: ""; position: absolute; left: 0.5rem; top: 0.25rem; width: 0.4375rem; height: 0.75rem; border: solid var(--on-ink); border-width: 0 3px 3px 0; opacity: 0; rotate: 40deg; scale: 0.4; transition: opacity 0.2s, scale 0.2s; }
.step.is-current { color: var(--text); font-weight: 600; }
.step.is-current::before { border-color: var(--ink); }
.step.is-done { color: var(--text); }
.step.is-done::before { background: var(--ink); border-color: var(--ink); }
.step.is-done::after { opacity: 1; scale: 1; }
.observation { margin-top: 1.25rem; padding-top: 0.5rem; border-top: 2px solid var(--border); }
.observation summary { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); cursor: pointer; list-style: none; }
.observation summary::-webkit-details-marker { display: none; }
.observation summary::after { content: ""; flex: none; width: 0.625rem; height: 0.625rem; margin-right: 0.25rem; border: solid currentColor; border-width: 0 3px 3px 0; rotate: 45deg; translate: 0 -2px; }
.observation[open] summary::after { rotate: 225deg; translate: 0 2px; }
.observation__title { font: 750 1.125rem/1 var(--display); font-variation-settings: "wdth" 92; }
.observation.is-revealed .observation__text { animation: reveal 0.6s ease-out; }
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }

.bench { position: relative; display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); gap: 1.25rem; padding: 1.25rem clamp(1rem, 2vw, 1.75rem) 1.75rem; border-radius: 10px; background: var(--bakelite); color: var(--on-panel); box-shadow: inset 0 0 0 2px var(--panel-line); transition: box-shadow 0.3s; }
.is-live .bench { box-shadow: inset 0 0 0 2px var(--led), 0 0 2.5rem color-mix(in srgb, var(--led) 35%, transparent); }
.bench__plate { display: flex; align-items: center; gap: 0.75rem; }
.bench__words { display: grid; gap: 0.3rem; }
.bench__kind { font-size: 0.9375rem; font-weight: 650; line-height: 1; color: var(--on-panel-muted); }
/* L'illustration du projet : nette derrière le titre, elle se fond dans la bakélite vers le bas */
.bench.has-art::before { content: ""; position: absolute; inset: 0 0 auto; height: 16rem; border-radius: 10px 10px 0 0; background: linear-gradient(color-mix(in srgb, var(--bakelite) 20%, transparent), color-mix(in srgb, var(--bakelite) 55%, transparent)), var(--art) 50% 40% / cover no-repeat; -webkit-mask: linear-gradient(#000 45%, transparent); mask: linear-gradient(#000 45%, transparent); pointer-events: none; }
.bench.has-art > :not(.jack) { position: relative; }
.bench.has-art .bench__plate { align-items: end; min-height: 7.5rem; }
.bench.has-art .bench__led { margin-bottom: 0.4rem; }
.bench.has-art .bench__words { text-shadow: 0 1px 0.75rem #000000b3; }
.bench.has-art .bench__kind { color: var(--on-panel); }
.bench__led { width: 0.875rem; height: 0.875rem; border-radius: 50%; background: var(--hollow); box-shadow: inset 0 0 0 2px var(--dim); transition: background-color 0.2s, box-shadow 0.2s; }
.is-live .bench__led { background: var(--led); box-shadow: 0 0 0.875rem var(--led); }
.bench__name { font: 800 1.75rem/1 var(--display); font-variation-settings: "wdth" 112; }
/* Les écrans prennent la hauteur que le cahier laisse */
.event { display: grid; grid-template: minmax(7rem, 1fr) auto / minmax(0, 1fr); gap: 1.5rem; }
.screens { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(7rem, 1fr); gap: 0.75rem; }
.controls { display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: center; gap: 1.5rem clamp(1.25rem, 2.4vw, 2.5rem); }
.control { display: grid; justify-items: center; gap: 0.75rem; }
.control__name { padding: 0; font-weight: 650; }
.control__knob { display: flex; align-items: end; gap: 0.5rem; }
.control__end { min-width: 3.25rem; padding-bottom: 0.25rem; font-size: 0.9375rem; font-weight: 600; text-align: right; color: var(--on-panel-muted); }
.control__end:last-child { text-align: left; }

/* Touche de lecture */
.key { display: grid; justify-items: center; gap: 0.75rem; min-width: 7.5rem; font-weight: 650; }
.key__cap { position: relative; display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%; background: var(--on-panel); box-shadow: 0 6px 0 #a08f62, 0 10px 14px #000000a6; transition: translate 0.1s, box-shadow 0.1s, background-color 0.2s; }
.key__cap::before { content: ""; margin-left: 6px; border-left: 1.5rem solid #1f1a17; border-block: 0.9375rem solid transparent; }
.key:hover .key__cap { background: #fff3c4; }
.key:active .key__cap, .key[aria-pressed="true"] .key__cap { translate: 0 5px; box-shadow: 0 1px 0 #a08f62, 0 2px 4px #000000a6; }
.key[aria-pressed="true"] .key__cap { background: var(--led); box-shadow: 0 1px 0 #00000080, 0 0 1.5rem color-mix(in srgb, var(--led) 60%, transparent); }
.key[aria-pressed="true"] .key__cap::before { width: 1.5rem; height: 1.5rem; margin: 0; border: 0; border-radius: 2px; background: #1f1a17; }
.key[data-state="loading"] .key__cap { translate: 0 5px; box-shadow: 0 1px 0 #a08f62, 0 2px 4px #000000a6; animation: blink 0.5s ease-in-out infinite alternate; }
.key[aria-disabled="true"] { cursor: wait; opacity: 0.5; }
.key[aria-disabled="true"] .key__cap { translate: none; background: var(--on-panel); }
.key:is([data-state="missing"], [data-state="error"]) .key__cap { background: transparent; box-shadow: inset 0 0 0 3px var(--led-jaune); }
.key:is([data-state="missing"], [data-state="error"]) .key__label { color: var(--led-jaune); }
.key:focus-visible { outline: none; }
.key:focus-visible .key__cap { outline: 3px solid var(--led-rare); outline-offset: 5px; }

/* Potard */
.knob { position: relative; width: 8.5rem; aspect-ratio: 1; border-radius: 50%; cursor: grab; touch-action: none; }
.knob.is-turning { cursor: grabbing; }
.knob:has(:focus-visible) { outline: 3px solid var(--led-rare); outline-offset: 2px; }
.knob__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.knob__input.is-reversed { direction: rtl; }
.knob__dial { width: 100%; height: 100%; }
.knob__tick { fill: none; stroke: var(--dim); stroke-width: 1.2; }
.knob__lit { fill: none; stroke: var(--led); stroke-width: 3.5; stroke-linecap: round; }
.knob__body { fill: var(--on-panel); }
.knob__rotor path { fill: none; stroke: #1f1a17; stroke-width: 5; stroke-linecap: round; }
.knob:hover .knob__body { fill: #fff3c4; }

/* Levier */
.lever { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem; min-height: 5rem; font: 750 1.125rem/1 var(--display); font-variation-settings: "wdth" 92; }
.lever__side { color: var(--on-panel-muted); text-align: right; transition: color 0.2s; }
.lever__side:last-child { text-align: left; }
.lever__side.is-on { color: var(--led); }
.lever__plate { position: relative; width: 7rem; height: 3.5rem; border-radius: 1.75rem; background: var(--hollow); box-shadow: inset 0 0 0 2px var(--panel-line); }
.lever__stick { position: absolute; left: 0.375rem; top: 0.375rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--on-panel); box-shadow: 0 3px 6px #000000a6; transition: translate 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), background-color 0.2s; }
.lever[aria-checked="true"] .lever__stick { translate: 3.5rem 0; background: var(--led); }
.lever:hover .lever__stick { background: #fff3c4; }

/* Touches à choix */
.pads { min-width: 0; margin: 0; padding: 0; border: 0; flex: 1 1 100%; }
.pads__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.pad { position: relative; display: grid; }
.pad input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pad__key { display: grid; align-content: start; gap: 0.375rem; min-height: 5.5rem; padding: 0.625rem 0.75rem; border-radius: 4px; background: #453a31; box-shadow: 0 4px 0 var(--hollow); font-size: 0.9375rem; font-weight: 600; line-height: 1.2; transition: translate 0.1s, box-shadow 0.1s, background-color 0.2s; }
.pad__number { font: 800 1.25rem/1 var(--display); color: var(--led); }
.pad:hover .pad__key { background: #564a3f; }
.pad input:checked + .pad__key { translate: 0 3px; background: var(--led); box-shadow: 0 1px 0 var(--hollow); color: #15110e; }
.pad input:checked + .pad__key .pad__number { color: inherit; }
.pad input:focus-visible + .pad__key { outline: 3px solid var(--on-panel); outline-offset: 2px; }
.pad input:disabled { cursor: not-allowed; }
.pad input:disabled + .pad__key { background: var(--hollow); box-shadow: inset 0 0 0 2px var(--panel-line); color: var(--dim); }
.pad input:disabled + .pad__key .pad__number { color: var(--dim); }
.pad.is-passed .pad__key { translate: 0 3px; } /* étape passée : la touche reste enfoncée, éteinte */
.pad.is-next .pad__key { box-shadow: 0 4px 0 var(--hollow), inset 0 0 0 2px var(--led); }
.pads__reset { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); margin-top: 0.875rem; padding: 0 1.125rem 0 0.875rem; border-radius: var(--radius); background: var(--on-panel); color: #1f1a17; font: 650 1rem/1 var(--display); font-variation-settings: "wdth" 92; box-shadow: 0 4px 0 #a08f62; transition: translate 0.1s, box-shadow 0.1s; }
.pads__reset svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pads__reset:hover { background: #fff3c4; }
.pads__reset:active { translate: 0 3px; box-shadow: 0 1px 0 #a08f62; }
.pads__reset:not([hidden]) { animation: reveal-reset 0.3s ease-out; }
@keyframes reveal-reset { from { opacity: 0; translate: 0 -0.5rem; } }

/* Vue de dessus */
.map { --accent: var(--led); position: relative; width: 100%; max-width: 26rem; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: repeating-radial-gradient(var(--panel-line) 0 1px, transparent 1px 12.5%), linear-gradient(var(--panel-line) 0 0) 50% / 1px 100% no-repeat, linear-gradient(var(--panel-line) 0 0) 50% / 100% 1px no-repeat, var(--hollow); box-shadow: inset 0 0 0 2px var(--panel-line); }
.map__ring, .map__listener, .map__blast, .map__target { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.map__ring { border: 1px dashed var(--accent); }
.map__ring--max { background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* Toute la vue est le bouton ; hors de la portée, le clic ne fait rien */
.map__surface { position: absolute; inset: 0; border-radius: 50%; cursor: crosshair; }
.map__surface.is-out { cursor: default; }
.map__surface[aria-disabled="true"] { cursor: wait; }
.map__surface:focus-visible { outline: 3px solid var(--led-rare); outline-offset: 3px; }
.map__blast { width: 1.25rem; height: 1.25rem; background: var(--led); opacity: 0; box-shadow: 0 0 1rem var(--led); }
.map__blast.is-set { opacity: 1; }
.map__surface[data-state="loading"] ~ .map__blast { animation: blink 0.5s ease-in-out infinite alternate; }
.map__surface:is([data-state="missing"], [data-state="error"]) ~ .map__blast { background: var(--led-jaune); }
/* La cible du clavier : une mire, seulement quand la vue a le focus au clavier */
.map__target { width: 1.75rem; height: 1.75rem; border: 2px solid var(--on-panel); opacity: 0; }
.map__target::before, .map__target::after { content: ""; position: absolute; left: 50%; top: 50%; background: var(--on-panel); translate: -50% -50%; }
.map__target::before { width: 2px; height: 0.5rem; }
.map__target::after { width: 0.5rem; height: 2px; }
.map__surface:focus-visible ~ .map__target { opacity: 1; }
.map__shockwave { border: 3px solid var(--led); opacity: 0; pointer-events: none; }
.map__label { position: absolute; left: 50%; transform: translate(-50%, -100%); padding-bottom: 0.125rem; font-size: 0.8125rem; line-height: 1; pointer-events: none; }
.map__listener { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 2px solid var(--on-panel); background: var(--bakelite); color: var(--on-panel); }
.map__listener svg { width: 1.5rem; height: 1.5rem; }
.map__readout { position: absolute; left: 50%; bottom: 0.125rem; transform: translateX(-50%); font-size: 0.875rem; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }

/* Prises et câbles : le signal passe d'une expérience à l'autre */
.jack { position: absolute; left: 70%; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--hollow); box-shadow: 0 0 0 4px #a08f62, inset 0 0 0 4px var(--dim); translate: -50% 0; z-index: 2; }
.jack--in { top: -0.875rem; }
.jack--out { bottom: -0.875rem; }
.exp:first-child .jack--in, .exp:last-child .jack--out { display: none; }
.cable { z-index: 1; width: calc((100% - clamp(1.5rem, 3vw, 3rem)) * 1.3 / 2.3); height: clamp(6rem, 12vw, 9rem); margin-left: auto; overflow: visible; fill: none; stroke-linecap: round; pointer-events: none; }
.cable path { vector-effect: non-scaling-stroke; }
.cable__sleeve { stroke: var(--ink); stroke-width: 11; }
[data-theme="dark"] .cable__sleeve { stroke: #564a3f; }
.cable__signal { stroke: var(--led-rare); stroke-width: 4; stroke-dasharray: 3 7; opacity: 0.25; }
.exp.is-tried + .cable .cable__signal { opacity: 0.8; }
.exp.is-live + .cable .cable__signal { opacity: 1; animation: signal 1s linear infinite; }
[data-led="rare"] + .cable { --c: var(--led-rare); }
[data-led="epic"] + .cable { --c: var(--led-epic); }
[data-led="jaune"] + .cable { --c: var(--led-jaune); }
[data-led="crete"] + .cable { --c: var(--led-crete); }
.cable__signal { stroke: var(--c); }
@keyframes signal { to { stroke-dashoffset: -10; } }

/* ---------- Fin ---------- */

.outro { margin-top: clamp(3rem, 9vh, 6rem); padding: clamp(3rem, 8vh, 5rem) var(--gutter); background: var(--bakelite); color: var(--on-panel); }
.outro h2 { font: 850 clamp(2rem, 4.4vw, 3.5rem)/0.95 var(--display); font-variation-settings: "wdth" 108; letter-spacing: -0.01em; text-wrap: balance; }
.outro p { max-width: 38rem; margin: 1rem 0 1.75rem; font-size: 1.25rem; line-height: 1.4; }
.outro__link { display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.5rem; border-radius: var(--radius); background: var(--on-panel); color: #1f1a17; font: 650 1.0625rem/1 var(--display); font-variation-settings: "wdth" 92; text-decoration: none; }
.outro__link:hover { background: #fff3c4; }
.outro__link:focus-visible { outline-color: var(--led-rare); }
.site-footer { padding: 1.5rem var(--gutter); background: var(--bakelite); color: var(--on-panel-muted); font-size: 0.9375rem; }

@media (max-width: 64rem) {
    /* La progression passe sur une seconde ligne de l'en-tête */
    html { scroll-padding-top: 7.5rem; }
    .site-header { flex-wrap: wrap; height: auto; min-height: 4rem; padding-block: 0.5rem; row-gap: 0.25rem; }
    .back { margin-right: auto; }
    .progress { order: 1; flex-basis: 100%; margin: 0; padding: 0.375rem 0 0.125rem; border-left: 0; border-top: 2px solid color-mix(in srgb, var(--ink) 18%, transparent); }
    .console, .exp { grid-template-columns: minmax(0, 1fr); }
    .notes { position: static; }
    .notes__title, .notes__text, .protocol { max-width: 44rem; }
    .exp + .cable { height: 4rem; visibility: hidden; } /* en colonne, les modules ne se touchent plus */
    .jack { display: none; }
}
@media (max-width: 40rem) {
    .site-header { gap: 0.25rem 0.75rem; min-height: 3.5rem; }
    .progress__count span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* « 0 sur 4 » suffit ; la suite reste lue */
    .volume { flex: 1; min-width: 0; gap: 0.5rem; justify-content: flex-end; }
    .volume label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .volume input { flex: 1; width: auto; min-width: 3rem; max-width: 8rem; }
    .volume output { min-width: 2.75rem; }
    .power .status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    :is(.theme, .lang) button[aria-pressed="true"] { display: none; } /* un seul bouton : celui de l'autre choix */
    :is(.theme, .lang)::before { display: none; }
    .is-switching:is(.theme, .lang) button { animation: switch-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
    .theme + .lang { margin-left: -0.25rem; }
    .pads__row { grid-template-columns: minmax(0, 1fr); }
    .pad__key { grid-template-columns: 1.5rem minmax(0, 1fr); align-items: center; min-height: var(--tap); }
    .lever { gap: 0.625rem; font-size: 1rem; }
    .lever__plate { width: 6rem; }
    .lever[aria-checked="true"] .lever__stick { translate: 2.5rem 0; }
    .knob { width: 8rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
