/* =====================================================================
   CV Akram Amouri — feuille de style
   Couleurs : variables ci-dessous (thème sombre puis thème clair).
   ===================================================================== */
:root,
[data-theme="dark"] {
  --bg: #0A1222;
  --bg-sunk: #08101E;
  --bg-raise: #111D35;
  --panel: rgba(22, 36, 66, .55);
  --panel-hover: rgba(30, 48, 86, .6);
  --line: rgba(148, 170, 220, .13);
  --line-strong: rgba(148, 170, 220, .26);
  --text: #E8EEF9;
  --muted: #9AA8C2;
  --faint: #6E7D99;
  --accent: #6E8BFF;
  --accent-ink: #A7B8FF;
  --cyan: #3DDCFF;
  --violet: #8A5CFF;
  --amber: #F2A93B;
  --amber-ink: #FFC46B;
  --grad: linear-gradient(135deg, #3DDCFF 0%, #4F6BFF 52%, #8A5CFF 100%);
  --tag-bg: rgba(110, 139, 255, .12);
  --tag-text: #BFCBFF;
  --glow-a: rgba(61, 220, 255, .16);
  --glow-b: rgba(138, 92, 255, .18);
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, .7);
  --btn-primary-bg: #E8EEF9;
  --btn-primary-text: #0A1222;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F5F7FB;
  --bg-sunk: #EDF1F7;
  --bg-raise: #FFFFFF;
  --panel: #FFFFFF;
  --panel-hover: #F8FAFE;
  --line: #E1E6EF;
  --line-strong: #CCD4E3;
  --text: #0F1A2E;
  --muted: #536079;
  --faint: #7A869C;
  --accent: #3D5BEA;
  --accent-ink: #2F48C9;
  --amber: #E39A24;
  --amber-ink: #A3630B;
  --tag-bg: #ECF0FE;
  --tag-text: #2F48C9;
  --glow-a: rgba(61, 220, 255, .18);
  --glow-b: rgba(138, 92, 255, .14);
  --shadow: 0 24px 60px -28px rgba(16, 26, 46, .3);
  --btn-primary-bg: #0F1A2E;
  --btn-primary-text: #FFFFFF;
  color-scheme: light;
}
:root {
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --rail-w: 17.5rem;
  --content-max: 66rem;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga", "ss01";
  transition: background-color .25s, color .25s;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
ul, ol, dl, dd, h1, h2, h3, h4, p, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
.i { width: 1.1rem; height: 1.1rem; flex: none; }
kbd {
  font: 500 .72rem/1 var(--mono); padding: .25rem .4rem; min-width: 1.35rem; text-align: center;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  color: var(--muted); background: var(--bg-sunk); display: inline-block;
}
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--bg-raise); color: var(--text); padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--line-strong); }
.skip-link:focus { top: 1rem; }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.content { min-width: 0; overflow-x: clip; }
.main { max-width: calc(var(--content-max) + 2 * clamp(1.5rem, 4.5vw, 4.5rem)); margin: 0 auto; padding: 0 clamp(1.5rem, 4.5vw, 4.5rem); }
.side-sections { display: contents; }
[id] { scroll-margin-top: 1.5rem; }

