/* =====================================================================
   Portfolio Amine Nakrou
   Mise en page : une colonne d'intitulés à gauche, le contenu à droite,
   comme une note technique d'actuariat. Une seule couleur d'accent.
   ===================================================================== */

:root {
  /* Couleurs (thème clair) */
  --paper: #f7f8f7;
  --paper-2: #eef1ef;
  --ink: #141a1c;
  --ink-2: #4b585c;
  --ink-3: #6f7c80;
  --rule: #d9dfdc;
  --accent: #0d6b52;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe7;
  --proj: #b8e0cf;
  --ok: #15803d;
  --grid: rgba(13, 107, 82, 0.075);
  --paid: #8e9b97;
  --vivid: #10b981;
  --sheet: #ffffff;
  --tint: #e6f4ed;
  --band: #064e3b;
  --band-2: #0f766e;
  --band-ink: #ecfdf5;
  --band-ink-2: #a7f3d0;
  --glow-1: #6ee7b7;
  --glow-2: #5eead4;
  --glow-3: #bef264;
  --glow-op: 0.55;

  /* Typographie */
  --display: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.2rem;
  --step-2: 1.6rem;
  --step-3: clamp(2.2rem, 3.4vw, 3.1rem);

  --shell: 1200px;
  --label-col: 210px;
  --ease: cubic-bezier(.22, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1413;
    --paper-2: #151c1a;
    --ink: #e5ebe9;
    --ink-2: #a4b1ad;
    --ink-3: #7e8c88;
    --rule: #26302d;
    --accent: #49c497;
    --accent-ink: #062018;
    --accent-soft: #15302a;
    --proj: #1e4b3d;
    --ok: #4ade80;
    --grid: rgba(73, 196, 151, 0.06);
    --paid: #5d6b67;
    --vivid: #34d399;
    --sheet: #131b19;
    --tint: #111f1a;
    --band: #04382b;
    --band-2: #0a4f45;
    --band-ink: #ecfdf5;
    --band-ink-2: #6ee7b7;
    --glow-1: #059669;
    --glow-2: #0d9488;
    --glow-3: #4d7c0f;
    --glow-op: 0.32;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1413;
  --paper-2: #151c1a;
  --ink: #e5ebe9;
  --ink-2: #a4b1ad;
  --ink-3: #7e8c88;
  --rule: #26302d;
  --accent: #49c497;
  --accent-ink: #062018;
  --accent-soft: #15302a;
  --proj: #1e4b3d;
  --ok: #4ade80;
  --grid: rgba(73, 196, 151, 0.06);
  --paid: #5d6b67;
  --vivid: #34d399;
  --sheet: #131b19;
  --tint: #111f1a;
  --band: #04382b;
  --band-2: #0a4f45;
  --band-ink: #ecfdf5;
  --band-ink-2: #6ee7b7;
  --glow-1: #059669;
  --glow-2: #0d9488;
  --glow-3: #4d7c0f;
  --glow-op: 0.32;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; }
strong { font-weight: 600; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.shell {
  width: 100%;
  max-width: calc(var(--shell) + 64px);
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Boutons et liens ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--ink); border-radius: 3px;
  background: transparent; color: var(--ink);
  font-weight: 500; font-size: 0.95rem; text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.small { padding: 7px 12px; font-size: var(--step--1); }

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.top.stuck { border-bottom-color: var(--rule); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
.top-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-right: auto; }
.nav a { position: relative; font-size: 0.93rem; color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tool {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
  border: 1px solid var(--rule); border-radius: 3px; background: transparent;
  font-size: var(--step--1); color: var(--ink-2); text-decoration: none;
  transition: border-color .2s, color .2s;
}
.tool:hover { border-color: var(--ink); color: var(--ink); }
.tool.icon { width: 34px; padding: 0; justify-content: center; }
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
#themeBtn svg path { fill: currentColor; stroke: none; }
.tool.cv { color: var(--ink); border-color: var(--ink); font-weight: 500; }
kbd { font-family: var(--mono); font-size: 0.72rem; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 3px; color: var(--ink-3); }
.lang { display: inline-flex; border: 1px solid var(--rule); border-radius: 3px; height: 34px; }
.lang button { border: 0; background: transparent; padding: 0 9px; font-size: 0.78rem; font-weight: 500; color: var(--ink-3); }
.lang button + button { border-left: 1px solid var(--rule); }
.lang button[aria-pressed="true"] { color: var(--ink); background: var(--paper-2); }
.menu-btn { display: none; }
.menu { display: grid; padding: 8px max(24px, env(safe-area-inset-right, 0px)) 18px max(24px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--rule); background: var(--paper); }
.menu a { padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1.1rem; }

/* ---------- Ouverture ---------- */
.hero { position: relative; isolation: isolate; }
.hero-glow { position: absolute; z-index: -2; top: -64px; bottom: -40px; left: calc(50% - 50vw); right: calc(50% - 50vw); overflow: hidden; pointer-events: none; }
.hero-glow span { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--glow-op); animation: drift 16s ease-in-out infinite alternate; will-change: transform; }
.hero-glow span:nth-child(1) { width: 46vw; height: 46vw; top: -14vw; right: -8vw; background: var(--glow-1); }
.hero-glow span:nth-child(2) { width: 30vw; height: 30vw; top: 12vw; right: 24vw; background: var(--glow-2); animation-duration: 21s; animation-delay: -7s; }
.hero-glow span:nth-child(3) { width: 34vw; height: 34vw; bottom: -20vw; left: -10vw; background: var(--glow-3); animation-duration: 25s; animation-delay: -3s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, 4vw) scale(1.12); }
  100% { transform: translate(4vw, -3vw) scale(.92); }
}
.cursor-glow { position: absolute; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--vivid) 30%, transparent), transparent); transform: translate(var(--cx, 70vw), var(--cy, 30%)); transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .4s; opacity: 0; }
.hero:hover .cursor-glow { opacity: 1; }
.hero::before {
  content: ""; position: absolute; z-index: -1; top: -64px; bottom: 0;
  left: calc(50% - 50vw); right: calc(50% - 50vw);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 75% at 72% 38%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 75% at 72% 38%, #000 25%, transparent 75%);
}
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 56px; align-items: start;
  padding-block: 72px 56px;
}
.eyebrow { font-family: var(--mono); font-size: var(--step--1); color: var(--ink-3); letter-spacing: 0.02em; }
.hero h1 { margin-top: 18px; max-width: 15ch; font-size: var(--step-3); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; }
.lede { margin-top: 24px; max-width: 54ch; font-size: 1.08rem; color: var(--ink-2); }
.lede strong { color: var(--ink); }
.availability { display: flex; align-items: center; gap: 10px; margin-top: 22px; font-size: 0.95rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

/* ---------- Fig. 1 : triangle ---------- */
.triangle-fig {
  margin: 6px 0 0; min-width: 0; padding: 22px 24px 20px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 40px 80px -40px rgba(6, 78, 59, .45), 0 12px 24px -16px rgba(6, 78, 59, .25);
}
.fig-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.fig-num { font-family: var(--mono); font-size: var(--step--1); font-weight: 500; white-space: nowrap; }
.fig-title { font-size: 0.9rem; color: var(--ink-2); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.triangle { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.triangle th, .triangle td { padding: 7px 6px; text-align: right; white-space: nowrap; }
.triangle thead th { font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--rule); font-size: 0.72rem; }
.triangle thead th:first-child, .triangle tbody th { text-align: left; }
.triangle tbody th { font-weight: 500; color: var(--ink-2); padding-right: 12px; }
.triangle tbody tr { border-bottom: 1px solid var(--rule); }
.triangle td.obs { color: var(--ink); }
.triangle td.prj { background: var(--accent-soft); color: var(--accent); font-style: italic; }
.triangle td.ult { font-weight: 500; border-left: 1px solid var(--ink); color: var(--ink); }
.triangle td.ult.est { color: var(--accent); }
.triangle tfoot td, .triangle tfoot th { padding-top: 9px; color: var(--ink-3); font-size: 0.72rem; text-align: right; }
.triangle tfoot th { text-align: left; font-weight: 500; }
.triangle tbody tr { cursor: default; }
.triangle tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.triangle tbody tr:hover th, .triangle tbody tr.hl th { color: var(--accent); }
.triangle tbody tr:hover > *, .triangle tbody tr.hl > * { box-shadow: inset 0 -1px 0 var(--accent); }
.triangle td { transition: opacity .35s var(--ease), transform .35s var(--ease), background-color .3s, color .3s; }
.triangle .pending { opacity: 0; transform: translateY(6px); }
.triangle td.scan { background: color-mix(in srgb, var(--vivid) 22%, transparent); }
.triangle td.prj.flash { background: color-mix(in srgb, var(--vivid) 45%, transparent); color: var(--ink); }
.triangle td.f { transition: color .3s; }
.triangle td.f.hot { color: var(--accent); font-weight: 500; }
.replay { margin-left: auto; border: 0; background: none; padding: 0; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); white-space: nowrap; }
.replay:hover { color: var(--accent); }
.replay[disabled] { opacity: .45; cursor: default; }

/* Fig. 1 (bas) : payé et réserve, barres empilées */
.bars-head { margin-top: 22px; font-size: 0.72rem; color: var(--ink-3); }
.bars { display: grid; gap: 5px; margin-top: 10px; }
.bar { display: grid; grid-template-columns: 40px minmax(0, 1fr) 44px; gap: 10px; align-items: center; padding: 1px 0; cursor: default; }
.bar-y, .bar-v { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar-v { text-align: right; color: var(--ink-2); }
.bar-track { height: 10px; }
.bar-fill { display: flex; gap: 2px; height: 100%; clip-path: inset(0 0 0 0); transition: clip-path .9s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.bars.pending .bar-fill { clip-path: inset(0 100% 0 0); }
.seg { height: 100%; }
.seg.paid { background: var(--paid); }
.seg.res { background: var(--vivid); border-radius: 0 4px 4px 0; }
.seg.paid.last { border-radius: 0 4px 4px 0; }
.bar:hover .bar-y, .bar.hl .bar-y { color: var(--accent); }
.bar:hover .seg.paid, .bar.hl .seg.paid { background: var(--ink-2); }
.triangle-fig figcaption { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 14px; font-size: 0.8rem; color: var(--ink-2); }
.legend { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; display: inline-block; border: 1px solid var(--rule); }
.sw-obs { background: var(--paid); border-color: var(--paid); }
.sw-proj { background: var(--accent-soft); border-color: var(--accent); }
.fig-readout { color: var(--accent); min-height: 1.2em; }
.fig-note { flex-basis: 100%; color: var(--ink-3); font-size: 0.76rem; }

/* ---------- Bandes de couleur pleine largeur ---------- */
.band { position: relative; isolation: isolate; }
.band::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); }
.band-tint::before { background: var(--tint); }
.band-dark {
  --ink: var(--band-ink); --ink-2: rgba(236, 253, 245, .82); --ink-3: rgba(236, 253, 245, .62);
  --rule: rgba(236, 253, 245, .18); --accent: var(--band-ink-2); --accent-ink: var(--band); --paper: var(--band);
  color: var(--ink);
}
.band-dark::before {
  background:
    radial-gradient(60% 120% at 85% 0%, color-mix(in srgb, var(--vivid) 45%, transparent), transparent 60%),
    radial-gradient(50% 120% at 0% 100%, color-mix(in srgb, var(--band-2) 90%, transparent), transparent 70%),
    linear-gradient(120deg, var(--band), var(--band-2));
  background-size: 140% 140%, 140% 140%, 100% 100%;
  animation: bandShift 18s ease-in-out infinite alternate;
}
@keyframes bandShift { from { background-position: 0% 0%, 100% 100%, 0 0; } to { background-position: 100% 30%, 0% 60%, 0 0; } }
.band + .block, .block.band { border-top-color: transparent; }

/* ---------- Repères chiffrés ---------- */
.figures { padding-block: 44px; }
.figures-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.figures-list dt { font-size: clamp(1.6rem, 2.6vw, 2.2rem) !important; color: #fff !important; }
.figures-list > div { padding: 20px 20px 22px 0; }
.figures-list > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.figures-list dt { font-size: 1.35rem; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.figures-list dd { margin: 6px 0 0; font-size: 0.86rem; color: var(--ink-2); line-height: 1.5; }

/* ---------- Blocs ---------- */
.block {
  display: grid; grid-template-columns: var(--label-col) minmax(0, 1fr); gap: 40px;
  padding-block: 64px;
  border-top: 1px solid var(--rule);
}
.figures + .block { border-top: 0; }
.band-dark .btn { border-color: var(--band-ink); color: var(--band-ink); }
.band-dark .btn:hover { background: var(--band-ink); color: var(--band); }
.contact .mail { color: #fff; }
.contact .links a { border-bottom-color: rgba(236, 253, 245, .35); }
.contact .links a:hover { border-bottom-color: #fff; }
.contact .wanted { border-top-color: rgba(236, 253, 245, .5); }

/* Survols plus vivants */
.entry { transition: background-color .3s; border-radius: 6px; }
.btn { position: relative; overflow: hidden; z-index: 0; }
.btn.primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-110%); transition: transform .7s var(--ease); }
.btn.primary:hover::after { transform: translateX(110%); }
.skills > div { transition: transform .3s var(--ease); }
.skills > div:hover { transform: translateX(6px); }
.skills > div:hover dt { color: var(--accent); }
.block-head { position: sticky; top: 92px; align-self: start; display: grid; gap: 6px; }
.block-label { font-size: var(--step-1); font-weight: 700; }
.block-meta { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.block-body { min-width: 0; margin: 0; padding: 0; }

/* Profil */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 48px; align-items: start; }
.prose { display: grid; gap: 16px; max-width: 66ch; font-size: 1.05rem; color: var(--ink-2); }
.prose strong { color: var(--ink); }
.portrait { margin: 0; }
.portrait img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: grayscale(.15) contrast(1.02); border: 1px solid var(--rule); }
.portrait figcaption { margin-top: 8px; font-size: 0.75rem; color: var(--ink-3); }

/* Entrées (expérience, formation) */
.entries { list-style: none; display: grid; gap: 0; }
.entry { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; padding-block: 28px; border-bottom: 1px solid var(--rule); }
.entry:first-child { padding-top: 4px; }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.when { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); line-height: 1.6; font-variant-numeric: tabular-nums; }
.when .now { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--ok); }
.entry h3 { font-size: 1.2rem; }
.org { margin-top: 2px; font-weight: 500; color: var(--accent); }
.team { margin-top: 4px; font-size: 0.9rem; color: var(--ink-3); }
.result { display: inline-block; margin-top: 14px; padding: 3px 0; font-family: var(--mono); font-size: 0.82rem; color: var(--ink); border-bottom: 1px solid var(--accent); }
.entry ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; max-width: 72ch; }
.entry li { position: relative; padding-left: 18px; color: var(--ink-2); }
.entry li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }
.entry li strong { color: var(--ink); }
.stack { margin-top: 14px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.edu-text { margin-top: 8px; color: var(--ink-2); max-width: 66ch; }

/* Projets */
.proj-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.filters button { border: 0; background: none; padding: 2px 0; font-size: 0.9rem; color: var(--ink-3); border-bottom: 1px solid transparent; }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.projects { border-top: 1px solid var(--ink); }
.proj { position: relative; border-bottom: 1px solid var(--rule); }
.proj::before { content: ""; position: absolute; left: -14px; top: 24px; height: 26px; width: 2px; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .35s var(--ease); }
.proj:hover::before, .proj.open::before { transform: scaleY(1); }
.proj.off { display: none; }
.proj-head {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto 24px; gap: 20px; align-items: baseline;
  width: 100%; padding: 22px 0 6px; border: 0; background: none; text-align: left;
}
.proj-cat { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); }
.proj-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; line-height: 1.2; }
.proj-metric { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); white-space: nowrap; }
.proj-toggle { position: relative; width: 14px; height: 14px; justify-self: end; align-self: center; }
.proj-toggle::before, .proj-toggle::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--ink); transition: transform .35s var(--ease); }
.proj-toggle::after { transform: rotate(90deg); }
.proj.open .proj-toggle::after { transform: rotate(0deg); }
.proj-head:hover .proj-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.proj-sum { margin-left: 170px; padding-bottom: 22px; max-width: 64ch; color: var(--ink-2); }
.proj-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.proj.open .proj-panel { grid-template-rows: 1fr; }
.proj-panel > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s linear .45s; }
.proj.open .proj-panel > div { visibility: visible; transition-delay: 0s; }
.proj-inner { margin-left: 170px; padding-bottom: 28px; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 20px; margin: 0; max-width: 78ch; }
.facts dt { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); padding-top: 3px; }
.facts dd { margin: 0; color: var(--ink-2); }
.proj-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.proj-links .note { font-size: 0.86rem; color: var(--ink-3); }

