:root {
  --bg: #141414;
  --panel: #121212;
  --panel-2: #121212;
  --card: #1d1d1d;
  --line: #2a2a2a;
  --text: #ececec;
  --muted: #9b9b9b;
  --accent: #c7ff1b;
  --accent-ink: #1a1d08;
  --glow-a: #0812a1;
  --glow-b: #0042a6;
  --radius: 14px;
  --col: 1040px;
  --pad: clamp(20px, 5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Halos flous sur les côtés, fixes pendant le scroll */
.glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 48% 55% at 0% 32%, var(--glow-a) 0%, transparent 70%),


    radial-gradient(ellipse 30% 50% at 100% 25%, var(--glow-b) 0%, transparent 70%);
  filter: blur(40px);
}

/* Colonne centrale : transparente (le fond est donné par chaque section) */
.page {
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Hero (transparent) ---------- */
.hero { padding: clamp(56px, 10vw, 120px) var(--pad) clamp(56px, 8vw, 96px); }
.avatar {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; display: block;
  background: #2b2b2b;
}

/* ---------- Avatar vinyle ---------- */
.vinyl {
  position: relative; display: block;
  width: 120px; height: 120px; padding: 0; margin-bottom: 36px;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
  animation: spin 3.5s linear infinite;
  animation-play-state: paused;          /* tourne seulement quand .playing */
  transition: box-shadow .4s;
}
.vinyl.playing { animation-play-state: running; }
.vinyl.on { box-shadow: 0 0 0 4px #0c0c0c, 0 8px 28px rgba(0, 0, 0, .6); }

/* sillons + reflet du disque, visibles après le premier clic */
.vinyl::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    conic-gradient(from 20deg, transparent 0 20%, rgba(255,255,255,.22) 25%, transparent 30% 70%, rgba(255,255,255,.22) 75%, transparent 80%),
    repeating-radial-gradient(circle, rgba(0,0,0,.45) 0 1px, transparent 1px 4px);
  opacity: 0; transition: opacity .5s;
}
/* trou central */
.vinyl::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: var(--bg); border: 2px solid #0c0c0c; pointer-events: none;
  opacity: 0; transition: opacity .5s;
}
.vinyl.on::before, .vinyl.on::after { opacity: 1; }

@keyframes spin { to { transform: rotate(360deg); } }

.hero h1 { margin: 0 0 14px; font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; letter-spacing: -.02em; }
.tagline { margin: 0 0 22px; font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.35; max-width: 20em; font-weight: 300; }
.intro { margin: 0 0 32px; color: var(--muted); max-width: 40em; font-size: 1.05rem; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  font-weight: 500; border: 1px solid transparent; transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #f3ff9a; }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: #4a4a4a; }

/* ---------- Sections ---------- */
.section { padding: 56px var(--pad); position: relative; background: var(--panel); }
.section h2 { margin: 0 0 18px; font-size: 1.7rem; letter-spacing: -.01em; }
.lead { margin: -8px 0 28px; color: var(--muted); }

/* Fond d'À propos : apparaît en fondu depuis le hero transparent */
#about {
  background: linear-gradient(to bottom, transparent 0, var(--panel) 220px);
}

