/* ==========================================================================
   Synapse — V11
   Feuille de styles unique. Pas de framework : tout est ici.
   Sommaire : 1. Polices  2. Variables  3. Base  4. En-tête  5. Boutons
   6. Mises en page  7. Accueil  8. Services  9. Méthode  10. Réalisations
   11. Qui on est  12. Contact  13. Pied de page  14. Animations
   ========================================================================== */

/* 1. Polices (auto-hébergées : rien n'est chargé chez Google, plus simple pour le RGPD)
   Trois voix : Geist (le système, tout le texte), Instrument Serif italique (la voix humaine,
   les mots-clés des titres), Geist Mono (le code, les étiquettes). */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-ext-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* 2. Variables
   Deux modes : sombre (« ardoise », par défaut) et clair (« clair »).
   Le visiteur choisit avec le bouton soleil / lune de l'en-tête ; sinon, le réglage de son appareil s'applique.
   La 3D lit les variables --gl-* : elle change de couleurs avec le mode. */
:root, [data-theme="ardoise"] {
  --ink-0: oklch(0.205 0.012 255);
  --ink-1: oklch(0.235 0.014 255);
  --ink-2: oklch(0.27 0.016 255);
  --ink-3: oklch(0.33 0.018 255);
  --line: oklch(0.52 0.015 255 / 0.4);
  --line-strong: oklch(0.66 0.015 255 / 0.45);
  --text: oklch(0.97 0.004 250);
  --text-2: oklch(0.85 0.01 250);
  --text-3: oklch(0.75 0.014 250);
  --mint: oklch(0.78 0.13 235);
  --on-mint: oklch(0.18 0.04 250);
  --ember: oklch(0.83 0.13 78);
  --gl-light: 0;
  --gl-bg: #14171d;
  --gl-accent: #55c4fe;
  --gl-text: #f3f5f8;
  --gl-text-2: #c9ced4;
  --gl-warm: #f6bc5d;
  --gl-dust: #727c86;
  --gl-rest: #464e58;
  --gl-card: rgba(28,33,40,0.96);
  --gl-card-ok: rgba(16,38,53,0.97);
  --gl-card-line: rgba(167,175,183,0.35);
  color-scheme: dark;
}
[data-theme="clair"] {
  --ink-0: oklch(0.975 0.004 245);
  --ink-1: oklch(0.995 0.002 245);
  --ink-2: oklch(0.95 0.006 245);
  --ink-3: oklch(0.9 0.01 245);
  --line: oklch(0.3 0.03 255 / 0.14);
  --line-strong: oklch(0.3 0.03 255 / 0.28);
  --text: oklch(0.2 0.035 260);
  --text-2: oklch(0.38 0.03 258);
  --text-3: oklch(0.5 0.025 255);
  --mint: oklch(0.53 0.1 195);
  --on-mint: oklch(0.99 0.0 0);
  --ember: oklch(0.6 0.15 45);
  --gl-light: 1;
  --gl-bg: #f5f7f9;
  --gl-accent: #007d7e;
  --gl-text: #0c1626;
  --gl-text-2: #394353;
  --gl-warm: #c65d26;
  --gl-dust: #93a0ae;
  --gl-rest: #aeb9c4;
  --gl-card: rgba(252,254,255,0.96);
  --gl-card-ok: rgba(231,250,249,0.97);
  --gl-card-line: rgba(90,100,114,0.35);
  color-scheme: light;
}

:root {
  --mint-soft: color-mix(in oklch, var(--mint) 13%, transparent);
  --ember-soft: color-mix(in oklch, var(--ember) 13%, transparent);

  --font: "Geist", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Échelle typographique fluide (ratio ~1.3) */
  --step--1: clamp(0.84rem, 0.81rem + 0.12vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.15rem);
  --step-3: clamp(1.95rem, 1.5rem + 2.1vw, 3.25rem);
  --step-4: clamp(2.45rem, 1.6rem + 4vw, 5.2rem);

  --space-s: clamp(0.75rem, 0.7rem + 0.3vw, 1rem);
  --space-m: clamp(1.25rem, 1rem + 1vw, 2rem);
  --space-l: clamp(2rem, 1.5rem + 2.5vw, 4rem);
  --space-xl: clamp(3.5rem, 2.5rem + 5vw, 7.5rem);

  --gutter: clamp(1.25rem, 0.6rem + 3.5vw, 4rem);
  --max: 1240px;
  --header-h: 68px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Échelle des plans (z-index) */
  --z-gl: 0;
  --z-content: 1;
  --z-sticky: 10;
  --z-header: 20;
  --z-menu: 30;
  --z-toast: 40;

}

/* 3. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; text-wrap: pretty; }
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.042em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 620; letter-spacing: -0.05em; line-height: .98; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
/* la voix humaine : les mots-clés des titres, en italique serif */
h1 em, h2 em, .serif {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 1.1em; line-height: 0; letter-spacing: -0.012em;
  color: var(--mint); padding-right: .05em;
}
strong { font-weight: 650; color: var(--text); }
::selection { background: var(--mint); color: var(--on-mint); }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 1rem; top: -100px; z-index: var(--z-toast);
  background: var(--mint); color: var(--on-mint); padding: .6rem 1rem; border-radius: 6px;
  font-weight: 650; text-decoration: none;
}
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--text-2); max-width: 38ch; }
.muted { color: var(--text-2); }
.small { font-size: var(--step--1); color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0; }
.prose { max-width: 62ch; color: var(--text-2); }
.prose p:last-child { margin-bottom: 0; }
.mint { color: var(--mint); }
.ember { color: var(--ember); }