/* ---------- Rail de navigation ---------- */
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.75rem 1.25rem 1.5rem;
  border-right: 1px solid var(--line); background: var(--bg-sunk);
}
.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; padding: 0 .35rem; }
.brand-logo { width: 2.5rem; height: auto; }
.brand-mono { width: 2.5rem; height: 2.5rem; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.brand-text { display: grid; line-height: 1.25; min-width: 0; }
.brand-text strong { font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .82rem; }

.search-btn {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .6rem .7rem; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1px solid var(--line-strong); background: var(--bg-raise); color: var(--muted); font-size: .9rem;
  transition: border-color .15s, color .15s;
}
.search-btn span { flex: 1; }
.search-btn:hover { border-color: var(--accent); color: var(--text); }

/* Le pipeline : chaque section est une étape, la progression se remplit au défilement */
.pipeline { position: relative; }
.pipeline ol { display: grid; gap: .15rem; position: relative; z-index: 1; }
.pipeline a {
  display: flex; align-items: center; gap: .9rem;
  padding: .55rem .65rem; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: color .15s, background-color .15s;
}
.pipeline a:hover { color: var(--text); background: var(--panel); }
.pipeline a[aria-current] { color: var(--text); background: var(--panel); }
.stage {
  width: .75rem; height: .75rem; border-radius: 50%; flex: none; position: relative;
  border: 2px solid var(--line-strong); background: var(--bg-sunk);
  transition: background-color .25s, border-color .25s, box-shadow .25s;
}
.pipeline li.is-done .stage { background: var(--accent); border-color: var(--accent); }
.pipeline a[aria-current] .stage {
  border-color: transparent; background: var(--grad);
  box-shadow: 0 0 0 4px rgba(110, 139, 255, .2), 0 0 16px rgba(61, 220, 255, .55);
}
.pipe-track { position: absolute; left: calc(.65rem + .375rem - 1px); width: 2px; background: var(--line); border-radius: 2px; }
.pipe-fill { position: absolute; left: 0; top: 0; width: 100%; height: 0; background: var(--grad); border-radius: 2px; transition: height .4s cubic-bezier(.2, .7, .2, 1); }

.rail-foot { margin-top: auto; display: grid; gap: .9rem; }
.rail-tools { display: flex; gap: .5rem; align-items: center; }
.shortcuts { font-size: .78rem; color: var(--faint); display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }

.seg-lang { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-raise); }
.seg-lang a { font: 600 .78rem/1 var(--font); letter-spacing: .02em; padding: .5rem .6rem; border-radius: 7px; text-decoration: none; color: var(--muted); }
.seg-lang a:hover { color: var(--text); }
.seg-lang a[aria-current] { background: var(--text); color: var(--bg); }
.icon-btn {
  width: 2.35rem; height: 2.35rem; display: inline-grid; place-items: center; flex: none;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-raise);
  color: var(--muted); cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Barre mobile ---------- */
.mbar { display: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; height: 2.85rem; padding: 0 1.15rem;
  border-radius: 12px; font-weight: 500; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, background-color .15s, border-color .15s;
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { border-color: var(--line-strong); background: var(--bg-raise); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-sm { height: 2.3rem; padding: 0 .8rem; font-size: .85rem; border-radius: 10px; }

/* ---------- Profil ---------- */
.hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 2.5rem 3.5rem;
  padding: clamp(3.5rem, 9vh, 6.5rem) 0 4.5rem;
}
.hero-glow {
  position: absolute; z-index: -1; inset: -6rem -20vw auto; height: 36rem; pointer-events: none;
  background:
    radial-gradient(40rem 22rem at 18% 30%, var(--glow-a), transparent 70%),
    radial-gradient(36rem 24rem at 82% 20%, var(--glow-b), transparent 70%);
}
.print-logo, .print-contact { display: none; }
.status {
  display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .4rem .9rem .4rem .7rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel);
  font-size: .86rem; font-weight: 500;
}
.status-since { color: var(--muted); font-weight: 400; }
.pulse { width: .55rem; height: .55rem; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(242, 169, 59, .2); }
.name {
  margin-top: 1.5rem;
  font-size: clamp(3rem, 7.2vw, 6rem); font-weight: 700; line-height: .95; letter-spacing: -.045em;
  text-wrap: balance;
}
.headline { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; font-size: clamp(1.1rem, 2vw, 1.35rem); }
.headline strong { font-weight: 600; }
.headline span { color: var(--muted); }
.summary { margin-top: 1.4rem; max-width: 62ch; font-size: 1.07rem; line-height: 1.7; color: var(--muted); }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }

