/* =========================================================
   Walid Ferchach - Portfolio
   Charte inspirée de kiliancd.fr : fond gris-bleu clair,
   cartes blanches arrondies, bleu primaire, police système,
   titres gras centrés, mode sombre.
   ========================================================= */

:root {
  /* Fonds */
  --bg:        #f8fafc;
  --card:      #ffffff;
  --soft:      #f1f5f9;

  /* Texte */
  --ink:       #1e293b;
  --ink-2:     #334155;
  --ink-3:     #64748b;

  /* Bordures */
  --rule:      #e2e8f0;
  --rule-2:    #cbd5e1;
  --card-line: rgba(0, 0, 0, .05);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, .05);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);

  /* Couleurs */
  --primary:       #0d6efd;
  --primary-hover: #0b5ed7;
  --primary-text:  #0d6efd;
  --primary-soft:  rgba(59, 130, 246, .08);
  --purple:        #a855f7;
  --green:         #198754;
  --amber:         #f59e0b;

  /* Badges */
  --tag-bg:     #f8f9fa;
  --tag-line:   #dee2e6;
  --tag-ink:    #212529;

  /* Syntaxe */
  --syn-key:  #0d6efd;
  --syn-fn:   #a855f7;
  --syn-str:  #198754;

  --nav-bg:   rgba(248, 250, 252, .8);

  --radius:    16px;
  --radius-sm: 8px;

  --maxw:     1140px;
  --maxw-txt: 70ch;

  --ff-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ff-head: var(--ff-body);
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:        #0f172a;
  --card:      #1e293b;
  --soft:      #172033;

  --ink:       #f1f5f9;
  --ink-2:     #cbd5e1;
  --ink-3:     #94a3b8;

  --rule:      #334155;
  --rule-2:    #475569;
  --card-line: rgba(255, 255, 255, .05);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, .2);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .45);

  --primary-text:  #6ea8fe;
  --primary-soft:  rgba(59, 130, 246, .12);

  --tag-bg:     #334155;
  --tag-line:   #475569;
  --tag-ink:    #f8fafc;

  --syn-key:  #6ea8fe;
  --syn-fn:   #c084fc;
  --syn-str:  #75b798;

  --nav-bg:   rgba(15, 23, 42, .8);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--primary); color: #fff; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

.section { padding-block: 72px; }
.section:first-of-type { padding-top: 64px; padding-bottom: 56px; }

.accent-text { color: var(--primary-text); }

/* Elements des anciennes chartes, neutralises */
.bg-orbs, .orb, .scroll-progress, .avatar-card__glow, .dot, .cta__bg { display: none !important; }

/* ---------- Titres ---------- */
h1, h2, h3, h4 {
  font-family: var(--ff-head);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

/* ---------- Carte generique ---------- */
.card, .feature, .comp, .skills__col, .project--card, .feat, .tl__item, .cta,
.stat, .pcard, .kpi, .fact {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s, background-color .3s;
}
.feature:hover, .comp:hover, .skills__col:hover, .project--card:hover, .feat:hover,
.tl__item:hover, .pcard:hover { transform: translateY(-5px); }

/* ---------- Boutons ---------- */
.btn {
  --pad: .5rem 1.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ff-body); font-weight: 400; font-size: 1rem; line-height: 1.5;
  padding: var(--pad); border-radius: .5rem; cursor: pointer;
  border: 1px solid transparent;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
  white-space: nowrap;
}
.btn--sm { --pad: .3rem .9rem; font-size: .88rem; }
.btn--lg { --pad: .6rem 1.75rem; font-size: 1.05rem; }
.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost { background: transparent; color: var(--primary-text); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary); color: #fff; }

