/* ============================================================
   THOMAS GRAGNIC — CSS  ✦ Dark Joy
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Dark palette ── */
  --bg:          #120B22;
  --bg-edge:     #06030D; /* darker plum for the background vignette edges */
  --surface:     rgba(255, 255, 255, 0.055);
  --surface-2:   rgba(255, 255, 255, 0.09);
  --border:      rgba(255, 255, 255, 0.10);
  --text:        #f0f0f0;
  --text-muted:  rgba(255, 255, 255, 0.32);
  --text-dim:    rgba(255, 255, 255, 0.60);

  /* ── Accents ── */
  --accent:      #FF4A1C;
  --accent-2:    #FFBE0B;
  --accent-3:    #06D6A0;
  --accent-glow: rgba(255, 74, 28, 0.18);
  --logo-accent: #e63c2f; /* = COLOR_2 du logo hero ("Gragnic") */

  /* ── Section glass overlay ── */
  --section-bg-rgb: 12, 7, 28;  /* opacité appliquée par section via --sec-a (JS) : 0.80 → 1 */
  --section-blur: blur(28px);

  /* ── Halo parallax offsets — updated by JS on scroll ── */
  --halo1-y: 0px;
  --halo2-y: 0px;

  --font-sans:    'Space Grotesk', sans-serif;
  --font-display: 'Syne', sans-serif;

  --nav-h:  64px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --max-w:  1280px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Filet de sécurité contre le scroll horizontal (mobile). « clip » et non « hidden » :
     hidden créerait un conteneur de défilement et casserait les sections en position:sticky */
  overflow-x: clip;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Sélection de texte : fond orange, texte blanc */
::selection {
  background: var(--accent);
  color: #fff;
}

/* ── Fixed background vignette: current plum at the centre, darker towards the edges ── */
body:not(.halos-on)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 75% 75% at 50% 50%,
    var(--bg) 0%,
    var(--bg) 25%,
    var(--bg-edge) 100%
  );
}

/* ── BACKUP — glowing halo arcs (top-left orange, bottom-right blue), currently OFF.
   To re-enable: add class="halos-on" on <body>. ── */
body.halos-on::before {
  content: '';
  position: fixed;
  /* Very large circle (R = 3·a) whose arc still meets the screen edges
     at --halo-a from the corner → only a gentle sliver of curve is visible */
  --halo-a: clamp(320px, 37.5vmin, 550px);
  top: calc(var(--halo-a) * -4.562); left: calc(var(--halo-a) * -4.562);
  width: calc(var(--halo-a) * 6); height: calc(var(--halo-a) * 6);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  transform: translateY(var(--halo1-y));
  will-change: transform;
  border: 2px solid rgba(255, 150, 90, 0.8);
  box-shadow:
    0 0 20px 3px rgba(255, 130, 60, 0.8),
    0 0 200px 70px rgba(255, 106, 28, 0.38),
    0 0 380px 140px rgba(255, 106, 28, 0.18),
    inset 0 0 180px 45px rgba(255, 106, 28, 0.18);
}

body.halos-on::after {
  content: '';
  position: fixed;
  --halo-a: clamp(320px, 37.5vmin, 550px);
  bottom: calc(var(--halo-a) * -4.562); right: calc(var(--halo-a) * -4.562);
  width: calc(var(--halo-a) * 6); height: calc(var(--halo-a) * 6);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  transform: translateY(var(--halo2-y));
  will-change: transform;
  border: 2px solid rgba(70, 150, 220, 0.75);
  box-shadow:
    0 0 20px 3px rgba(50, 140, 220, 0.75),
    0 0 200px 70px rgba(30, 110, 200, 0.34),
    0 0 380px 140px rgba(30, 110, 200, 0.16),
    inset 0 0 180px 45px rgba(30, 110, 200, 0.16);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }


/* ============================================================
   NAVIGATION
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 100;
  transition: background 0.3s var(--ease), backdrop-filter 0.3s, box-shadow 0.3s;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--accent); }

/* Groupe de droite : liens + bouton FR/EN + burger (mobile) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

/* ── Bouton de langue : l'autre langue dans un rond (même contour que les flèches du modal) ──
   Survol : le rond se remplit de blanc, le texte passe en orange */
