/* =========================================================
   Portfolio — Gaëtan Rederstorff
   Design inspiré d'Apple · Liquid Glass · One-page · FR/EN
   Palette : bleu #0b55eb · blanc #ffffff · bleu très pâle #eaf0fc
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  /* Police système : SF Pro sur Apple, Segoe UI sur Windows, Roboto sur Android (aucun service tiers) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Palette */
  --blue: #0b55eb;
  --blue-pale: #eaf0fc;
  --white: #ffffff;

  /* Nuances dérivées du bleu (textes, survols) */
  --blue-dark: #0843bb;
  --blue-light: #6f9bf5;
  --ink: #0a1633;                      /* texte principal (bleu nuit) */
  --ink-2: rgba(10, 22, 51, 0.72);     /* texte secondaire */
  --ink-3: rgba(10, 22, 51, 0.62);     /* texte discret (contraste ≥ 4,5:1) */
  --blue-tint: rgba(11, 85, 235, 0.08);
  --blue-line: rgba(11, 85, 235, 0.16);

  /* Liquid glass (clair) */
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.66) 100%);
  --glass-blur: blur(26px) saturate(180%);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -1px 0 rgba(11, 85, 235, 0.05),
    0 1px 2px rgba(11, 85, 235, 0.06),
    0 18px 50px -18px rgba(11, 85, 235, 0.28);

  /* Jetons du thème (clair par défaut) */
  --bg: var(--blue-pale);
  --accent: #0743bd;                   /* bleu des petits textes : version foncée de #0b55eb pour un contraste ≥ 4,5:1 */
  --nav-bg: rgba(255, 255, 255, 0.86);
  --surface: #ffffff;
  --field-bg: rgba(255, 255, 255, 0.85);
  --glass-edge: linear-gradient(140deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.2) 35%, rgba(11, 85, 235, 0.12) 65%, rgba(255, 255, 255, 0.9) 100%);
  --glass-glare: rgba(255, 255, 255, 0.7);
  --amb-1: rgba(120, 155, 225, 0.22);
  --amb-2: rgba(150, 180, 235, 0.22);
  --amb-3: rgba(255, 255, 255, 0.9);
  --amb-4: rgba(190, 210, 245, 0.35);
  --amb-5: rgba(120, 155, 225, 0.12);

  --radius-xl: 32px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Thème sombre ---------- */
html[data-theme="dark"] {
  --bg: #060b18;
  --ink: #eef2fb;
  --ink-2: rgba(238, 242, 251, 0.72);
  --ink-3: rgba(238, 242, 251, 0.58);
  --accent: #93b5ff;
  --nav-bg: rgba(12, 18, 36, 0.84);
  --blue-tint: rgba(91, 143, 247, 0.12);
  --blue-line: rgba(91, 143, 247, 0.24);
  --surface: rgba(255, 255, 255, 0.06);
  --field-bg: rgba(255, 255, 255, 0.05);
  --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 255, 255, 0.07) 100%);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 20px 50px -18px rgba(0, 0, 0, 0.7);
  --glass-edge: linear-gradient(140deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.06) 35%, rgba(91, 143, 247, 0.18) 65%, rgba(255, 255, 255, 0.25) 100%);
  --glass-glare: rgba(255, 255, 255, 0.1);
  --amb-1: rgba(30, 60, 130, 0.35);
  --amb-2: rgba(25, 50, 110, 0.3);
  --amb-3: rgba(60, 90, 160, 0.1);
  --amb-4: rgba(70, 100, 170, 0.14);
  --amb-5: rgba(30, 60, 130, 0.2);
  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: rgba(11, 85, 235, 0.2); }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------- Fond d'ambiance (derrière le verre, hors accueil) ---------- */