/* 4. En-tête */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header);
  height: var(--header-h);
  view-transition-name: site-header;
  transition: background-color .4s var(--ease-out), border-color .4s var(--ease-out), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in oklch, var(--ink-0) 82%, transparent);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 2rem; }
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; font-weight: 640; font-size: 1.12rem; letter-spacing: -0.035em;
}
.brand img { width: 30px; height: 30px; border-radius: 50%; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a {
  position: relative; padding: .5rem .8rem; border-radius: 6px;
  text-decoration: none; color: var(--text-2); font-size: .95rem; font-weight: 500;
  transition: color .2s;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: .2rem; height: 2px;
  background: var(--mint); border-radius: 2px;
}
.menu-btn {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line-strong); color: var(--text);
  font: 600 .9rem var(--font); padding: .5rem .9rem; border-radius: 999px; cursor: pointer;
}
.mobile-menu {
  position: fixed; inset: 0; z-index: var(--z-menu);
  background: var(--ink-0);
  padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  display: flex; flex-direction: column; gap: .25rem;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a {
  text-decoration: none; font-size: var(--step-3); font-weight: 600; letter-spacing: -0.045em;
  padding: .35rem 0; border-bottom: 1px solid var(--line);
}
.mobile-menu a[aria-current="page"] { color: var(--mint); }
.mobile-menu .btn { margin-top: 1.5rem; font-size: 1rem; padding: .95rem 1.35rem; align-self: flex-start; border-bottom: 0; }
.mobile-menu-close {
  position: absolute; top: 14px; right: var(--gutter);
  background: none; border: 1px solid var(--line-strong); color: var(--text);
  font: 600 .9rem var(--font); padding: .5rem .9rem; border-radius: 999px; cursor: pointer;
}



/* 5. Boutons & liens */
.btn {
  --bg: var(--mint); --fg: var(--on-mint);
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--bg); color: var(--fg);
  font: 560 .98rem/1 var(--font); letter-spacing: -0.01em;
  padding: .95rem 1.35rem; border-radius: 8px; border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px color-mix(in oklch, var(--mint) 55%, transparent); }
.btn:active { transform: translateY(0); }
.btn .arrow { transition: transform .25s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--ghost { --bg: transparent; --fg: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--text-2); box-shadow: none; }
.btn--small { padding: .62rem 1rem; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--mint); text-decoration: none; font-weight: 600;
  border-bottom: 1px solid color-mix(in oklch, var(--mint) 35%, transparent); padding-bottom: 2px;
  transition: border-color .2s, gap .25s var(--ease-out);
}
.link-arrow:hover { border-color: var(--mint); gap: .7rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: var(--space-m); }

/* 6. Mises en page communes */
main { position: relative; z-index: var(--z-content); }
.section { padding-block: var(--space-xl); position: relative; }
.section--tight { padding-block: var(--space-l); }
.section-head { max-width: 46rem; margin-bottom: var(--space-l); }
.section-head p { margin-top: var(--space-s); }

/* Toile WebGL */
.gl { position: fixed; inset: 0; z-index: var(--z-gl); width: 100%; height: 100%; pointer-events: none; }
.gl canvas { width: 100% !important; height: 100% !important; }
.no-webgl .gl { display: none; }
.gl-fallback { display: none; }
.no-webgl .gl-fallback { display: block; }

/* Voile pour garder le texte lisible devant la 3D */
.scrim { position: relative; }
.scrim::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in oklch, var(--ink-0) 95%, transparent) 0%, color-mix(in oklch, var(--ink-0) 86%, transparent) 38%, color-mix(in oklch, var(--ink-0) 40%, transparent) 54%, color-mix(in oklch, var(--ink-0) 0%, transparent) 68%);
}
@media (max-width: 900px) {
  .scrim::before { background: color-mix(in oklch, var(--ink-0) 62%, transparent); }
}


/* Présentations « étape par étape » (film.js)
   Sans 3D : les étapes se lisent comme des sections normales.
   Avec 3D (.is-film) : la section reste à l'écran, chaque geste passe à l'étape suivante. */
html { scrollbar-gutter: stable; }
.film { position: relative; }
.film-gl { display: none; }
.gl-ready .film-gl { display: block; }
.film-gl canvas { width: 100% !important; height: 100% !important; }
.film-step { position: relative; z-index: 1; padding-block: var(--space-l); }
.film-step:first-child { padding-top: calc(var(--header-h) + var(--space-xl)); }
.gl-ready .film:not(.is-film) .film-gl { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.gl-ready .film:not(.is-film) .film-step { background: color-mix(in oklch, var(--ink-0) 62%, transparent); }

.is-film .film-pin { position: sticky; top: 0; overflow: hidden; }
.is-film .film-gl { position: absolute; inset: 0; z-index: 0; }
.is-film .film-step {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 1rem) 0 clamp(2.4rem, 7vh, 5rem);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .45s var(--ease-out), visibility 0s linear .45s;
}
.is-film .film-step.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .7s var(--ease-out) .25s, visibility 0s; }
.is-film .film-step::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(0deg, color-mix(in oklch, var(--ink-0) 94%, transparent) 0%, color-mix(in oklch, var(--ink-0) 72%, transparent) 26%, color-mix(in oklch, var(--ink-0) 0%, transparent) 50%);
}
.is-film .film-step--hero, .is-film .film-step--left { justify-content: center; }
.is-film .film-step--hero::before, .is-film .film-step--left::before {
  background: linear-gradient(90deg, color-mix(in oklch, var(--ink-0) 95%, transparent) 0%, color-mix(in oklch, var(--ink-0) 86%, transparent) 36%, color-mix(in oklch, var(--ink-0) 40%, transparent) 54%, color-mix(in oklch, var(--ink-0) 0%, transparent) 68%);
}
.is-film .film-step .panel > * { transform: translateY(18px); opacity: 0; transition: transform .9s var(--ease-out), opacity .9s var(--ease-out); }
.is-film .film-step.is-active .panel > * { transform: none; opacity: 1; }
.is-film .film-step.is-active .panel > :nth-child(1) { transition-delay: .3s; }
.is-film .film-step.is-active .panel > :nth-child(2) { transition-delay: .42s; }
.is-film .film-step.is-active .panel > :nth-child(3) { transition-delay: .54s; }
.is-film .film-step.is-active .panel > :nth-child(4) { transition-delay: .66s; }
.is-film .film-step.is-active .panel > :nth-child(5) { transition-delay: .78s; }