.lang-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-indent: 0.06em;   /* compense l'espacement après la dernière lettre → texte bien centré */
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.lang-toggle:hover {
  background: #fff;
  border-color: #fff;
  color: var(--accent);
}
.lang-toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.nav-link {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  position: relative;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
/* Croix : chaque trait rejoint le milieu (écart entre les traits = 5px + 1.5px → moitié = 3.25px) */
.nav-burger.open span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-burger.open span:last-child  { transform: translateY(-3.25px) rotate(-45deg); }

/* Scrolled nav: dark frosted glass */
#nav.scrolled {
  background: rgba(12, 7, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);   /* bleu du site, uni (sans transparence) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  z-index: 99;
  transform: translateX(100%);
  /* Fermé : masqué (visibility) une fois sorti de l'écran → n'élargit pas la page
     et ses liens ne sont plus atteignables au clavier */
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0s 0.4s;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.4s var(--ease), visibility 0s;
}

.mobile-link {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 800;
  color: #fff;
  transition: color 0.2s;
}
.mobile-link:hover,
.mobile-link:focus-visible { color: var(--accent); }

/* Menu ouvert : la barre du haut prend le même fond uni que le menu (pas de bande givrée) */
#nav.menu-open {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
  box-shadow: none;
}


/* ============================================================
   SECTION UTILITIES
   ============================================================ */
section {
  position: sticky;
  top: 0;
  min-height: 100vh;
  overflow: visible;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-header {
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.section-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  /* Progressif : ~36px à 1280px, ~50px en Full HD (1920px), 64px max à partir de 2560px (2K) */
  font-size: clamp(2rem, 0.5rem + 2.1875vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
}


/* ============================================================
   HERO  — transparent: révèle directement le fond sombre + orbes
   ============================================================ */
#hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--nav-h) var(--gutter) 4rem;
  overflow: visible;
  background: transparent;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  margin-bottom: 2rem;
}

/* Header rules on each side, same color as the text */
.hero-eyebrow::before,
.hero-eyebrow::after {
  content: '';
  flex: 0 0 75px;
  height: 1px;
  background: currentColor;
}

/* Wrapper — gives layout height, canvas overflows it freely */
.logo-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
}

/* Canvas is larger than wrapper to give scatter space */
#logoCanvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 2;
}

#logoCanvas.ready {
  opacity: 1;
}

.hero-sub {
  margin-top: 4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Phones: too long for one line at this size — let it wrap */
@media (max-width: 640px) {
  .hero-sub { white-space: normal; }
  /* Le surtitre peut passer sur 2 lignes : en une seule, il dépassait de l'écran (scroll horizontal) */
  .hero-eyebrow { font-size: 0.7rem; letter-spacing: 0.12em; gap: 0.75rem; white-space: normal; text-align: center; }
  .hero-eyebrow::before, .hero-eyebrow::after { flex-basis: 24px; flex-shrink: 0; }
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
  cursor: pointer;
  padding: 0.75rem 2rem 1.25rem;
}

.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}

.hero-scroll:hover span {
  color: var(--accent);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
/* Hero recouvert (is-offscreen posé par SectionVis, script.js) : animation en pause */
#hero.is-offscreen .scroll-line { animation-play-state: paused; }

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50%       { transform: scaleY(0.6); opacity: 0.4; }
}


/* Séparateur — à top:0 pour qu'il soit la démarcation visuelle exacte entre sections */
#who::before, #what::before, #work::before, #when::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 0;
}


/* ============================================================
   WHO
   — fond sombre semi-transparent + blur sur ce qui est en dessous
   ============================================================ */
#who {
  background: rgba(var(--section-bg-rgb), var(--sec-a, 0.80));
  backdrop-filter: var(--section-blur);
  -webkit-backdrop-filter: var(--section-blur);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 3rem) 0 3rem;
}

/* Texte sur la moitié droite, sans cadre — la moitié gauche est laissée aux triangles */
/* Who : le conteneur s'étend sur toute la largeur de l'écran (pas de max-width) */
#who .section-inner {
  max-width: none;
  padding: 0;
}

