/* =========================================================
   PORTFOLIO — Ayoub EL MAHDAOUI
   Sommaire :
   1. Variables (design tokens)
   2. Base & utilitaires
   3. Décor de fond
   4. Navigation & menu mobile
   5. Boutons
   6. Préchargeur & hero
   7. Bandeau (ticker)
   8. Sections (en-têtes communs)
   9. Projets (cartes + illustrations)
   10. Compétences
   11. Parcours (timeline)
   12. Contact & footer
   13. Page fiche projet
   14. Animations (chargement, révélation)
   15. Responsive
   16. Réduction des animations
   ========================================================= */

/* ---------- 0. POLICES (hébergées localement, licence SIL OFL — voir assets/fonts) ---------- */
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/geist-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- 1. VARIABLES ---------- */
:root {
  /* Couleurs */
  --bg: #060810;
  --bg-elev: #0b0f1d;
  --bg-elev-2: #10152a;
  --line: rgba(140, 150, 255, 0.11);
  --line-strong: rgba(140, 150, 255, 0.24);
  --text: #eef0fa;
  --text-2: #a6adc8;
  --text-3: #7d85a6;
  --indigo: #7c7bff;
  --blue: #4cc2ff;
  --violet: #a78bfa;
  --ok: #5eead4;
  --grad: linear-gradient(100deg, #9a97ff 0%, #6ea8ff 45%, #4cc2ff 100%);

  /* Typographie */
  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --f-serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.6vw, 1.5rem);
  --fs-h3: clamp(1.5rem, 2.2vw, 1.95rem);
  --fs-h2: clamp(2.3rem, 5.4vw, 4.6rem);
  --fs-display: clamp(2.75rem, 8.2vw, 8.25rem);

  /* Espacements */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --section-y: clamp(6rem, 12vw, 10rem);
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max-w: 1280px;

  /* Formes & mouvements */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.6s;
  --dur-fast: 0.25s;
}

/* ---------- 2. BASE ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.menu-open { overflow: hidden; }

/* Fondu court pendant le changement de langue */
main, .nav__links, .mobile-menu__links, .footer { transition: opacity 0.18s ease; }
.is-switching main,
.is-switching .nav__links,
.is-switching .mobile-menu__links,
.is-switching .footer { opacity: 0.15; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; padding: 0; }

