/* ==========================================================================
   Sidekar — feuille de style
   Une table à dessin isométrique : trait d'encre épais, aplats, aucune ombre
   au repos. Pointillé = idée, plein = réalisé.
   ========================================================================== */

@font-face {
  font-family: "Space Grotesk";
  src: url("space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Profondeur d'un bloc, animable (bouton qu'on enfonce, brique qui se pose). */
@property --d {
  syntax: "<length>";
  inherits: true;
  initial-value: 8px;
}

@property --sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  /* Mise en page : texte calé à gauche sur 12 colonnes, la scène isométrique au centre. */
  color-scheme: light;

  /* Papier et encre */
  --bg: #f4f5f8;
  --surface: #ffffff;
  --grid: #e1e5f0;
  --ink: #0d1030;
  --text: #0d1030;
  --muted: #4a5165;
  --ghost: #8a90a8;

  /* Palette « framboise & bleu nuit » : crochet haut (a), crochet bas (b), cube (n) */
  --a: #ff2e7e;
  --a-top: #ff7bad;
  --a-side: #ff0565;
  --b: #22308f;
  --b-top: #3145cd;
  --b-side: #1a256e;
  --n: #ffe3ee;
  --n-top: #fff0f6;
  --n-side: #ffbad5;

  --tint-a: #ffe9f1;
  --tint-b: #e7ebfd;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-solid: rgba(255, 255, 255, 0.86);
  --glass-line: rgba(13, 16, 48, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.75);
  --glass-hover: rgba(13, 16, 48, 0.06);

  --on-a: #0d1030;
  --band: var(--b);
  --on-band: #ffffff;
  --on-band-muted: #e6eaff;

  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --bar-h: 4rem;
  --bar-top: 0px;
  --bw: 2.5px;
  --maxw: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141a30;
    --surface: #1c2443;
    --grid: #232b4d;
    --ink: #080b1a;
    --text: #f4f5f8;
    --muted: #b5bcdc;
    --ghost: #7480bd;
    --tint-a: #2a1736;
    --tint-b: #1b2350;
    --glass: rgba(28, 36, 67, 0.55);
    --glass-solid: rgba(28, 36, 67, 0.9);
    --glass-line: rgba(255, 255, 255, 0.12);
    --glass-hi: rgba(255, 255, 255, 0.07);
    --glass-hover: rgba(255, 255, 255, 0.08);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141a30;
  --surface: #1c2443;
  --grid: #232b4d;
  --ink: #080b1a;
  --text: #f4f5f8;
  --muted: #b5bcdc;
  --ghost: #7480bd;
  --tint-a: #2a1736;
  --tint-b: #1b2350;
  --glass: rgba(28, 36, 67, 0.55);
  --glass-solid: rgba(28, 36, 67, 0.9);
  --glass-line: rgba(255, 255, 255, 0.12);
  --glass-hi: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + var(--bar-top) + 1.25rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font: 400 1.0625rem/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  overflow-x: clip;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2.25rem, 6.2vw, 4.75rem);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  max-width: 62ch;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

canvas,
svg {
  display: block;
}

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

.band :focus-visible {
  outline-color: var(--on-band);
}

[hidden] {
  display: none !important;
}

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

.skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: var(--on-a);
  background: var(--a);
  border: var(--bw) solid var(--ink);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  overflow: clip;
  padding-block: clamp(4.5rem, 11vw, 9rem);
}

.tone-a {
  background: var(--tint-a);
}

.tone-b {
  background: var(--tint-b);
}

/* Les briques du décor, dessinées en isométrique dans les marges de chaque section. */
.decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.section > .wrap {
  position: relative;
  z-index: 1;
}

/* Les titres s'écrivent mot à mot : chaque mot tombe en contour pointillé, puis se remplit. */
.words .w {
  display: inline-block;
}

.js .words.pending .w {
  opacity: 0;
}

.js .words.in .w {
  animation: word-drop 0.75s cubic-bezier(0.34, 1.45, 0.64, 1) both;
  animation-delay: calc(var(--k, 0) * 75ms);
}

.band {
  --wstroke: var(--on-band-muted);
}

@keyframes word-drop {
  0% {
    opacity: 0;
    transform: translateY(-0.75em);
    color: transparent;
    -webkit-text-stroke: 1.5px var(--wstroke, var(--ghost));
  }

  55% {
    opacity: 1;
    transform: translateY(0.03em);
    color: transparent;
    -webkit-text-stroke: 1.5px var(--wstroke, var(--ghost));
  }

  100% {
    opacity: 1;
    transform: none;
    -webkit-text-stroke: 0 transparent;
  }
}