.ambient {
  position: fixed; inset: 0; z-index: -2;
  background: var(--bg);
  transition: background-color 0.5s var(--ease);
  overflow: hidden;
  pointer-events: none;
}
/* Halos de lumière qui dérivent lentement */
.ambient span {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
  /* décalage supplémentaire lié au défilement (piloté par le JS via --p, de 0 à 1) */
  translate: calc(var(--p, 0) * var(--sx, 0vw)) calc(var(--p, 0) * var(--sy, 0vh));
  transition: translate 0.6s linear;
}
.ambient span:nth-child(1) { width: 52vw; height: 52vw; left: -14vw; top: -6vh;  background: var(--amb-1); animation: float-a 17s ease-in-out infinite alternate; --sx: 20vw; --sy: 45vh; }
.ambient span:nth-child(2) { width: 42vw; height: 42vw; right: -12vw; top: 30vh;  background: var(--amb-2); animation: float-b 20s ease-in-out infinite alternate; --sx: -24vw; --sy: -32vh; }
.ambient span:nth-child(3) { width: 38vw; height: 38vw; left: 28vw; bottom: -18vw; background: var(--amb-3); animation: float-c 23s ease-in-out infinite alternate; --sx: -14vw; --sy: -38vh; }
.ambient span:nth-child(4) { width: 26vw; height: 26vw; left: 45vw; top: 8vh;  background: var(--amb-4); animation: float-d 15s ease-in-out infinite alternate; --sx: 16vw; --sy: 52vh; }
.ambient span:nth-child(5) { width: 22vw; height: 22vw; left: 8vw; bottom: 4vh;  background: var(--amb-5); animation: float-e 19s ease-in-out infinite alternate; --sx: 26vw; --sy: -24vh; }

@keyframes float-a { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(26vw, 22vh, 0) scale(1.2); } 100% { transform: translate3d(10vw, 42vh, 0) scale(0.92); } }
@keyframes float-b { 0% { transform: translate3d(0, 0, 0) scale(1.05); } 50% { transform: translate3d(-28vw, -12vh, 0) scale(0.9); } 100% { transform: translate3d(-12vw, 28vh, 0) scale(1.15); } }
@keyframes float-c { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-22vw, -32vh, 0) scale(1.2); } 100% { transform: translate3d(18vw, -18vh, 0) scale(1); } }
@keyframes float-d { 0% { transform: translate3d(0, 0, 0) scale(0.95); } 50% { transform: translate3d(-18vw, 30vh, 0) scale(1.18); } 100% { transform: translate3d(20vw, 48vh, 0) scale(1); } }
@keyframes float-e { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(32vw, -20vh, 0) scale(1.2); } 100% { transform: translate3d(46vw, 6vh, 0) scale(0.92); } }



/* ---------- Liquid Glass ---------- */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
/* Arête lumineuse du verre */
.glass::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
/* Reflet qui suit la souris */
.glass::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), var(--glass-glare), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.glass:hover::after { opacity: 1; }

/* Variante sombre : verre posé sur la vidéo de l'accueil */
.glass--dark {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 18px 50px -18px rgba(0, 0, 0, 0.5);
}
.glass--dark::before {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.4));
}
.glass--dark::after { background: radial-gradient(420px circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.18), transparent 45%); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(255, 255, 255, 0.94); }
  .glass--dark { background: rgba(10, 22, 51, 0.7); }
}

/* ---------- Typo utilitaires ---------- */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.gradient-text {
  background: linear-gradient(90deg, #0743bd 0%, #1d5fe6 50%, #0743bd 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 8s linear infinite;
}
html[data-theme="dark"] .gradient-text { background-image: linear-gradient(90deg, var(--accent) 0%, #a9c4fa 50%, var(--accent) 100%); }
@keyframes shine { to { background-position: 200% center; } }
.muted { color: var(--ink-3); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.4s var(--ease), background 0.3s, box-shadow 0.3s;
}
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 30px -8px rgba(11, 85, 235, 0.6);
}
.btn--primary:hover { background: var(--blue-dark); }
.btn--glass { color: inherit; }
.btn--small { height: 36px; padding: 0 16px; font-size: 0.85rem; }
.btn--block { width: 100%; margin-top: 6px; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 14px; left: 0; right: 0;
  z-index: 100;
  display: flex; justify-content: center;
  padding: 0 14px;
  transition: transform 0.5s var(--ease);
}
.nav.is-hidden { transform: translateY(-120%); }
.nav__bar {
  display: flex; align-items: center; gap: 24px;
  width: min(900px, 100%);
  height: 56px;
  padding: 0 10px 0 22px;
  border-radius: 999px;
}
.nav__bar.glass { background: var(--nav-bg); }
.nav__logo { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.03em; color: var(--ink); }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 2px; margin-left: auto; }
.nav__links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink-2);
  transition: color 0.3s, background 0.3s;
}
.nav__links a:hover { color: var(--accent); }
.nav__links a.is-active { color: var(--accent); background: var(--blue-tint); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--blue-tint);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
}
.lang-switch span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: background 0.35s var(--ease), color 0.35s;
}
html[lang="fr"] .lang-switch [data-l="fr"],
html[lang="en"] .lang-switch [data-l="en"] { background: var(--blue); color: var(--white); }