::selection { background: rgba(124, 123, 255, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.serif {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.skip-link {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus { transform: none; }

.noscript {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  padding: 1rem;
  background: var(--bg-elev-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  z-index: 300;
}

/* ---------- 3. DÉCOR DE FOND ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.backdrop__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 80% 60% at 60% 20%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 60% 20%, #000 10%, transparent 75%);
  opacity: 0.55;
}

.backdrop__halo {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
}
.backdrop__halo--a {
  width: 46vmax;
  height: 46vmax;
  top: -18vmax;
  right: -10vmax;
  background: radial-gradient(circle, rgba(124, 123, 255, 0.55), transparent 65%);
  animation: drift 22s var(--ease-in-out) infinite alternate;
}
.backdrop__halo--b {
  width: 38vmax;
  height: 38vmax;
  top: 40vh;
  left: -20vmax;
  background: radial-gradient(circle, rgba(76, 194, 255, 0.28), transparent 65%);
  animation: drift 28s var(--ease-in-out) infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-6vmax, 4vmax, 0) scale(1.08); }
}

/* ---------- 4. NAVIGATION ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--nav-h);
  transition: height var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  --nav-h: 62px;
  background: rgba(6, 8, 16, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--line);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-1);
}
.nav__logo {
  display: inline-block;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  line-height: 1;
  transition: transform var(--dur-fast) var(--ease);
}
.nav__logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav__brand:hover .nav__logo { transform: rotate(-6deg); }
.nav__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
  transition: color var(--dur-fast);
}
.nav__brand:hover .nav__name { color: var(--text); }

/* La navigation apparaît avec le hero */
.js .nav { opacity: 0; transition: opacity 1s var(--ease) 0.2s, height var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.js .is-ready .nav { opacity: 1; }

.nav__links {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 15, 29, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav__links a {
  position: relative;
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-radius: 999px;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a[aria-current="true"] {
  color: var(--text);
  background: rgba(124, 123, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(124, 123, 255, 0.25);
}

.nav__tools { display: flex; align-items: center; gap: var(--sp-3); }

.lang {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  isolation: isolate;
}
.lang__btn {
  position: relative;
  z-index: 1;
  min-width: 2.6rem;
  padding: 0.35rem 0.6rem;
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-radius: 999px;
  transition: color var(--dur-fast) var(--ease);
}
.lang__btn[aria-pressed="true"] { color: var(--bg); font-weight: 500; }
.lang__btn:not([aria-pressed="true"]):hover { color: var(--text); }
.lang__thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.45s var(--ease);
}
.lang[data-active="en"] .lang__thumb { transform: translateX(100%); }

.nav__burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  position: relative;
}
.nav__burger span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 25px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.nav__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 100%;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

/* Menu mobile */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + var(--sp-7)) var(--gutter) var(--sp-7);
  background: rgba(6, 8, 16, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease), visibility 0s;
}
.mobile-menu__links { display: flex; flex-direction: column; }
.mobile-menu__links a {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color var(--dur-fast);
}
.mobile-menu__links a .mono { color: var(--indigo); }
.mobile-menu__links a:hover { color: var(--blue); }
.mobile-menu.is-open .mobile-menu__links a { opacity: 1; transform: none; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu__links a:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu__foot { color: var(--text-3); }

/* ---------- 5. BOUTONS ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: 0 var(--sp-5);
  font-weight: 500;
  font-size: var(--fs-base);
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur-fast), color var(--dur-fast);
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  color: #070912;
  background: var(--text);
  box-shadow: 0 0 0 0 rgba(124, 123, 255, 0);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grad);
  transform: translateY(101%);
  transition: transform 0.5s var(--ease);
}
.btn--primary:hover::before { transform: none; }
.btn--primary:hover { box-shadow: 0 12px 40px -10px rgba(124, 123, 255, 0.7); }
.btn--primary:hover svg { transform: translateY(3px); }

.btn--ghost {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}
.btn--ghost:hover { border-color: rgba(124, 123, 255, 0.6); background: rgba(124, 123, 255, 0.08); }
.btn--ghost:hover svg { transform: translateX(4px); }

/* ---------- 6. PRÉCHARGEUR & HERO ---------- */

/* Préchargeur : visible seulement si <html> a la classe .intro (1re visite de la session) */
.preloader { display: none; }
.intro .preloader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}
.intro body { overflow: hidden; }
.preloader.is-leaving { transform: translateY(-100%); }
.preloader__inner { display: grid; justify-items: center; gap: var(--sp-5); }

.preloader__mark {
  position: relative;
  display: flex;
  gap: 0.28em;
  padding: 0.38em 0.1em 0.32em 0.38em;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
}
/* Les deux traits qui se dessinent au-dessus et en dessous des initiales */
.preloader__mark::before,
.preloader__mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  animation: drawLine 0.8s var(--ease) 0.15s forwards;
}
.preloader__mark::before { top: 0; transform-origin: left; }
.preloader__mark::after { bottom: 0; transform-origin: right; }
.preloader__mark span {
  display: inline-block;
  transform: translateY(110%);
  animation: riseIn 0.9s var(--ease) forwards;
}
.preloader__mark span:nth-child(1) { animation-delay: 0.35s; }
.preloader__mark span:nth-child(2) { animation-delay: 0.45s; }
.preloader__mark span:nth-child(3) { animation-delay: 0.55s; }
.preloader__motto {
  color: var(--text-3);
  letter-spacing: 0.2em;
  opacity: 0;
  animation: fadeIn 0.8s var(--ease) 0.8s forwards;
}
@keyframes drawLine { to { transform: scaleX(1); } }
@keyframes riseIn { to { transform: none; } }
@keyframes fadeIn { to { opacity: 1; } }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: calc(var(--nav-h) + var(--sp-7)) 0 calc(var(--sp-9) + var(--sp-5));
  overflow: hidden;
  isolation: isolate;
}

/* Réseau de particules */
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s var(--ease);
  mask-image: linear-gradient(180deg, #000 65%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent);
}
.is-ready .hero__canvas,
html:not(.js) .hero__canvas { opacity: 1; }

.hero__inner { display: flex; flex-direction: column; align-items: center; }

/* Badge « Recherche de stage » : accent turquoise pour ressortir sur le fond sombre */
.hero__badge {
  --teal: #5eead4;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.55rem 1.1rem 0.55rem 0.9rem;
  margin-bottom: var(--sp-6);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8ff5e3;
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(94, 234, 212, 0.12), rgba(76, 194, 255, 0.08));
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.05), 0 10px 40px -12px rgba(94, 234, 212, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero__badge-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal);
}
.hero__badge-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--teal);
  animation: softPing 2.8s var(--ease) infinite;
}
@keyframes softPing {
  0% { transform: scale(1); opacity: 0.5; }
  70%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Étiquettes : durée, période, zones */
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.fact {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(16, 21, 42, 0.7);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.fact:hover { border-color: rgba(124, 123, 255, 0.55); background: rgba(124, 123, 255, 0.1); }
.fact svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__signature {
  margin-top: var(--sp-6);
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.accent-dot { color: var(--indigo); }

/* Texte tapé : deux couches superposées.
   .typed__ghost = texte complet (réserve la place, lu par les lecteurs d'écran)
   .typed__live  = texte qui s'écrit progressivement par-dessus */
.typed { display: grid; }
.typed > * { grid-area: 1 / 1; }
.js .typed__ghost,
.js .typed__ghost * {
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  background: none !important;
}
html:not(.js) .typed__live { display: none; }

.caret {
  display: inline-block;
  width: 0.07em;
  min-width: 2px;
  height: 0.95em;
  margin-left: 0.06em;
  vertical-align: -0.1em;
  background: var(--blue);
  animation: caretBlink 1s steps(2, jump-none) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.hero__title {
  max-width: 17ch;
  font-size: clamp(2.3rem, 6.2vw, 5.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin-bottom: var(--sp-6);
}
.hero__title em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding-right: 0.06em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__bar {
  display: block;
  width: 64px;
  height: 2px;
  margin-bottom: var(--sp-6);
  border-radius: 2px;
  background: var(--grad);
}
.js .hero__bar { transform: scaleX(0); transition: transform 0.8s var(--ease); }
.js .hero.title-done .hero__bar { transform: none; }

.hero__intro {
  max-width: 38rem;
  color: var(--text);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  margin-bottom: var(--sp-5);
}
.hero__intro strong { color: var(--text); font-weight: 500; }
.hero__intro .caret { width: 2px; background: var(--indigo); }

.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }

/* Les CTA apparaissent dès que le titre est écrit ; la flèche à la fin de la frappe */
.js .hero__cta,
.js .hero__signature,
.js .hero__down { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .hero.title-done .hero__cta { opacity: 1; transform: none; }
.js .hero.title-done .hero__signature { opacity: 1; transform: none; transition-delay: 0.15s; }
.hero__cta .btn--primary:hover svg { transform: translateX(4px); }
.hero__cta .btn--ghost:hover svg { transform: translateY(3px); }
.js .hero.typing-done .hero__down { opacity: 1; transform: none; transition-delay: 0.25s; }

.hero__down {
  position: absolute;
  left: 50%;
  bottom: var(--sp-6);
  margin-left: -26px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--indigo), #5b8cff);
  box-shadow: 0 10px 30px -8px rgba(124, 123, 255, 0.7);
}
.hero__down svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 2s var(--ease-in-out) infinite;
}
.hero__down::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(124, 123, 255, 0.4);
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
.hero__down:hover::before { transform: scale(1.15); opacity: 0; }
@keyframes nudge {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

/* ---------- 7. TICKER ---------- */
.ticker {
  border-block: 1px solid var(--line);
  padding: var(--sp-4) 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: marquee 45s linear infinite;
}
.ticker__group { display: flex; flex: none; }
.ticker__item {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding-right: var(--sp-6);
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
  color: var(--text-3);
  white-space: nowrap;
}
.ticker__item::after {
  content: "";
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border: 1px solid var(--indigo);
}
.ticker:hover .ticker__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 8. SECTIONS ---------- */
.section { padding-block: var(--section-y) 0; }

.section__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--sp-5);
  row-gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.section__index {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-3);
}
.section__index span:first-child { color: var(--indigo); }
.section__index::after {
  content: "";
  flex: 0 1 80px;
  height: 1px;
  margin-left: var(--sp-3);
  background: var(--line-strong);
}
.section__title {
  grid-column: 1 / span 8;
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}
.section__title .serif {
  display: inline;
  color: var(--text-2);
}
.section__lead {
  grid-column: 9 / -1;
  align-self: end;
  color: var(--text-2);
  max-width: 28rem;
}

/* ---------- 9. PROJETS ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-5);
}
.projects > .card:nth-child(4n + 1),
.projects > .card:nth-child(4n + 4) { grid-column: span 7; }
.projects > .card:nth-child(4n + 2),
.projects > .card:nth-child(4n + 3) { grid-column: span 5; }

.card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 21, 42, 0.7), rgba(11, 15, 29, 0.55));
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.6s var(--ease), border-color 0.4s var(--ease), box-shadow 0.6s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(124, 123, 255, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.card:hover,
.card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(124, 123, 255, 0.35);
  box-shadow: 0 40px 80px -40px rgba(76, 90, 255, 0.45);
}
.card:hover::before,
.card:focus-within::before { opacity: 1; }

.card__visual {
  position: relative;
  height: 240px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 120%, rgba(124, 123, 255, 0.22), transparent 60%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px;
  overflow: hidden;
}
.card__visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.card__caption {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 1;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 8, 16, 0.6);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-4);
  padding: var(--sp-6);
}
.card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-3);
}
.card__num { color: var(--indigo); }
.card__num::after { content: " —"; color: var(--text-3); }
.card__title {
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.card__summary { color: var(--text-2); }
.card__role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text);
}
.card__role .mono { color: var(--text-3); }
.card__note {
  display: flex;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.card__note::before { content: "※"; color: var(--violet); }

.tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tag {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.card:hover .tag { border-color: rgba(124, 123, 255, 0.35); }

.card__foot {
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-3);
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--text-3);
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 500;
  color: var(--text);
}
.card__link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform 0.4s var(--ease); }
.card__link:hover svg { transform: translate(3px, -3px); }
/* Rend toute la carte cliquable quand une fiche existe */
.card__link--stretch::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.card__links { display: flex; gap: var(--sp-4); position: relative; z-index: 3; }

/* Surbrillance quand on arrive depuis la section Compétences */
.card.is-highlight { animation: highlight 1.6s var(--ease); }
@keyframes highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 123, 255, 0); }
  30% { box-shadow: 0 0 0 3px rgba(124, 123, 255, 0.6); }
}