/* Sections plus sombres, séparées par une ligne simple */
.section.alt { background: var(--panel-2); border-top: 1px solid #1f1f1f; }

#about-text p { margin: 0 0 16px; max-width: 70ch; }

/* ---------- Expérience ---------- */
.timeline { display: grid; gap: 44px; margin-top: 28px; }
.job { display: grid; grid-template-columns: 170px 1fr; gap: 24px; }
.job-side {
  display: flex;
  flex-direction: column;
  align-items: center;      /* centre le logo sous la date */
  width: max-content;       /* le bloc fait la largeur de la date */
  max-width: 100%;
}
.job-date { color: var(--muted); font-size: .95rem; padding-top: 6px; }
.job-logo { height: 64px; width: auto; max-width: 100%; margin-top: 25px; display: block; border-radius: 12px; }
.job-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.job-meta { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }
.job-desc { margin: 0 0 12px; color: #c9c9c9; }
.job ul { margin: 0; padding: 0; list-style: none; color: #c9c9c9; }
.job li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.job li::before {
  content: ""; position: absolute; left: 4px; top: .6em;
  width: 7px; height: 7px; border: 1.5px solid var(--muted); border-radius: 50%;
}

/* ---------- Cartes (projets marquants) ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.card-media { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: block; }
.card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 4px; font-size: 1.25rem; }
.meta { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.card p.desc { margin: 0 0 16px; color: #bdbdbd; }
.card .link { margin-top: auto; }
.link small { color: var(--muted); font-size: .9em; }

/* ---------- Liste (autres projets) ---------- */
.rows { display: grid; gap: 34px; }
.row { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.row-media {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block;
  border-radius: 10px; border: 1px solid var(--line);
}
.row h3 { margin: 0 0 6px; font-size: 1.15rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.row h3 .meta { margin: 0; font-weight: 400; }
.row p { margin: 0; color: #c2c2c2; }
.row .link { display: inline-block; margin-top: 8px; }

/* Vignette de remplacement quand aucune image n'est fournie */
.ph {
  background: linear-gradient(135deg, #2b3418, #1b1b1b 60%, #3a2f5c);
  display: grid; place-items: center; color: rgba(255,255,255,.5);
  font-weight: 700; font-size: 1.4rem; letter-spacing: .02em;
}

.footer {
  padding: 40px var(--pad) 56px; color: var(--muted); font-size: .9rem; background: var(--panel-2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}

/* ---------- Icônes réseaux (discrètes, s'allument au survol) ---------- */
.socials { display: flex; align-items: center; gap: 20px; }
.socials a {
  display: inline-flex; width: 26px; height: 26px;
  color: var(--muted); opacity: .65;
  transition: opacity .2s, color .2s, transform .2s;
}
.socials a:hover { color: var(--text); opacity: 1; transform: translateY(-2px); text-decoration: none; }
.socials svg { width: 100%; height: 100%; fill: currentColor; }
.socials img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) brightness(1.3); transition: filter .2s; }
.socials a:hover img { filter: none; }
/* ---------- Adresse ETH (discrète) ---------- */
.footer-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.eth {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0; border: 0; background: none; cursor: pointer;
  font: .78rem/1 "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, Consolas, monospace;
  color: var(--muted); opacity: .6; transition: opacity .2s, color .2s;
}
.eth svg { width: 11px; height: 11px; fill: currentColor; }
.eth:hover, .eth:focus-visible { opacity: 1; color: var(--text); }
.eth.copied { opacity: 1; color: var(--accent); }

/* ---------- Titre animé façon terminal ---------- */
.typed { white-space: nowrap; }
.typed.term {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, Consolas, "Courier New", monospace;
  font-size: .82em;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -.01em;
}

/* Empêche le texte animé de modifier la hauteur de la ligne du titre */
#name { line-height: 1.1; }
.typed { line-height: 0; }
.caret {
  display: inline-block; width: .5em; height: 1em; margin-left: 3px;
  background: var(--accent); vertical-align: -.12em;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
}

/* ---------- Write-ups ---------- */
.writeups { display: grid; gap: 14px; }
.wu {
  display: grid; grid-template-columns: 200px 1fr auto; align-items: center; gap: 18px;
  padding: 18px 22px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: border-color .2s, transform .2s;
}
.wu:hover { border-color: #4a4a4a; transform: translateY(-2px); text-decoration: none; }
.wu-event { color: var(--muted); font-size: .92rem; }
.wu-title { font-weight: 600; }
.wu-arrow { color: var(--accent); transition: transform .2s; }
.wu:hover .wu-arrow { transform: translateX(4px); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .job { grid-template-columns: 1fr; gap: 6px; }
  .cards { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 14px; }
  .wu { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .wu-event { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .vinyl { animation: none; }
}
/* ---------- Bouton + fenêtre CV ---------- */
button.btn { font: inherit; font-weight: 500; color: var(--text); background: none; cursor: pointer; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; }
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon:hover { color: var(--accent); }
.cv-modal {
  width: min(960px, 94vw); height: 90vh; max-width: none; max-height: none;
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: #1a1a1a; color: var(--text); overflow: hidden;
}
.cv-modal[open] { display: flex; flex-direction: column; animation: cv-in .2s ease-out; }
.cv-modal::backdrop { background: rgba(0, 0, 0, .78); backdrop-filter: blur(4px); }

.cv-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cv-dl { font-size: .9rem; }
.cv-close {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: none; color: var(--text); font-size: 1rem; cursor: pointer;
}
.cv-close:hover { border-color: #4a4a4a; }
.cv-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---------- Fenêtre clé GPG (réutilise .cv-modal) ---------- */
.key-modal { width: min(720px, 94vw); height: auto; max-height: 88vh; }
.key-title { font-weight: 600; }
.key-text {
  margin: 0; padding: 18px 20px; overflow: auto; flex: 1;
  font: .82rem/1.5 "JetBrains Mono", "Fira Code", "Cascadia Code", ui-monospace, Consolas, monospace;
  color: #cfcfcf; white-space: pre-wrap; word-break: break-all; user-select: all;
}
.key-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.key-actions .btn { font-size: .95rem; }
button.btn-primary { color: var(--accent-ink); background: var(--accent); }

/* ---------- Bras de lecture ---------- */
.turntable { position: relative; width: 120px; height: 120px; margin-bottom: 36px; }
.turntable .vinyl { margin-bottom: 0; }   /* la marge est maintenant portée par .turntable */

.tonearm {
  position: absolute; left: 100px; top: -20px; width: 90px; height: 130px;
  overflow: visible; pointer-events: none;
  transform-origin: 66px 26px;
  transform: rotate(-6deg);                 /* repos */
  opacity: 0;                               /* invisible tant qu'on n'a pas cliqué */
  transition: transform .9s cubic-bezier(.45, .05, .25, 1), opacity .4s;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55));
}
.turntable.on .tonearm { opacity: 1; }
.turntable.playing .tonearm { transform: rotate(40deg); }   /* posé sur le disque */

/* ---------- Mode CRT (easter egg) : noir & vert uniquement ---------- */
:root { --px: 4px; }   /* taille d'un pixel visible : doit = CELL en JS */

.crt-snow, .crt-overlay, .crt-tear, .crt-tint {
  position: fixed; inset: 0; pointer-events: none; display: none;
}
body.crt .crt-snow, body.crt .crt-overlay,
body.crt .crt-tear, body.crt .crt-tint { display: block; }

/* neige */
.crt-snow { z-index: 9990; image-rendering: pixelated; opacity: .38; transition: opacity .1s; }
body.crt-glitch .crt-snow, body.crt-boot .crt-snow { opacity: .85; }

/* scanlines + grille de pixels + vignette */
.crt-overlay {
  z-index: 9991;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.55) 0 1px, transparent 1px var(--px)),
    repeating-linear-gradient(to right,  rgba(0,0,0,.40) 0 1px, transparent 1px var(--px)),
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.75) 100%);
  animation: crt-flicker .12s infinite;
}
/* barres d'interférence qui défilent */
.crt-overlay::before, .crt-overlay::after {
  content: ""; position: absolute; left: 0; right: 0; top: -25vh;
}
.crt-overlay::before {
  height: 18vh; background: linear-gradient(transparent, rgba(57,255,20,.07), transparent);
  animation: crt-roll 7s linear infinite;
}
.crt-overlay::after {
  height: 4vh; background: linear-gradient(transparent, rgba(57,255,20,.14), transparent);
  animation: crt-roll 2.8s linear infinite; animation-delay: -1s;
}

/* bande de déchirure (position/hauteur aléatoires via JS) */
.crt-tear {
  inset: auto 0 auto 0; z-index: 9992; opacity: 0;
  background: rgba(57,255,20,.18);
  border-block: 1px solid rgba(57,255,20,.6);
}
body.crt-glitch .crt-tear { opacity: 1; }

/* teinte finale : tout devient noir + vert phosphore */
.crt-tint { z-index: 9999; background: #39ff14; mix-blend-mode: multiply; }

/* palette + page en niveaux de gris (la teinte fait le reste) */
body.crt {
  --text: #d6ffd6; --muted: #4fd45a; --accent: #39ff14; --accent-ink: #031a05;
  --line: #1c4a22; --card: #0b1a0d;
  --glow-a: #0a3d14; --glow-b: #0b5a1c;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}
body.crt .page {
  text-shadow: 0 0 5px rgba(57,255,20,.55), 0 0 14px rgba(57,255,20,.2);
  filter: grayscale(1) contrast(1.15) brightness(1.05);
  animation: crt-jitter .25s steps(2) infinite;
}
/* modales (CV, clé GPG) : elles passent au-dessus des calques, on les teinte à part */
body.crt dialog { filter: grayscale(1) sepia(1) hue-rotate(70deg) saturate(3); }

/* glitch : déchirures SVG + décalage latéral */
body.crt.crt-glitch .page {
  filter: url(#crt-warp) grayscale(1) contrast(1.3) brightness(1.15);
  animation: crt-glitch .18s steps(3) infinite;
}

/* allumage / extinction (doivent rester après les règles ci-dessus) */
body.crt.crt-boot .page { animation: crt-on .9s cubic-bezier(.2,.8,.2,1); }
body.crt.crt-off  .page { animation: crt-off .5s ease-in forwards; }

@keyframes crt-on {
  0%   { transform: scale(.2, .002); filter: grayscale(1) brightness(12); }
  35%  { transform: scale(1, .004);  filter: grayscale(1) brightness(8); }
  70%  { transform: scale(1, 1.04);  filter: grayscale(1) brightness(2); }
  100% { transform: none; }
}
@keyframes crt-off {
  0%   { transform: none; filter: grayscale(1) brightness(1); }
  60%  { transform: scale(1, .004); filter: grayscale(1) brightness(8); }
  100% { transform: scale(0, .002); filter: grayscale(1) brightness(12); opacity: 0; }
}
@keyframes crt-glitch {
  0%   { transform: translateX(var(--gx, 0px)) skewX(2deg); }
  33%  { transform: translateX(calc(var(--gx, 0px) * -1)) skewX(-1.5deg); }
  66%  { transform: translateX(calc(var(--gx, 0px) * .5)); }
  100% { transform: none; }
}
@keyframes crt-jitter  { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(.6px); } }
@keyframes crt-flicker { 0%, 100% { opacity: 1; } 50% { opacity: .94; } }
@keyframes crt-roll    { to { transform: translateY(150vh); } }

@media (prefers-reduced-motion: reduce) {
  .crt-overlay, .crt-overlay::before, .crt-overlay::after,
  body.crt .page, body.crt.crt-boot .page, body.crt.crt-off .page { animation: none; }
}


@media (prefers-reduced-motion: reduce) {
  .tonearm { transition: none; }
    .wu, .wu-arrow { transition: none; }
}

/* ---------- Write-ups : boutons de la liste + lecteur Markdown ---------- */
button.wu { font: inherit; text-align: left; width: 100%; cursor: pointer; }

.wu-modal { width: min(900px, 94vw); }
.wu-doc { flex: 1; overflow: auto; padding: 28px clamp(18px, 4vw, 44px) 64px; line-height: 1.75; }
.wu-doc > :where(p, ul, ol, h1, h2, h3, h4, aside, blockquote) { max-width: 72ch; }

.wu-doc h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 3.6vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; }
.wu-doc h2 { margin: 2.2em 0 .6em; padding-bottom: .3em; font-size: 1.4rem; border-bottom: 1px solid var(--line); }
.wu-doc h3 { margin: 1.8em 0 .5em; font-size: 1.15rem; }
.wu-doc h4 { margin: 1.5em 0 .4em; font-size: 1rem; color: var(--muted); }
.wu-doc p, .wu-doc li { color: #d2d2d2; }
.wu-doc p { margin: 0 0 1em; }
.wu-doc ul, .wu-doc ol { margin: 0 0 1em; padding-left: 1.4em; }
.wu-doc li { margin-bottom: .35em; }
.wu-doc hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.wu-doc a { text-decoration: underline; text-underline-offset: 3px; }
.wu-doc :not(pre) > code {
  padding: .1em .4em; border: 1px solid var(--line); border-radius: 6px;
  background: #262626; color: var(--text);
  font: .88em "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}
.wu-doc blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }
.wu-doc blockquote p { color: inherit; }

.md-meta { margin: 0 0 22px; color: var(--muted); font-size: .9rem; }
.md-error { color: #ff8a8a; }

/* blocs de code */
.md-code { margin: 1.2em 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #0e0e0e; }
.md-code figcaption {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 12px;
  border-bottom: 1px solid var(--line); background: #181818; color: var(--muted);
  font: .78rem "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}
.md-copy { padding: 2px 9px; font: inherit; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.md-copy:hover { color: var(--accent); border-color: #4a4a4a; }
.md-code pre { margin: 0; padding: 14px 16px; overflow: auto; }
.md-code code { color: #e6e6e6; white-space: pre; font: .85rem/1.55 "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace; }

/* images */
.md-fig { margin: 1.4em 0; }
.md-img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; cursor: zoom-in; }
.md-fig figcaption { margin-top: 8px; color: var(--muted); font-size: .88rem; text-align: center; }
.md-missing { padding: 28px; border-style: dashed; background: #161616; color: var(--muted); text-align: center; cursor: default; }

/* tableaux */
.md-table { margin: 1.2em 0; overflow-x: auto; }
.md-table table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.md-table th, .md-table td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.md-table th { background: #1a1a1a; }

/* encadrés  > [!NOTE] */
.md-callout { margin: 1.2em 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; background: #171717; }
.md-callout > :last-child { margin-bottom: 0; }
.md-callout p { margin-bottom: .6em; }
.md-callout-title { display: block; margin-bottom: 4px; color: var(--accent); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; }
.md-warning { border-left-color: #ff9f1a; }
.md-warning .md-callout-title { color: #ff9f1a; }
.md-important { border-left-color: #b388ff; }
.md-important .md-callout-title { color: #b388ff; }
.md-flag { border-left-color: #39ff14; background: #0d1a0f; }
.md-flag p { font: .95rem "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace; color: #39ff14; }

/* image en grand */
.wu-zoom { max-width: 96vw; max-height: 96vh; padding: 0; overflow: visible; border: 0; background: transparent; }
.wu-zoom::backdrop { background: rgba(0, 0, 0, .88); }
.wu-zoom img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 10px; cursor: zoom-out; }

/* ---------- Podium CTF ---------- */
.pd-title {
  margin: 0 0 8px; color: var(--accent);
  font: .85rem "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}
.podium {
  list-style: none; margin: 0 auto 44px; padding: 28px 0 0; max-width: 720px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end;
  border-bottom: 2px solid var(--line);                 /* le "sol" du podium */
}
.pd { display: flex; flex-direction: column; min-width: 0; }
/* DOM = 1er, 2ème, 3ème (lecteurs d'écran) ; affichage = 2ème, 1er, 3ème */
.pd:nth-child(1) { order: 2; }
.pd:nth-child(2) { order: 1; }
.pd:nth-child(3) { order: 3; }

.pd-1 { --c: var(--accent); --h: 168px; --d: .3s; }
.pd-2 { --c: #cfd3d6;       --h: 124px; --d: .15s; }
.pd-3 { --c: #d08a4e;       --h: 92px;  --d: 0s; }

/* carte au-dessus de la marche */
.pd-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0 8px 14px; text-align: center;
  opacity: 0; transform: translateY(14px);
  transition: opacity .5s, transform .5s; transition-delay: calc(var(--d) + .45s);
}
.podium.in .pd-card { opacity: 1; transform: none; }
.pd-icon { width: 30px; height: 30px; margin-bottom: 6px; color: var(--c); }
.pd-1 .pd-icon {
  width: 40px; height: 40px;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c) 60%, transparent));
}
.pd-event { font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.pd-year  { color: var(--muted); font-size: .88rem; }
.pd-note  { margin-top: 4px; color: var(--muted); font-size: .8rem; }

/* marche */
.pd-step {
  position: relative; height: var(--h); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 12px; gap: 2px;
  border: 1px solid var(--line); border-bottom: 0; border-top: 2px solid var(--c);
  border-radius: 12px 12px 0 0;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 4px),
    linear-gradient(to bottom, color-mix(in srgb, var(--c) 20%, var(--card)), var(--card) 85%);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform .7s cubic-bezier(.2, .9, .25, 1); transition-delay: var(--d);
}
.podium.in .pd-step { transform: none; }
.pd-1 .pd-step { box-shadow: 0 -10px 40px -12px color-mix(in srgb, var(--c) 45%, transparent); }

.pd-rank {
  color: var(--c); font: 700 3rem/1 "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
}
.pd-1 .pd-rank { font-size: 3.7rem; }
.pd-label {
  color: var(--muted); font: .75rem "JetBrains Mono", "Fira Code", ui-monospace, Consolas, monospace;
  letter-spacing: .1em; text-transform: uppercase;
}

/* mobile : liste verticale 1er → 3ème */
@media (max-width: 640px) {
  .podium { grid-template-columns: 1fr; gap: 10px; padding-top: 12px; border-bottom: 0; }
  .pd:nth-child(n) { order: 0; }
  .pd { flex-direction: row-reverse; align-items: stretch; gap: 14px; }
  .pd-card { align-items: flex-start; justify-content: center; padding: 6px 0; text-align: left; flex: 1; }
  .pd-step {
    width: 84px; height: auto; padding: 10px 0; justify-content: center; flex-shrink: 0;
    border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 12px;
    transform: none; opacity: 0; transition: opacity .5s; transition-delay: var(--d);
  }
  .podium.in .pd-step { opacity: 1; }
  .pd-rank, .pd-1 .pd-rank { font-size: 2.2rem; }
}

/* ---------- Sous-titre entre le podium et la liste ---------- */
.wu-subtitle {
  margin: 0 0 16px; padding-left: 12px;
  font-size: 1.15rem; letter-spacing: -.01em;
  border-left: 3px solid var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .pd-step, .pd-card { transition: none; }
}

body:has(.cv-modal[open]) { overflow: hidden; }   /* bloque le scroll de la page derrière */

@keyframes cv-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cv-modal[open] { animation: none; } }