/* Texte = moitié droite de l'écran, décalé vers la droite (15vw à gauche, 5vw à droite) */
.who-content {
  margin-left: 50%;
  width: 50%;
  padding-left: 15vw;
  padding-right: 5vw;
}

/* Bouton « Voir mon CV » : même style que le bouton Envoyer (.submit-btn) */
.cv-btn {
  display: inline-flex;
  margin-top: 2rem;
  cursor: pointer;
}

/* ── Modale CV (cv_modal.js) : plein écran, image scrollable ── */
.cv-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 3, 13, 0.92);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.cv-modal[hidden] { display: none; }
.cv-modal.is-open { opacity: 1; }

.cv-modal-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(44px + 2 * clamp(0.75rem, 1.5vw, 1.25rem)) var(--gutter) 3rem;
  /* CV centré verticalement s'il reste de la place ; s'il est plus haut que l'écran,
     les marges auto tombent à 0 → collé en haut, on scrolle pour voir la suite
     (contrairement à justify-content: center, qui couperait le haut) */
  display: flex;
  flex-direction: column;
}
.cv-modal-img {
  display: block;
  flex-shrink: 0;
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: auto;
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  transform: translateY(24px);
  transition: transform 0.5s var(--ease);
}
.cv-modal.is-open .cv-modal-img { transform: none; }

/* Barre d'actions en haut à droite : Télécharger + croix */
.cv-modal-bar {
  position: absolute;
  top: clamp(0.75rem, 1.5vw, 1.25rem);
  right: clamp(0.75rem, 1.5vw, 1.25rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cv-modal-bar .cv-download {
  width: auto;                      /* annule le width:100% mobile de .submit-btn */
  padding: 0.65rem 1.4rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cv-modal-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(6, 3, 13, 0.55);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.cv-modal-close:hover {
  background: var(--logo-accent);
  border-color: var(--logo-accent);
}
.cv-modal-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.cv-modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.who-bio {
  margin-top: 0;
  font-size: 1rem;
  line-height: 1.8;
  color: #fff;
}

.accent-word { color: var(--logo-accent); }

/* Texte invisible à l'écran mais lu par Google et les lecteurs d'écran (ex. le <h1>) */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.who-bio + .who-bio { margin-top: 1rem; }

/* Phrase d'accroche : un cran au-dessus du corps de texte */
.who-lead {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #fff;
}

/* Tablette / mobile : le texte reprend toute la largeur, les triangles passent dessous */
@media (max-width: 900px) {
  .who-content { margin-left: 0; width: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
}

/* Portrait (écran plus haut que large) : les deux carrés l'un au-dessus de l'autre —
   visage en haut (espace réservé = carré de la largeur d'écran, au plus 45 % de la hauteur),
   texte en bas, sur les éclats de fond (cf. WHO CANVAS dans script.js) */
@media (orientation: portrait) {
  #who {
    justify-content: flex-end;
    padding-top: calc(var(--nav-h) + min(100vw, 45vh));
    padding-top: calc(var(--nav-h) + min(100vw, 45svh));
    padding-bottom: 2.5rem;
  }
  .who-content { margin-left: 0; width: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
}

/* ============================================================
   WHAT — Physics overlay
   ============================================================ */

/* Canvas is absolutely positioned inside the section — no extra styles needed,
   all handled inline by JS. Just ensure the section is a positioning context. */
#what {
  isolation: isolate; /* create stacking context for the z-index:10 canvas */
}


/* ============================================================
   WHAT
   ============================================================ */
#what {
  background: rgba(var(--section-bg-rgb), var(--sec-a, 0.80));
  backdrop-filter: var(--section-blur);
  -webkit-backdrop-filter: var(--section-blur);
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 3rem) 0 3rem;
}

.section-tagline {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-dim);
}