.theme-switch {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-tint);
  color: var(--accent);
  transition: transform 0.4s var(--ease), background 0.3s;
}
.theme-switch:hover { transform: rotate(-15deg) scale(1.06); }
.theme-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch .i-sun { display: none; }
html[data-theme="dark"] .theme-switch .i-sun { display: block; }
html[data-theme="dark"] .theme-switch .i-moon { display: none; }

.nav__burger { display: none; width: 40px; height: 40px; position: relative; }
.nav__burger span {
  position: absolute; left: 11px; right: 11px; height: 1.5px;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav__burger span:first-child { top: 16px; }
.nav__burger span:last-child { top: 23px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 19.5px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 19.5px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; top: 80px; left: 14px; right: 14px;
  z-index: 99;
  display: flex; flex-direction: column;
  padding: 12px;
  border-radius: var(--radius-lg);
  opacity: 0; transform: translateY(-10px) scale(0.98);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s;
}
.mobile-menu.glass { background: var(--nav-bg); }
.mobile-menu.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.mobile-menu a { padding: 14px 16px; font-size: 1.1rem; font-weight: 500; border-radius: 14px; color: var(--ink); }
.mobile-menu a:hover { background: var(--blue-tint); color: var(--accent); }

/* ---------- Accueil (vidéo) ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 120px 20px 120px;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; background: #0a1633; }
.hero__media { position: absolute; inset: -4% 0; display: block; }
.hero__img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  /* photo floutée + lent mouvement de caméra (zoom et léger déplacement) */
  filter: blur(7px) saturate(1.1);
  transform-origin: 55% 50%;
  animation: drift-zoom 24s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift-zoom {
  0%   { transform: scale(1.1) translate3d(-1.5%, 1%, 0); }
  50%  { transform: scale(1.17) translate3d(0.5%, -0.5%, 0); }
  100% { transform: scale(1.24) translate3d(2%, -1.5%, 0); }
}

/* Voile bleu nuit pour la lisibilité */
.hero__veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 22, 51, 0.5) 0%, rgba(10, 22, 51, 0.3) 40%, rgba(10, 22, 51, 0.35) 75%, rgba(10, 22, 51, 0.1) 100%),
    radial-gradient(110% 80% at 50% 45%, transparent 30%, rgba(10, 22, 51, 0.35) 100%);
}
.hero__content { max-width: 900px; }
.hero .eyebrow { color: #ffffff; }
.hero__title {
  font-size: clamp(2.3rem, 10.5vw, 8.5rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin-bottom: 28px;
}
.hero__title .gradient-text {
  background-image: linear-gradient(90deg, var(--white) 0%, var(--blue-pale) 30%, #a9c4fa 60%, var(--white) 100%);
}
.hero__subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.9);
  max-width: 660px;
  margin: 0 auto 40px;
  line-height: 1.45;
}
.hero .eyebrow, .hero__title, .hero__subtitle { text-shadow: 0 2px 24px rgba(10, 22, 51, 0.4); }
.hero .gradient-text { text-shadow: none; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero__card {
  display: flex; align-items: center; gap: 14px;
  margin-top: 60px;
  padding: 12px 18px 12px 12px;
  border-radius: 999px;
  text-align: left;
}
.hero__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  color: var(--white);
  font-weight: 700; font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.hero__card-name { font-weight: 600; font-size: 0.95rem; }
.hero__card-role { font-size: 0.8rem; color: rgba(255, 255, 255, 0.75); }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%;
  width: 26px; height: 42px;
  margin-left: -13px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 20px;
}
.scroll-hint span {
  position: absolute; top: 8px; left: 50%;
  width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px;
  background: var(--white);
  animation: scroll 2s var(--ease) infinite;
}
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 13vw, 150px) 0; }
.section__title {
  font-size: clamp(2.3rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: clamp(40px, 6vw, 72px);
  color: var(--ink);
}

/* ---------- À propos ---------- */
.about { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.6fr); gap: 20px; align-items: stretch; }
.about--no-photo { grid-template-columns: 1fr; }
.about__photo {
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 360px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.45), transparent 55%),
    linear-gradient(150deg, var(--blue-light), var(--blue) 70%);
}
.about__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.about__photo img ~ .about__initials { display: none; }
.about__initials { font-size: clamp(4rem, 9vw, 7rem); font-weight: 800; letter-spacing: -0.06em; color: rgba(255, 255, 255, 0.95); }
.about__text {
  padding: clamp(28px, 4vw, 44px);
  border-radius: var(--radius-xl);
  font-size: 1.05rem;
  color: var(--ink-2);
}
.about__text p + p { margin-top: 18px; }
.about__text strong { color: var(--ink); font-weight: 600; }
.about__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-line);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.about + .stats { margin-top: 20px; }
.stat {
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  display: flex; flex-wrap: wrap; align-content: flex-end; align-items: baseline;
  min-height: 170px;
}
.stat__num { font-size: clamp(2.6rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--accent); }
.stat__plus { font-size: 1.1rem; font-weight: 600; margin-left: 6px; color: var(--accent); }
.stat p { width: 100%; margin-top: 8px; font-size: 0.9rem; color: var(--ink-2); }

