/* ═══════════════════════════════════════════════
   Ursus GBAGUIDI · Portfolio
   Direction : carnet de laboratoire / publication scientifique
   ═══════════════════════════════════════════════ */

:root {
  --paper: #f2eee4;
  --paper-2: #e9e3d5;
  --ink: #14161a;
  --ink-2: #3a3d44;
  --mute: #74716a;
  --ink-rgb: 20, 22, 26;
  --paper-rgb: 242, 238, 228;
  --grid: rgba(var(--ink-rgb), .07);
  --grid-2: rgba(var(--ink-rgb), .14);
  --plot: #f7f4ec;
  --tint: rgba(226, 218, 200, .45);
  --deep: #14161a;
  --deep-fg: #f2eee4;
  --glow-a: rgba(255, 255, 255, .7);
  --glow-b: rgba(185, 122, 68, .14);
  --noise-op: .5;
  --noise-blend: multiply;
  --blue: #2346ff;
  --red: #e0412b;
  --camel: #b97a44;

  --f-d: "Schibsted Grotesk", system-ui, sans-serif;
  --f-m: "IBM Plex Mono", ui-monospace, monospace;

  --wrap: 1240px;
  --gut: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --cell: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.6 var(--f-d);
  position: relative;
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

/* ─── Fond : papier millimétré ─── */
.bg { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(1100px 700px at 12% -5%, var(--glow-a), transparent 65%),
    radial-gradient(900px 800px at 105% 105%, var(--glow-b), transparent 60%),
    radial-gradient(700px 600px at 95% 10%, rgba(35, 70, 255, .05), transparent 60%),
    var(--paper);
}
.bg::after { content: ""; position: absolute; inset: 0; opacity: var(--noise-op); mix-blend-mode: var(--noise-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .4 0 0 0 0 .32 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-grid, .bg-glow { position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--maj) 1px, transparent 1px),
    linear-gradient(90deg, var(--maj) 1px, transparent 1px),
    linear-gradient(var(--min) 1px, transparent 1px),
    linear-gradient(90deg, var(--min) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: 0 var(--gy, 0px);
}
.bg-grid { --maj: rgba(var(--ink-rgb), .11); --min: rgba(var(--ink-rgb), .055); }
.bg-glow { --maj: rgba(35, 70, 255, .7); --min: rgba(35, 70, 255, .38);
  -webkit-mask-image: radial-gradient(340px 340px at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0,0,0,.4) 35%, transparent 70%);
          mask-image: radial-gradient(340px 340px at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0,0,0,.4) 35%, transparent 70%);
  transition: opacity .4s; }