/* ── Menu déroulant : 3 disciplines séparées par des lignes translucides ── */
.what-menu {
  max-width: 1125px;
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

.what-item + .what-item {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.what-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.1rem, 2.2vw, 1.75rem) 0;
  background: none;
  border: 0;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.what-name {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.05;
  transition: transform 0.4s var(--ease);
}

.what-trigger:hover .what-name,
.what-trigger[aria-expanded="true"] .what-name {
  transform: translateX(0.5rem);
}

/* Un panneau ouvert : les autres titres passent à 40 % pour mettre l'ouvert en avant */
.what-trigger { transition: opacity 0.35s ease; }
.what-menu:has(.is-open) .what-item:not(.is-open) .what-trigger { opacity: 0.4; }

.what-trigger:focus-visible {
  outline: 2px solid var(--logo-accent);
  outline-offset: 4px;
}

/* Flèche orange ↗ — pivote vers ↘ quand le panneau est ouvert */
.what-arrow {
  flex: none;
  width: clamp(1.5rem, 2.5vw, 2rem);
  height: auto;
  fill: none;
  stroke: var(--logo-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s var(--ease);
}

.what-trigger:hover .what-arrow { transform: translate(2px, -2px); }
.what-trigger[aria-expanded="true"] .what-arrow { transform: rotate(90deg); }

/* Panneau : hauteur animée via grid-template-rows (0fr → 1fr) */
.what-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}

.what-item.is-open .what-panel {
  grid-template-rows: 1fr;
}

.what-panel-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.what-item.is-open .what-panel-inner {
  opacity: 1;
  transition: opacity 0.4s ease 0.15s;
}

.what-desc {
  max-width: 75ch;
  font-size: 1rem;
  line-height: 1.75;
  color: #fff;
}

/* Compétences sur une ligne, séparées par des « / » */
.what-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.6rem;
  margin-top: 1rem;
  padding-bottom: clamp(1.25rem, 2.5vw, 2rem);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.what-skills span + span::before {
  content: '/';
  margin-right: 0.6rem;
  color: var(--logo-accent);
}

/* Contenu resserré au centre : laisse de la place sur les côtés pour que les pictos
   (what_physics.js) circulent autour. Grand écran : inchangé (1280px max) ;
   en dessous, 75 % de la largeur d'écran ; mobile : 88 % (le texte doit rester lisible). */
#what .section-inner {
  max-width: min(var(--max-w), 75vw);
}
@media (max-width: 640px) {
  #what .section-inner { max-width: 88vw; }
}

/* ============================================================
   WORK
   ============================================================ */
#work {
  position: relative;
  background: rgba(var(--section-bg-rgb), var(--sec-a, 0.80));
  backdrop-filter: var(--section-blur);
  -webkit-backdrop-filter: var(--section-blur);
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: calc(var(--nav-h) + 3rem) 0 5rem;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.25s;
}

.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.filter-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* Projects grid — 2 colonnes, rythme « 1 pleine largeur + 2 moitiés »
   (la classe .is-full est posée par script.js sur les projets visibles) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
}

.project-card.is-full {
  grid-column: 1 / -1;
}
.project-card.is-full .project-img-wrap {
  aspect-ratio: 21 / 9;
}

/* Carte sobre : pas de cadre ni de fond — juste l'image arrondie et le texte dessous */
.project-card {
  min-width: 0;   /* la carte peut rétrécir sous la largeur de son titre (coupé par « … ») */
  cursor: pointer;
  transition: transform 0.4s;
  position: relative;
  z-index: 1; /* base explicite pour que z-index:10 au hover l'emporte toujours */
}

.project-card.hidden {
  display: none;
}


.project-img-wrap {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-2);
}

.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 7, 28, 0.25);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.35s;
}

.project-type {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-meta {
  padding: 0.9rem 0.15rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.project-meta h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta span {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 0.75rem;
}

/* ── Modal projet (work_modal.js) ── */
.work-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.work-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 3, 13, 0.85);
  opacity: 0;
  transition: opacity 0.45s ease;
  cursor: pointer;
}
.work-modal.is-open .work-modal-backdrop { opacity: 1; }