/* Les cartes tombent en place la première fois qu'elles arrivent à l'écran. */
.js .reveal {
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.34, 1.5, 0.64, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.js .reveal.pending {
  opacity: 0;
  transform: translateY(-2.5rem);
}

.lead {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

/* Couleurs du logo en SVG (pas de style en ligne, la politique de sécurité reste stricte). */
.fa { fill: var(--a); }
.fa-t { fill: var(--a-top); }
.fa-s { fill: var(--a-side); }
.fb { fill: var(--b); }
.fb-t { fill: var(--b-top); }
.fb-s { fill: var(--b-side); }
.fn { fill: var(--n); }
.fn-t { fill: var(--n-top); }

.logo-s {
  stroke: var(--ink);
  stroke-width: 18;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* ------------------------------------------------------- le bloc en relief
   Une face avant (l'élément), un dessus (::before) et un côté (::after),
   extrudés à 30° vers le haut à droite, comme la profondeur du S.          */

.blk {
  --d: 10px;
  --blk-top: var(--surface);
  --blk-side: var(--grid);
  position: relative;
  border: var(--bw) solid var(--ink);
}

/* Le relief : le dessus et le côté droit, dessinés d'un seul tenant par deux calques posés autour de la carte.
   ::before trace la silhouette à l'encre, ::after y pose les deux teintes, en retrait de l'épaisseur du trait.
   Les angles sont calculés (30° comme le reste du site) : les jonctions tombent juste, quelle que soit la taille. */
.blk::before,
.blk::after {
  --dx: calc(var(--d) * 0.866);
  --dy: calc(var(--d) * 0.5);
  --s: var(--bw);
  content: "";
  position: absolute;
  top: calc(var(--bw) * -1 - var(--dy));
  left: calc(var(--bw) * -1);
  width: calc(100% + var(--bw) * 2 + var(--dx));
  height: calc(100% + var(--bw) * 2 + var(--dy));
  pointer-events: none;
}

/* La silhouette : le dessus, puis le côté. Elle déborde d'un pixel sous la bordure de la carte (même encre),
   sauf quand la carte est à plat. */
.blk::before {
  --o: min(1px, var(--dy));
  background: var(--ink);
  clip-path: polygon(
    0 calc(var(--dy) + var(--o)),
    0 var(--dy),
    var(--dx) 0,
    100% 0,
    100% calc(100% - var(--dy)),
    calc(100% - var(--dx)) 100%,
    calc(100% - var(--dx) - var(--o)) 100%,
    calc(100% - var(--dx) - var(--o)) calc(var(--dy) + var(--o))
  );
}

/* Les teintes : le dessus à gauche de l'arête, le côté à droite (l'arête part du coin haut droit de la carte). */
.blk::after {
  background: conic-gradient(from 60deg at calc(100% - var(--dx)) var(--dy), var(--blk-side) 0deg 180deg, var(--blk-top) 180deg 360deg);
  clip-path: polygon(
    calc(var(--dx) + 0.268 * var(--s)) min(var(--s), var(--dy)),
    calc(100% - 2.732 * var(--s)) min(var(--s), var(--dy)),
    calc(100% - var(--dx) - var(--s)) var(--dy),
    calc(100% - var(--dx)) calc(var(--dy) + 0.577 * var(--s)),
    max(100% - var(--s), 100% - var(--dx)) calc(1.155 * var(--s)),
    max(100% - var(--s), 100% - var(--dx)) calc(100% - var(--dy) - 0.577 * var(--s)),
    calc(100% - var(--dx)) calc(100% - 1.155 * var(--s)),
    calc(100% - var(--dx)) calc(var(--dy) + 0.577 * var(--s)),
    calc(100% - var(--dx) - var(--s)) var(--dy),
    calc(2 * var(--s)) var(--dy)
  );
}

/* ---------------------------------------------------------------- bouton */

/* À plat : une couleur pleine et des coins doux, comme le bouton Contact du menu.
   Au survol, un trait se dessine tout autour du bouton (--sweep est l'angle déjà tracé). */
.btn {
  --btn-line: var(--on-a);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  font: 700 1.125rem/1 var(--font);
  color: var(--on-a);
  text-decoration: none;
  background: var(--a);
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--bw) solid var(--btn-line);
  border-radius: inherit;
  pointer-events: none;
  -webkit-mask: conic-gradient(from 270deg, #000 var(--sweep), transparent 0);
  mask: conic-gradient(from 270deg, #000 var(--sweep), transparent 0);
  transition: --sweep 0.5s cubic-bezier(0.6, 0, 0.2, 1);
}

.btn:hover::after,
.btn:focus-visible::after {
  --sweep: 360deg;
}

.btn:active {
  transform: scale(0.98);
}

/* ------------------------------------------------------------- en-tête */

/* La barre : du verre dépoli sur toute la largeur. Le logo s'aligne sur le bord gauche du contenu. */
.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-inline: max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  transition: opacity 0.25s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-s {
  height: 2.25rem;
  width: auto;
  overflow: visible;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.bl {
  display: inline-block;
  width: 0;
  height: 0;
}

.links {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 1.6vw, 1.25rem);
  margin-left: auto;
}

.links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.6rem;
  font-weight: 500;
  text-decoration: none;
}

/* Au survol, un trait rose se trace sous le lien, et repart dans l'autre sens. */
.links a:not(.link-cta)::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.5rem;
  height: 2.5px;
  background: var(--a);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.32s cubic-bezier(0.6, 0, 0.2, 1);
}

.links a:not(.link-cta):hover::after,
.links a:not(.link-cta):focus-visible::after,
.links a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.links a[aria-current="page"] {
  font-weight: 700;
}

.links .link-cta {
  min-height: 2.75rem;
  padding: 0 1rem;
  font-weight: 700;
  color: var(--on-a);
  background: var(--a);
  border-radius: 0.75rem;
  transition: background-color 0.2s ease;
}

.links .link-cta:hover {
  background: var(--a-top);
}

.tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}

/* Lien vers l'autre langue : FR / EN, souligné d'un trait qui se dessine au survol. */
.lang-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.lang-link::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.55rem;
  height: 2.5px;
  background: var(--a);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.32s cubic-bezier(0.6, 0, 0.2, 1);
}

.lang-link:hover::after,
.lang-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Au survol, les traits de l'icône se redessinent (chaque tracé a pathLength="1"). */
.icon-btn svg > * {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.icon-btn:hover svg > *,
.icon-btn:focus-visible svg > * {
  animation: redraw 0.6s cubic-bezier(0.6, 0, 0.2, 1);
}

@keyframes redraw {
  from {
    stroke-dashoffset: 1;
  }

  to {
    stroke-dashoffset: 0;
  }
}

.icon-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#themeBtn .moon,
:root[data-theme="dark"] #themeBtn .sun {
  display: none;
}

:root[data-theme="dark"] #themeBtn .moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeBtn .sun {
    display: none;
  }

  :root:not([data-theme="light"]) #themeBtn .moon {
    display: block;
  }
}