.portrait {
  position: relative; align-self: start; margin-top: 2.6rem; padding: 8px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--bg-raise);
  box-shadow: 0 30px 80px -34px rgba(79, 107, 255, .55);
}
/* arc lumineux discret sur l'anneau (couleurs du logo) */
.portrait::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; padding: 2px; pointer-events: none;
  background: conic-gradient(from 210deg, transparent 0 52%, #3DDCFF 68%, #4F6BFF 80%, #8A5CFF 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.portrait img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }


.stats {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  backdrop-filter: blur(8px);
}
.stat { padding: 1.3rem 1.4rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat dt { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat dd { margin-top: .3rem; color: var(--muted); font-size: .86rem; line-height: 1.35; }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: .75rem 2.5rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.section-head p { color: var(--muted); max-width: 44ch; font-size: .95rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Parcours (frise) ---------- */
.track-panel { padding: 1.75rem 1.75rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.track { display: flex; gap: 5px; align-items: flex-end; clip-path: inset(0 100% 0 0); }
.track.is-drawn { clip-path: inset(0 0 0 0); transition: clip-path 1.2s cubic-bezier(.2, .7, .2, 1); }
.track-group { flex-basis: 0; min-width: 0; display: flex; flex-direction: column; gap: .55rem; }
.track-company { font-size: .8rem; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; line-height: 1.2; }
.track-company.is-tight { visibility: hidden; }
.track-segs { display: flex; gap: 2px; }
.seg {
  flex-basis: 0; min-width: 6px; height: 1.6rem; border: 0; padding: 0; cursor: pointer; border-radius: 5px;
  background: color-mix(in srgb, var(--accent) calc(22% + var(--k, 1) * 78%), var(--bg-raise));
  transition: background-color .15s, transform .15s; transform-origin: bottom;
}
.seg-current { background: var(--amber); }
.seg:hover, .seg.is-active { background: var(--grad); transform: scaleY(1.25); }
.seg-current.is-active { background: var(--amber); }
.ticks { position: relative; height: 1.4rem; margin-top: .55rem; font-size: .76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.tick { position: absolute; top: 0; transform: translateX(-50%); }
.tick-start { left: 0; transform: none; }
.tick-end { right: 0; left: auto; transform: none; color: var(--amber-ink); }
.track-caption { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); min-height: 2.6em; display: flex; flex-wrap: wrap; gap: .2rem .75rem; align-items: baseline; font-size: .95rem; color: var(--muted); }
.track-caption strong { color: var(--text); font-weight: 600; }
.cap-period { color: var(--faint); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .track, .track.is-drawn { clip-path: none; transition: none; } }

/* ---------- Expérience (frise verticale) ---------- */
.xp { position: relative; }
.xp-item { position: relative; display: grid; grid-template-columns: 8.5rem 1.25rem minmax(0, 1fr); column-gap: 1.25rem; padding-bottom: 2.25rem; transition: opacity .2s; }
.xp-item::before { content: ""; position: absolute; left: calc(8.5rem + 1.25rem + .625rem - 1px); top: 1.1rem; bottom: -.4rem; width: 2px; background: var(--line); }
.xp-item:last-child::before { display: none; }
.xp-when { text-align: right; padding-top: .2rem; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.45; }
.xp-when time, .xp-when .now { display: block; }
.xp-when .sep { display: none; }
.xp-when .now { color: var(--amber-ink); font-weight: 600; }
.xp-dot { justify-self: center; width: .8rem; height: .8rem; margin-top: .45rem; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); position: relative; z-index: 1; }
.is-current .xp-dot { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 5px rgba(242, 169, 59, .18); }
.xp-body h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.xp-org { display: flex; flex-wrap: wrap; gap: .1rem 1rem; margin-top: .25rem; font-size: .92rem; color: var(--muted); }
.org { color: var(--text); font-weight: 500; }
.is-current .xp-body { padding: 1.5rem 1.6rem 1.6rem; margin-top: -.9rem; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel); box-shadow: var(--shadow); }
.is-current .xp-body h3 { font-size: 1.45rem; }
.xp-more { display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.1rem; font-size: .9rem; font-weight: 500; color: var(--accent-ink); text-decoration: none; }
.xp-more:hover { text-decoration: underline; }

.bullets { margin-top: .8rem; display: grid; gap: .45rem; }
.bullets li { position: relative; padding-left: 1.15rem; max-width: 72ch; }
.bullets li::before { content: ""; position: absolute; left: 0; top: .7em; width: .4rem; height: .4rem; border-radius: 2px; background: var(--grad); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag {
  font: 500 .76rem/1 var(--mono); padding: .45rem .6rem; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent; background: var(--tag-bg); color: var(--tag-text);
  transition: border-color .15s, background-color .15s, color .15s;
}
.tag:hover { border-color: var(--accent); }
.tag.is-on, .chip.is-on { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- Projets ---------- */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card {
  display: flex; flex-direction: column; gap: .2rem;
  padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
  transition: border-color .2s, opacity .2s;
}
.card:hover { border-color: var(--line-strong); }
.card:first-child { grid-column: span 2; }
.card h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.card-sub { color: var(--muted); font-size: .86rem; }
.card .bullets { font-size: .94rem; }
.card .tags { margin-top: auto; padding-top: 1rem; }

/* ---------- Compétences ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.skill-group { padding: 1.3rem 1.4rem 1.4rem; }
.panel h3 { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.chip {
  display: inline-block; font-size: .86rem; line-height: 1; padding: .5rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-raise); color: var(--text);
}
button.chip { cursor: pointer; border-color: var(--line-strong); transition: border-color .15s; }
button.chip:hover { border-color: var(--accent); }
span.chip { color: var(--muted); }
.facets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.facets .panel { padding: 1.3rem 1.4rem; }
.plain { display: grid; gap: .45rem; margin-top: .8rem; font-size: .94rem; color: var(--muted); }
.langs { display: grid; gap: .5rem; margin-top: .8rem; font-size: .94rem; }
.langs div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .5rem; border-bottom: 1px dashed var(--line); }
.langs div:last-child { border-bottom: 0; padding-bottom: 0; }
.langs dt { font-weight: 500; }
.langs dd { color: var(--muted); text-align: right; }

/* ---------- Formation ---------- */
.edu-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.sub-title { font-size: .95rem; font-weight: 600; color: var(--muted); margin-bottom: .9rem; }
.creds { display: grid; gap: .75rem; }
.cred { padding: 1.1rem 1.25rem; display: grid; gap: .2rem; }
.cred strong { font-weight: 600; line-height: 1.35; }
.cred strong a { text-decoration: none; }
.cred strong a:hover { text-decoration: underline; }
.cred span { color: var(--muted); font-size: .9rem; }
.badge { justify-self: start; font-size: .74rem; font-weight: 600; padding: .25rem .55rem; border-radius: 999px; background: rgba(242, 169, 59, .14); color: var(--amber-ink); margin-bottom: .3rem; }

/* ---------- Contact ---------- */
.contact { padding-bottom: 2rem; }
.contact-panel {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(2rem, 5vw, 3.5rem); border-radius: 24px; border: 1px solid var(--line-strong); background: var(--panel);
}
.contact-panel::before {
  content: ""; position: absolute; z-index: -1; inset: auto -10% -60% 30%; height: 120%;
  background: radial-gradient(closest-side, var(--glow-b), transparent), radial-gradient(closest-side at 30% 40%, var(--glow-a), transparent);
}
.contact-panel h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 600; letter-spacing: -.035em; }
.contact-lead { margin-top: .5rem; color: var(--muted); max-width: 50ch; }
.contact-mail { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.75rem; }
.mail-big { font-size: clamp(1.35rem, 3.4vw, 2.3rem); font-weight: 600; letter-spacing: -.03em; text-decoration: none; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; overflow-wrap: anywhere; }
.mail-big:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.contact-list { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin-top: 1.75rem; color: var(--muted); }
.contact-list li { display: flex; align-items: center; gap: .55rem; }
.contact-list a { color: var(--text); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.site-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem; margin-top: 2.5rem; font-size: .85rem; color: var(--faint); }

/* ---------- Filtre par technologie ---------- */
.is-filtering [data-tech]:not(.is-match) { opacity: .28; }
.is-filtering .card.is-match, .is-filtering .is-current.is-match .xp-body { border-color: var(--accent); }
.filterbar {
  position: fixed; z-index: 40; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: .75rem; padding: .5rem .55rem .5rem 1rem;
  border-radius: 14px; border: 1px solid var(--line-strong); background: var(--bg-raise); box-shadow: var(--shadow);
  font-size: .9rem; white-space: nowrap; max-width: calc(100vw - 2rem);
}
.filterbar[hidden] { display: none; }
.filterbar .i { color: var(--accent-ink); }
.filterbar .count { color: var(--muted); }
.filterbar button { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line-strong); background: var(--bg-sunk); border-radius: 9px; padding: .4rem .65rem; cursor: pointer; font-size: .85rem; }
.filterbar button:hover { border-color: var(--accent); }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 5rem; transform: translate(-50%, 1rem);
  padding: .65rem 1rem; border-radius: 12px; background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.is-flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 35% { box-shadow: 0 0 0 3px var(--accent); border-radius: var(--radius); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---------- Palette de recherche ---------- */
.palette { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; }
.palette[hidden] { display: none; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(4, 9, 20, .55); backdrop-filter: blur(6px); }
.palette-panel {
  position: relative; width: min(40rem, 100%); max-height: 76vh; display: flex; flex-direction: column;
  border-radius: 18px; border: 1px solid var(--line-strong); background: var(--bg-raise); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .7);
  overflow: hidden; animation: pop .16s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .palette-panel { animation: none; } }
.palette-input { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 1.05rem/1.4 var(--font); color: var(--text); }
.palette-input input::placeholder { color: var(--faint); }
.palette-list { overflow-y: auto; padding: .4rem .5rem .6rem; }
.palette-group { padding: .75rem .65rem .35rem; font-size: .76rem; font-weight: 600; color: var(--faint); }
.palette-opt { display: flex; align-items: center; gap: .8rem; padding: .55rem .65rem; border-radius: 11px; cursor: pointer; }
.palette-opt[aria-selected="true"] { background: var(--tag-bg); }
.palette-ico { width: 2.1rem; height: 2.1rem; flex: none; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-sunk); color: var(--accent-ink); }
.palette-text { display: grid; min-width: 0; line-height: 1.3; }
.palette-text strong { font-weight: 500; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-text small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .92rem; }
.palette-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--faint); background: var(--bg-sunk); }
.palette-foot span { display: inline-flex; align-items: center; gap: .3rem; }