/* Illustrations des cartes (SVG générés dans script.js) */
.viz-stroke { fill: none; stroke: rgba(160, 165, 255, 0.45); stroke-width: 1.2; }
.viz-soft { fill: none; stroke: rgba(160, 165, 255, 0.2); stroke-width: 1; }
.viz-fill { fill: var(--bg-elev-2); stroke: rgba(160, 165, 255, 0.5); stroke-width: 1.2; }
.viz-accent { fill: var(--indigo); }
.viz-blue { fill: var(--blue); }
.viz-text { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em; fill: var(--text-3); }
.viz-text--accent { fill: #b8b6ff; }
.viz-dash { stroke-dasharray: 4 5; animation: dash 1.6s linear infinite; animation-play-state: paused; }
.card:hover .viz-dash, .card:focus-within .viz-dash { animation-play-state: running; }
@keyframes dash { to { stroke-dashoffset: -18; } }

/* Réseau : zones VLAN */
.viz-zone { transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); transform-box: fill-box; transform-origin: center; }
.viz-zone--a { fill: rgba(124, 123, 255, 0.1); stroke: rgba(124, 123, 255, 0.5); }
.viz-zone--b { fill: rgba(76, 194, 255, 0.08); stroke: rgba(76, 194, 255, 0.45); }
.viz-zone--c { fill: rgba(167, 139, 250, 0.08); stroke: rgba(167, 139, 250, 0.45); }
.card:hover .viz-zone { transform: scale(1.04); }