/* ---------- Compétences ---------- */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.bento__item {
  padding: 32px;
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column;
  min-height: 260px;
}
.bento__item h3 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; margin: 22px 0 8px; color: var(--ink); }
.bento__item p { color: var(--ink-2); font-size: 1rem; max-width: 460px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 24px; }
.tags span {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--blue-line);
  color: var(--ink-2);
}
.icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--blue-light), var(--blue) 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 24px -8px rgba(11, 85, 235, 0.7);
}
.icon svg { width: 26px; height: 26px; fill: none; stroke: var(--white); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Parcours ---------- */
.segmented {
  position: relative;
  display: inline-grid; grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-radius: 999px;
  margin-bottom: 56px;
}
.segmented button {
  position: relative; z-index: 3;
  padding: 10px 26px;
  font-size: 0.95rem; font-weight: 500;
  color: var(--ink-2);
  border-radius: 999px;
  transition: color 0.3s;
}
.segmented button.is-active { color: var(--white); }
.segmented__pill {
  position: absolute; z-index: 2;
  top: 5px; bottom: 5px; left: 5px;
  width: calc(50% - 5px);
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 6px 18px -6px rgba(11, 85, 235, 0.7);
  transition: transform 0.5s var(--ease);
}
.segmented[data-active="school"] .segmented__pill { transform: translateX(100%); }

.timeline { position: relative; display: none; padding-left: 36px; }
.timeline.is-active { display: block; animation: fadeUp 0.6s var(--ease); }
.timeline::before {
  content: "";
  position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), rgba(11, 85, 235, 0.15));
  border-radius: 2px;
}
.timeline__item { position: relative; }
.timeline__item + .timeline__item { margin-top: 20px; }
.timeline__dot {
  position: absolute; left: -36px; top: 30px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(11, 85, 235, 0.12);
}
.timeline__card { padding: 28px 32px; border-radius: var(--radius-lg); }
.timeline__date {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--accent);
  font-size: 0.8rem; font-weight: 600;
  margin-bottom: 14px;
}
.timeline__card h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.timeline__place { color: var(--ink-3); font-size: 0.92rem; margin: 4px 0 12px; }
.timeline__card ul { display: grid; gap: 6px; }
.timeline__card li { position: relative; padding-left: 18px; color: var(--ink-2); }
.timeline__card li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Contact ---------- */
.contact {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center;
  padding: clamp(32px, 6vw, 72px);
  border-radius: 40px;
}
.contact__title {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 24px;
  color: var(--ink);
}
.contact__text { color: var(--ink-2); font-size: 1.1rem; max-width: 460px; margin-bottom: 32px; }
.contact__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.social {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent);
  transition: transform 0.4s var(--ease);
}
.social:hover { transform: translateY(-3px) scale(1.06); }
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* Liens de contact : e-mail et LinkedIn */
.contact__intro .contact__text:last-child { margin-bottom: 0; }
.contact__links { display: grid; gap: 14px; }
.contact-link {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px 18px 18px;
  border-radius: var(--radius-lg);
  color: var(--ink);
  transition: transform 0.4s var(--ease);
}
.contact-link:hover { transform: translateY(-3px); }
.contact-link .icon { flex: none; }
.contact-link .icon svg.is-solid { width: 22px; height: 22px; fill: var(--white); stroke: none; }
.contact-link__body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.contact-link__label { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.contact-link__value { font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.contact-link__arrow {
  flex: none; width: 20px; height: 20px;
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.4s var(--ease);
}
.contact-link:hover .contact-link__arrow { transform: translate(2px, -2px); }
.contact-link:focus-visible { border-radius: var(--radius-lg); }
.nowrap { white-space: nowrap; }
/* Petits écrans : l'adresse e-mail doit tenir sur une seule ligne */
@media (max-width: 480px) {
  .contact { padding: 28px 20px; }
  .contact-link { gap: 10px; padding: 12px 14px 12px 12px; }
  .contact-link .icon { width: 40px; height: 40px; border-radius: 13px; }
  .contact-link .icon svg { width: 20px; height: 20px; }
  .contact-link .icon svg.is-solid { width: 17px; height: 17px; }
  .contact-link__value { font-size: clamp(0.78rem, 3.9vw, 0.98rem); }
  .contact-link__arrow { display: none; }
}

/* ---------- Footer ---------- */
.footer { padding: 32px 0 44px; border-top: 1px solid var(--blue-line); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-3); }
.footer a:hover { color: var(--accent); }

/* ---------- Réalisations ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.project--wide { grid-column: 1 / -1; }
.project--wide .project__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.project {
  display: flex; flex-direction: column;
  padding: 30px;
  border-radius: var(--radius-xl);
}
.project__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.project__top .icon { width: 46px; height: 46px; border-radius: 14px; }
.project__top .icon svg { width: 22px; height: 22px; }
.project__meta {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--accent);
  font-size: 0.78rem; font-weight: 600;
  white-space: nowrap;
}
.project__meta--live { display: inline-flex; align-items: center; gap: 7px; }
.project__meta--live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(11, 85, 235, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(11, 85, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 85, 235, 0); }
}
.project h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; color: var(--ink); }
.project__org { font-size: 0.9rem; color: var(--ink-3); margin: 6px 0 14px; }
.project__context { color: var(--ink-2); margin-bottom: 14px; }
.project__list { display: grid; gap: 6px; }
.project__list li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 0.95rem; }
.project__list li::before {
  content: ""; position: absolute; left: 2px; top: 0.6em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- Petits liens-boutons ---------- */
.link-btn {
  font: inherit; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--blue-line);
  padding: 0;
}
.link-btn:hover { text-decoration-color: currentColor; }
.contact__privacy { margin-top: 6px; padding: 0 4px; font-size: 0.82rem; line-height: 1.55; color: var(--ink-2); text-align: left; }
.contact__privacy a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }


@media (max-width: 900px) and (orientation: portrait) {
  .hero__veil {
    background:
      linear-gradient(to bottom, rgba(10, 22, 51, 0.72) 0%, rgba(10, 22, 51, 0.52) 40%, rgba(10, 22, 51, 0.45) 75%, rgba(10, 22, 51, 0.2) 100%),
      radial-gradient(110% 80% at 50% 45%, transparent 30%, rgba(10, 22, 51, 0.35) 100%);
  }
}

/* ---------- Accessibilité ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
/* Lien « Aller au contenu » : invisible jusqu'à ce qu'on arrive dessus au clavier */
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--blue); color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: none; }
/* Contour bien visible pour la navigation au clavier */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.btn:focus-visible, .social:focus-visible, .lang-switch:focus-visible, .theme-switch:focus-visible { border-radius: 999px; }
.hero :focus-visible { outline-color: #fff; }
main:focus { outline: none; }
.timeline[role="tabpanel"]:focus-visible { outline-offset: 8px; border-radius: 16px; }

/* Animations mises en pause par le visiteur (bouton du pied de page) */
.no-motion *, .no-motion *::before, .no-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.no-motion { scroll-behavior: auto; }
.js.no-motion .reveal { opacity: 1; transform: none; filter: none; }

/* ---------- Pied de page : liens légaux ---------- */
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.footer__links a, .footer__links .link-btn { color: var(--ink-2); text-decoration: none; }
.footer__links a:hover, .footer__links .link-btn:hover { color: var(--accent); text-decoration: underline; }
.motion-toggle { font-size: inherit; cursor: pointer; }
.motion-toggle[aria-pressed="true"] .motion-toggle__off,
.motion-toggle[aria-pressed="false"] .motion-toggle__on { display: none; }

/* ---------- Pages légales ---------- */
.nav--static .nav__bar { gap: 14px; }
.nav--static .lang-switch { margin-left: 0; }
.nav__back {
  margin-left: auto; margin-right: 4px;
  font-size: 0.9rem; font-weight: 500;
  color: var(--ink-2);
  padding: 8px 12px; border-radius: 999px;
}
.nav__back:hover { color: var(--accent); background: var(--blue-tint); }
.legal-page {
  width: min(820px, 100% - 32px);
  margin: 0 auto;
  padding: 120px 0 80px;
}
.legal-card {
  padding: clamp(28px, 5vw, 56px);
  border-radius: 32px;
  color: var(--ink);
}
.legal-card h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.legal-updated { margin: 10px 0 8px; font-size: 0.9rem; color: var(--ink-3); }
.legal-card h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 36px 0 10px;
  color: var(--ink);
}
.legal-card p, .legal-card li, .legal-card td { color: var(--ink-2); font-size: 1rem; line-height: 1.65; }
.legal-card p + p { margin-top: 10px; }
.legal-card ul { list-style: disc; padding-left: 1.3em; display: grid; gap: 6px; }
.legal-card strong { color: var(--ink); }
.legal-card a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  padding: 2px 6px; border-radius: 6px;
  background: var(--blue-tint); color: var(--ink);
}
.legal-summary {
  margin-top: 24px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-line);
}
.legal-summary .legal-summary__title { margin: 0 0 8px; font-size: 1rem; }
.table-wrap { overflow-x: auto; margin: 8px 0 12px; border-radius: 14px; border: 1px solid var(--blue-line); }
.legal-card table { width: 100%; border-collapse: collapse; min-width: 480px; }
.legal-card th, .legal-card td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--blue-line); }
.legal-card tr:last-child th, .legal-card tr:last-child td { border-bottom: 0; }
.legal-card th { color: var(--ink); font-weight: 600; font-size: 0.95rem; background: var(--blue-tint); white-space: nowrap; }
.legal-card td[rowspan] { border-left: 1px solid var(--blue-line); }
@media (max-width: 640px) {
  .nav__back { font-size: 0.85rem; padding: 8px; }
  .legal-page { padding-top: 100px; }
}

