:root {
  --bg: #ffffff; --panel: #f6f5fb; --text: #1b1a24; --muted: #5f5d70; --line: #e6e3f0;
  --accent: #7c3aed; --accent-soft: #f3edff; --code: #f2f0f7; --shadow: 0 6px 24px rgba(30, 15, 60, .10);
  --band: linear-gradient(90deg, #38bdf8, #7c3aed, #a855f7);
  --hero: linear-gradient(135deg, #1e1b4b 0%, #5b21b6 50%, #0891b2 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0b16; --panel: #15121f; --text: #ebe9f4; --muted: #a29fb5; --line: #262236;
    --accent: #a78bfa; --accent-soft: #1f1836; --code: #1b1828; --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--bg); padding: 6px 10px; }
.top {
  position: sticky; top: 0; z-index: 5; height: 60px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; border-bottom: 2px solid transparent; border-image: var(--band) 1;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); }
.logo { width: 28px; height: 28px; border-radius: 7px; }
.lang { font-size: 14px; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.lang:hover { border-color: var(--accent); text-decoration: none; }
.layout {
  display: grid; grid-template-columns: 250px minmax(0, 780px) 220px; gap: 48px;
  max-width: 1360px; margin: 0 auto; padding: 0 24px;
}
.side { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 28px 0; }
.side .dl { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 12px; margin: 0 0 8px;
  border-radius: 10px; background: var(--band); color: #fff; font-size: 15px; font-weight: 650;
  box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
.side .dl:hover { text-decoration: none; filter: brightness(1.08); }
.side .dl svg { flex: none; }
.dl-hint { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0 0 24px; text-align: center; }
.side .dl-hint a { display: inline; padding: 0; font-size: inherit; color: var(--text); text-decoration: underline; }
.side .dl-hint a:hover { background: none; }
.side summary { list-style: none; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px; pointer-events: none; }
.side summary::-webkit-details-marker { display: none; }
.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--text); font-size: 15px; }
.side a:hover { background: var(--panel); text-decoration: none; }
.side a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { padding: 36px 0 80px; min-width: 0; }
.hero { display: flex; align-items: center; gap: 24px; margin: 0 0 28px; padding: 28px; border-radius: 16px;
  color: #fff; background: var(--hero); box-shadow: var(--shadow); }
.hero img { width: 96px; height: 96px; flex: none; border-radius: 22px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.hero p { margin: 0; color: #fff; }
.hero .kicker { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.hero .name { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.hero .tag { opacity: .92; margin-top: 4px; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.badges span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.cards a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text); font-weight: 600; }
.cards a:hover { border-color: var(--accent); text-decoration: none; }
.cards small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gallery.g3 { grid-template-columns: 1fr 1fr 1fr; }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow); }
article h1 { font-size: 2.2rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 20px; }
article h2 { font-size: 1.45rem; letter-spacing: -.01em; margin: 48px 0 12px; padding-top: 20px;
  border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
article h2::before { content: ""; flex: none; width: 10px; height: 22px; border-radius: 4px; background: var(--band); }
article h3 { font-size: 1.12rem; margin: 32px 0 8px; }
article ul, article ol { padding-left: 1.4em; }
article li { margin: 4px 0; }
article li::marker { color: var(--muted); }
article strong { font-weight: 620; }
article code { font: .88em ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--code);
  padding: .12em .4em; border-radius: 5px; }
article pre { background: var(--code); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
article pre code { background: none; padding: 0; }
article blockquote { margin: 20px 0; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 10px 10px 0; }
article blockquote p { margin: 4px 0; }
article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; }
article th, article td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
article th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
kbd { font: .85em ui-monospace, Consolas, monospace; padding: .1em .45em; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; background: var(--panel); }
figure { margin: 24px 0; }
figure img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line);
  box-shadow: var(--shadow); }
figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; text-align: center; }
article img { max-width: 100%; }
.pager { display: flex; gap: 16px; margin-top: 56px; }
.pager a { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; color: var(--text); font-weight: 600; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.pager .next { text-align: right; margin-left: auto; }
.toc { position: sticky; top: 60px; align-self: start; padding: 36px 0; font-size: 14px;
  max-height: calc(100vh - 60px); overflow: auto; }
.toc p { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--muted); }
.toc a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px; padding: 24px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot a, .foot span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.foot img { border-radius: 5px; }
.foot small { flex-basis: 100%; text-align: center; font-size: 12px; }
@media (max-width: 1180px) { .layout { grid-template-columns: 230px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .top { padding: 0 16px; }
  .layout { display: block; padding: 0 16px; }
  .side { position: static; max-height: none; padding: 16px 0 0; }
  .side details { border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
  .side summary { pointer-events: auto; cursor: pointer; margin: 4px 6px; }
  article h1 { font-size: 1.8rem; }
  .hero { flex-direction: column; text-align: center; }
  .gallery, .gallery.g3 { grid-template-columns: 1fr 1fr; }
  .brand em { display: none; }
  .pager { flex-direction: column; }
}

/* ── Matières et mouvement (façon Apple) ─────────────────────────────────────────────────────────────────────
   Ressort critiquement amorti (amortissement 1.0, réponse 0,4 s) échantillonné en linear() : aucun rebond. */
:root { --spring: linear(0, .142 10%, .38 20%, .589 30%, .74 40%, .841 50%, .905 60%, .945 70%, .968 80%, .982 90%, 1); }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui,
  Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
article h1 { font-size: clamp(2rem, 3.2vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; }
article h2 { letter-spacing: -.02em; }
.hero .name { letter-spacing: -.025em; }

/* Barre du haut : matière translucide, ombre seulement quand le contenu passe dessous. */
.top { border-image: none; border-bottom: 0; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(20px) saturate(180%); transition: box-shadow .3s ease; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--band); }
.top.scrolled { box-shadow: 0 10px 30px -14px rgba(20, 10, 50, .35); }

/* Changement de page (site.js, marche aussi en file://) : le surlignage du menu glisse d'un lien à l'autre,
   comme la pastille de la barre latérale d'Orbit ; le contenu sort puis entre en glissant. */
.side ul { position: relative; }
.side li { position: relative; z-index: 1; }
.side .pill { position: absolute; left: 0; right: 0; top: 0; z-index: 0; border-radius: 8px; background: var(--accent-soft);
  pointer-events: none; transition: transform .5s var(--spring), height .5s var(--spring); }
.side .pill.still { transition: none; }
.side ul.has-pill a[aria-current] { background: transparent; }

/* Bandeau d'accueil : dégradé vivant + reflet qui suit le pointeur. */
.hero { position: relative; overflow: hidden; isolation: isolate; background: #1e1b4b; }
.hero::before { content: ""; position: absolute; inset: -50%; z-index: -2;
  background: radial-gradient(35% 45% at 25% 35%, #7c3aed 0, transparent 70%),
    radial-gradient(30% 40% at 75% 25%, #0891b2 0, transparent 70%),
    radial-gradient(40% 50% at 60% 80%, #a855f7 0, transparent 70%), linear-gradient(135deg, #1e1b4b, #312e81);
  animation: mesh 30s linear infinite; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(320px circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, .16), transparent 65%);
  transition: opacity .35s ease; }
.hero:hover::after { opacity: 1; }
.hero img { transition: transform .6s var(--spring); }
.hero:hover img { transform: translateY(-3px) rotate(-6deg) scale(1.05); }
@keyframes mesh { to { transform: rotate(360deg); } }

/* Apparition au défilement (ajoutée par site.js aux éléments sous la ligne de flottaison seulement). */
.js .rv { opacity: 0; transform: translateY(18px); }
.js .rv.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .75s var(--spring);
  transition-delay: calc(var(--i, 0) * 50ms); }

/* Retour au toucher : réponse à l'appui, immédiate. */
.side a { transition: background .2s ease, color .2s ease, transform .12s ease-out; }
.side a:active, .pager a:active, .lang:active { transform: scale(.97); transition-duration: .08s; }
.side .dl { position: relative; overflow: hidden; transition: transform .12s ease-out, box-shadow .3s ease, filter .2s; }
.side .dl::after { content: ""; position: absolute; inset: 0; transform: translateX(-110%);
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transition: transform .9s var(--spring); }
.side .dl:hover::after { transform: translateX(110%); }
.side .dl:active { transform: scale(.97); transition-duration: .08s; }
.cards a { position: relative; overflow: hidden; transition: transform .35s var(--spring), border-color .2s, box-shadow .35s; }
.cards a::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(240px circle at var(--x, 50%) var(--y, 50%), color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%); }
.cards a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cards a:hover::before { opacity: 1; }
.cards a:active { transform: scale(.98); transition-duration: .08s; }
.pager a { transition: transform .35s var(--spring), border-color .2s, box-shadow .35s; }
.pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Captures : légère élévation au survol, fondu à l'arrivée, zoom qui part de l'image (site.js). */
figure img, .gallery img { transition: transform .4s var(--spring), box-shadow .4s ease, opacity .5s ease; }
figure a { display: block; cursor: zoom-in; }
figure a:hover img, .gallery img:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -16px rgba(30, 15, 60, .45); }
figure a:active img { transform: scale(.99); transition-duration: .08s; }
img.ld { opacity: 0; }
.lb { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 4vh 4vw; cursor: zoom-out;
  background: rgba(10, 8, 20, 0); backdrop-filter: blur(0) saturate(100%);
  transition: background .35s ease, backdrop-filter .35s ease; }
.lb.on { background: rgba(10, 8, 20, .55); backdrop-filter: blur(16px) saturate(140%); }
.lb img { max-width: 100%; max-height: 92vh; border-radius: 14px; transform-origin: 0 0;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .6); }

/* Sur cette page : indicateur qui glisse vers la section lue. */
.toc ul { position: relative; }
.toc .ind { position: absolute; left: 0; top: 0; width: 2px; border-radius: 2px; background: var(--accent); opacity: 0;
  transition: transform .45s var(--spring), height .45s var(--spring), opacity .3s; }
.toc a { transition: color .2s ease; }
.toc a.on { color: var(--text); }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
/* « Réduire les animations » : plus de glissement, de zoom ni de rotation, mais des fondus doux (règle Apple). */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .js .rv, .js .rv.in { transform: none; }
  .js .rv.in { transition: opacity .5s ease; }
  .cards a:hover, .pager a:hover, figure a:hover img, .gallery img:hover, .hero:hover img { transform: none; }
  .toc .ind { transition: opacity .3s; }
}
@media (prefers-reduced-transparency: reduce) { .top { background: var(--bg); backdrop-filter: none; } }