/* ---------- Surtitres et entetes de section ---------- */
.chip {
  display: inline-block; font-size: 1rem; font-weight: 600;
  color: var(--primary-text); margin-bottom: 8px;
}
.section__head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section__head--sm { margin-top: 64px; margin-bottom: 28px; }
.section__title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section__title--sm { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
.section__sub { color: var(--ink-3); margin-top: 14px; font-size: 1.03rem; }
.section__sub a, .block__sub a { color: var(--primary-text); }
.section__sub a:hover, .block__sub a:hover { text-decoration: underline; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-block: 16px;
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand__name { font-size: 1.25rem; font-weight: 700; color: var(--primary-text); }

.nav__links { display: flex; gap: 16px; margin-inline: auto; }
.nav__link {
  font-size: 1rem; color: var(--ink-3); padding: 8px;
  transition: color .15s;
}
.nav__link:hover { color: var(--ink-2); }
.nav__link.active { color: var(--ink); }

.nav__actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: transparent; color: #6c757d; border: 1px solid #6c757d; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.theme-toggle:hover { background: #6c757d; color: #fff; }
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle { color: #adb5bd; border-color: #adb5bd; }
:root[data-theme="dark"] .theme-toggle:hover { background: #adb5bd; color: var(--bg); }

.nav__burger {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px;
}
.nav__burger span { width: 22px; height: 2px; background: var(--ink-2); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  min-height: 70vh;
}
.hero__hi { font-weight: 600; color: var(--primary-text); margin-bottom: 8px; }
.hero__title { font-size: clamp(2.4rem, 5vw, 3.5rem); line-height: 1.15; }
.hero__name { font-size: 1.5rem; font-weight: 500; color: var(--ink-3); margin-top: 8px; line-height: 1.3; }
.hero__desc { font-size: 1.2rem; font-weight: 300; margin-top: 24px; max-width: 520px; color: var(--ink-3); }
.hero__desc strong { font-weight: 600; color: var(--ink-2); }

.hero__socials { display: flex; gap: 10px; margin-top: 28px; }
.social {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--card-shadow);
  color: var(--primary-text);
  transition: color .15s, background-color .15s;
}
.social:hover { color: #fff; background: var(--primary); }
.social--sm { width: 36px; height: 36px; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }

/* Portrait */
.hero__visual { display: grid; justify-items: center; }
.portrait { width: min(400px, 100%); }
.portrait__frame {
  border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow-lg);
  background: #fff; height: 450px;
}
.portrait__frame picture, .portrait__frame img { width: 100%; height: 100%; }
.portrait__frame img { object-fit: cover; object-position: center top; }
.portrait__cap { margin-top: 16px; font-size: .88rem; color: var(--ink-3); text-align: center; }

/* Chiffres */
.stats { margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { padding: 24px; text-align: center; }
.stat__num {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 700; color: var(--primary-text);
  display: block; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat__label { color: var(--ink-3); font-size: .85rem; margin-top: 10px; display: block; line-height: 1.45; }
.stat__num sup { font-size: .5em; line-height: 0; }

/* =========================================================
   A PROPOS
   ========================================================= */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about__text p { margin-bottom: 16px; max-width: var(--maxw-txt); }
.about__text strong { color: var(--ink); font-weight: 600; }

.about__facts { margin-top: 24px; display: grid; gap: 10px; }
.about__facts li { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: .95rem; }
.about__facts svg {
  color: var(--primary-text); flex: none; box-sizing: content-box;
  padding: 9px; border-radius: 50%; background: var(--primary-soft);
}

.about__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.feature { padding: 24px; border: 0; background: rgba(59, 130, 246, .05); box-shadow: none; }
.feature:nth-child(2) { background: rgba(168, 85, 247, .05); }
.feature:nth-child(3) { background: rgba(34, 197, 94, .05); }
.feature:nth-child(4) { background: rgba(245, 158, 11, .06); }
:root[data-theme="dark"] .feature { background: rgba(59, 130, 246, .1); }
:root[data-theme="dark"] .feature:nth-child(2) { background: rgba(168, 85, 247, .1); }
:root[data-theme="dark"] .feature:nth-child(3) { background: rgba(34, 197, 94, .1); }
:root[data-theme="dark"] .feature:nth-child(4) { background: rgba(245, 158, 11, .1); }
.feature__icon { color: var(--primary); margin-bottom: 16px; }
.feature:nth-child(2) .feature__icon { color: var(--purple); }
.feature:nth-child(3) .feature__icon { color: var(--green); }
.feature:nth-child(4) .feature__icon { color: var(--amber); }
.feature__icon svg { width: 32px; height: 32px; }
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--ink-3); font-size: .88rem; }

/* =========================================================
   COMPETENCES
   ========================================================= */
.comp__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.comp { padding: 28px; }
.comp__num {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .95rem;
  font-variant-numeric: tabular-nums; margin-bottom: 16px;
}
.comp__title { font-size: 1.2rem; margin-bottom: 10px; }
.comp__desc { font-size: .93rem; color: var(--ink-3); }
.comp__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

/* Badges : tags, piles techniques */
.tag, .comp__tags li, .project__stack li {
  display: inline-block; font-size: .78rem; font-weight: 500; line-height: 1;
  color: var(--tag-ink); background: var(--tag-bg); border: 1px solid var(--tag-line);
  padding: .5em 1em; border-radius: var(--radius-sm); white-space: nowrap;
}

/* Boite a outils */
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.skills__col { padding: 24px; }
.skills__cat { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.skills__tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* =========================================================
   PROJETS
   ========================================================= */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.project__top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 12px;
}
.project__tag { font-size: .85rem; font-weight: 600; color: var(--primary-text); }
.project__comp { font-size: .8rem; color: var(--ink-3); text-align: right; }
.project__title { font-size: 1.2rem; margin-bottom: 10px; }
.project__desc { font-size: .9rem; color: var(--ink-3); }
.project__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

.project__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px;
  font-size: 1rem; color: #fff; background: var(--primary);
  padding: .5rem 1.5rem; border-radius: .5rem;
  transition: background-color .15s ease-in-out;
}
.project__link:hover { background: var(--primary-hover); }
.project__link svg { transition: transform .2s ease; }

/* Projets detailles (ancienne mise en page) */
.projects--lead { grid-template-columns: 1fr; counter-reset: proj; margin-bottom: 56px; }
.project--lg { display: grid; grid-template-columns: 1fr 292px; gap: 40px; align-items: start; }
.project__cover { border-radius: 12px; overflow: hidden; }

.projects__more {
  font-size: 1.35rem; font-weight: 700; color: var(--ink);
  text-align: center; margin-bottom: 28px;
}
.projects__note { color: var(--ink-3); font-size: .92rem; margin-top: 32px; text-align: center; }
.projects__note a { color: var(--primary-text); }
.projects__note a:hover { text-decoration: underline; }

/* Projets data en vitrine */
.featured { display: grid; gap: 32px; margin-bottom: 72px; }
.feat {
  display: grid; grid-template-columns: 5fr 6fr; gap: 40px; align-items: center;
  padding: 32px;
}
.feat--rev .feat__media { order: -1; }
.feat__step { font-size: .88rem; color: var(--ink-3); margin-bottom: 12px; }
.feat__step b { color: var(--primary-text); font-weight: 600; }
.feat__title { font-size: 1.6rem; line-height: 1.25; margin-bottom: 14px; }
.feat__title a:hover { color: var(--primary-text); }
.feat__desc { font-size: .98rem; color: var(--ink-3); max-width: 52ch; }
.feat__figs { display: flex; flex-wrap: wrap; gap: 14px 32px; margin-top: 22px; }
.feat__fig { display: flex; flex-direction: column; }
.feat__fig b {
  font-weight: 700; font-size: 1.6rem; line-height: 1.1;
  color: var(--primary-text); font-variant-numeric: tabular-nums;
}
.feat__fig span { font-size: .8rem; color: var(--ink-3); }
.feat .project__stack { margin-top: 20px; }
.feat__media {
  display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--rule); background: #fff;
}
.feat__media img { transition: transform .3s ease; }
.feat__media:hover img { transform: scale(1.02); }
.feat .project__link:hover svg, .project--card:hover .project__link svg { transform: translateX(3px); }

/* Autres projets : cartes */
.projects--2 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project--card { display: flex; flex-direction: column; padding: 24px; }
.project--card .project__desc { flex-grow: 1; }
.project--card:hover .project__title { color: var(--primary-text); }
.project--card .project__link { width: 100%; margin-top: 20px; }
.project--card:hover .project__link { background: var(--primary-hover); }

/* Competence au coeur du parcours */
.comp__badge {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: .72rem; font-weight: 600; color: #fff; background: var(--green);
  border-radius: 50rem; padding: 4px 10px;
}

/* =========================================================
   PARCOURS
   ========================================================= */
.parcours__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.timeline__heading { font-size: 1.25rem; margin-bottom: 20px; text-align: center; }
.tl { display: grid; gap: 20px; }
.tl__item {
  display: grid; grid-template-columns: 48px 1fr; column-gap: 20px; align-content: start;
  padding: 24px; border: 0;
}
.tl__item > :not(.tl__dot) { grid-column: 2; }
.tl__dot {
  grid-row: 1 / span 5; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%; color: #fff; background: var(--primary);
}
.tl__dot--purple { background: var(--purple); }
.tl__dot--green { background: var(--green); }
.tl__dot--amber { background: var(--amber); }
.tl__title { font-size: 1.1rem; }
.tl__date { display: block; font-size: .82rem; color: var(--ink-3); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tl__place { color: var(--ink-3); font-size: .88rem; margin: 2px 0 8px; }
.tl__desc { font-size: .9rem; color: var(--ink-3); line-height: 1.8; }
.certs { margin-top: 56px; }

/* =========================================================
   CONTACT
   ========================================================= */
.cta { padding: 56px 40px; text-align: center; }
.cta__content { max-width: 58ch; margin-inline: auto; }
.cta__title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.cta__sub { margin-top: 14px; font-size: 1.03rem; color: var(--ink-3); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 28px; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { border-top: 1px solid var(--rule); padding-block: 24px; margin-top: 48px; }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer .brand { display: none; }
.footer__copy { color: var(--ink-3); font-size: .875rem; }
.footer__socials { display: flex; gap: 8px; }

.reveal { opacity: 1; transform: none; }

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

/* =========================================================
   PAGE PROJET
   ========================================================= */
.phero { padding-top: 48px; padding-bottom: 16px; }
.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .88rem; color: var(--ink-3); margin-bottom: 24px;
}
.crumbs a { color: var(--primary-text); }
.crumbs a:hover { text-decoration: underline; }

.phero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.phero__meta .chip {
  margin-bottom: 0; font-size: .82rem; padding: 4px 12px; border-radius: 50rem;
  background: var(--primary-soft);
}
.phero__meta .chip + .chip { color: var(--ink-2); background: var(--tag-bg); border: 1px solid var(--tag-line); }
.phero__year { font-size: .88rem; color: var(--ink-3); }
.phero__title { font-size: clamp(2.1rem, 4.6vw, 3.2rem); max-width: 22ch; }
.phero__lead { font-size: 1.2rem; font-weight: 300; color: var(--ink-3); margin-top: 20px; max-width: 60ch; }
.phero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 48px; }
.fact { padding: 20px; }
.fact__k { font-size: .8rem; font-weight: 600; color: var(--primary-text); }
.fact__v { margin-top: 6px; font-size: .95rem; color: var(--ink); }
.fact__v span { color: var(--ink-3); }

.block { padding-block: 56px; }
.block__head { max-width: var(--maxw-txt); margin-bottom: 28px; }
.block__title { font-size: clamp(1.5rem, 2.8vw, 1.9rem); }
.block__sub { margin-top: 12px; color: var(--ink-3); }

.prose { max-width: var(--maxw-txt); }
.prose p { margin-bottom: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--primary-text); }
.prose a:hover { text-decoration: underline; }
.prose ul { list-style: disc; padding-left: 1.25rem; margin: 16px 0; display: grid; gap: 6px; }
.prose li { line-height: 1.8; }
.prose li::marker { color: var(--primary-text); }