/* Dominion : éventail de cartes */
.viz-fan > g {
  transform-box: view-box;
  transform-origin: 200px 300px;
  transform: rotate(var(--r, 0deg));
  transition: transform 0.7s var(--ease);
}
.card:hover .viz-fan > g,
.card:focus-within .viz-fan > g { transform: rotate(calc(var(--r, 0deg) * 1.6)) translateY(-6px); }

/* Caméra : balayage */
.viz-scan { animation: scanY 3.2s var(--ease-in-out) infinite alternate; }
@keyframes scanY { from { transform: translateY(0); } to { transform: translateY(128px); } }
.viz-cell { fill: rgba(76, 194, 255, 0); transition: fill 0.4s var(--ease); }
.card:hover .viz-cell--hot { fill: rgba(76, 194, 255, 0.22); }
.viz-alert { opacity: 0.35; transition: opacity 0.4s var(--ease); }
.card:hover .viz-alert { opacity: 1; animation: blink 1s steps(2, jump-none) infinite; }
.viz-rec { animation: blink 1.4s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* E-commerce : lignes de requêtes et équipe */
.viz-row { fill: rgba(160, 165, 255, 0.12); }
.viz-row--fix { fill: rgba(94, 234, 212, 0.18); transition: fill 0.5s var(--ease); }
.card:hover .viz-row--fix { fill: rgba(94, 234, 212, 0.4); }
.viz-check { fill: none; stroke: var(--ok); stroke-width: 1.6; stroke-dasharray: 14; stroke-dashoffset: 14; transition: stroke-dashoffset 0.6s var(--ease) 0.15s; }
.card:hover .viz-check { stroke-dashoffset: 0; }

/* ---------- 10. COMPÉTENCES ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-5);
}
.skill-group {
  grid-column: span 4;
  position: relative;
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(11, 15, 29, 0.5);
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}
.skill-group:hover { border-color: var(--line-strong); background: rgba(16, 21, 42, 0.6); }
.skill-group:nth-child(4) { grid-column: span 7; }
.skill-group:nth-child(5) { grid-column: span 5; }

.skill-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.skill-group__title { font-size: var(--fs-lg); font-weight: 500; letter-spacing: -0.02em; }
.skill-group__count { color: var(--text-3); }

.skill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
}
.skill__name {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-md);
}
.skill__name::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  transform: rotate(45deg);
  background: var(--line-strong);
  transition: background-color var(--dur-fast);
}
.skill.has-projects .skill__name::before { background: var(--indigo); }
.skill__refs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.skill__refs-label { color: var(--text-3); font-size: 0.65rem; }
.skill__ref {
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast);
}
.skill__ref:hover { color: var(--text); border-color: var(--indigo); background: rgba(124, 123, 255, 0.1); }
.skill__level {
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  border-radius: 4px;
  color: var(--text-2);
  background: rgba(124, 123, 255, 0.12);
}

.skills__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-5);
  color: var(--text-3);
}

/* ---------- 11. PARCOURS ---------- */
.timeline {
  position: relative;
  display: grid;
  gap: 0;
}
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc(25% + 0px);
  width: 1px;
  background: var(--line-strong);
}
.timeline::after {
  background: linear-gradient(180deg, var(--indigo), var(--blue));
  transform-origin: top;
  transform: scaleY(var(--line-progress, 0));
}