.panel { max-width: 40rem; }
.panel .count { display: flex; align-items: center; gap: .7rem; font-family: var(--mono); font-size: .8rem; color: var(--mint); margin: 0 0 .9rem; }
.panel .count::after { content: ""; width: 2.5rem; height: 1px; background: currentColor; opacity: .5; }
.panel h2 { font-size: var(--step-3); max-width: 17ch; }
.panel > p { font-size: var(--step-1); line-height: 1.45; color: var(--text-2); max-width: 40ch; margin: 1rem 0 0; }
.panel > p strong { color: var(--text); font-weight: 600; }
.panel .link-arrow { margin-top: 1.2rem; }
.panel .actions { margin-top: 1.6rem; }
.film-step--hero .panel { max-width: 62rem; }
.film-step--hero .panel h1 { max-width: 18ch; }
.film-step--hero .panel h1 .line { display: block; }
.film-step--hero .panel .lead { margin-top: var(--space-m); max-width: 40ch; }

.is-film.film--split .panel { max-width: min(34rem, calc(50vw - var(--gutter) - 2.5rem)); }
.is-film.film--split .film-gl { left: 48%; }
.is-film.film--split .film-step { justify-content: center; }
.is-film.film--split .film-step::before { background: linear-gradient(90deg, var(--ink-0) 0%, var(--ink-0) 44%, color-mix(in oklch, var(--ink-0) 0%, transparent) 60%); }
.gl-ready .film--split:not(.is-film) .film-gl { opacity: 0; }

@media (max-width: 760px) {
  .is-film .film-step { padding-bottom: 2.6rem; }
  .is-film .film-step--hero::before { background: color-mix(in oklch, var(--ink-0) 66%, transparent); }
  .is-film .film-step--left::before { background: linear-gradient(0deg, color-mix(in oklch, var(--ink-0) 96%, transparent) 0%, color-mix(in oklch, var(--ink-0) 85%, transparent) 48%, color-mix(in oklch, var(--ink-0) 0%, transparent) 68%); }
  .panel { padding-right: 1.2rem; }
  .panel > p { font-size: 1.05rem; }
}

/* Page d'en-tête simple (pages intérieures) */
.page-hero { padding-top: calc(var(--header-h) + var(--space-xl)); padding-bottom: var(--space-l); }
.page-hero h1 { max-width: 15ch; }
.page-hero .lead { margin-top: var(--space-m); max-width: 44ch; }

/* 7. Accueil */
.hero {
  min-height: 100svh; display: flex; align-items: center;
  padding-top: var(--header-h);
}
.hero h1 { max-width: 18ch; }
.hero h1 .line { display: block; }
.hero .lead { margin-top: var(--space-m); max-width: 40ch; }
.hero-note {
  margin-top: var(--space-l); display: flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .8rem; color: var(--text-3);
}
.hero-note::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ember);
  box-shadow: 0 0 0 4px var(--ember-soft);
}

/* Teaser étude de cas */
.case-teaser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-l); align-items: start; }
.case-teaser h2 { font-size: var(--step-3); max-width: 14ch; }
.case-meta { font-family: var(--mono); font-size: .8rem; color: var(--text-3); margin-bottom: 1rem; }
.case-teaser .prose { margin: var(--space-m) 0 var(--space-m); }
@media (max-width: 900px) { .case-teaser { grid-template-columns: 1fr; } }

/* Comparatif avant / après (utilisé sur accueil et réalisations) */
.ba { border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1); overflow: hidden; }
.ba-switch { display: flex; padding: .35rem; gap: .35rem; border-bottom: 1px solid var(--line); }
.ba-switch label {
  flex: 1; text-align: center; padding: .55rem .75rem; border-radius: 7px; cursor: pointer;
  font-weight: 600; font-size: .9rem; color: var(--text-2); transition: background-color .25s, color .25s;
}
.ba-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ba-switch input:focus-visible + label { outline: 2px solid var(--mint); outline-offset: 2px; }
.ba-switch input[value="avant"]:checked + label { background: var(--ember-soft); color: var(--ember); }
.ba-switch input[value="apres"]:checked + label { background: var(--mint-soft); color: var(--mint); }
.ba-panel { padding: 1.25rem 1.35rem 1.4rem; display: none; }
.ba:has(input[value="avant"]:checked) .ba-panel[data-side="avant"],
.ba:has(input[value="apres"]:checked) .ba-panel[data-side="apres"] { display: block; animation: ba-in .45s var(--ease-out); }
.ba-panel ol { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.ba-panel li {
  counter-increment: s; display: grid; grid-template-columns: 1.6rem 1fr; gap: .5rem;
  padding: .55rem 0; border-top: 1px dashed var(--line); color: var(--text-2);
}
.ba-panel li:first-child { border-top: 0; }
.ba-panel li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: .78rem; padding-top: .2rem; }
.ba-panel[data-side="avant"] li::before { color: var(--ember); }
.ba-panel[data-side="apres"] li::before { color: var(--mint); }
.ba-foot { margin: .9rem 0 0; font-size: var(--step--1); color: var(--text-3); }
@keyframes ba-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Méthode en bref (accueil) */
.brief { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-m); margin-top: var(--space-l); }
.brief div { border-top: 1px solid var(--line-strong); padding-top: 1rem; }
.brief h3 { margin-bottom: .5rem; }
.brief p { color: var(--text-2); margin: 0; }
@media (max-width: 760px) { .brief { grid-template-columns: 1fr; } }