.work-modal-panel {
  position: fixed;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.work-modal-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Vidéo de présentation : par-dessus l'image, en fondu une fois lancée */
.work-modal-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.work-modal-video.is-ready { opacity: 1; }

/* ── Mode « encadré » (classe is-boxed, cf. work_modal.js → updateFraming) ──
   Bannières, ou vidéos qu'on ne peut pas mettre en plein panneau sans rognage aberrant.
   Fond : image du projet floutée à 22 % sur le bleu du site.
   Vidéo : entière ; position et taille posées par work_modal.js (en % du panneau).
   Panneau horizontal → infos à gauche (colonne --info-col), vidéo à droite.
   Panneau vertical (is-portrait) → vidéo en haut, infos juste en dessous (--info-top). */
.work-modal-img {
  transition: filter 0.6s ease, opacity 0.6s ease, transform 0.6s ease;
}
.work-modal.is-boxed .work-modal-panel { background: var(--bg); }
.work-modal.is-boxed .work-modal-img {
  filter: blur(24px);
  opacity: 0.22;            /* image à 22 % sur le bleu du site (≈ voile bleu à 78 %) */
  transform: scale(1.12);   /* masque les bords transparents du flou */
}
.work-modal.is-boxed .work-modal-video {
  right: auto;
  bottom: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Infos centrées verticalement dans leur zone (vidéo encadrée).
   Deux cales flexibles au-dessus / au-dessous : texte centré tant qu'il tient ;
   s'il est trop long, les cales tombent à 0 → il part du haut et reste défilable
   (contrairement à justify-content: center, qui couperait le début). */
.work-modal.is-boxed .work-modal-info {
  display: flex;
  flex-direction: column;
  background: none;         /* plus rien à faire ressortir sur la vidéo */
}
.work-modal.is-boxed .work-modal-info::before,
.work-modal.is-boxed .work-modal-info::after {
  content: '';
  flex: 1 0 0;
}

/* Panneau horizontal : colonne d'infos à gauche, toute la hauteur (même largeur que dans work_modal.js) */
.work-modal.is-boxed:not(.is-portrait) .work-modal-info {
  top: 0;
  right: auto;
  width: min(620px, 40%);
}

/* Panneau vertical : infos dans l'espace restant sous la vidéo, défilables si longues */
.work-modal.is-boxed.is-portrait .work-modal-info {
  top: var(--info-top, 50%);
  bottom: 0;
  padding-top: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

/* Barre de progression vidéo : 3px (10px au survol), fond blanc 30 %, avancement orange.
   Cliquable / glissable pour se déplacer dans la vidéo (work_modal.js).
   left / width / top posés par work_modal.js : top = bas de la vidéo, et
   translateY(-100%) fait grandir la barre vers le haut, bas toujours collé. */
.work-modal-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 3px;
  z-index: 2;                 /* au-dessus du dégradé des infos */
  transform: translateY(-100%);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  touch-action: none;         /* le glissé sert à naviguer dans la vidéo */
  opacity: 0;
  pointer-events: none;       /* inactive tant que la vidéo n'est pas lancée */
  transition: opacity 0.6s ease, height 0.2s ease;
}
/* Zone de survol élargie (12px au-dessus du trait) : plus facile à viser */
.work-modal-progress::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15px;
}
.work-modal-progress span {
  position: relative;         /* au-dessus de la zone de survol */
  display: block;
  height: 100%;
  background: var(--logo-accent);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  pointer-events: none;
}
/* Visible et cliquable dès que la vidéo joue (même fondu que la vidéo) */
.work-modal-video.is-ready ~ .work-modal-progress {
  opacity: 1;
  pointer-events: auto;
}
.work-modal-progress:hover,
.work-modal-progress.is-seeking { height: 10px; }
/* Vidéo cadrée : coins arrondis → la barre suit l'arrondi du bas */
.work-modal.is-boxed .work-modal-progress,
.work-modal.is-boxed .work-modal-progress span { border-radius: 0 0 6px 6px; }

/* Fermeture : vidéo + barre s'effacent vite, l'image de fond redevient nette
   (même rendu que la carte vers laquelle le panneau se rétracte) */
.work-modal.is-closing .work-modal-video,
.work-modal.is-closing .work-modal-progress {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.work-modal.is-closing .work-modal-img {
  filter: none;
  opacity: 1;
  transform: none;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}
.work-modal.is-closing .work-modal-info {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* Titre + catégorie : apparaissent une fois le panneau ouvert */
.work-modal-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: linear-gradient(to top, rgba(6, 3, 13, 0.85), transparent);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.work-modal.is-open .work-modal-info {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease 0.35s, transform 0.45s var(--ease) 0.35s;
}

/* Infos projet (projects-data.js) : sous le titre, en bas du panneau */
.work-modal-info {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;            /* jamais de scroll horizontal */
  container-type: inline-size;   /* le titre s'adapte à la largeur du bloc (cqi) */
}
.work-modal-details:empty { display: none; }
.work-modal-details {
  max-width: 70ch;
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

/* Une rubrique par ligne : « Design : Akrolab » */
.work-modal-facts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.work-modal-fact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.4em;
  font-size: 0.95rem;
  line-height: 1.5;
}
.work-modal-fact dt {
  font-weight: 700;
  color: var(--logo-accent);
}
.work-modal-fact dt::after {
  content: "\00a0:";   /* espace insécable + deux-points (typo française) */
}
html:lang(en) .work-modal-fact dt::after {
  content: ":";        /* anglais : pas d'espace avant les deux-points */
}
.work-modal-fact dd {
  margin: 0;
  color: #fff;
}

/* Nom cliquable (client-link / design-link / dev-link / animation-link)
   Texte et soulignement toujours blancs. Le soulignement est un dégradé de fond
   (animable, contrairement à text-decoration). Au survol : il se rétracte vers
   la droite, puis repart de la gauche jusqu'à pleine largeur. */
.work-modal-fact-link {
  color: #fff;
  text-decoration: none;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: 0 100%;
}
.work-modal-fact-link:hover,
.work-modal-fact-link:focus-visible {
  animation: fact-underline 0.5s ease-in-out;
}
@keyframes fact-underline {
  0%     { background-size: 100% 1px; background-position: 100% 100%; } /* ancré à droite… */
  50%    { background-size: 0%   1px; background-position: 100% 100%; } /* …se rétracte vers la droite */
  50.01% { background-size: 0%   1px; background-position: 0    100%; } /* bascule à gauche (invisible) */
  100%   { background-size: 100% 1px; background-position: 0    100%; } /* repart de la gauche */
}
.work-modal-fact-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

.work-modal-text {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #fff;
}
.work-modal-text + .work-modal-text { margin-top: 0.75rem; }

/* Bouton orange « View Website » */
.work-modal-link {
  display: inline-flex;
  align-items: center;
  margin-top: 1.25rem;
  padding: 0.75rem 1.4rem;
  border-radius: 100px;
  background: var(--logo-accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.work-modal-link::after {
  content: '';
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.6rem;
  background: currentColor;
  /* la flèche ↗ du site, en masque */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.work-modal-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(230, 60, 47, 0.35);
}
.work-modal-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Fiches vidéo : infos + dégradé masqués après quelques secondes (work_modal.js) */
.work-modal.is-open.info-hidden .work-modal-info {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.work-modal-cat {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--logo-accent);
}

.work-modal-title {
  font-family: var(--font-display);
  /* Taille selon la largeur du bloc d'infos (pas de l'écran) : un mot long comme
     « International » tient toujours dans la colonne ; coupé en dernier recours */
  font-size: clamp(1.2rem, 7.5cqi, 2.8rem);
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Contenu du projet (glisse lors de la navigation ‹ ›) */
.work-modal-content {
  position: absolute;
  inset: 0;
}

/* Flèches précédent / suivant */
.work-modal-nav {
  position: fixed;
  z-index: 1;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  display: grid;
  place-items: center;
  /* même rond que la croix de fermeture */
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(6, 3, 13, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s, border-color 0.2s, transform 0.4s var(--ease);
}
/* À 30px du bord du panneau (--modal-gutter = marge réelle, posée par work_modal.js ;
   48px = largeur du bouton), sans jamais sortir de l'écran */
.work-modal-prev { left:  max(8px, calc(var(--modal-gutter, 10vw) - 30px - 48px)); }
.work-modal-next { right: max(8px, calc(var(--modal-gutter, 10vw) - 30px - 48px)); }

/* Mobile : panneau à 92vw, marges trop étroites → flèches sous le panneau, côte à côte
   (le panneau fait 85vh → 7.5vh libres en bas) */
@media (max-width: 699px) {
  .work-modal-nav {
    top: auto;
    margin-top: 0;
    bottom: max(0.5rem, calc(3.75vh - 24px));
  }
  .work-modal-prev { left:  calc(50% - 60px); }
  .work-modal-next { right: calc(50% - 60px); }
}
/* La flèche ↗ du menu What, pivotée : → (45°) et ← (−135°) */
.work-modal-next svg { transform: rotate(45deg); }
.work-modal-prev svg { transform: rotate(-135deg); }

.work-modal.is-open .work-modal-nav {
  opacity: 1;
  transition: opacity 0.35s ease 0.3s, background 0.2s, border-color 0.2s, transform 0.4s var(--ease);
}
.work-modal-nav:hover {
  background: var(--logo-accent);
  border-color: var(--logo-accent);
}
.work-modal-prev:hover { transform: translateX(-3px); }
.work-modal-next:hover { transform: translateX(3px); }
.work-modal-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.work-modal-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Un seul projet visible (filtre) : pas de flèches */
.work-modal.is-single .work-modal-nav { display: none; }

/* Bouton son (si "sound": true) — même rond que la croix, juste à sa gauche */
.work-modal-sound {
  position: absolute;
  top: clamp(0.75rem, 1.5vw, 1.25rem);
  right: calc(clamp(0.75rem, 1.5vw, 1.25rem) + 44px + 0.6rem);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(6, 3, 13, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s, border-color 0.2s;
}
.work-modal-sound[hidden] { display: none; }
.work-modal.is-open .work-modal-sound {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s ease 0.3s, transform 0.35s var(--ease) 0.3s, background 0.2s, border-color 0.2s;
}
.work-modal-sound:hover,
.work-modal-sound.is-on {
  background: var(--logo-accent);
  border-color: var(--logo-accent);
}
.work-modal-sound:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.work-modal-sound svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Coupé : haut-parleur barré | Activé : ondes sonores */
.work-modal-sound .wave { display: none; }
.work-modal-sound.is-on .wave { display: inline; }
.work-modal-sound.is-on .mute { display: none; }

/* Croix de fermeture */
.work-modal-close {
  position: absolute;
  top: clamp(0.75rem, 1.5vw, 1.25rem);
  right: clamp(0.75rem, 1.5vw, 1.25rem);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(6, 3, 13, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s, border-color 0.2s, color 0.2s;
}
.work-modal.is-open .work-modal-close {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s ease 0.3s, transform 0.35s var(--ease) 0.3s, background 0.2s, border-color 0.2s, color 0.2s;
}
.work-modal-close:hover {
  background: var(--logo-accent);
  border-color: var(--logo-accent);
}
.work-modal-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.work-modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.project-card:focus-visible { outline: none; }
.project-card:focus-visible .project-img-wrap {
  outline: 2px solid var(--logo-accent);
  outline-offset: 4px;
}

/* ============================================================
   CONTACT
   ============================================================ */
#when {
  background: rgba(var(--section-bg-rgb), var(--sec-a, 0.80));
  backdrop-filter: var(--section-blur);
  -webkit-backdrop-filter: var(--section-blur);
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 3rem) 0 3rem;
}

/* Canvas aquatique derrière le contenu contact */
#when .contact-inner {
  position: relative;
  z-index: 1;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 8vw, 7rem);
  align-items: start;
}

.contact-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 0.5rem + 2.1875vw, 4rem);   /* même progression que .section-title */
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
}

.contact-title em {
  font-style: normal;
  color: var(--accent);
}

.contact-sub {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 36ch;
}

.contact-email-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-email {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  font-weight: 500;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.contact-email:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  transition: all 0.2s;
}

.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.copy-btn.copied {
  color: var(--accent-3);
  border-color: var(--accent-3);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Champ vide ou email invalide (posé par script.js au moment de l'envoi) */
.form-group [aria-invalid="true"] {
  border-color: var(--logo-accent);
}

/* Message sous le bouton : erreur (orange) ou envoi réussi */
.form-status {
  font-size: 0.9rem;
  line-height: 1.5;
}
.form-status.is-error   { color: var(--logo-accent); }
.form-status.is-success { color: var(--text); }
.form-status.is-success::before { content: '✓\00a0'; color: var(--accent); font-weight: 700; }

.submit-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.submit-btn {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #FF6B45 100%);
  padding: 0.85rem 1.75rem;
  border-radius: 100px;
}

/* Flèche : posée sur un cercle blanc qui apparaît en scale au survol.
   Marges négatives : le cercle ne change pas la taille du bouton. */
.submit-arrow {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -6px -8px -6px -4px;
  transition: transform 0.3s var(--ease);   /* cercle + flèche bougent ensemble → cercle toujours centré */
}
.submit-arrow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.3s var(--ease);
}
.submit-arrow svg {
  position: relative;            /* au-dessus du cercle */
  transition: color 0.2s;
}
.submit-btn:hover .submit-arrow::before,
.submit-btn:focus-visible .submit-arrow::before {
  transform: scale(1);
}
.submit-btn:hover .submit-arrow,
.submit-btn:focus-visible .submit-arrow {
  transform: translateX(3px);
}
.submit-btn:hover .submit-arrow svg,
.submit-btn:focus-visible .submit-arrow svg {
  color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 10;
  background: rgba(12, 7, 28, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.75rem var(--gutter);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Liens Mentions légales / Confidentialité (ouvrent legal_modal.js) */
.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-link,
.form-privacy-link {
  font: inherit;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.footer-link:hover,
.footer-link:focus-visible,
.form-privacy-link:hover,
.form-privacy-link:focus-visible {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* Ligne sous le formulaire */
.form-privacy {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.form-privacy-link {
  text-decoration-color: currentColor;   /* lien souligné d'emblée (dans une phrase) */
}

/* ── Fenêtre Mentions légales / Confidentialité (base = .cv-modal) ──
   Vraie page plein écran : fond opaque (le site ne se voit plus dessous), pas de cadre.
   Texte en colonne de 1000px max (tient sans scroll en 2K). */
.legal-modal { background: var(--bg); }
.legal-content {
  flex-shrink: 0;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;               /* collé en haut, comme une page (pas centré verticalement) */
  padding-bottom: 2rem;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
}
.legal-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.legal-content h2 + h3 { margin-top: 1.25rem; }
.legal-content h2:not(:first-child) {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.legal-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--logo-accent);
}
.legal-content a {
  color: var(--text);
  text-underline-offset: 3px;
}
.legal-content a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── Tablet ── */
@media (max-width: 900px) {

  .contact-inner {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  :root {
    --nav-h: 56px;
  }

  /* Sections: scrollables et non coupées sur mobile */
  section {
    position: relative;
    min-height: 100svh;
  }

  /* Désactive le blur (perf + rendu mobile) */
  #who, #what, #when {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-links { display: none; }
  .nav-right { gap: 1.25rem; }
  /* Bouton de langue : caché sur mobile, il apparaît à côté de la croix quand le menu est ouvert */
  .lang-toggle {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    transition: background 0.2s, border-color 0.2s, color 0.2s,
                opacity 0.3s, transform 0.4s var(--ease), visibility 0s 0.3s;
  }
  #nav.menu-open .lang-toggle {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s,
                opacity 0.3s 0.1s, transform 0.4s var(--ease) 0.1s, visibility 0s;
  }
  .nav-burger { display: flex; }

  /* Mobile : une seule colonne, toutes les cartes au même format */
  .projects-grid {
    /* minmax(0, …) et non 1fr : sinon un titre long (texte sur une ligne, coupé par « … »)
       élargit la colonne au-delà de l'écran */
    grid-template-columns: minmax(0, 1fr);
  }
  .project-card.is-full .project-img-wrap {
    aspect-ratio: 3 / 2;
  }

  .filter-tabs {
    gap: 0.4rem;
  }

  .contact-email {
    font-size: 0.85rem;
    word-break: break-all;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  .footer-right {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ============================================================
   ANIMATIONS (on scroll)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