.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 25% 1fr;
  column-gap: var(--sp-7);
  padding-bottom: var(--sp-8);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item__date {
  justify-self: end;
  padding-right: var(--sp-7);
  padding-top: 0.35rem;
  color: var(--text-3);
  text-align: right;
}
.tl-item__node {
  position: absolute;
  top: 0.35rem;
  left: 25%;
  z-index: 1;
  width: 15px;
  height: 15px;
  translate: -7px 0;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  transition: border-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.tl-item__node::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--text-3);
  transition: background-color 0.6s var(--ease);
}
.tl-item.is-visible .tl-item__node { border-color: var(--indigo); box-shadow: 0 0 0 5px rgba(124, 123, 255, 0.12); }
.tl-item.is-visible .tl-item__node::after { background: var(--indigo); }
.tl-item--goal .tl-item__node { border-style: dashed; }
.tl-item--goal.is-visible .tl-item__node::after { background: var(--ok); }

.tl-item__body {
  max-width: 44rem;
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 15, 29, 0.45);
  transition: border-color 0.4s var(--ease), transform 0.5s var(--ease);
}
.tl-item__body:hover { border-color: var(--line-strong); transform: translateX(4px); }
.tl-item--goal .tl-item__body {
  border-style: dashed;
  border-color: rgba(94, 234, 212, 0.35);
  background: linear-gradient(120deg, rgba(94, 234, 212, 0.06), transparent 60%);
}
.tl-item__kind { display: inline-block; margin-bottom: var(--sp-2); color: var(--indigo); }
.tl-item--goal .tl-item__kind { color: var(--ok); }
.tl-item__title { font-size: var(--fs-h3); font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.tl-item__org { margin-top: var(--sp-1); color: var(--text-2); font-size: var(--fs-sm); }
.tl-item__text { margin-top: var(--sp-3); color: var(--text-2); }
.tl-item .tags { margin-top: var(--sp-4); }

/* ---------- 12. CONTACT & FOOTER ---------- */
.section--contact { padding-bottom: var(--section-y); }
.contact {
  position: relative;
  padding: clamp(2rem, 6vw, 5rem);
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius-lg) + 8px);
  background: linear-gradient(160deg, rgba(20, 24, 52, 0.85), rgba(8, 10, 22, 0.9));
  overflow: hidden;
  isolation: isolate;
}
.contact__glow {
  position: absolute;
  z-index: -1;
  width: 70%;
  aspect-ratio: 1;
  right: -20%;
  top: -40%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 123, 255, 0.35), transparent 60%);
  filter: blur(40px);
}
.contact .section__index { margin-bottom: var(--sp-5); }
.contact__title {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: var(--sp-5);
}
.contact__title .serif {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.08em;
}
.contact__lead { max-width: 40rem; color: var(--text); font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.contact__focus {
  display: flex;
  gap: var(--sp-3);
  max-width: 40rem;
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-7);
}
.contact__focus::before { content: "→"; color: var(--indigo); }