.final-cta { text-align: left; }
.final-cta h2 { max-width: 16ch; }

/* 8. Services */
.chapter-index { font-family: var(--mono); font-size: .8rem; color: var(--mint); margin-bottom: 1rem; }
.chapter h2 { font-size: var(--step-3); max-width: 14ch; margin-bottom: var(--space-m); }
.chapter .symptom {
  font-size: var(--step-1); line-height: 1.45; color: var(--text); max-width: 34ch;
  padding-left: 0; margin-bottom: var(--space-m);
}
.chapter .symptom::before { content: "« "; color: var(--ember); }
.chapter .symptom::after { content: " »"; color: var(--ember); }
.chapter dl { margin: 0; display: grid; gap: 1.1rem; max-width: 40rem; }
.chapter dt { font-weight: 650; font-size: .95rem; margin-bottom: .25rem; }
.chapter dd { margin: 0; color: var(--text-2); }
.chapter ul { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--text-2); }
.chapter ul li { margin: .2rem 0; }
.chapter ul li::marker { color: var(--mint); }
.stack { font-family: var(--mono); font-size: .78rem; color: var(--text-3); margin-top: var(--space-m); }
.also { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-l); align-items: start; }
@media (max-width: 860px) { .also { grid-template-columns: 1fr; } }
.nots { list-style: none; margin: 0; padding: 0; }
.nots li { padding: 1rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: .25rem 1.5rem; }
.nots li:last-child { border-bottom: 1px solid var(--line); }
.nots strong { font-weight: 650; }
.nots span { color: var(--text-2); }
@media (max-width: 640px) { .nots li { grid-template-columns: 1fr; } }

/* 9. Méthode */
.step-num { font-family: var(--mono); font-size: .85rem; color: var(--mint); display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.step-num::after { content: ""; height: 1px; width: 3rem; background: var(--mint); opacity: .5; }
.deliverable {
  margin-top: var(--space-m); padding: 1rem 1.1rem; border-radius: 10px;
  background: var(--mint-soft); border: 1px solid color-mix(in oklch, var(--mint) 25%, transparent);
}
.deliverable b { display: block; font-size: .8rem; font-family: var(--mono); font-weight: 500; color: var(--mint); margin-bottom: .3rem; }
.deliverable p { margin: 0; color: var(--text); }

.faq { max-width: 52rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.25rem 2.5rem 1.25rem 0; position: relative;
  font-size: var(--step-1); font-weight: 620;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; translate: 0 -50%;
  font-family: var(--mono); font-weight: 400; color: var(--mint); font-size: 1.4rem; transition: rotate .3s var(--ease-out);
}
.faq details[open] summary::after { rotate: 45deg; }
.faq details > div { padding: 0 0 1.4rem; color: var(--text-2); max-width: 60ch; }
.faq details > div p:last-child { margin: 0; }

/* 10. Réalisations */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--space-l); }
.chip {
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font: 550 .9rem var(--font); padding: .5rem .95rem; border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--ink-0); border-color: var(--text); }

.projects { display: grid; gap: 0; }
.project {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--space-m) var(--space-l);
  padding-block: var(--space-l); border-top: 1px solid var(--line);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project[hidden] { display: none; }
.project-head h2 { font-size: var(--step-3); max-width: 13ch; margin: .4rem 0 1rem; }
.project-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-family: var(--mono); font-size: .78rem; color: var(--text-3); }
.status { display: inline-flex; align-items: center; gap: .4rem; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.status--wip::before { background: var(--ember); }
.project-head .prose { margin-top: .5rem; }
.project .stack { margin-top: 1rem; }
.project--small { padding-block: var(--space-m); align-items: start; }
.project--small .project-head h2 { font-size: var(--step-2); margin-bottom: 0; }
.project--small .prose { max-width: 52ch; }
@media (max-width: 900px) { .project, .project--small { grid-template-columns: 1fr; } }

.demo-note {
  margin-top: var(--space-l); padding: 1.25rem 1.4rem; border: 1px dashed var(--line-strong); border-radius: 12px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.demo-note p { margin: 0; max-width: 46ch; }

/* 11. Qui on est */

/* Qui on est : en-tête avec les deux neurones */
.studio-hero { min-height: 86svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--space-l); padding-top: var(--header-h); }
.studio-hero h1 { max-width: 14ch; font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4.4rem); }
.studio-hero .lead { margin-top: var(--space-m); max-width: 44ch; }
.pair-gl { position: relative; height: min(66vh, 540px); }
.pair-gl canvas { width: 100% !important; height: 100% !important; }
@media (max-width: 900px) {
  .studio-hero { grid-template-columns: 1fr; min-height: auto; padding-top: calc(var(--header-h) + var(--space-l)); }
  .pair-gl { height: 280px; order: -1; margin-bottom: -1rem; }
}