.menu-btn {
  display: none;
}

/* Tant que le logo de l'ouverture n'est pas venu se ranger, l'en-tête reste discret. */
.js .bar:not(.docked)::before {
  opacity: 0;
}

.js .bar:not(.docked) {
  pointer-events: none;
}

.js .bar:not(.docked) .tools,
.bar.menu-open .links {
  pointer-events: auto;
}

.js .bar:not(.docked) .brand {
  visibility: hidden;
}

@media (min-width: 821px) {
  .js .links {
    opacity: var(--nav, 0);
    transform: translateY(calc((1 - var(--nav, 0)) * -0.5rem));
  }

  .js .bar:not(.docked) .links {
    pointer-events: none;
  }

  .js .bar:not(.nav-on) .links {
    visibility: hidden;
  }
}

/* Entre la tablette et l'ordinateur, les liens en français ne tenaient pas tous dans la barre
   (le bouton du thème sortait de l'écran) : la barre se resserre. */
@media (min-width: 821px) and (max-width: 1100px) {
  .bar {
    gap: 0.5rem;
    padding-inline: clamp(1rem, 2.5vw, 2rem);
  }

  .links {
    gap: 0;
  }

  .links a {
    padding: 0 0.45rem;
    font-size: 0.95rem;
  }

  .links a:not(.link-cta)::after {
    left: 0.45rem;
    right: 0.45rem;
  }

  .links .link-cta {
    margin-left: 0.35rem;
    padding: 0 0.8rem;
  }

  .tools {
    gap: 0;
  }
}

@media (max-width: 820px) {
  :root {
    --bar-h: 3.75rem;
  }

  .brand-s {
    height: 2rem;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .tools {
    margin-left: auto;
  }

  .menu-btn {
    display: grid;
  }

  .links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) 1.25rem;
    background: var(--glass-solid);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    backdrop-filter: blur(18px) saturate(1.6);
    border-bottom: 1px solid var(--glass-line);
    box-shadow: inset 0 1px 0 var(--glass-hi);
  }

  .bar.menu-open .links {
    display: flex;
  }

  .bar.menu-open::before {
    opacity: 1;
  }

  .links a {
    min-height: 3.25rem;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    border-bottom: 2px dashed var(--ghost);
  }

  /* Sur le menu déplié, le trait plein recouvre le pointillé. */
  .links a:not(.link-cta)::after {
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
  }

  .links .link-cta {
    justify-content: center;
    margin-top: 1rem;
    border-bottom: 0;
  }
}

/* Très petit écran : le logo, la langue, le son, le thème et le menu tiennent sur une ligne. */
@media (max-width: 359px) {
  .bar {
    gap: 0.5rem;
    padding-inline: 0.75rem;
  }

  .brand {
    gap: 0.4rem;
  }

  .brand-s {
    height: 1.75rem;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .tools .icon-btn,
  .tools .lang-link {
    width: 2.5rem;
  }
}

/* -------------------------------------------------------------- ouverture */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
}