.contact__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.contact-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  min-height: 76px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(6, 8, 16, 0.45);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), transform 0.4s var(--ease);
}
.contact-item__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
}
.contact-item__icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.contact-item__label { display: block; color: var(--text-3); }
.contact-item__value { display: block; font-size: var(--fs-md); overflow-wrap: anywhere; }
.contact-item__arrow { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 0.4s var(--ease); }
.contact-item__main { min-width: 0; }
.contact-item__main a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.contact-item:has(a):hover { border-color: rgba(124, 123, 255, 0.6); background: rgba(124, 123, 255, 0.08); transform: translateY(-2px); }
.contact-item:has(a):hover .contact-item__arrow { transform: translate(3px, -3px); }
.contact-item__copy {
  position: relative;
  z-index: 1;
  padding: 0.3rem 0.7rem;
  font-size: var(--fs-xs);
  font-family: var(--f-mono);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.contact-item__copy:hover { color: var(--text); border-color: var(--indigo); }

/* L'e-mail, contact principal, occupe toute la largeur */
.contact-item--wide { grid-column: 1 / -1; }

/* Footer */
.footer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-top: var(--sp-8);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 15, 29, 0) 0%, rgba(11, 15, 29, 0.85) 100%);
  color: var(--text-2);
}
/* Fin trait dégradé en haut du footer */
.footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(560px, 80%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--indigo), var(--blue), transparent);
}
.footer__glow {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -60%;
  width: 70%;
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(124, 123, 255, 0.16), transparent 65%);
  pointer-events: none;
}

.footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
  gap: var(--sp-7);
  padding-bottom: var(--sp-7);
}

.footer__logo {
  display: inline-block;
  margin-bottom: var(--sp-4);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  transition: transform var(--dur-fast) var(--ease);
}
.footer__logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer__logo:hover { transform: rotate(-6deg); }

.footer__sign {
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-2);
  margin-bottom: var(--sp-2);
}
.footer__sign strong {
  font-weight: 500;
  color: var(--text);
  background: linear-gradient(transparent 62%, rgba(124, 123, 255, 0.28) 62%, rgba(124, 123, 255, 0.28) 92%, transparent 92%);
}
.footer__tech { color: var(--text-3); margin-bottom: var(--sp-5); }

.footer__status {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--sp-3);
  max-width: 30rem;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-2);
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: var(--radius);
  background: rgba(94, 234, 212, 0.05);
}
.footer__status-dot {
  width: 7px;
  height: 7px;
  flex: none;
  margin-top: 0.45em;
  border-radius: 50%;
  background: #5eead4;
  box-shadow: 0 0 8px #5eead4;
}

.footer__heading {
  margin-bottom: var(--sp-4);
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.12em;
}
.footer__links { display: grid; gap: var(--sp-2); }
.footer__links a {
  position: relative;
  display: inline-block;
  padding: 0.15rem 0;
  color: var(--text-2);
  transition: color var(--dur-fast), transform 0.35s var(--ease);
}
.footer__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.footer__links a:hover,
.footer__links a:focus-visible { color: var(--text); transform: translateX(3px); }
.footer__links a:hover::after,
.footer__links a:focus-visible::after { transform: scaleX(1); }