/* « Un besoin, deux traductions » : besoin → cadrage (Aldo) → code (Paul) → résultat */
.duo-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--space-m); }
.duo-need {
  border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.35rem; background: var(--ink-1);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; align-items: baseline;
}
.duo-need .who, .duo-card header, .duo-result .who { font-family: var(--mono); font-size: .76rem; color: var(--text-3); }
.duo-need p { margin: 0; font-size: var(--step-1); line-height: 1.45; color: var(--text); min-height: 2.9em; }
.duo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 7rem minmax(0, 1.15fr); align-items: stretch; margin-top: 1rem; }
.duo-card { border: 1px solid var(--line); border-radius: 14px; background: var(--ink-1); padding: 1.1rem 1.25rem 1.3rem; min-height: 19rem; display: flex; flex-direction: column; }
.duo-card header { display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; }
.duo-card header .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.duo-card--paul header .dot { background: var(--text); box-shadow: 0 0 0 4px color-mix(in oklch, var(--text) 14%, transparent); }
.duo-card header .lang { margin-left: auto; border: 1px solid var(--line-strong); border-radius: 999px; padding: .1rem .55rem; }
.duo-card header strong { color: var(--text); font-family: var(--font); font-size: .95rem; font-weight: 650; }
.brief-list { margin: 0; display: grid; gap: .7rem; }
.brief-list div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .8rem; padding-bottom: .7rem; border-bottom: 1px dashed var(--line); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.brief-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.brief-list dt { font-size: .82rem; font-weight: 650; color: var(--mint); }
.brief-list dd { margin: 0; color: var(--text-2); font-size: .95rem; line-height: 1.5; }
.duo-js .brief-list div:not(.is-on) { opacity: 0; transform: translateY(8px); }
.duo-card pre { margin: 0; flex: 1; overflow-x: auto; font-family: var(--mono); font-size: .84rem; line-height: 1.75; color: var(--text-2); white-space: pre; tab-size: 4; }
.duo-card pre .k { color: var(--mint); }
.duo-card pre .s { color: var(--ember); }
.duo-card pre .f { color: var(--text); font-weight: 600; }
.duo-card pre .n { color: var(--ember); }
.duo-card pre .c { color: var(--text-3); font-style: italic; }
.duo-card pre .caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -0.2em; background: var(--mint); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.duo-link { position: relative; display: grid; place-items: center; }
.duo-link svg { width: 100%; height: 60px; overflow: visible; }
.duo-link .track { stroke: var(--line-strong); stroke-width: 1.5; fill: none; }
.duo-link .flow { stroke: var(--mint); stroke-width: 2; fill: none; stroke-dasharray: 3 14; stroke-linecap: round; opacity: 0; }
.duo-link.is-flowing .flow { opacity: 1; animation: flow .9s linear infinite; }
.duo-link .tag { position: absolute; top: calc(50% + 22px); font-family: var(--mono); font-size: .7rem; color: var(--text-3); }
@keyframes flow { to { stroke-dashoffset: -34; } }
.duo-result { margin-top: 1rem; border-radius: 14px; padding: 1rem 1.35rem; background: var(--mint-soft); border: 1px solid color-mix(in oklch, var(--mint) 30%, transparent); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem 1rem; align-items: baseline; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.duo-result p { margin: 0; color: var(--text); font-size: var(--step-1); line-height: 1.45; }
.duo-js .duo-result:not(.is-on) { opacity: 0; transform: translateY(8px); }
@media (max-width: 900px) {
  .duo-grid { grid-template-columns: minmax(0, 1fr); }
  .duo-card { min-width: 0; }
  .duo-link { height: 64px; }
  .duo-link svg { width: 60px; height: 100%; transform: rotate(90deg); }
  .duo-link .tag { top: auto; left: calc(50% + 40px); }
  .duo-need { grid-template-columns: 1fr; }
  .brief-list div { grid-template-columns: 1fr; gap: .2rem; }
  .duo-card { min-height: 0; }
}

/* Bouton mode clair / sombre (soleil ↔ lune) */
.theme-toggle {
  display: inline-grid; place-items: center; flex: none;
  width: 2.35rem; height: 2.35rem; margin-inline: -1rem; padding: 0;
  background: none; border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--text-2); cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-3); }
.theme-toggle:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; overflow: visible; }
.theme-toggle .tt-core, .theme-toggle .tt-cut, .theme-toggle .tt-rays { transform-box: fill-box; transform-origin: center; transition: transform .55s var(--ease-out), opacity .35s var(--ease-out); }
/* sombre : une lune (le disque grossit, l'ombre le croque, les rayons disparaissent) */
.theme-toggle .tt-core { transform: scale(1.45); }
.theme-toggle .tt-cut { transform: translate(0, 0); }
.theme-toggle .tt-rays { transform: rotate(-60deg) scale(.4); opacity: 0; }
/* clair : un soleil */
[data-theme="clair"] .theme-toggle .tt-core { transform: scale(1); }
[data-theme="clair"] .theme-toggle .tt-cut { transform: translate(9px, -9px); }
[data-theme="clair"] .theme-toggle .tt-rays { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .theme-toggle .tt-core, .theme-toggle .tt-cut, .theme-toggle .tt-rays { transition: none; } }

/* Changement de mode : le nouveau mode s'ouvre en cercle depuis le bouton */
.theme-vt .site-header { view-transition-name: none; }
.theme-vt::view-transition-group(root) { animation-duration: .75s; }
.theme-vt::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
.theme-vt::view-transition-new(root) { animation: theme-reveal .75s cubic-bezier(.65, 0, .35, 1) both; mix-blend-mode: normal; }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 0)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 0)); }
}

.tags { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li { font-family: var(--mono); font-size: .76rem; color: var(--text-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: .3rem .65rem; }
.tags--mint li { color: var(--mint); border-color: color-mix(in oklch, var(--mint) 38%, transparent); }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-l); }
@media (max-width: 820px) { .people { grid-template-columns: 1fr; } }
.person-photo {
  aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--ink-2);
  border: 1px solid var(--line); position: relative; margin-bottom: 1.25rem; max-width: 340px;
}
.person-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) contrast(1.05); }
.person-photo .initial {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(5rem, 4rem + 6vw, 9rem); font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--ink-3);
  letter-spacing: -0.04em;
}
.person-photo img + .initial { display: none; }
.person-name { font-size: var(--step-2); }
.person .role { font-family: var(--mono); font-size: .82rem; color: var(--mint); margin: .35rem 0 1rem; }
.person p { color: var(--text-2); max-width: 46ch; }

.commitments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-l); }
.commitments div { padding: 1.35rem 0; border-top: 1px solid var(--line); }
.commitments h3 { margin-bottom: .45rem; }
.commitments p { margin: 0; color: var(--text-2); }
@media (max-width: 760px) { .commitments { grid-template-columns: 1fr; } }