.js .hero {
  height: 165vh;
  height: 165svh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 34rem;
  overflow: hidden;
  background: var(--bg);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.hero-static {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: var(--bar-h) var(--gutter) 3rem;
  text-align: center;
}

.hs-s {
  height: min(34vh, 16rem);
  width: auto;
  overflow: visible;
}

.hs-name {
  font-size: clamp(3rem, 15vw, 8rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hs-slogan {
  font-size: clamp(1.1rem, 3.4vw, 1.75rem);
  font-weight: 300;
}

.hs-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1rem;
  max-width: 34rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

/* Le temps que la scène démarre, la version statique attend (elle revient seule si le script manque). */
.pre .hero-static {
  opacity: 0;
  animation: late 0.01s linear 3s forwards;
}

@keyframes late {
  to {
    opacity: 1;
  }
}

/* Une fois la scène animée lancée, la version statique reste lisible pour les lecteurs d'écran. */
.scene-on .hero-static {
  width: 1px;
  height: 1px;
  inset: auto;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.cue {
  position: absolute;
  left: 50%;
  bottom: clamp(0.75rem, 3.5svh, 2rem);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  /* La largeur suit le texte, sur une ligne : le centrage reste juste quelle que soit la langue. */
  width: max-content;
  white-space: nowrap;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0.4s ease;
}

.js .cue {
  opacity: 0;
}

.js.intro-done .cue {
  opacity: var(--cue, 1);
}

.cue::after {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-right: var(--bw) solid currentColor;
  border-bottom: var(--bw) solid currentColor;
  transform: rotate(45deg);
  animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(-2px) rotate(45deg);
  }

  50% {
    transform: translateY(3px) rotate(45deg);
  }
}

/* La feuille de contenu glisse par-dessus la table à dessin pendant que le logo s'envole. */
.sheet {
  position: relative;
  z-index: 2;
  background: var(--bg);
}

.js .sheet {
  margin-top: -65vh;
  margin-top: -65svh;
  border-top: var(--bw) solid var(--ink);
}

.hint {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(0.75rem, 3.5svh, 2rem);
  display: none;
  max-width: 19rem;
  min-height: 2.75rem;
  align-items: center;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

@media (hover: hover) and (pointer: fine) and (min-width: 821px) {
  .js.scene-on .hint {
    display: flex;
    opacity: 0;
  }

  .js.scene-on.intro-done .hint {
    opacity: var(--cue, 1);
  }
}

/* ----------------------------------------------------------- présentation */

.about {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
}

.about-text {
  display: grid;
  gap: 1.5rem;
}

/* Les deux personnes de l'atelier, côte à côte : la photo, puis le nom et le rôle.
   Chacun a sa couleur, portée par le relief de sa photo : rose pour Romain, bleu pour Anaïs. */
.duo {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.person {
  display: grid;
  grid-template-columns: clamp(6.5rem, 24vw, 10rem) minmax(0, 1fr);
  /* De l'air entre la photo et le texte (le relief de la photo déborde déjà d'une dizaine de pixels). */
  gap: clamp(1.75rem, 5vw, 2.5rem);
  align-items: start;
}

.person-text {
  display: grid;
  gap: 0.3rem;
}

.person strong {
  font-size: 1.35rem;
  line-height: 1.2;
}

.person span {
  font-size: 1.0625rem;
  text-wrap: pretty;
}

/* Le rôle de chacun, sur sa propre ligne, avant le métier. */
.person .role {
  font-weight: 700;
}

/* Téléphone : la colonne à côté de la photo est trop étroite pour garder les phrases d'un seul tenant.
   Le nom et le rôle restent à côté de la photo, le métier passe dessous, sur toute la largeur. */
@media (max-width: 560px) {
  .person {
    grid-template-columns: clamp(6rem, 30vw, 8rem) minmax(0, 1fr);
    gap: 1.1rem 1.75rem;
  }

  .person-text {
    display: contents;
  }

  .person strong,
  .person .role {
    grid-column: 2;
  }

  .person strong {
    align-self: end;
    margin-top: 0.5rem;
  }

  .person .role {
    align-self: start;
    margin-top: -0.6rem;
  }

  .person figure {
    grid-row: 1 / span 2;
  }

  .person .trade {
    grid-column: 1 / -1;
  }
}

/* « Devis gratuit » : souligné d'un trait rose épais, partout où il apparaît. */
.free {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--a);
  text-decoration-thickness: 0.22em;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: none;
  white-space: nowrap;
}

/* Le cadre d'une photo, en relief comme les cartes du site. */
.portrait {
  position: relative;
  display: grid;
  place-content: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  --d: 10px;
  --blk-top: var(--a-top);
  --blk-side: var(--a-side);
}

/* La seconde personne : le relief en bleu. */
.portrait-b {
  --blk-top: var(--b-top);
  --blk-side: var(--b-side);
}

.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.facts {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.facts li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.facts li::before {
  content: "";
  width: 1rem;
  height: 1rem;
  margin-top: 0.3rem;
  background: var(--a);
  border: 2px solid var(--ink);
}

.facts li:nth-child(2)::before {
  background: var(--b-top);
}

.facts li:nth-child(3)::before {
  background: var(--n);
}

@media (min-width: 821px) {
  .duo,
  .about-text {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* -------------------------------------------------------------- solutions */

.head {
  display: grid;
  gap: 1.25rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

/* Sur petit écran, cinq boutons ne tiennent pas côte à côte : une liste déroulante les remplace.
   Elle est dessinée par le site (pas la fenêtre du téléphone) : un bouton au cadre encre, et la liste
   qui se déplie juste dessous, sur la même largeur ; l'exemple choisi en bleu, comme un bouton enfoncé. */
.preset-pick {
  display: none;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.preset-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.dd {
  position: relative;
}

.dd-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 3.25rem;
  padding: 0 3rem 0 1rem;
  font: 700 1.05rem/1.2 var(--font);
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}

/* Le chevron : il se retourne quand la liste est ouverte. */
.dd-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1.15rem;
  width: 0.6rem;
  height: 0.6rem;
  border-right: var(--bw) solid var(--text);
  border-bottom: var(--bw) solid var(--text);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.dd.open .dd-btn::after {
  transform: translateY(-20%) rotate(225deg);
}

.dd-list {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 20;
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-top: 0;
  box-shadow: 0 0.6rem 0 rgba(13, 16, 48, 0.12);
  outline: none;
  transform-origin: top;
  animation: dd-in 0.16s ease-out;
}

.dd-list[hidden] {
  display: none;
}

@keyframes dd-in {
  from {
    opacity: 0;
    transform: scaleY(0.9);
  }
}

.dd-opt {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1rem;
  font-weight: 500;
  border-top: 1px dashed var(--ghost);
  cursor: pointer;
}

.dd-opt:first-child {
  border-top-color: transparent;
}

/* Survol, ou choix au clavier : un fond teinté. */
.dd-opt.is-active {
  background: var(--tint-b);
}

.dd-list:focus-visible .dd-opt.is-active {
  outline: 2px solid var(--a);
  outline-offset: -4px;
}

.dd-opt[aria-selected="true"] {
  font-weight: 700;
  color: var(--on-band);
  background: var(--b);
}

@media (prefers-reduced-motion: reduce) {
  .dd-list {
    animation: none;
  }

  .dd-btn::after {
    transition: none;
  }
}

@media (max-width: 820px) {
  .chips {
    display: none;
  }

  .preset-pick {
    display: grid;
  }
}

.chip {
  min-height: 2.75rem;
  padding: 0 1rem;
  font: 500 1rem/1 var(--font);
  color: var(--text);
  background: transparent;
  border: 2px dashed var(--ghost);
  cursor: pointer;
}

.chip:hover {
  border-style: solid;
  border-color: var(--ink);
}

.chip[aria-pressed="true"] {
  font-weight: 700;
  color: var(--on-band);
  background: var(--b);
  border: 2px solid var(--ink);
}

.assembly {
  min-height: 3.2em;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  font-weight: 500;
}

.bricks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
}

.brick {
  --d: 9px;
  --blk-top: var(--surface);
  --blk-side: var(--grid);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  padding: 0.9rem 0.9rem 1.1rem;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: --d 0.18s ease;
}

.brick-art {
  width: 100%;
  height: 6.75rem;
}

.brick-name {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brick-desc {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--muted);
}

.brick:hover {
  --d: 13px;
}

.brick:active {
  --d: 3px;
}

/* Brique hors de l'assemblage : retour à l'état d'idée, à plat et en pointillés. */
.brick[aria-pressed="false"] {
  --d: 0px;
  background: transparent;
  border-style: dashed;
  border-color: var(--ghost);
}

.brick[aria-pressed="false"]::before,
.brick[aria-pressed="false"]::after {
  display: none;
}

.brick[aria-pressed="false"] .brick-name,
.brick[aria-pressed="false"] .brick-desc {
  color: var(--muted);
}

/* Très petit écran (320 à 360 px) : « Applications » et « Électronique » dépassaient de leur carte. */
@media (max-width: 360px) {
  .bricks {
    gap: 1.25rem 0.9rem;
  }

  .brick {
    padding: 0.8rem 0.7rem 1rem;
  }

  .brick-name {
    font-size: 1.05rem;
  }

  .brick-desc {
    font-size: 0.9rem;
    overflow-wrap: break-word;
  }
}

@media (min-width: 821px) {
  .bricks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 1.75rem;
  }

  .brick {
    padding: 1.1rem 1.1rem 1.4rem;
  }

  .brick-art {
    height: 8.25rem;
  }
}

.more {
  display: flex;
  justify-content: flex-end;
  max-width: none;
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* Bouton secondaire : en pointillés (une idée), le trait plein vient le recouvrir au survol. */
.btn-ghost {
  --btn-line: var(--text);
  color: var(--text);
  background: none;
}

.btn-ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  border: var(--bw) dashed var(--ghost);
  border-radius: inherit;
  pointer-events: none;
}

/* ------------------------------------------------------------ applications */

.apps {
  display: grid;
  gap: 1.75rem 1.5rem;
}

.app {
  --d: 9px;
  --blk-top: var(--surface);
  --blk-side: var(--grid);
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 0.2rem 1.1rem;
  height: 100%;
  padding: 1.1rem 1.25rem 1.25rem 1rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  transition: --d 0.18s ease;
}

.app-art,
.app-icon {
  grid-row: span 3;
  width: 5.5rem;
  height: 5.5rem;
}

.app-icon {
  object-fit: cover;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 1.35rem;
}

.band .head .lead {
  color: var(--on-band-muted);
}

.band .app-soon {
  color: var(--on-band);
  border-color: var(--on-band-muted);
}

.band .app-soon .app-url,
.band .app-soon .app-desc {
  color: var(--on-band-muted);
}

.band .app-soon .badge {
  color: var(--on-band);
  border-color: var(--on-band-muted);
}

.app-name {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.app-url {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--a);
}

:root[data-theme="dark"] .app-url {
  color: var(--a-top);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-url {
    color: var(--a-top);
  }
}

.app-desc {
  margin-top: 0.35rem;
  font-size: 0.975rem;
  line-height: 1.45;
  color: var(--muted);
}

a.app[href]:hover {
  --d: 13px;
}

a.app[href]:hover .app-url {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

a.app[href]:active {
  --d: 3px;
}

a.app:not([href]) .app-url {
  color: var(--muted);
}

/* Application en chantier : encore une idée, à plat et en pointillés. */
.app-soon {
  --d: 0px;
  background: transparent;
  border-style: dashed;
  border-color: var(--ghost);
}

.app-soon::before,
.app-soon::after {
  display: none;
}

.app-soon .app-url {
  color: var(--muted);
}

.badge {
  justify-self: start;
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  border: 2px dashed var(--ghost);
}

@media (min-width: 821px) {
  .apps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 2.25rem;
  }
}

/* ------------------------------------------------------------------- avis */

.reviews {
  display: grid;
  gap: 1.75rem 1.5rem;
}

.review {
  --d: 9px;
  --blk-top: var(--surface);
  --blk-side: var(--grid);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1.25rem;
  height: 100%;
  margin: 0;
  padding: 1.5rem 1.5rem 1.35rem;
  background: var(--surface);
}

.review blockquote {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}

.review blockquote::before {
  content: "\201C";
  display: block;
  height: 2.25rem;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--a);
}

.review figcaption {
  display: grid;
  gap: 0.1rem;
}

.review-name {
  font-weight: 700;
}

.review-meta {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Avis d'exemple, à remplacer : dessiné comme une idée. */
.review[data-placeholder] {
  --d: 0px;
  color: var(--muted);
  background: transparent;
  border-style: dashed;
  border-color: var(--ghost);
}

.review[data-placeholder]::before,
.review[data-placeholder]::after {
  display: none;
}

.review[data-placeholder] blockquote::before {
  color: var(--ghost);
}

@media (min-width: 821px) {
  .reviews {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.75rem;
  }
}

/* -------------------------------------------------------------- portfolio */

.pf-intro {
  padding-top: calc(var(--bar-h) + var(--bar-top) + clamp(3rem, 8vw, 6rem));
}

.h-page {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
}

.pf-note {
  min-height: 1.6em;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.pf-card .brick-soon {
  display: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--a);
}

.pf-card.soon .brick-soon {
  display: block;
}

/* ------------------------------------------------------------ formulaire */

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  padding: 0;
  font-weight: 700;
}

.opt {
  font-weight: 400;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 0;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea {
  border-color: var(--ghost);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .field input,
  :root:not([data-theme="light"]) .field textarea {
    border-color: var(--ghost);
  }
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--a);
  outline-offset: 0;
}

.field [aria-invalid="true"] {
  border-color: var(--a);
  border-style: dashed;
}

.two {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 560px) {
  .two {
    grid-template-columns: 1fr 1fr;
  }
}

.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.field .pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  font-weight: 500;
  border: 2px dashed var(--ghost);
  cursor: pointer;
}

.field .pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pick:has(input:checked) {
  font-weight: 700;
  color: var(--on-band);
  background: var(--b);
  border: 2px solid var(--ink);
}

.pick:has(input:focus-visible) {
  outline: 3px solid var(--a);
  outline-offset: 2px;
}

/* Code promo : un simple lien souligné, qui déplie le champ. */
.promo-toggle {
  position: relative;
  justify-self: start;
  padding: 0.35rem 0;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}

.promo-toggle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1rem;
  height: 2.5px;
  background: currentColor;
  transform: scaleX(0.35);
  transform-origin: left center;
  transition: transform 0.32s cubic-bezier(0.6, 0, 0.2, 1);
}

.promo-toggle:hover::after,
.promo-toggle:focus-visible::after {
  transform: scaleX(1);
}

.promo-box {
  display: grid;
  gap: 0.35rem;
  max-width: 24rem;
}

.promo-box input {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.promo-note:empty {
  display: none;
}

.promo-note {
  font-size: 0.95rem;
  font-weight: 500;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note {
  max-width: 34ch;
  font-size: 0.95rem;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.form-status {
  padding: 0.75rem 0.9rem;
  font-weight: 500;
  border: 2px dashed var(--a);
}

.form-status a {
  font-weight: 700;
}

/* Le formulaire se déplie sous le bouton, sur fond rose. */
.form-slot {
  display: grid;
  grid-template-rows: 1fr;
}

.js .form-slot {
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .form-slot.open {
  grid-template-rows: 1fr;
}

.form-clip {
  min-height: 0;
  overflow: hidden;
}

.form-pad {
  padding: 3rem 16px 6px 0;
}

.form-panel {
  --d: 14px;
  --blk-top: var(--a-top);
  --blk-side: var(--a-side);
  --text: #0d1030;
  --muted: #3c1530;
  --bg: #ffffff;
  --ghost: rgba(13, 16, 48, 0.5);
  color: var(--text);
  background: var(--a);
  padding: clamp(1.25rem, 4vw, 2.75rem);
}

.js .form-slot .form-panel {
  transform: translateY(-1.5rem);
  transition: transform 0.55s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.js .form-slot.open .form-panel {
  transform: none;
}

.form-panel form,
.form-done {
  display: grid;
  gap: 1.25rem;
}

.form-done {
  justify-items: start;
}

.form-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.form-panel h3 {
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.form-head .icon-btn {
  flex: none;
  margin: -0.4rem -0.6rem 0 0;
  color: var(--text);
}


.form-grid {
  display: grid;
  gap: 1.1rem;
}

.form-col {
  display: grid;
  gap: 1.1rem;
}

.field-msg textarea {
  height: 100%;
  min-height: 10rem;
}

@media (min-width: 821px) {
  .form-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 1.5rem;
  }

  .field-msg {
    grid-template-rows: auto 1fr;
  }
}

.form-panel :focus-visible,
.form-panel .field input:focus-visible,
.form-panel .field textarea:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.form-panel .field .pick:has(input:focus-visible) {
  outline-color: var(--text);
}

.form-panel .field .pick {
  border-color: rgba(13, 16, 48, 0.55);
  background: rgba(255, 255, 255, 0.35);
}

.form-panel .field .pick:has(input:checked) {
  color: #ffffff;
  background: var(--b);
  border-color: var(--ink);
}

.form-panel .form-status {
  background: #ffffff;
  border: 2px solid var(--ink);
}

.form-panel .field [aria-invalid="true"] {
  border-color: var(--ink);
  border-width: 3px;
}

.btn-navy {
  --btn-line: #ffffff;
  color: #ffffff;
  background: var(--b);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-top: 0.25rem;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.btn[disabled]::after {
  --sweep: 0deg;
}

/* ---------------------------------------------------------------- méthode */

.steps {
  display: grid;
  gap: 2.5rem 1.75rem;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.35rem 1.25rem;
  align-items: start;
  align-content: start;
  counter-increment: step;
}

.step canvas {
  grid-row: span 2;
  width: 6.5rem;
  height: 9.25rem;
}

.step h3 {
  align-self: end;
  font-size: 1.4rem;
}

.step h3 {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.4em;
}

.step h3::before {
  content: counter(step) ".";
  color: var(--a);
}

.step p {
  color: var(--muted);
}

.method-stage {
  display: none;
}

@media (min-width: 821px) {
  .method {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 3rem;
    align-items: start;
  }

  .method-stage {
    position: sticky;
    top: calc(var(--bar-h) + var(--bar-top) + 1.5rem);
    display: block;
    height: min(72vh, 40rem);
  }

  .method-stage canvas {
    width: 100%;
    height: 100%;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .step {
    grid-template-columns: 1fr;
    align-content: center;
    min-height: 52vh;
    gap: 0.75rem;
    transition: opacity 0.3s ease;
  }

  .step canvas {
    display: none;
  }

  .step h3 {
    align-self: start;
    font-size: clamp(1.75rem, 2.8vw, 2.4rem);
    letter-spacing: -0.02em;
  }

  .step p {
    font-size: 1.15rem;
  }

  .method.live .step:not(.active) {
    opacity: 0.32;
  }
}

/* --------------------------------------------------------------- contact */

.band {
  color: var(--on-band);
  background: var(--band);
  border-block: var(--bw) solid var(--ink);
}

.cta {
  display: grid;
  gap: 2rem;
  align-items: end;
}

.cta-text {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

.cta-text h2 {
  max-width: 15ch;
  font-size: clamp(2.4rem, 5.4vw, 4.75rem);
}

.cta-text .lead {
  color: var(--on-band-muted);
}

.cta-text .btn {
  margin-top: 0.75rem;
}

.coords {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.75rem;
  font-weight: 500;
  color: var(--on-band-muted);
}

.coords a {
  color: var(--on-band);
  text-underline-offset: 0.25em;
}

.coords.flash {
  animation: flash 0.9s ease;
}

@keyframes flash {
  30% {
    color: var(--on-band);
    transform: translateX(6px);
  }
}

#pile {
  width: 100%;
  height: clamp(15rem, 62vw, 26rem);
}

@media (min-width: 821px) {
  .cta {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  }

  #pile {
    height: clamp(20rem, 34vw, 30rem);
  }
}

/* ------------------------------------------------- suivi du défilement */

.rail {
  position: fixed;
  right: 0.9rem;
  top: 50%;
  z-index: 40;
  padding: 0.5rem 0.3rem;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  transform: translateY(-50%);
  transition: opacity 0.3s ease, visibility 0.3s;
}

.js .rail:not(.on) {
  opacity: 0;
  visibility: hidden;
}

.rail ol {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rail a {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
}

.rail .cube {
  width: 1.05rem;
  height: 1.15rem;
  overflow: visible;
  transition: transform 0.25s cubic-bezier(0.34, 1.6, 0.64, 1);
}

.rail .cube polygon {
  fill: var(--surface);
  stroke: var(--ghost);
  stroke-width: 1.6;
  stroke-dasharray: 2.2 2.4;
  stroke-linejoin: round;
}

/* Section déjà lue : le cube devient plein, mais reste gris. Seule la section en cours prend la couleur. */
.rail a.done .cube polygon {
  stroke-dasharray: none;
}

.rail a.done .l {
  fill: var(--grid);
}

.rail a.done .r {
  fill: var(--ghost);
  fill-opacity: 0.4;
}

.rail a.current .cube polygon {
  stroke: var(--ink);
  stroke-dasharray: none;
}

.rail a.current .t {
  fill: var(--a-top);
}

.rail a.current .l {
  fill: var(--a);
}

.rail a.current .r {
  fill: var(--a-side);
}

.rail a.current .cube {
  transform: scale(1.45);
}

.rail-label {
  position: absolute;
  right: calc(100% + 0.6rem);
  top: 50%;
  padding: 0.3rem 0.7rem;
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
  border-radius: 0.65rem;
  background: var(--glass-solid);
  border: 1px solid var(--glass-line);
  opacity: 0;
  transform: translate(0.4rem, -50%);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rail a:hover .rail-label,
.rail a:focus-visible .rail-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.rail-line {
  position: absolute;
  left: 50%;
  top: 1.75rem;
  bottom: 1.75rem;
  width: 2px;
  background: var(--glass-line);
  transform: translateX(-50%);
}

.rail-fill {
  display: block;
  width: 100%;
  height: calc(var(--p, 0) * 100%);
  background: var(--ghost);
}

@media (max-width: 1239px) {
  .rail {
    top: 0;
    bottom: 0;
    right: 0;
    width: 4px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: none;
    pointer-events: none;
  }

  .rail ol {
    display: none;
  }

  .rail-line {
    inset: 0;
    width: 4px;
    background: transparent;
    transform: none;
  }

  /* Sur petit écran, la fine barre est le seul repère : elle garde sa couleur. */
  .rail-fill {
    background: var(--a);
  }
}

/* ------------------------------------------------------------ pied de page */

.foot {
  padding-block: 3rem 2.5rem;
  background: var(--bg);
}

.foot-in {
  display: grid;
  gap: 1.5rem;
}

.foot .brand {
  visibility: visible;
}

.foot-slogan {
  font-size: 1.15rem;
  font-weight: 300;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-weight: 500;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  text-underline-offset: 0.3em;
}

.legal {
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (min-width: 821px) {
  .foot-in {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .foot-links {
    justify-content: flex-end;
  }
}

/* ----------------------------------------------------------- page d'erreur */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.5rem;
  padding: var(--gutter);
  text-align: center;
}

.lost svg {
  height: 12rem;
  width: auto;
  overflow: visible;
}

.lost .ghost-s polygon {
  fill: var(--bg);
  stroke: var(--ghost);
  stroke-width: 9;
  stroke-dasharray: 20 22;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------ pages secondaires */

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: calc(var(--bar-h) + var(--bar-top) + 3.5rem) var(--gutter) 5rem;
}

.doc h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
}

.doc h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.doc p + p {
  margin-top: 0.75rem;
}

.doc dl {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
}

.doc dt {
  font-weight: 700;
}

.doc dd {
  margin: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-left: auto;
  padding: 0 0.75rem;
  font-weight: 500;
  text-underline-offset: 0.3em;
}

@media (max-width: 520px) {
  .doc dl {
    grid-template-columns: 1fr;
  }

  .doc dd {
    margin-bottom: 0.5rem;
  }
}

/* Vérification anti-robot (Cloudflare Turnstile), affichée à l'ouverture du formulaire. */
.ts-label {
  font-weight: 700;
}

.ts-box {
  min-height: 65px;
  max-width: 100%;
}

/* Champs du formulaire : trait d'encre plein sur le fond rose, dans les deux thèmes. */
#formulaire .field input,
#formulaire .field textarea {
  border-color: var(--ink);
}

#formulaire .field [aria-invalid="true"] {
  border-width: 3px;
  border-style: dashed;
}

/* ------------------------------------------------------- mouvement réduit */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .cue::after,
  .coords.flash {
    animation: none;
  }

  .btn,
  .btn::after,
  .promo-toggle::after,
  .brick,
  .bar::before,
  .js .reveal,
  .js .form-slot,
  .js .form-slot .form-panel,
  .rail .cube {
    transition: none;
  }

  .links a::after {
    transition: none;
  }

  .icon-btn:hover svg > *,
  .icon-btn:focus-visible svg > * {
    animation: none;
  }

  .js .reveal.pending {
    opacity: 1;
    transform: none;
  }
}

/* Son des briques : ondes quand il est actif, croix quand il est coupé. */
#soundBtn .mute,
#soundBtn[aria-pressed="false"] .wave {
  display: none;
}

#soundBtn[aria-pressed="false"] .mute {
  display: inline;
}

/* Code secret : une pluie de pièces posée en bas de l'écran, par-dessus tout, sans bloquer les clics. */
.rain {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rain-toast {
  position: fixed;
  top: 5.2rem;
  left: 50%;
  z-index: 61;
  max-width: min(32rem, calc(100% - 2rem));
  margin: 0;
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  background: var(--a);
  border: 2.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transform: translate(-50%, -0.6rem);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
  pointer-events: none;
}

.rain-toast.in {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .rain-toast {
    transition: none;
  }
}