code {
  font-family: var(--ff-mono); font-size: .85em; color: #d63384;
  background: var(--soft); padding: 1px 6px; border-radius: 4px;
}
:root[data-theme="dark"] code { color: #e685b5; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.kpi { padding: 20px; text-align: center; }
.kpi__n { font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--primary-text); font-variant-numeric: tabular-nums; }
.kpi__l { color: var(--ink-3); font-size: .85rem; margin-top: 9px; line-height: 1.45; }

.pcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pcards--2 { grid-template-columns: repeat(2, 1fr); }
.pcard { padding: 24px; }
.pcard__k {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px;
  border-radius: 50rem; background: var(--primary-soft); color: var(--primary-text);
  font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; margin-bottom: 14px;
}
.pcard h3 { font-size: 1.1rem; margin-bottom: 10px; }
.pcard p { font-size: .9rem; color: var(--ink-3); }

.figure {
  background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
  box-shadow: var(--card-shadow); overflow: hidden;
}
.figure img { width: 100%; cursor: zoom-in; }
.figure--light img { background: #fff; padding: 12px; }
.figure figcaption {
  padding: 12px 20px; color: var(--ink-3); font-size: .85rem;
  border-top: 1px solid var(--rule);
}

.table-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 8px 20px;
}
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 540px; }
.tbl th {
  text-align: left; font-size: .85rem; font-weight: 700; color: var(--ink);
  padding: 12px 20px 12px 0; border-bottom: 2px solid var(--rule); white-space: nowrap;
}
.tbl td { padding: 12px 20px 12px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--soft); }
.tbl td:first-child { color: var(--ink); font-weight: 500; }
.tbl .num { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.code {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 12px;
  box-shadow: var(--card-shadow); overflow: hidden;
}
.code__bar {
  display: flex; align-items: center; gap: 9px; padding: 10px 18px;
  background: var(--soft); border-bottom: 1px solid var(--rule); color: var(--ink-3);
  font-family: var(--ff-mono); font-size: .78rem;
}
.code pre {
  margin: 0; padding: 20px; overflow-x: auto; color: var(--ink);
  font-family: var(--ff-mono); font-size: .8rem; line-height: 1.75;
}
.code code { background: none; border: none; padding: 0; font-size: inherit; color: inherit; }
.code .k { color: var(--syn-key); font-weight: 600; }
.code .cm { color: var(--ink-3); font-style: italic; }
.code .fn { color: var(--syn-fn); }
.code .s  { color: var(--syn-str); }

.note {
  background: var(--primary-soft); border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0; padding: 16px 20px; color: var(--ink-2);
}
.note strong { color: var(--ink); font-weight: 600; }
.notes { display: grid; gap: 16px; }

.shots { display: grid; gap: 32px; }
.shot {
  display: grid; grid-template-columns: .85fr 1.15fr; gap: 40px; align-items: center;
  padding: 32px; background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius); box-shadow: var(--card-shadow);
}
.shot--rev .shot__media { order: -1; }
.shot__k { font-size: .85rem; font-weight: 600; color: var(--primary-text); margin-bottom: 8px; }
.shot__t { font-size: 1.3rem; margin-bottom: 12px; }
.shot__d { font-size: .95rem; color: var(--ink-3); }
.shot__d + .shot__d { margin-top: 12px; }
.shot__media img {
  width: 100%; border: 1px solid var(--rule); border-radius: 12px; cursor: zoom-in; background: #fff;
  transition: transform .2s ease;
}
.shot__media img:hover { transform: scale(1.01); }