/* 12. Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-l); align-items: start; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }
.form fieldset { border: 0; margin: 0 0 var(--space-l); padding: 0; min-width: 0; }
.form legend { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; margin-bottom: 1rem; padding: 0; display: flex; align-items: baseline; gap: .8rem; }
.form legend .mono { color: var(--mint); font-size: .8rem; font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .55rem 1rem; cursor: pointer;
  color: var(--text-2); font-weight: 520; transition: background-color .2s, color .2s, border-color .2s;
  user-select: none;
}
.chips label:hover { color: var(--text); border-color: var(--text-3); }
.chips input:checked + label { background: var(--mint-soft); border-color: var(--mint); color: var(--mint); }
.chips input:focus-visible + label { outline: 2px solid var(--mint); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .fields { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 560; font-size: .92rem; margin-bottom: .4rem; }
.field label .opt { color: var(--text-3); font-weight: 400; }
.field input, .field textarea {
  width: 100%; background: var(--ink-1); border: 1px solid var(--line-strong); color: var(--text);
  font: 400 1rem/1.5 var(--font); padding: .8rem .9rem; border-radius: 8px;
  transition: border-color .2s, background-color .2s;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); opacity: 1; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--mint); background: var(--ink-2); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--ember); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-legal { font-size: var(--step--1); color: var(--text-3); margin-top: 1rem; max-width: 52ch; }
.form-status { margin-top: 1rem; font-weight: 550; }
.form-status.is-error { color: var(--ember); }
.form-done { border: 1px solid color-mix(in oklch, var(--mint) 35%, transparent); background: var(--mint-soft); border-radius: 14px; padding: 2rem; }
.form-done h2 { font-size: var(--step-3); margin-bottom: 1rem; }

.aside { position: sticky; top: calc(var(--header-h) + 2rem); border-left: 1px solid var(--line); padding-left: var(--space-m); }
@media (max-width: 960px) { .aside { position: static; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: var(--space-m); } }
.aside h2 { font-size: var(--step-1); margin-bottom: 1rem; }
.next-steps { list-style: none; margin: 0 0 var(--space-m); padding: 0; counter-reset: n; }
.next-steps li { counter-increment: n; display: grid; grid-template-columns: 2rem 1fr; padding: .55rem 0; color: var(--text-2); }
.next-steps li::before { content: counter(n); font-family: var(--mono); color: var(--mint); }
.direct a { color: var(--text); font-weight: 600; text-decoration-color: var(--mint); text-underline-offset: 4px; }

/* 13. Pied de page */
.site-footer { position: relative; z-index: var(--z-content); border-top: 1px solid var(--line); background: var(--ink-0); padding-block: var(--space-l) 2rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: var(--space-m); }
.footer-grid p { color: var(--text-2); max-width: 34ch; margin-top: .9rem; }
.footer-grid h3 { font-size: .8rem; font-family: var(--mono); font-weight: 500; color: var(--text-3); margin-bottom: .7rem; letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: .3rem 0; }
.footer-grid a { text-decoration: none; color: var(--text-2); }
.footer-grid a:hover { color: var(--mint); }
.footer-bottom { margin-top: var(--space-l); padding-top: 1.2rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: var(--step--1); color: var(--text-3); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

@media (max-width: 900px) {
  .site-header .nav, .site-header .header-cta { display: none; }
  .site-header .menu-btn { display: inline-block; margin-left: 0; }
  .site-header .header-inner { gap: .6rem; }
  .site-header .theme-toggle { margin: 0 0 0 auto; }
}

/* Pages simples (404, mentions) */
.plain { padding-top: calc(var(--header-h) + var(--space-xl)); padding-bottom: var(--space-xl); }
.plain h1 { font-size: var(--step-3); max-width: 18ch; margin-bottom: var(--space-m); }
.legal h2 { font-size: var(--step-1); margin: 2.2rem 0 .7rem; }
.legal p, .legal li { color: var(--text-2); max-width: 70ch; }
.todo { background: var(--ember-soft); color: var(--ember); padding: 0 .3em; border-radius: 4px; font-family: var(--mono); font-size: .85em; }

/* 14. Animations
   Le contenu est toujours visible par défaut : les apparitions ne font que l'accompagner
   (navigateurs compatibles uniquement, et jamais si l'utilisateur a demandé moins d'animations). */
@media (prefers-reduced-motion: no-preference) {
  .page-hero h1, .page-hero .lead, .page-hero .actions, .studio-hero h1, .studio-hero .lead {
    animation: rise .9s var(--ease-out) both;
  }
  .page-hero .lead, .studio-hero .lead { animation-delay: .28s; }
  .page-hero .actions { animation-delay: .38s; }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 45%;
    }
    .reveal-line {
      animation: reveal-line linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .reveal-soft {
      animation: reveal-soft linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }

  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .22s var(--ease-in-out) both; }
  ::view-transition-new(root) { animation: vt-in .42s var(--ease-out) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes reveal-line { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes reveal-soft { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* V9 — compléments */
.chapter .panel > .symptom { font-size: var(--step-1); line-height: 1.45; color: var(--text); max-width: 34ch; margin: 0 0 var(--space-m); }
.chapter .panel > .stack { font-size: .78rem; color: var(--text-3); margin-top: var(--space-m); }
.chapter .panel h2 { margin-bottom: var(--space-m); }
.film-step--left .panel { max-width: 34rem; }
.film-step--left .panel h1 { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.8rem); max-width: 13ch; }
.film-step--left .panel .lead { margin-top: var(--space-m); max-width: 40ch; }
.film-step--left .panel h2 { font-size: var(--step-3); margin-bottom: var(--space-m); }
.film-step--left .panel .prose p { margin-bottom: .8em; }
.panel .hero-note, .panel > p.hero-note { margin-top: var(--space-l); font-size: .8rem; line-height: 1.4; color: var(--text-3); max-width: none; }
.project-meta .num { color: var(--mint); font-weight: 500; }
.final-cta { border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .film-step--left .panel h2 { font-size: var(--step-2); }
  .film-step--left .panel .prose { font-size: .98rem; }
  .is-film .film-step--left { justify-content: flex-end; }
}

/* ==========================================================================
   15. Mouvement (V11) — motion.js et le texte en particules de l'accueil
   ========================================================================== */

/* Le texte qui sera animé reste masqué le temps que motion.js le découpe (filet de sécurité : 2,5 s) */
.motion main :is(h1, h2):not([data-split]):not([data-nosplit]),
.motion main .lead:not([data-split]),
.motion .film-step .panel > p:not(.count):not(.hero-note):not(.visually-hidden):not([data-split]) {
  opacity: 0; animation: kx-failsafe .01s 2.5s forwards;
}
@keyframes kx-failsafe { to { opacity: 1; } }
.motion .kx, .motion .kp { animation: none !important; }

/* Mots : flous et décalés, puis nets — la couleur d'accent passe comme un signal */
.motion .kx .kw, .motion .kp .kw {
  display: inline-block; white-space: nowrap;
  opacity: 0; transform: translateY(.42em); filter: blur(10px);
  transition: opacity .3s, transform .3s, filter .3s, color .3s;
}
.motion .kx .kw { color: var(--mint); }
.motion .kx em .kw { color: var(--text); }
.motion .kp .kw { transform: translateY(.5em); filter: blur(4px); }
:is(h1, h2) em .kw { line-height: .9; }
.motion .kx.is-in:not(.is-film .kx) .kw,
.motion .kp.is-in:not(.is-film .kp) .kw,
.motion .is-film .film-step.is-active .kx .kw,
.motion .is-film .film-step.is-active .kp .kw {
  opacity: 1; transform: none; filter: blur(0); color: inherit;
  transition:
    opacity .8s var(--ease-out) calc(var(--d0, 0ms) + var(--i) * var(--st, 60ms)),
    transform 1.1s var(--ease-out) calc(var(--d0, 0ms) + var(--i) * var(--st, 60ms)),
    filter .9s var(--ease-out) calc(var(--d0, 0ms) + var(--i) * var(--st, 60ms)),
    color 1.4s var(--ease-out) calc(var(--d0, 0ms) + 260ms + var(--i) * var(--st, 60ms));
}
.kp { --st: 16ms; }
.motion .is-film .film-step .kx { --d0: 260ms; }
.motion .is-film .film-step .kp { --d0: 620ms; }
.motion :is(.page-hero, .studio-hero) .kp { --d0: 420ms; }
/* dans les étapes épinglées, les autres éléments du panneau n'ont plus besoin de glisser */
.motion .is-film .film-step .panel > :is(h1, h2, .kp) { transform: none; opacity: 1; transition: none; }

/* Accueil : les titres naissent des particules (scenes.js), puis le vrai texte prend le relais */
html.ptext-wait .film[data-ptext] .film-step .panel > :is(h1, h2) { opacity: 0 !important; }
.ptext-on .film[data-ptext] .panel > :is(h1, h2) { opacity: 0 !important; transition: opacity .18s linear !important; }
.ptext-on .film[data-ptext] .film-step.is-formed .panel > :is(h1, h2) { opacity: 1 !important; transition: opacity .45s var(--ease-out) !important; }
.ptext-on .film[data-ptext] .panel > :is(h1, h2) .kw { opacity: 1 !important; transform: none !important; filter: none !important; color: inherit !important; transition: none !important; }
.film-fx { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.film-fx canvas { width: 100% !important; height: 100% !important; }

/* Étiquettes mono : la largeur ne bouge pas pendant le décodage */
.count, .case-meta, [data-decode] { font-variant-numeric: tabular-nums; }

/* Lettres qui roulent au survol */
.roll { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: top; line-height: 1.25; height: 1.25em; }
.rc { display: inline-block; text-shadow: 0 1.25em currentColor; transition: transform .55s var(--ease-out) calc(var(--i) * 12ms); }
:is(a, .btn):is(:hover, :focus-visible) .rc { transform: translateY(-1.25em); }
.nav a .roll { line-height: 1.25; }

/* Boutons aimantés (translate se combine avec le transform du survol) */
.btn, .theme-toggle, [data-magnetic] { translate: var(--mx, 0px) var(--my, 0px); }
.btn { transition: transform .25s var(--ease-out), translate .45s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s; }
.theme-toggle { transition: color .2s, border-color .2s, background-color .2s, translate .45s var(--ease-out); }

/* Grand badge d'appel à l'action */
.final-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-l); align-items: center; }
.cta-orb {
  position: relative; display: grid; place-items: center; width: clamp(9rem, 7rem + 8vw, 13.5rem); aspect-ratio: 1;
  color: var(--text-2); text-decoration: none; border-radius: 50%;
  transition: translate .5s var(--ease-out), color .3s;
}
.cta-orb .spin { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(var(--spin, 0deg)); overflow: visible; }
.cta-orb text { font: 500 12.5px var(--mono); fill: currentColor; letter-spacing: .04em; text-transform: uppercase; }
.orb-core {
  width: 42%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--mint); color: var(--on-mint);
  box-shadow: 0 0 0 0 var(--mint-soft); transition: box-shadow .5s var(--ease-out), transform .5s var(--ease-out);
}
.orb-core svg { width: 38%; transition: transform .5s var(--ease-out); }
.cta-orb:hover { color: var(--text); }
.cta-orb:hover .orb-core { box-shadow: 0 0 0 14px var(--mint-soft); transform: scale(1.06); }
.cta-orb:hover .orb-core svg { transform: rotate(-45deg); }
@media (max-width: 760px) { .final-grid { grid-template-columns: 1fr; } .cta-orb { justify-self: start; } }

/* Bandeaux de mots */
.band { overflow: hidden; padding-block: clamp(1.5rem, 1rem + 2vw, 3rem); border-block: 1px solid var(--line); margin-block: var(--space-l); }
.band-track { display: flex; align-items: baseline; gap: .35em; width: max-content; font-size: clamp(3rem, 1.6rem + 7vw, 8.5rem); line-height: 1; letter-spacing: -0.05em; white-space: nowrap; will-change: transform; }
.band-track span { font-weight: 600; color: transparent; -webkit-text-stroke: 1px color-mix(in oklch, var(--text) 45%, transparent); }
.band-track em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.015em; color: var(--mint); font-size: 1.08em; }
.band-track i { font-style: normal; color: var(--text-3); font-size: .4em; align-self: center; padding-inline: .3em; }