/* ---------- Bilingue FR / EN ---------- */
html[lang="fr"] [lang="en"],
html[lang="en"] [lang="fr"] { display: none !important; }

/* ---------- Animations d'apparition ---------- */
/* Masqué au départ uniquement si le JavaScript tourne (classe « js » posée dans le <head>) */
.js .reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.985);
  filter: blur(6px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* Effet 3D léger au survol */
[data-tilt].is-visible,
.reveal.is-visible [data-tilt],
:not(.reveal) > [data-tilt]:not(.reveal) {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
[data-tilt].is-settled { transition: transform 0.6s var(--ease); }
[data-tilt].is-settled.is-tilting { transition: transform 0.12s linear; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { min-height: 280px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .project--wide .project__cols { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav__cta { display: none; }
}
@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__burger { display: block; margin-left: 4px; }
  .lang-switch { margin-left: auto; }
  .nav__bar { padding: 0 8px 0 22px; gap: 10px; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .bento__item { min-height: 0; padding: 26px; }
  .hero__card { flex-wrap: wrap; border-radius: var(--radius-lg); justify-content: center; text-align: center; }
  .timeline { padding-left: 28px; }
  .timeline__dot { left: -28px; }
  .timeline__card { padding: 24px; }
  .btn { height: 48px; padding: 0 22px; }
}

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
  .hero__img { animation: none; }
}