.sub { margin-top: 48px; }
.sub-title { font-size: 1.05rem; margin-bottom: 6px; }
.lab { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.lab li { padding: 16px 20px 6px 0; }
.lab li + li { padding-left: 20px; border-left: 1px solid var(--rule); }
.lab .status { font-family: var(--mono); font-size: 0.72rem; color: var(--accent); }
.lab h4 { margin-top: 6px; font-size: 1rem; }
.lab p { margin-top: 6px; font-size: 0.88rem; color: var(--ink-2); }
.others { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.92rem; }
.others th, .others td { text-align: left; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.others thead th { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; color: var(--ink-3); border-bottom-color: var(--ink); }
.others td:first-child { font-weight: 500; }
.others td.dom { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); white-space: nowrap; }
.others td.desc { color: var(--ink-2); }
.others td.lk { white-space: nowrap; }
.others a { color: var(--accent); text-decoration: none; margin-right: 12px; }
.others a:hover { text-decoration: underline; }

/* Compétences */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.skills > div { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.skills dt { font-family: var(--mono); font-size: 0.76rem; color: var(--ink-3); }
.skills dd { margin: 6px 0 0; }

/* Contact */
.contact-lead { max-width: 52ch; font-size: 1.1rem; color: var(--ink-2); }
.wanted { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 32px 0 36px; border-top: 1px solid var(--ink); }
.wanted > div { padding: 14px 18px 4px 0; }
.wanted > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.wanted dt { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); }
.wanted dd { margin: 6px 0 0; font-size: 0.95rem; }
.cv-meta { margin-top: 10px; font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 18px; }
.mail { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 3.4vw, 2.4rem); letter-spacing: -0.03em; text-decoration: none; overflow-wrap: anywhere; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--ease); }
.mail:hover { background-size: 100% 2px; }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 26px 0 0; padding: 0; }
.links a { text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--rule); padding-bottom: 2px; transition: border-color .2s; }
.links a:hover { border-bottom-color: var(--ink); }
.arrow { display: inline-block; transition: transform .25s var(--ease); }
.links a:hover .arrow { transform: translate(2px, -2px); }