.bg-margin { position: absolute; top: 0; bottom: 0; left: max(18px, calc((100vw - var(--wrap)) / 2 - 22px)); width: 5px; border-left: 1px solid rgba(224, 65, 43, .45); border-right: 1px solid rgba(224, 65, 43, .3); }
.notes { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.notes span.hi { color: rgba(35, 70, 255, .3); }
.notes span { position: absolute; font: 400 clamp(13px, 1.2vw, 17px)/1 var(--f-m); color: rgba(var(--ink-rgb), .24); white-space: nowrap; transform: rotate(var(--r)) translateY(var(--py, 0px)); will-change: transform; }
.notes sub, .notes sup { font-size: .7em; }
@media (max-width: 960px) { .bg-margin, .bg-glow { display: none; } .notes span { color: rgba(var(--ink-rgb), .13); } }
i, em, cite, address { font-style: normal; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
b, strong { font-weight: 700; }
mark { background: linear-gradient(transparent 58%, rgba(35, 70, 255, .22) 58%); color: inherit; padding: 0 2px; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* ─── Mode sombre : plan d'architecte ─── */
:root[data-theme="dark"] {
  --paper: #101318; --paper-2: #171b22; --ink: #ece6d8; --ink-2: #b8b2a5; --mute: #8b867c;
  --ink-rgb: 236, 230, 216; --paper-rgb: 16, 19, 24;
  --grid: rgba(var(--ink-rgb), .06); --grid-2: rgba(var(--ink-rgb), .14);
  --blue: #6f8bff; --red: #ff6a52; --camel: #d9a06b;
  --plot: #141820; --tint: rgba(30, 36, 48, .45);
  --deep: #090b0f; --deep-fg: #f2eee4;
  --glow-a: rgba(111, 139, 255, .10); --glow-b: rgba(217, 160, 107, .08);
  --noise-op: .25; --noise-blend: normal;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101318; --paper-2: #171b22; --ink: #ece6d8; --ink-2: #b8b2a5; --mute: #8b867c;
    --ink-rgb: 236, 230, 216; --paper-rgb: 16, 19, 24;
    --grid: rgba(var(--ink-rgb), .06); --grid-2: rgba(var(--ink-rgb), .14);
    --blue: #6f8bff; --red: #ff6a52; --camel: #d9a06b;
    --plot: #141820; --tint: rgba(30, 36, 48, .45);
    --deep: #090b0f; --deep-fg: #f2eee4;
    --glow-a: rgba(111, 139, 255, .10); --glow-b: rgba(217, 160, 107, .08);
    --noise-op: .25; --noise-blend: normal;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .hero-photo img, :root[data-theme="dark"] .cert-thumb img { filter: brightness(.92); }
:root[data-theme="dark"] .sec-ink { border-block: 1.5px solid var(--grid-2); }

/* ─── Bouton thème ─── */
.theme-btn { width: 44px; height: 44px; border: 1.5px solid var(--ink); display: grid; place-items: center; transition: background .2s, color .2s; flex: none; }
.theme-btn:hover { background: var(--ink); color: var(--paper); }
.theme-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
html.theme-anim, html.theme-anim * { transition: background-color .4s, color .4s, border-color .4s, fill .4s, stroke .4s !important; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* ─── Réticule ─── */
.cross { position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: 0; transition: opacity .3s; }
.cross.on { opacity: 1; }
.cross-h, .cross-v { position: absolute; background: rgba(35, 70, 255, .25); }
.cross-h { left: 0; right: 0; height: 1px; top: 0; }
.cross-v { top: 0; bottom: 0; width: 1px; left: 0; }
.cross-read { position: absolute; font: 500 10px/1 var(--f-m); color: var(--blue); background: var(--paper); padding: 3px 5px; border: 1px solid rgba(35, 70, 255, .35); white-space: nowrap; }
@media (hover: none), (max-width: 960px) { .cross { display: none; } }

/* ─── Boutons / liens ─── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; font: 600 15px/1 var(--f-d); border: 1.5px solid var(--ink); transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s; }
.btn:hover { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { box-shadow: 3px 3px 0 var(--blue); }
.btn-out { background: var(--paper); }
.btn-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-paper:hover { box-shadow: 3px 3px 0 var(--blue); }
.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-blue:hover { box-shadow: 3px 3px 0 var(--paper); }
.btn.sm { padding: 9px 14px; font-size: 13px; }
.btn.full { width: 100%; }
.lnk { font: 500 13px/1.4 var(--f-m); color: var(--blue); border-bottom: 1px solid rgba(35, 70, 255, .35); transition: border-color .2s, color .2s; }
.lnk:hover { border-color: var(--blue); }
.lnk.off { color: var(--mute); border: 0; }
.lnk-row { display: flex; gap: 18px; flex-wrap: wrap; }
.tag { font: 500 12px/1.4 var(--f-m); letter-spacing: .04em; text-transform: uppercase; }
.led { display: inline-block; width: 8px; height: 8px; background: #16a34a; border-radius: 50%; margin-right: 8px; vertical-align: 1px; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* ─── MASTHEAD ─── */
.mast { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 20px; padding: 14px var(--gut); background: rgba(var(--paper-rgb), .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1.5px solid var(--ink); }
.mast.menu-open { backdrop-filter: none; -webkit-backdrop-filter: none; }
.mast-id { display: flex; align-items: center; gap: 10px; margin-right: auto; font: 800 16px/1 var(--f-d); letter-spacing: -.01em; }
.mast-glyph { width: 34px; height: 22px; fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; }
.mast-nav { display: flex; gap: 2px; }
.mast-nav a { padding: 7px 10px; font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.mast-nav a b { font: 500 11px/1 var(--f-m); color: var(--mute); margin-right: 3px; }
.mast-nav a:hover { background: var(--ink); color: var(--paper); }
.mast-nav a:hover b { color: var(--paper); }
.mast-nav a.is-active { background: var(--blue); color: #fff; }
.mast-nav a.is-active b { color: #fff; }
.mast-burger { display: none; width: 44px; height: 44px; border: 1.5px solid var(--ink); position: relative; }
.mast-burger span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); transition: transform .3s var(--ease), top .3s; }
.mast-burger span:first-child { top: 16px; }
.mast-burger span:last-child { top: 24px; }
.mast-burger[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.mast-burger[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }
.mast-axis { position: absolute; left: 0; right: 0; bottom: -1.5px; height: 3px; }
.mast-axis span { display: block; height: 100%; background: var(--blue); transform-origin: 0 50%; transform: scaleX(0); }
.mast-axis b { position: absolute; right: var(--gut); top: 8px; font: 500 10px/1 var(--f-m); color: var(--mute); background: var(--paper); padding: 2px 4px; }

/* ─── HERO ─── */
.hero { position: relative; padding: clamp(110px, 15vh, 150px) 0 40px; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
#mc { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy .tag { margin-bottom: 22px; }
.hero-name { font: 900 clamp(58px, 9vw, 140px)/.84 var(--f-d); letter-spacing: -.055em; margin-bottom: 26px; }
.hero-name .scr { display: block; }
.hero-name .scr:last-child { color: var(--blue); }
.hero-name .glyph { color: var(--red); }
.hero-role { font: 500 14px/1.5 var(--f-m); margin-bottom: 22px; }
.hero-role span { color: var(--red); margin: 0 10px; }
.hero-abstract { max-width: 600px; font-size: clamp(17px, 1.5vw, 19px); color: var(--ink-2); background: rgba(var(--paper-rgb), .82); padding: 14px 16px; border-left: 3px solid var(--ink); margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-n { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; border: 1.5px solid var(--ink); background: var(--paper); width: max-content; max-width: 100%; }
.hero-n div { padding: 10px 18px; }
.hero-n div + div { border-left: 1.5px solid var(--ink); }
.hero-n dt { font: 500 12px/1 var(--f-m); color: var(--mute); }
.hero-n dt::before { content: "n "; color: var(--blue); }
.hero-n dd { font: 800 34px/1.1 var(--f-d); letter-spacing: -.03em; }

.hero-fig figcaption { font: 400 12px/1.5 var(--f-m); color: var(--ink-2); margin-top: 12px; }
.hero-fig figcaption b { color: var(--ink); }
.hero-photo { position: relative; aspect-ratio: 4 / 5; border: 1.5px solid var(--ink); padding: 10px; background: var(--paper); box-shadow: 10px 10px 0 var(--ink); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; filter: contrast(1.04); }
.corner { position: absolute; width: 22px; height: 22px; border-color: var(--red); border-style: solid; border-width: 0; z-index: 2; transition: transform .6s var(--ease); }
.c1 { top: -8px; left: -8px; border-top-width: 2px; border-left-width: 2px; }
.c2 { top: -8px; right: -8px; border-top-width: 2px; border-right-width: 2px; }
.c3 { bottom: -8px; left: -8px; border-bottom-width: 2px; border-left-width: 2px; }
.c4 { bottom: -8px; right: -8px; border-bottom-width: 2px; border-right-width: 2px; }
.hero-fig:hover .c1 { transform: translate(-6px, -6px); }
.hero-fig:hover .c2 { transform: translate(6px, -6px); }
.hero-fig:hover .c3 { transform: translate(-6px, 6px); }
.hero-fig:hover .c4 { transform: translate(6px, 6px); }
.scanline { position: absolute; left: 10px; right: 10px; top: 10px; height: 2px; background: var(--blue); box-shadow: 0 0 18px 4px rgba(35, 70, 255, .45); z-index: 2; animation: scan 4.5s var(--ease) infinite; opacity: .8; }
@keyframes scan { 0% { top: 10px; opacity: 0; } 10% { opacity: .8; } 90% { opacity: .8; } 100% { top: calc(100% - 12px); opacity: 0; } }
.mark { position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--f-m); background: var(--ink); color: var(--paper); padding: 6px 8px; white-space: nowrap; opacity: 0; transform: translateX(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.mark i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(224, 65, 43, .25); }
.mark.in { opacity: 1; transform: none; }
.m1 { top: 18%; right: -22px; }
.m2 { top: 46%; left: -28px; }
.m3 { bottom: 14%; right: -16px; }
.mc-legend { position: relative; z-index: 1; margin-top: 40px; font: 400 11px/1.4 var(--f-m); color: var(--mute); }

/* ─── SECTIONS ─── */
.sec { padding: clamp(80px, 11vw, 130px) 0; position: relative; }
.sec-tint { background-color: var(--tint); border-block: 1.5px solid var(--ink); }
.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }
.sec-id { font: 600 clamp(18px, 2vw, 24px)/1 var(--f-m); color: var(--blue); }
.sec-head h2 { font: 900 clamp(40px, 6.4vw, 88px)/.95 var(--f-d); letter-spacing: -.045em; white-space: nowrap; }
.sec-rule { flex: 1; height: 1.5px; background: var(--ink); align-self: center; transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.2s var(--ease) .2s; min-width: 30px; }
.sec-head.in .sec-rule { transform: scaleX(1); }
.sec-lead { font: 400 14px/1.6 var(--f-m); color: var(--ink-2); margin-bottom: 40px; max-width: 760px; }

/* ─── §1 Résumé ─── */
.abstract { display: grid; grid-template-columns: 1.3fr .7fr; gap: clamp(32px, 5vw, 72px); align-items: start; margin-top: 40px; }
.abstract-text p { color: var(--ink-2); margin-bottom: 18px; max-width: 720px; }
.abstract-text .big { font: 600 clamp(22px, 2.4vw, 32px)/1.3 var(--f-d); color: var(--ink); letter-spacing: -.02em; }
.keywords { font: 400 13px/1.7 var(--f-m) !important; border-top: 1.5px solid var(--ink); padding-top: 14px; }
.lnk-inline, .abstract-text .lnk { font-family: var(--f-d); font-size: inherit; }
.abstract-fig { border: 1.5px solid var(--ink); padding: 10px; background: var(--paper); transform: rotate(1.5deg); transition: transform .5s var(--ease); }
.abstract-fig:hover { transform: rotate(0); }
.abstract-fig img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; filter: grayscale(1) contrast(1.1); transition: filter .5s; }
.abstract-fig:hover img { filter: none; }
figcaption { font: 400 12px/1.5 var(--f-m); color: var(--ink-2); margin-top: 10px; }

/* ─── §2 Résultats ─── */
.results { border: 1.5px solid var(--ink); background: var(--paper); }
.res-head, .res summary { display: grid; grid-template-columns: 90px 1.4fr 1fr 110px 40px; align-items: center; gap: 16px; padding: 16px 20px; }
.res-head { font: 500 11px/1 var(--f-m); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); border-bottom: 1.5px solid var(--ink); padding-block: 12px; }
.res { border-bottom: 1px solid var(--grid-2); }
.res:last-child { border-bottom: 0; }
.res summary { cursor: pointer; list-style: none; transition: background .2s; }
.res summary::-webkit-details-marker { display: none; }
.res summary:hover { background: rgba(35, 70, 255, .06); }
.rk { font: 800 26px/1 var(--f-d); letter-spacing: -.03em; }
.rk sup { font-size: .5em; }
.rk-1 { color: var(--blue); }
.rk-2 { color: var(--camel); }
.res-name { font: 700 clamp(17px, 1.6vw, 21px)/1.25 var(--f-d); letter-spacing: -.01em; }
.res-dom, .res-y { font: 400 13px/1.3 var(--f-m); color: var(--ink-2); }
.res-tog { width: 22px; height: 22px; position: relative; justify-self: end; }
.res-tog::before, .res-tog::after { content: ""; position: absolute; left: 4px; right: 4px; top: 10px; height: 2px; background: var(--ink); transition: transform .3s var(--ease); }
.res-tog::after { transform: rotate(90deg); }
.res[open] .res-tog::after { transform: rotate(0); }
.res[open] summary { background: var(--ink); color: var(--paper); }
.res[open] .res-dom, .res[open] .res-y { color: var(--paper); opacity: .75; }
.res[open] .res-tog::before, .res[open] .res-tog::after { background: var(--paper); }
.res-body { padding: 18px 20px 22px calc(90px + 36px); display: grid; gap: 12px; color: var(--ink-2); max-width: 980px; animation: drop .4s var(--ease); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ─── §3 Méthodes ─── */
.sets { display: grid; gap: 0; border: 1.5px solid var(--ink); background: var(--paper); }
.set { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 26px 24px; border-bottom: 1px solid var(--grid-2); align-items: baseline; }
.set-eq { font: 600 18px/1.3 var(--f-d); }
.set-eq b { font: 700 30px/1 var(--f-m); color: var(--blue); margin-right: 6px; }
.set-body { font: 400 15px/1.9 var(--f-m); color: var(--ink-2); }
.brace { font: 300 28px/1 var(--f-m); color: var(--red); margin: 0 6px; vertical-align: -3px; }
.set-result { padding: 20px 24px; font: 600 15px/1.5 var(--f-m); background: var(--ink); color: var(--paper); }

/* ─── Filtres ─── */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter { padding: 8px 14px; font: 500 13px/1 var(--f-m); border: 1.5px solid var(--ink); background: var(--paper); transition: background .2s, color .2s; }
.filter i { color: var(--blue); margin-left: 4px; }
.filter:hover { background: var(--paper-2); }
.filter.is-on { background: var(--ink); color: var(--paper); }
.filter.is-on i { color: #9fb0ff; }
.is-hidden { display: none !important; }

/* ─── §4 Figures ─── */
.fig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.fig { display: flex; flex-direction: column; border: 1.5px solid var(--ink); background: var(--paper); transition: transform .3s var(--ease), box-shadow .3s var(--ease); scroll-margin-top: 90px; }
.fig:hover { transform: translate(-4px, -4px); box-shadow: 6px 6px 0 var(--ink); }
.plot { aspect-ratio: 16 / 10; border-bottom: 1.5px solid var(--ink); position: relative; overflow: hidden;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px; background-color: var(--plot); }
.plot svg { width: 100%; height: 100%; display: block; }
.fig-cap { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.fig-meta { font: 400 12px/1.4 var(--f-m); color: var(--mute); }
.fig-meta b { color: var(--blue); margin-right: 6px; }
.fig h3 { font: 800 clamp(24px, 2.3vw, 30px)/1.05 var(--f-d); letter-spacing: -.03em; }
.fig-cap > p:not(.fig-meta):not(.fig-stack) { color: var(--ink-2); font-size: 15.5px; flex: 1; }
.fig-stack { font: 400 12px/1.6 var(--f-m); color: var(--ink); border-top: 1px dashed var(--grid-2); padding-top: 10px; }
.more { display: inline-block; margin-top: 30px; }

/* tracés SVG */
.v-axis { stroke: var(--ink); stroke-width: 1.2; fill: none; }
.v-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v-blue { stroke: var(--blue); }
.v-red { stroke: var(--red); }
.v-thin { stroke-width: 1.2; }
.v-dash { stroke-dasharray: 4 4; }
.v-fill-ink { fill: var(--ink); }
.v-fill-blue { fill: var(--blue); }
.v-fill-red { fill: var(--red); }
.v-fill-soft { fill: rgba(35, 70, 255, .12); }
.v-txt { font: 500 9px var(--f-m); fill: var(--mute); }
.js .fig .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .fig.in .draw { animation: draw 1.6s var(--ease) forwards; animation-delay: var(--dl, 0s); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.js .fig .pop { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); }
.js .fig.in .pop { animation: pop .7s var(--ease) forwards; animation-delay: var(--dl, 0s); }
@keyframes pop { to { transform: scale(1); } }
.fig:hover .wig { animation: wig 1.2s ease-in-out infinite alternate; }
@keyframes wig { to { transform: translateY(-3px); } }

/* ─── §5 SNOW ─── */
.sec-ink { background: var(--deep); color: var(--deep-fg); background-image: linear-gradient(rgba(242, 238, 228, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(242, 238, 228, .06) 1px, transparent 1px); background-size: var(--cell) var(--cell); }
.sec-ink .sec-id { color: #8fa2ff; }
.sec-ink .sec-rule { background: var(--deep-fg); }
.snow { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); margin-top: 40px; }
.snow-motto { font: 900 clamp(40px, 5vw, 68px)/.95 var(--f-d); letter-spacing: -.045em; margin-bottom: 24px; }
.snow-left > p:not(.snow-motto) { color: #cfcabe; margin-bottom: 26px; max-width: 520px; }
.snow-left b { color: var(--deep-fg); }
.snow-poles { border-top: 1px solid rgba(242, 238, 228, .25); margin-bottom: 28px; }
.snow-poles li { display: grid; grid-template-columns: 120px 1fr; padding: 14px 0; border-bottom: 1px solid rgba(242, 238, 228, .25); color: #cfcabe; font-size: 15px; }
.snow-poles span { font: 600 13px/1.6 var(--f-m); color: #8fa2ff; text-transform: uppercase; letter-spacing: .06em; }
.snow-flag { border: 1.5px solid var(--deep-fg); padding: clamp(24px, 3.5vw, 40px); display: flex; flex-direction: column; gap: 18px; align-items: flex-start; position: relative; background: rgba(35, 70, 255, .08); }
.snow-flag h3 { font: 900 clamp(48px, 6.5vw, 92px)/.88 var(--f-d); letter-spacing: -.05em; color: #fff; }
.snow-flag > p { color: #d6d2c8; }
.snow-flag b { color: #fff; }
.coin-flow { display: flex; align-items: center; gap: 10px; width: 100%; font: 500 12px/1 var(--f-m); text-transform: uppercase; letter-spacing: .06em; color: #cfcabe; padding: 14px 0; }
.coin-flow .flow { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, #8fa2ff 0 8px, transparent 8px 14px); background-size: 28px 2px; animation: flow 0.9s linear infinite; }
@keyframes flow { to { background-position: 28px 0; } }
.coin { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #e3ad2b; color: #14161a; font: 900 18px/1 var(--f-d); box-shadow: 0 0 0 4px rgba(227, 173, 43, .25); animation: spin 3s ease-in-out infinite; }
@keyframes spin { 0%, 60% { transform: rotateY(0); } 80%, 100% { transform: rotateY(360deg); } }
.snow-family { font: 400 13px/1.7 var(--f-m); color: #b7b2a6; border-top: 1px solid rgba(242, 238, 228, .25); padding-top: 16px; width: 100%; }
.snow-family a { color: var(--deep-fg); border-bottom: 1px solid rgba(242, 238, 228, .4); }
.snow-family a:hover { color: #8fa2ff; }

.snow-products { margin-top: clamp(48px, 6vw, 72px); }
.snow-sub { font: 600 13px/1 var(--f-m); text-transform: uppercase; letter-spacing: .08em; color: #8fa2ff; margin-bottom: 20px; }
.snow-grid-p { grid-template-columns: repeat(2, 1fr); }
.fig-snow { color: var(--ink); }
.fig-snow:hover { box-shadow: 6px 6px 0 #8fa2ff; }
@media (max-width: 640px) { .snow-grid-p { grid-template-columns: 1fr; } }

/* ─── §6 Chronologie (axe horizontal) ─── */
.axis-scroll { overflow-x: auto; scroll-snap-type: x mandatory; padding: 30px 0 10px; scrollbar-width: thin; }
.tl { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); position: relative; }
.tl::before { content: ""; position: absolute; left: var(--gut); right: var(--gut); top: 32px; height: 2px; background: var(--ink); }
.tl::after { content: ""; position: absolute; right: calc(var(--gut) - 6px); top: 27px; border: 6px solid transparent; border-left: 10px solid var(--ink); }
.tl li { scroll-snap-align: start; padding: 0 16px 0 0; position: relative; display: flex; flex-direction: column; }
.tl-t { display: block; font: 600 13px/1 var(--f-m); color: var(--blue); height: 26px; order: 0; }
.tl h3 { order: 2; } .tl p { order: 3; }
.tl li::before { order: 1; content: ""; display: block; width: 14px; height: 14px; border: 2px solid var(--ink); background: var(--paper); border-radius: 50%; margin: 0 0 22px; position: relative; z-index: 1; transition: background .3s, transform .3s var(--ease); }
.tl li:hover::before { background: var(--red); transform: scale(1.3); }
.tl li:last-child::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 6px rgba(35, 70, 255, .18); }
.tl h3 { font: 700 18px/1.25 var(--f-d); letter-spacing: -.015em; margin-bottom: 6px; }
.tl p { font-size: 14px; color: var(--ink-2); }

/* ─── §7 Pièces ─── */
.cert-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.cert { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--paper); border: 1.5px solid var(--ink); padding: 10px 10px 16px; transition: transform .3s var(--ease), box-shadow .3s var(--ease); position: relative; }
.cert:nth-child(odd) { transform: rotate(-.6deg); }
.cert:nth-child(even) { transform: rotate(.6deg); }
.cert::before { content: ""; position: absolute; top: -9px; left: 50%; width: 46px; height: 16px; margin-left: -23px; background: rgba(224, 65, 43, .28); transform: rotate(-3deg); z-index: 1; }
.cert:hover { transform: rotate(0) translate(-3px, -3px); box-shadow: 6px 6px 0 var(--ink); }
.cert-thumb { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--grid-2); background: #fff; margin-bottom: 10px; display: block; }
.cert-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .6s var(--ease); }
.cert:hover .cert-thumb img { transform: scale(1.06); }
.cert > span:not(.cert-thumb) { padding: 0 4px; }
.cert-id { font: 500 11px/1.3 var(--f-m); color: var(--blue); }
.cert-title { font: 700 16px/1.25 var(--f-d); }
.cert-org { font-size: 13px; color: var(--mute); }

/* ─── §8 Correspondance ─── */
.corr { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: start; margin-top: 40px; }
.corr-big { font: 700 clamp(24px, 2.8vw, 36px)/1.2 var(--f-d); letter-spacing: -.025em; margin-bottom: 32px; }
.corr-list li { display: grid; grid-template-columns: 40px 110px 1fr; align-items: baseline; padding: 14px 0; border-top: 1.5px solid var(--ink); }
.corr-list li:last-child { border-bottom: 1.5px solid var(--ink); }
.corr-list span { font: 500 13px/1 var(--f-m); color: var(--blue); }
.corr-list b { font: 500 12px/1 var(--f-m); text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.corr-list a { font-weight: 700; overflow-wrap: anywhere; transition: color .2s; }
.corr-list a:hover { color: var(--blue); }
.corr-form { border: 1.5px solid var(--ink); background: var(--paper); padding: clamp(20px, 3vw, 32px); display: grid; gap: 16px; box-shadow: 8px 8px 0 var(--ink); }
.form-head { font: 600 12px/1 var(--f-m); text-transform: uppercase; letter-spacing: .08em; padding-bottom: 14px; border-bottom: 1.5px solid var(--ink); }
.corr-form label { display: grid; gap: 6px; }
.corr-form label span { font: 500 12px/1 var(--f-m); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.corr-form input, .corr-form textarea { width: 100%; border: 0; border-bottom: 1.5px solid var(--ink); background: transparent; padding: 10px 2px; font: 400 17px/1.4 var(--f-d); color: var(--ink); resize: vertical; border-radius: 0; transition: border-color .2s, background .2s; }
.corr-form textarea { border: 1.5px solid var(--ink); padding: 10px; }
.corr-form input:focus, .corr-form textarea:focus { outline: none; border-color: var(--blue); background: rgba(35, 70, 255, .04); }
.corr-form .is-invalid { border-color: var(--red) !important; }
.form-note { font: 400 12px/1.4 var(--f-m); color: var(--mute); text-align: center; }

/* ─── Footer ─── */
.foot { border-top: 1.5px solid var(--ink); padding: 28px 0 36px; background: var(--paper-2); }
.foot-in { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font: 400 13px/1.6 var(--f-m); color: var(--ink-2); }

/* ─── Lightbox ─── */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10, 11, 14, .95); display: grid; place-items: center; padding: 64px 76px; color: #f2eee4; }
.lightbox[hidden] { display: none; }
.lb-figure { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 1000px; width: 100%; }
.lb-figure img { max-height: 70vh; width: auto; max-width: 100%; border: 8px solid #f2eee4; }
.lb-figure figcaption { text-align: center; display: grid; gap: 8px; justify-items: center; color: #c9c4b8; }
.lb-figure h3 { font: 700 20px/1.25 var(--f-d); color: #f2eee4; }
.lb-btn { position: absolute; width: 48px; height: 48px; border: 1.5px solid #f2eee4; color: #f2eee4; font-size: 18px; transition: background .2s, color .2s; }
.lb-btn:hover { background: #f2eee4; color: #14161a; }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ─── Reveal ─── */
.js .rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.js .rv.in { opacity: 1; transform: none; }
.js .cert.rv.in:nth-child(odd) { transform: rotate(-.6deg); }
.js .cert.rv.in:nth-child(even) { transform: rotate(.6deg); }
.js .cert.rv.in:hover { transform: rotate(0) translate(-3px, -3px); }
.js .fig.rv.in:hover { transform: translate(-4px, -4px); }

/* ─── Responsive ─── */
@media (max-width: 1180px) {
  .mast-nav a { padding: 7px 7px; font-size: 13px; }
  .mast-nav a b { display: none; }
  .fig-grid { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .mast-burger { display: block; }
  .mast-nav { position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 0; padding: 80px var(--gut) 40px; background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: var(--cell) var(--cell); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  .mast-nav.is-open { opacity: 1; visibility: visible; }
  .mast-nav a { font: 900 clamp(30px, 8vw, 46px)/1.15 var(--f-d); letter-spacing: -.04em; padding: 6px 0; background: none !important; color: var(--ink) !important; border-bottom: 1px solid var(--grid-2); }
  .mast-nav a b { display: inline; font-size: 14px; color: var(--blue) !important; margin-right: 10px; vertical-align: 6px; }
  .hero { min-height: 0; }
  .hero-grid, .abstract, .snow, .corr { grid-template-columns: 1fr; }
  .hero-fig { max-width: 460px; margin: 10px auto 0; width: 100%; }
  .abstract-fig { max-width: 380px; }
  .set { grid-template-columns: 1fr; gap: 8px; }
  .res-head { display: none; }
  .res summary { grid-template-columns: 64px 1fr 30px; row-gap: 4px; }
  .res-dom { grid-column: 2; grid-row: 2; }
  .res-y { display: none; }
  .res-tog { grid-column: 3; grid-row: 1 / span 2; }
  .res-body { padding-left: 20px; }
  .tl { grid-template-columns: repeat(7, 240px); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .sec-head { flex-wrap: wrap; gap: 8px 12px; }
  .sec-head h2 { white-space: normal; }
  .sec-rule { flex-basis: 100%; }
  .hero-n { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .hero-n div:nth-child(3) { border-left: 0; }
  .hero-n div:nth-child(n+3) { border-top: 1.5px solid var(--ink); }
  .hero-name { font-size: 17vw; }
  .m1 { right: 4px; } .m2 { left: 4px; } .m3 { right: 4px; }
  .hero-photo { box-shadow: 6px 6px 0 var(--ink); }
  .fig-grid { grid-template-columns: 1fr; }
  .plot { aspect-ratio: 16 / 8; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cert-title { font-size: 14px; }
  .snow-poles li { grid-template-columns: 1fr; gap: 2px; }
  .corr-list li { grid-template-columns: 34px 1fr; }
  .corr-list a { grid-column: 2; }
  .corr-form { box-shadow: 5px 5px 0 var(--ink); }
  .lightbox { padding: 72px 12px 90px; }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
  .js .fig .draw { stroke-dashoffset: 0; }
  .js .fig .pop { transform: none; }
  .mark { opacity: 1; transform: none; }
}

/* boutons clairs sur fonds toujours sombres (SNOW, visionneuse) */
.sec-ink .btn-paper, .lightbox .btn-paper { background: var(--deep-fg); color: #14161a; border-color: var(--deep-fg); }