/* Écran d'ouverture */
.intro { display: none; }
.intro-on .intro { display: block; position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.intro-on body { overflow: hidden; }
.intro-half { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--ink-0); transition: transform 1.05s cubic-bezier(.76, 0, .24, 1); }
.intro-half--top { top: 0; }
.intro-half--bottom { bottom: 0; }
.intro-gap { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--mint); transform: scaleX(0); opacity: 0; box-shadow: 0 0 18px 2px var(--mint-soft); }
.intro-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); display: flex; align-items: flex-start; color: var(--text); transition: opacity .35s, transform .7s var(--ease-in-out); }
.intro-count { font-family: var(--serif); font-style: italic; font-size: clamp(6rem, 4rem + 12vw, 15rem); line-height: .9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.intro-pct { font-family: var(--mono); font-size: clamp(.9rem, .7rem + .6vw, 1.3rem); color: var(--mint); margin-top: .8em; margin-left: .3em; }
.intro-meta { position: absolute; bottom: clamp(1.2rem, 4vh, 2.5rem); margin: 0; font-family: var(--mono); font-size: .78rem; color: var(--text-3); transition: opacity .3s; }
.intro-meta--l { left: var(--gutter); }
.intro-meta--r { right: var(--gutter); color: var(--mint); }
.intro.is-out .intro-core, .intro.is-out .intro-meta { opacity: 0; }
.intro.is-out .intro-core { transform: translate(-50%, -54%) scale(.92); }
.intro.is-out .intro-gap { animation: intro-gap 1s var(--ease-out) forwards; }
.intro.is-out .intro-half--top { transform: translateY(-100%); transition-delay: .32s; }
.intro.is-out .intro-half--bottom { transform: translateY(100%); transition-delay: .32s; }
@keyframes intro-gap { 0% { transform: scaleX(0); opacity: 1; } 40% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }

/* Changement de page : la nouvelle page monte comme un rideau */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-page-out .5s var(--ease-in-out) both; }
  ::view-transition-new(root) { animation: vt-page-in .7s cubic-bezier(.76, 0, .24, 1) both; }
}
@keyframes vt-page-out { to { opacity: .35; transform: translateY(-3vh) scale(.985); } }
@keyframes vt-page-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
/* dans la présentation de l'accueil, le reste du panneau attend que le titre soit formé */
.ptext-on .film[data-ptext] .film-step:not(.is-formed) .kp .kw { opacity: 0 !important; transform: translateY(.5em) !important; filter: blur(4px) !important; transition: opacity .2s, transform .2s, filter .2s !important; }
.ptext-on .film[data-ptext] .film-step .kp { --d0: 80ms; }
.ptext-on .film[data-ptext] .film-step:not(.is-formed) .panel > :is(.actions, .link-arrow, .hero-note) { opacity: 0 !important; transform: translateY(14px) !important; transition: opacity .2s, transform .2s !important; }
.ptext-on .film[data-ptext] .film-step.is-formed .panel > :is(.actions, .link-arrow, .hero-note) { transition-delay: .45s !important; }