/* Pied de page */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px 40px; border-top: 1px solid var(--rule); font-size: 0.84rem; color: var(--ink-3); }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* Recherche rapide */
.palette { width: min(560px, calc(100% - 32px)); margin-top: 14vh; padding: 0; border: 1px solid var(--ink); border-radius: 4px; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45); }
.palette::backdrop { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.palette input { width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; color: var(--ink); font: inherit; font-size: 1.02rem; outline: 0; }
.palette ul { list-style: none; margin: 6px; padding: 0; max-height: 52vh; overflow: auto; }
.palette li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; cursor: pointer; }
.palette li small { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
.palette li[aria-selected="true"] { background: var(--accent-soft); }
.palette li.empty { color: var(--ink-3); cursor: default; }
.palette-hint { margin: 0; padding: 9px 18px; border-top: 1px solid var(--rule); font-size: 0.72rem; color: var(--ink-3); }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); z-index: 60; margin: 0; padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 0.88rem; border-radius: 3px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-block: 48px 40px; }
  .search-btn { display: none; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .block { grid-template-columns: 1fr; gap: 20px; padding-block: 48px; }
  .block-head { position: static; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 14px; }
  .block-head::after { display: none !important; }
  .proj::before { display: none; }
  .wanted { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wanted > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .wanted > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .figures-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures-list > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .figures-list > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .profile { grid-template-columns: minmax(0, 1fr) 160px; gap: 28px; }
}
@media (max-width: 640px) {
  .tools .cv, .lang { display: none; }
  .top-inner { gap: 12px; }
  .shell { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .menu { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .profile { grid-template-columns: 1fr; }
  .portrait { max-width: 200px; }
  .entry { grid-template-columns: 1fr; gap: 6px; }
  .proj-head { grid-template-columns: minmax(0, 1fr) 20px; gap: 6px 12px; }
  .proj-cat { grid-column: 1 / -1; }
  .proj-metric { grid-column: 1; grid-row: 3; }
  .proj-toggle { grid-column: 2; grid-row: 2; }
  .proj-sum, .proj-inner { margin-left: 0; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .lab { grid-template-columns: 1fr; }
  .lab li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .skills { grid-template-columns: 1fr; }
  .others td.desc { display: none; }
  .fig-title { flex: 1 1 60%; }
  .replay { margin-left: 0; flex-basis: 100%; text-align: left; }
  .triangle { font-size: 0.66rem; }
  .triangle th, .triangle td { padding: 6px 2px; }
  .triangle thead th, .triangle tfoot td, .triangle tfoot th { font-size: 0.6rem; }
  .triangle tbody th { padding-right: 4px; }
  .bar { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 8px; }
  .others thead th:nth-child(3) { display: none; }
}

/* ---------- Ouverture animée (au chargement uniquement) ---------- */
.progress { display: none; }
.intro .hero h1 .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.intro .hero h1 .w > span { display: inline-block; animation: rise .9s var(--ease) both; animation-delay: calc(120ms + var(--i) * 55ms); }
.intro .eyebrow { animation: fadeUp .7s var(--ease) both; }
.intro .lede { animation: fadeUp .8s var(--ease) .55s both; }
.intro .availability { animation: fadeUp .8s var(--ease) .68s both; }
.intro .actions { animation: fadeUp .8s var(--ease) .8s both; }
.intro .fig-head { animation: fadeUp .7s var(--ease) .25s both; }
.intro .figures-list { animation: fadeUp .9s var(--ease) 1s both; }
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dot { animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- Défilement : apparitions et progression (navigateurs récents) ---------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .entry, article.proj, .skills > div, .lab li, .wanted > div, .prose > p, .portrait, .others tbody tr, .sub-title, .contact-lead, .mail-row {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 20%;
    }
    @keyframes reveal { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
    .block { view-timeline-name: --sec; }
    .block-head::after {
      content: ""; display: block; width: 56px; height: 2px; margin-top: 6px; background: var(--accent);
      transform-origin: left; animation: grow linear both; animation-timeline: --sec; animation-range: cover 10% cover 70%;
    }
    .progress {
      display: block; position: fixed; z-index: 40; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 2px;
      background: var(--accent); transform-origin: left; animation: grow linear both; animation-timeline: scroll(root);
    }
    @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }
}

/* Repli des apparitions (Firefox, Safari) : piloté par JavaScript */
.io .rv { transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--rd, 0ms); }
.io .rv:not(.in) { opacity: 0; transform: translateY(30px); }

/* ---------- Impression : une version propre, sans navigation ---------- */
@media print {
  :root { --paper: #fff; --paper-2: #fff; --ink: #000; --ink-2: #222; --ink-3: #555; --rule: #ccc; --accent: #0d6b52; --accent-soft: #e6f2ed; }
  .top, .tools, .actions, .filters, .proj-bar p, .palette, .toast, .skip, .foot a, #copyMail, .fig-readout, .hero-glow, .band::before, .replay, .progress { display: none !important; }
  .band-dark { --ink: #000; --ink-2: #222; --ink-3: #555; --rule: #ccc; --accent: #0d6b52; color: #000; }
  .figures-list dt, .contact .mail { color: #000 !important; }
  .triangle-fig { box-shadow: none; }
  body { font-size: 10.5pt; }
  .hero { padding-block: 0 16px; grid-template-columns: 1fr 1fr; gap: 24px; }
  .block { padding-block: 18px; break-inside: avoid-page; }
  .block-head { position: static; }
  .proj-panel { grid-template-rows: 1fr !important; }
  .proj-panel > div { visibility: visible !important; }
  .proj-toggle { display: none; }
  a { text-decoration: none; }
  .entry, .proj { break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