.load-error, .noscript { max-width: 40rem; margin: 4rem auto; padding: 2rem; background: #fff; color: #111; border-radius: 12px; border-left: 4px solid #C0392B; font-family: system-ui, sans-serif; }
.load-error h1 { font-size: 1.3rem; margin-bottom: .75rem; }
.load-error p + p { margin-top: .6rem; }

/* ---------- Tablette et mobile ---------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .mbar {
    display: block; position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
  }
  .mbar-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem clamp(1rem, 4vw, 2rem) .55rem; }
  .mbar .brand { padding: 0; }
  .mbar .brand-logo { width: 2.1rem; }
  .mbar-tools { display: flex; align-items: center; gap: .45rem; }
  .tabs { display: flex; gap: .3rem; overflow-x: auto; padding: 0 clamp(1rem, 4vw, 2rem) .65rem; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; padding: .45rem .85rem; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
  .tabs a[aria-current] { color: var(--text); background: var(--panel); border-color: var(--line-strong); }
  [id] { scroll-margin-top: 7.5rem; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 2.25rem; gap: 2rem; }
  .portrait { order: -1; width: 7rem; margin-top: 0; padding: 5px; }
  .status { border-radius: 14px; }
  .name { margin-top: 1.1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .section { padding: 3.75rem 0; }
  .section-head { margin-bottom: 1.75rem; }
  .track-panel { padding: 1.25rem 1rem 1rem; }
  .tick-edge { display: none; }
  .xp-item { grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: 1rem; }
  .xp-item::before { left: calc(.625rem - 1px); }
  .xp-when { grid-column: 2; grid-row: 1; text-align: left; padding: 0 0 .3rem; }
  .xp-when time, .xp-when .now { display: inline; }
  .xp-when .sep { display: inline; }
  .xp-dot { grid-column: 1; grid-row: 1; margin-top: .3rem; }
  .xp-body { grid-column: 2; }
  .is-current .xp-body { margin-top: .4rem; padding: 1.2rem; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .card:first-child { grid-column: auto; }
  .facets, .edu-cols { grid-template-columns: minmax(0, 1fr); }
  .filterbar .count { display: none; }
  .mbar-top .seg-lang a { padding: .45rem .5rem; }
}
@media (max-width: 400px) {
  .mbar .brand-text { display: none; }
}

/* ---------- Impression / PDF (A4, 2 pages) ---------- */
@media print {
  @page { size: A4; margin: 14mm 16mm 14mm; }
  :root, [data-theme] {
    --bg: #fff; --bg-sunk: #fff; --bg-raise: #fff; --panel: #fff; --line: #E1E6EF; --line-strong: #CCD4E3;
    --text: #0F1A2E; --muted: #4F5B72; --faint: #7A869C; --accent: #3D5BEA; --accent-ink: #2F48C9;
    --tag-bg: #ECF0FE; --tag-text: #2F48C9; --amber: #E39A24; --amber-ink: #A3630B; --shadow: none;
    color-scheme: light;
  }
  html { background: #fff; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html { font-size: 8.5pt; }
  body { background: #fff; }
  .rail, .mbar, .palette, .filterbar, .toast, .skip-link, .hero-glow, .cta, #career, #contact, .xp-more, .section-head p { display: none !important; }
  .shell { display: block; }
  .main { max-width: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) 13rem; column-gap: 1.4rem; }
  #profile { grid-column: 1 / -1; }
  #experience { grid-column: 1; grid-row: 2; }
  #projects { grid-column: 1; grid-row: 3; }
  .side-sections { display: block; grid-column: 2; grid-row: 2 / span 2; }
  .is-filtering [data-tech]:not(.is-match) { opacity: 1; }

  .hero { grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 0 1.2rem; padding: 0 0 .9rem; border-bottom: 2px solid var(--text); }
  .portrait { grid-column: 1; grid-row: 1; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
  .portrait::before { display: none; }
  .hero-main { grid-column: 2; grid-row: 1; }
  .print-logo { display: block; grid-column: 3; grid-row: 1; width: 2.6rem; height: auto; justify-self: end; }
  .status { display: none; }
  .name { margin: 0; font-size: 2.6rem; letter-spacing: -.035em; }
  .headline { margin-top: .35rem; font-size: 1.15rem; }
  .summary { margin-top: .6rem; font-size: 1rem; max-width: none; color: var(--text); line-height: 1.55; }
  .print-contact { display: flex; flex-wrap: wrap; gap: .1rem 1.2rem; margin-top: .5rem; font-size: .92rem; color: var(--muted); }
  .print-contact a { text-decoration: none; color: var(--muted); }
  .stats { margin-top: .8rem; border-radius: 8px; backdrop-filter: none; }
  .stat { padding: .5rem .8rem; }
  .stat dt { font-size: 1.3rem; }
  .stat dd { font-size: .82rem; margin-top: .1rem; }

  .section { padding: 1rem 0 0; border-top: 0; }
  .section-head { margin-bottom: .6rem; padding-bottom: .35rem; border-bottom: 1px solid var(--text); }
  .section-head h2 { font-size: 1.3rem; letter-spacing: -.02em; }
  .xp-item { grid-template-columns: 5.6rem minmax(0, 1fr); column-gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--line); break-inside: avoid; }
  .xp-item:first-child { border-top: 0; padding-top: 0; }
  .xp-item::before, .xp-dot { display: none; }
  .xp-when { text-align: left; padding-top: .1rem; font-size: .85rem; }
  .is-current .xp-body { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
  .is-current .xp-body h3, .xp-body h3 { font-size: 1.1rem; }
  .bullets { gap: .2rem; margin-top: .4rem; }
  .bullets li::before { background: var(--accent); }
  .tags { margin-top: .45rem; gap: .25rem; }
  .tag { padding: .25rem .4rem; font-size: .76rem; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1rem; }
  .card, .card:first-child { grid-column: auto; padding: 0 0 0 .7rem; border: 0; border-left: 2px solid var(--accent); border-radius: 0; break-inside: avoid; }
  .card h3 { font-size: 1.05rem; }
  .card .bullets { font-size: 1rem; }
  .card .tags { padding-top: .45rem; }

  .side-sections .section-head h2 { font-size: 1.15rem; }
  .skills-grid, .facets, .edu-cols, .creds { display: grid; grid-template-columns: minmax(0, 1fr); gap: .55rem; margin: 0; }
  .facets { margin-top: .55rem; }
  .panel, .skill-group, .facets .panel, .cred { padding: 0; border: 0; border-radius: 0; background: none; break-inside: avoid; }
  .panel h3 { font-size: .95rem; }
  .chips { gap: .2rem; margin-top: .35rem; }
  .chip, button.chip, span.chip { font-size: .8rem; padding: .25rem .35rem; border-radius: 4px; color: var(--text); border-color: var(--line); }
  .plain, .langs { margin-top: .35rem; gap: .2rem; font-size: .9rem; }
  .langs div { padding-bottom: .2rem; }
  .sub-title { margin: .2rem 0 .4rem; font-size: .9rem; }
  .cred { gap: 0; }
  .cred span { font-size: .85rem; }
  .badge { padding: .1rem .4rem; margin-bottom: .1rem; }
  a { text-decoration: none; }
}