.footer__social {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.45rem 0.9rem 0.45rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  transition: border-color var(--dur-fast), background-color var(--dur-fast), transform 0.35s var(--ease);
}
.footer__social-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(124, 123, 255, 0.14);
  transition: background-color var(--dur-fast), transform 0.4s var(--ease);
}
.footer__social-icon svg { width: 16px; height: 16px; fill: var(--text); }
.footer__ext { width: 14px; height: 14px; fill: none; stroke: var(--text-3); stroke-width: 2; transition: transform 0.35s var(--ease), stroke var(--dur-fast); }
.footer__social:hover { border-color: rgba(124, 123, 255, 0.6); background: rgba(124, 123, 255, 0.08); transform: translateY(-2px); }
.footer__social:hover .footer__social-icon { background: #0a66c2; transform: rotate(-8deg); }
.footer__social:hover .footer__ext { transform: translate(2px, -2px); stroke: var(--text); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  padding-block: var(--sp-5);
  border-top: 1px solid var(--line);
  color: var(--text-3);
}
.footer__legal {
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color var(--dur-fast), text-decoration-color var(--dur-fast);
}
.footer__legal:hover { color: var(--text); text-decoration-color: var(--indigo); }
.detail__block a { color: var(--text); text-decoration: underline; text-decoration-color: var(--indigo); text-underline-offset: 3px; }
.detail__block p + p { margin-top: var(--sp-2); }

.footer__top {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.footer__top svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.35s var(--ease); }
.footer__top:hover { color: var(--text); border-color: rgba(124, 123, 255, 0.6); }
.footer__top:hover svg { transform: translateY(-3px); }

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  z-index: 150;
  padding: 0.7rem 1.1rem;
  font-size: var(--fs-sm);
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 13. PAGE FICHE PROJET ---------- */
.detail { padding-top: calc(var(--nav-h) + var(--sp-8)); padding-bottom: var(--section-y); }
.detail__back { display: inline-block; margin-bottom: var(--sp-7); color: var(--text-2); transition: color var(--dur-fast); }
.detail__back:hover { color: var(--text); }
.detail__head { margin-bottom: var(--sp-7); }
.detail__head .card__meta { margin-bottom: var(--sp-4); }
.detail__title { font-size: var(--fs-h2); font-weight: 500; letter-spacing: -0.045em; line-height: 1; margin-bottom: var(--sp-5); }
.detail__summary { max-width: 46rem; font-size: var(--fs-md); color: var(--text-2); }
.detail__draft {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
  padding: var(--sp-4) var(--sp-5);
  border: 1px dashed rgba(167, 139, 250, 0.45);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.detail__draft::before { content: "※"; color: var(--violet); }
.detail__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.detail__block {
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(11, 15, 29, 0.5);
}
.detail__block--wide { grid-column: 1 / -1; }
.detail__block h2 { margin-bottom: var(--sp-4); color: var(--indigo); }
.detail__block p, .detail__block li { color: var(--text-2); }
.detail__block ul { display: grid; gap: var(--sp-2); }
.detail__block li { display: flex; gap: var(--sp-3); }
.detail__block li::before { content: "→"; color: var(--indigo); }
.detail__media { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.detail__media img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.detail__media figcaption { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-3); }

/* ---------- 14. ANIMATIONS ---------- */
/* Les états « cachés » ne s'appliquent que si JavaScript est actif (classe .js sur <html>) */
.js [data-load] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .is-ready [data-load] { opacity: 1; transform: none; }

[data-load="1"] { --d: 0.1s; }
[data-load="2"] { --d: 0.25s; }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
/* Les cartes gardent leur propre transition au survol une fois révélées */
.js .card[data-reveal].is-visible { transition: transform 0.6s var(--ease), border-color 0.4s var(--ease), box-shadow 0.6s var(--ease), opacity 0.9s var(--ease); transition-delay: 0s; }

/* ---------- 15. RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .section__title { grid-column: 1 / -1; }
  .section__lead { grid-column: 1 / span 8; }
  .skill-group { grid-column: span 6 !important; }
  .skill-group:nth-child(5) { grid-column: 1 / -1 !important; }
}

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: block; }

  .section__lead { grid-column: 1 / -1; }

  .projects > .card { grid-column: 1 / -1 !important; }

  .timeline::before, .timeline::after { left: 7px; }
  .tl-item { grid-template-columns: 1fr; padding-left: var(--sp-7); padding-bottom: var(--sp-7); }
  .tl-item__node { left: 7px; top: 0.2rem; }
  .tl-item__date { justify-self: start; text-align: left; padding: 0 0 var(--sp-3); }

  .contact__list { grid-template-columns: 1fr; }
  .footer__main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
  .detail__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --nav-h: 64px; }
  .skill-group { grid-column: 1 / -1 !important; padding: var(--sp-5); }
  .card__body { padding: var(--sp-5); }
  .card__visual { height: 200px; }
  .hero__cta { align-self: stretch; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .hero__badge { font-size: 0.72rem; letter-spacing: 0.1em; padding: 0.5rem 0.9rem 0.5rem 0.8rem; margin-bottom: var(--sp-5); }
  .hero__title { margin-bottom: var(--sp-5); }
  .hero__bar { margin-bottom: var(--sp-5); }
  .hero__intro { font-size: 1.05rem; }
  .hero__facts { gap: 0.4rem; margin-bottom: var(--sp-5); }
  .fact { font-size: 0.8rem; padding: 0.35rem 0.7rem 0.35rem 0.6rem; }
  .hero__signature { font-size: 0.65rem; }
  .tl-item__body { padding: var(--sp-5); }
  .contact-item { grid-template-columns: auto 1fr; }
  .contact-item__arrow { display: none; }
  .contact-item__copy { grid-column: 2; justify-self: start; }
  .footer { padding-top: var(--sp-7); }
  .footer__main { gap: var(--sp-6) var(--sp-5); padding-bottom: var(--sp-6); }
  .footer__sign { font-size: 1.15rem; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .nav__name { display: none; }
}

/* ---------- 16. RÉDUCTION DES ANIMATIONS ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-load],
  .js [data-reveal] { transform: none; }
  .ticker__track { animation: none; }
  .caret { display: none; }
  .card:hover, .card:focus-within { transform: none; }
}