/* Étapes : points d'aimantation sur écran tactile (la molette passe par film.js + Lenis) */
.film-snap { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; scroll-snap-align: start; }
@media (hover: none) and (pointer: coarse) { html:has(.is-film) { scroll-snap-type: y proximity; } }

/* Accueil (V12) : règle graduée qui défile avec chaque geste — l'appât du mode carrousel */
.film-rail {
  position: absolute; z-index: 4; pointer-events: none;
  right: clamp(.6rem, calc(var(--gutter) * .5), 2.2rem); top: 50%; width: 4.6rem; height: min(48vh, 400px);
  transform: translateY(-50%); overflow: hidden; opacity: 0; transition: opacity .8s var(--ease-out);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
}
.film.is-engaged .film-rail { opacity: 1; }
.rail-track {
  position: absolute; right: 0; top: -48px; bottom: -48px; width: 1.4rem; will-change: transform;
  background:
    repeating-linear-gradient(to bottom, var(--text-3) 0 1px, transparent 1px 48px) right top / 1.4rem 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 8px) right top / .7rem 100% no-repeat;
}
.film-rail::after { content: ""; position: absolute; right: 0; top: 50%; width: 2rem; height: 1px; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.rail-num { position: absolute; right: 2.4rem; top: 50%; transform: translateY(-55%); font: 500 .68rem/1 var(--mono); color: var(--mint); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.film.is-busy .film-rail::after { animation: rail-pulse 1.1s ease-in-out infinite; }
@keyframes rail-pulse { 50% { opacity: .35; } }
@media (max-width: 760px) {
  .film-rail { top: 34%; height: 26vh; width: 1.2rem; right: .15rem; }
  .film-rail::after { width: 1.1rem; }
  .rail-track { width: .9rem; }
  .rail-num { display: none; }
}