.pagenav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-block: 32px; border-top: 1px solid var(--rule);
}
.pagenav__link {
  display: inline-flex; align-items: center; gap: 10px; color: var(--primary-text);
  border: 1px solid var(--primary); border-radius: .5rem; padding: .5rem 1.25rem;
  transition: background-color .15s, color .15s;
}
.pagenav__link:hover { background: var(--primary); color: #fff; }

/* Agrandissement d'une capture */
.zoom {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: rgba(15, 23, 42, .9); padding: 32px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.zoom.open { opacity: 1; pointer-events: auto; }
.zoom img { max-width: 100%; max-height: 90vh; width: auto; height: auto; background: #fff; border-radius: 12px; }
.zoom__close {
  position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: #fff;
  background: transparent; border: 1px solid rgba(255, 255, 255, .4);
}
.zoom__close:hover { background: rgba(255, 255, 255, .12); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 991px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; min-height: 0; }
  .hero__visual { order: -1; }
  .portrait__frame { height: 380px; }
  .about__grid, .parcours__grid { grid-template-columns: 1fr; gap: 32px; }
  .comp__grid, .projects, .pcards, .pcards--2 { grid-template-columns: 1fr; }
  .skills { grid-template-columns: repeat(2, 1fr); }
  .project--lg { grid-template-columns: 1fr; gap: 24px; }
  .feat { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .feat__media, .feat--rev .feat__media { order: -1; }
  .feat__title { font-size: 1.4rem; }
  .project__cover { order: -1; max-width: 420px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .shot { grid-template-columns: 1fr; gap: 24px; padding: 24px; }
  .shot--rev .shot__media { order: 0; }

  .nav__links {
    position: absolute; left: 16px; right: 16px; top: calc(100% + 4px); flex-direction: column; gap: 0;
    background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 8px 20px; display: none;
  }
  .nav__links.open { display: flex; }
  .nav__link { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .nav__link:last-child { border-bottom: 0; }
  .nav__burger { display: flex; }
}

@media (max-width: 720px) {
  .container { padding-inline: 16px; }
  .section { padding-block: 56px; }
  .section:first-of-type { padding-top: 32px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .about__cards { grid-template-columns: 1fr; }
  .block { padding-block: 44px; }
  .cta { padding: 40px 20px; }
}

@media (max-width: 460px) {
  .skills, .facts { grid-template-columns: 1fr; }
  .feat__figs { gap: 12px 22px; }
  .feat__fig b { font-size: 1.35rem; }
  .hero__cta .btn { width: 100%; }
  .portrait__frame { height: 340px; }
}
