/*
  Samuel Porchet | Portfolio
  Direction : brutalisme suisse, mode "télémétrie" sombre.
  - Grille visible (lignes de 1px), angles droits partout (aucun border-radius).
  - Trois polices : Archivo Black (titrage), JetBrains Mono (métadonnées), Inter (texte courant, charte Sirius).
  - Une seule teinte d'accent : le violet Sirius (#3D0FC5 en aplat, #BB93FB pour le texte sur fond sombre).
  - Un seul vert "terminal" : l'indicateur de disponibilité.
*/

/* ================================================================
   0. POLICES (hébergées sur le site, dans assets/fonts/)
   Aucune requête vers Google : l'adresse IP des visiteurs ne quitte pas le site.
   Licence : SIL Open Font License (usage libre, y compris commercial).
   Chaque police a deux fichiers : "latin" (le français courant) et "latin-ext"
   (caractères plus rares, comme le « ᵉ » de 3ᵉ). Le navigateur ne télécharge
   le second que si la page en a besoin (unicode-range).
   Inter et JetBrains Mono sont des polices variables : un seul fichier pour toutes les graisses.
   ================================================================ */
@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/archivo-black-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/archivo-black-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ================================================================
   1. VARIABLES
   ================================================================ */
:root {
  --bg: #0b0b0c;
  --bg-2: #111113;
  --bg-3: #18181b;
  --line: #2a2a2f;
  --line-strong: #45454d;
  --fg: #eaeaea;
  --fg-2: #b4b4ba;
  --muted: #8c8c93;

  --accent: #3d0fc5;        /* violet Sirius, pour les aplats */
  --accent-hi: #5427e0;     /* survol des aplats */
  --accent-ink: #bb93fb;    /* violet clair Sirius, pour le texte */
  --signal: #4af626;        /* vert terminal, usage unique : disponibilité */
  --danger: #ff5a4f;

  --font-display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 56px;
  --pad: clamp(16px, 2.4vw, 32px);
  --max: 1600px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* ================================================================
   2. BASE
   ================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
}

html {
  color-scheme: dark; /* barres de défilement, listes déroulantes et clavier en sombre */
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

/* Grain analogique global : pseudo-élément fixe, jamais sur un conteneur qui défile */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

/* Contrôles tactiles :
   - touch-action: manipulation supprime le délai de 300 ms (le navigateur n'attend plus un double-tap) ;
   - user-select: none empêche un appui long de sélectionner le texte d'un bouton, comme une vraie app.
   Le texte des paragraphes reste sélectionnable. */
a,
button,
[role="button"],
label,
select {
  touch-action: manipulation;
}

button,
[role="button"],
.btn,
.nav-links a,
.logo-mark,
.foot-links a,
.foot-top {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Retour visuel au moment où le doigt se pose (pas au relâchement) */
.filter-btn:active,
.nav-links a:active,
.foot-links a:active,
.foot-top:active,
.lightbox-close:active,
.reel-toggle:active,
.nav-toggle:active {
  background: var(--bg-3);
}

.gallery-card:active figcaption {
  background: var(--accent);
  color: #fff;
}

.lightbox-nav:not(:disabled):active {
  background: var(--accent);
  border-color: var(--accent);
}

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

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* L'attribut hidden doit gagner sur les display: flex/grid définis plus bas */
[hidden] {
  display: none !important;
}

/* Lien d'évitement : invisible, il apparaît au premier appui sur Tab pour sauter le menu */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 110;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateY(calc(-100% - 16px));
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

/* Retours à la ligne : titres équilibrés, pas de mot seul en fin de paragraphe */
h1,
h2,
h3,
.display,
.h-section {
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ================================================================
   3. TYPOGRAPHIE UTILITAIRE
   ================================================================ */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.88;
}

.h-section {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.9;
  font-size: clamp(2.6rem, 7vw, 6.5rem);
}

.lede {
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.55;
  color: var(--fg);
  max-width: 62ch;
}

.body-text p {
  color: var(--fg-2);
  max-width: 64ch;
}

.body-text p + p {
  margin-top: 1em;
}

.body-text strong {
  color: var(--fg);
  font-weight: 600;
}

/* ================================================================
   4. STRUCTURE : cadre et cellules
   ================================================================ */
.frame {
  max-width: var(--max);
  margin: 0 auto;
  /* Téléphone en paysage : le fond des sections va jusqu'au bord, le contenu évite l'encoche */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.cell {
  padding: var(--pad);
}

/* Ligne horizontale pleine largeur (animable : se "trace" à l'apparition) */
.rule {
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
}

.section {
  border-bottom: 1px solid var(--line);
}

/* ================================================================
   5. BOUTONS ET LIENS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 52px;
  padding: 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--fg);
  transition: background-color 160ms ease, color 160ms ease,
    border-color 160ms ease, transform 120ms var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn .arrow {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}

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

.btn-ghost {
  background: transparent;
  color: var(--fg);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--accent-hi);
    border-color: var(--accent-hi);
  }
  .btn-ghost:hover {
    background: var(--fg);
    color: var(--bg);
  }
  .btn:hover .arrow {
    transform: translateX(4px);
  }
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover {
    color: var(--fg);
  }
}

/* ================================================================
   6. EN-TÊTE
   ================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .frame {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  height: var(--header-h);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--pad);
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo-mark svg {
  width: 30px;
  height: 30px;
  color: var(--fg);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  grid-column: 3;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(14px, 1.6vw, 24px);
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-links a[aria-current="page"] {
  color: var(--fg);
  box-shadow: inset 0 -2px 0 var(--accent-ink);
}

.nav-links .nav-cv {
  background: var(--fg);
  color: var(--bg);
}

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover {
    background: var(--bg-3);
    color: var(--fg);
  }
  .nav-links .nav-cv:hover {
    background: var(--accent);
    color: #fff;
  }
}

.nav-toggle {
  display: none;
  grid-column: 3;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad);
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Icône du menu : les trois traits deviennent une croix quand le menu est ouvert.
   Transitions (et non keyframes) : un double appui rapide repart de la position actuelle. */
.nav-toggle .bar {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out);
}

.nav-toggle[aria-expanded="true"] .bar-1 {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar-2 {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar-3 {
  transform: translateY(-4px) rotate(-45deg);
}

/* Changement de page (accueil ↔ À propos) : le menu reste en place, le contenu passe en fondu.
   Navigateurs non compatibles : changement de page normal. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

.site-header {
  view-transition-name: site-header;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: var(--ease-out);
}

/* Barre de progression : dessinée par le défilement (CSS scroll-driven, sans JS) */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent-ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: scroll-progress linear both;
    animation-timeline: scroll(root);
  }
}

@keyframes scroll-progress {
  to {
    transform: scaleX(1);
  }
}

/* ================================================================
   7. HERO (accueil)
   ================================================================ */
.hero .frame {
  display: grid;
  grid-template-columns: minmax(240px, 22%) 1fr minmax(300px, 34%);
  grid-template-rows: auto 1fr;
  /* svh : hauteur stable quand la barre d'adresse se replie (pas de saut au scroll) */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
}

.hero-meta {
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.meta-list {
  display: grid;
}

.meta-list > div {
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line);
}

.meta-list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.meta-list dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  line-height: 1.4;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--signal);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot {
    /* 3 clignotements au chargement pour attirer l'œil, puis allumé en continu */
    animation: blink 1.6s steps(1, end) 3;
  }
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

.hero-name-cell {
  grid-column: 2 / span 2;
  border-bottom: 1px solid var(--line);
  padding: clamp(24px, 4vw, 56px) var(--pad) clamp(20px, 3vw, 40px);
  display: flex;
  align-items: flex-end;
}

.hero-name {
  font-size: clamp(3.4rem, 11.2vw, 12.5rem);
  overflow: hidden;
  padding-bottom: 0.04em;
}

.hero-name .line {
  display: block;
  overflow: hidden;
}

.hero-name .line > span {
  display: inline-block;
}

.hero-name .accent-block {
  display: inline-block;
  width: 0.55em;
  height: 0.7em;
  margin-left: 0.08em;
  background: var(--accent);
  vertical-align: baseline;
}

/* Intro du hero, au chargement.
   En CSS plutôt qu'en JavaScript : elle se joue pendant que les images et les polices se chargent,
   et le CSS reste fluide même quand le navigateur est occupé.
   Remplissage "backwards" : l'état de départ s'applique pendant le délai, puis l'animation
   s'efface complètement une fois finie (les :hover et :active des boutons restent libres). */
@media (prefers-reduced-motion: no-preference) {
  .hero .hero-name .line > span:not(.accent-block) {
    animation: hero-rise 900ms var(--ease-out) 50ms backwards;
  }
  .hero .hero-name .line:nth-child(2) > span:not(.accent-block) {
    animation-delay: 140ms;
  }
  .hero .hero-name .accent-block {
    transform-origin: 0 50%;
    animation: hero-block 500ms var(--ease-in-out) 600ms backwards;
  }
  .hero .reel-frame {
    animation: hero-wipe 1000ms var(--ease-in-out) 150ms backwards;
  }
  .hero .meta-list > div {
    animation: hero-meta 500ms var(--ease-out) 450ms backwards;
  }
  .hero .meta-list > div:nth-child(2) { animation-delay: 500ms; }
  .hero .meta-list > div:nth-child(3) { animation-delay: 550ms; }
  .hero .meta-list > div:nth-child(4) { animation-delay: 600ms; }
  .hero .hero-role,
  .hero .hero-copy .lede,
  .hero .hero-actions .btn {
    animation: hero-fade 600ms var(--ease-out) 550ms backwards;
  }
  .hero .hero-copy .lede { animation-delay: 610ms; }
  .hero .hero-actions .btn:nth-child(1) { animation-delay: 670ms; }
  .hero .hero-actions .btn:nth-child(2) { animation-delay: 730ms; }
}

@keyframes hero-rise {
  from { transform: translateY(105%); }
  to { transform: none; }
}

@keyframes hero-block {
  from { transform: scaleX(0); }
  to { transform: none; }
}

@keyframes hero-wipe {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes hero-meta {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}

@keyframes hero-fade {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: var(--pad);
  border-right: 1px solid var(--line);
}

.hero-role {
  display: grid;
  gap: 6px;
}

.hero-job {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent-ink);
}

.hero-spec {
  color: var(--fg-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Visionneuse de créations : coupes franches, pas de fondu */
.hero-reel {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: var(--bg-2);
}

.reel-frame {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.reel-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.reel-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--pad);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.reel-caption .reel-title {
  color: var(--fg);
}

.reel-caption .reel-series {
  color: var(--accent-ink);
  margin-left: auto;
}

.reel-toggle {
  margin: -12px calc(-1 * var(--pad)) -12px 0;
  padding: 0 var(--pad);
  min-width: 96px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: background-color 160ms ease, color 160ms ease;
}

.reel-toggle[aria-pressed="true"] {
  color: var(--accent-ink);
}

@media (hover: hover) and (pointer: fine) {
  .reel-toggle:hover {
    background: var(--bg-3);
    color: var(--fg);
  }
}

/* ================================================================
   8. À PROPOS (accueil)
   ================================================================ */
.about .frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.about-head {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about-lede {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 26ch;
}

.about-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.block-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Matrice de cases (compétences, domaines) : les bordures forment la grille */
.matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.matrix li {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.matrix.is-strong li {
  color: var(--fg);
  background: var(--bg-2);
}

/* Statistiques : grands chiffres */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.stat-row li {
  padding: 18px 16px 4px 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.stat-row li + li {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.stat-num {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums; /* chiffres à largeur fixe : pas de tremblement pendant le comptage */
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ================================================================
   9. PALETTE DE COULEURS (pages projet : Sirius, Novara)
   ================================================================ */
.palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.swatch {
  border-right: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.swatch-color {
  aspect-ratio: 16 / 10;
}

.swatch-label {
  display: block;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.25);
}

/* ================================================================
   9 bis. PROJETS (cartes de l'accueil + pages de détail projet-*.html)
   ================================================================ */
.projects-head {
  display: grid;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-card {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  color: inherit;
}

/* Grille de 2 colonnes : pas de trait au bord droit, et un trait entre les rangées.
   Les règles tiennent quel que soit le nombre de cartes. */
.project-card:nth-child(2n),
.project-card:last-child {
  border-right: 0;
}

.project-card:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.project-card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease-out);
}

.project-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: var(--pad);
  transition: background-color 160ms ease;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: var(--muted);
}

.project-card-meta span:first-child {
  color: var(--accent-ink);
}

.project-card-title {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}

.project-card-text {
  color: var(--fg-2);
  max-width: 52ch;
}

.project-card .link-arrow {
  margin-top: auto;
  align-self: flex-start;
}

.project-card:active .project-card-body {
  background: var(--bg-3);
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover .project-card-media img {
    transform: scale(1.03);
  }
  .project-card:hover .project-card-body {
    background: var(--bg-2);
  }
  .project-card:hover .link-arrow {
    color: var(--fg);
  }
}

/* --- Page de détail d'un projet --- */
.project-back {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  transition: background-color 160ms ease, color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .project-back:hover {
    background: var(--bg-3);
    color: var(--fg);
  }
}

.project-hero .frame {
  display: grid;
  grid-template-columns: 7fr 5fr;
}

.project-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 28px;
  border-right: 1px solid var(--line);
  padding-top: clamp(40px, 6vw, 88px);
}

.project-title {
  font-size: clamp(3.4rem, 11vw, 11rem);
}

.project-hero .info-list {
  align-self: end;
}

/* Grande image pleine largeur */
.project-figure {
  margin: 0;
  overflow: hidden;
  background: var(--bg-2);
}

.project-figure img {
  width: 100%;
  height: auto;
}

.project-figure figcaption,
.project-duo figcaption {
  padding: 12px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

/* Deux images côte à côte */
.project-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.project-duo figure {
  margin: 0;
  overflow: hidden;
  background: var(--bg-2);
}

.project-duo figure + figure {
  border-left: 1px solid var(--line);
}

.project-duo img {
  width: 100%;
  height: auto;
}

/* Bloc de texte : titre à gauche, texte à droite */
.project-text .frame {
  display: grid;
  grid-template-columns: 4fr 8fr;
}

.project-text h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.95;
  border-right: 1px solid var(--line);
}

.project-text .body-text {
  display: grid;
  gap: 16px;
}

.project-text .body-text p + p {
  margin-top: 0;
}

.project-text ul {
  display: grid;
  gap: 8px;
  max-width: 68ch;
}

.project-text ul li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-2);
}

.project-text ul li::before {
  content: "/";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--accent-ink);
}

/* Ordinateur : images des projets affichées plus petites et centrées dans un cadre sombre.
   Les fichiers sources ont une résolution limitée : agrandis sur toute la largeur de l'écran,
   ils paraissaient flous. Ici, ils ne dépassent jamais une taille où ils restent nets.
   Sur téléphone (moins de 861 px), rien ne change : l'écran est assez petit. */
@media (min-width: 861px) {
  .project-figure,
  .project-duo figure {
    display: grid;
    place-items: center;
    padding: clamp(32px, 4vw, 64px) var(--pad);
  }
  .project-figure img {
    width: auto;
    max-width: min(960px, 100%);
    max-height: 760px;
  }
  .project-duo img {
    width: auto;
    max-width: min(560px, 100%);
    max-height: 640px;
  }
  .project-figure figcaption,
  .project-duo figcaption {
    justify-self: stretch;
    margin: clamp(32px, 4vw, 64px) calc(-1 * var(--pad)) calc(-1 * clamp(32px, 4vw, 64px));
  }
}

/* Palette d'un projet : une seule rangée, autant de colonnes que de couleurs (3 pour Novara, 4 pour Sirius) */
.project-text .palette {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  max-width: 720px;
}

/* Texte encore à écrire : bien visible pour ne pas l'oublier avant la mise en ligne */
.placeholder {
  padding: 14px 16px;
  border: 1px dashed var(--accent-ink);
  color: var(--accent-ink) !important;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
}

/* Toutes les pages du document, en planche */
.project-pages {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid var(--line);
}

.project-pages.is-landscape {
  grid-template-columns: repeat(4, 1fr);
}

.project-pages figure {
  margin: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.project-pages.is-portrait figure:nth-child(6n),
.project-pages.is-landscape figure:nth-child(4n) {
  border-right: 0;
}

.project-pages img {
  width: 100%;
  height: auto;
}

.project-pages-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

/* Lien vers le projet suivant */
.project-next {
  display: grid;
  gap: 12px;
  padding: clamp(32px, 5vw, 64px) var(--pad);
  background: var(--accent);
  color: #fff;
  transition: background-color 160ms ease;
}

.project-next .mono {
  color: rgba(255, 255, 255, 0.78);
}

.project-next .display {
  font-size: clamp(2.6rem, 8vw, 7rem);
}

@media (hover: hover) and (pointer: fine) {
  .project-next:hover {
    background: var(--accent-hi);
  }
}

@media (max-width: 860px) {
  .projects-grid,
  .project-hero .frame,
  .project-text .frame {
    grid-template-columns: 1fr;
  }
  .project-card {
    border-right: 0;
  }
  .project-card + .project-card {
    border-top: 1px solid var(--line);
  }
  .project-hero-main,
  .project-text h2 {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .project-pages.is-portrait {
    grid-template-columns: repeat(3, 1fr);
  }
  .project-pages.is-landscape {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-pages.is-portrait figure:nth-child(6n),
  .project-pages.is-landscape figure:nth-child(4n) {
    border-right: 1px solid var(--line);
  }
  .project-pages.is-portrait figure:nth-child(3n),
  .project-pages.is-landscape figure:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 767px) {
  .project-duo {
    grid-template-columns: 1fr;
  }
  .project-duo figure + figure {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* ================================================================
   10. GALERIE
   ================================================================ */
.gallery-head {
  display: grid;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.gallery-head .body-text {
  max-width: 70ch;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.filter-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-2);
  line-height: 48px;
  transition: background-color 160ms ease, color 160ms ease;
}

.filter-btn .count {
  color: var(--muted);
  font-size: 11px;
}

.filter-btn.is-active {
  background: var(--fg);
  color: var(--bg);
}

.filter-btn.is-active .count {
  color: var(--bg);
  opacity: 0.6;
}

@media (hover: hover) and (pointer: fine) {
  .filter-btn:not(.is-active):hover {
    background: var(--bg-3);
    color: var(--fg);
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.gallery-card {
  margin: 0;
  position: relative;
  cursor: pointer;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  outline-offset: -2px;
}

.gallery-grid .gallery-card:nth-child(4n) {
  border-right: 0;
}

.gallery-card .thumb {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-2);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease-out); /* survolé souvent : doit suivre la souris */
}

.gallery-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease;
}

.gallery-card-title {
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card-series {
  color: var(--muted);
  flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-card:hover img {
    transform: scale(1.035);
  }
  .gallery-card:hover figcaption {
    background: var(--accent);
    color: #fff;
  }
  .gallery-card:hover .gallery-card-title,
  .gallery-card:hover .gallery-card-series {
    color: #fff;
  }
}

/* ================================================================
   11. CONTACT
   ================================================================ */
.contact .frame {
  display: grid;
  grid-template-columns: 5fr 7fr;
}

.contact-intro {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-intro h2 {
  font-size: clamp(2.4rem, 5.2vw, 5rem);
}

.contact-alt {
  margin-top: auto;
  display: grid;
  border-top: 1px solid var(--line);
}

.contact-alt a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
  transition: color 160ms ease;
  overflow-wrap: anywhere;
}

.contact-alt a .k {
  color: var(--muted);
  flex-shrink: 0;
}

.contact-alt a.email-link {
  text-transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .contact-alt a:hover {
    color: var(--accent-ink);
  }
}

.contact-form {
  display: grid;
  gap: 22px;
  align-content: start;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  font-size: 16px; /* 16px minimum : évite le zoom automatique sur iPhone */
  transition: border-color 160ms ease, background-color 160ms ease;
  appearance: none;
}

.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23eaeaea' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-field textarea {
  resize: vertical;
  min-height: 150px;
}

.form-field ::placeholder {
  color: #7a7a82;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-ink);
  background: var(--bg-3);
}

.form-field .is-invalid,
.form-field .is-invalid:focus {
  border-color: var(--danger);
}

.contact-form .btn {
  justify-self: start;
  min-width: 260px;
}

.form-status {
  min-height: 1.4em;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  /* Apparition en volet de gauche à droite (la classe is-shown est ajoutée par js/main.js) */
  clip-path: inset(0 100% 0 0);
  opacity: 0;
}

.form-status.is-shown {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transition: clip-path 300ms var(--ease-out), opacity 300ms var(--ease-out);
}

/* Bouton pendant l'envoi : barre de chargement qui balaie le bas du bouton */
.contact-form .btn {
  position: relative;
  overflow: hidden;
}

.btn.is-sending::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #fff;
  animation: sending 900ms linear infinite;
}

@keyframes sending {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.form-status.is-success {
  color: var(--accent-ink);
}

.form-status.is-error {
  color: var(--danger);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ================================================================
   12. PIED DE PAGE
   ================================================================ */
.site-footer {
  padding-bottom: env(safe-area-inset-bottom, 0px); /* au-dessus de la barre d'accueil de l'iPhone */
}

.site-footer .frame {
  display: grid;
  grid-template-columns: auto 1fr repeat(3, auto);
  align-items: stretch;
  min-height: 64px;
}

.site-footer .logo-mark {
  border-right: 1px solid var(--line);
}

/* display: block (et non flex) : en flex, les espaces entre "©", l'année et le nom disparaissent */
.site-footer .foot-copy {
  display: block;
  align-self: center;
  padding: 12px var(--pad);
  color: var(--muted);
}

.site-footer .foot-links {
  display: flex;
}

.site-footer .foot-links a,
.site-footer .foot-legal,
.site-footer .foot-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--pad);
  border-left: 1px solid var(--line);
  color: var(--fg-2);
  transition: background-color 160ms ease, color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer .foot-links a:hover,
  .site-footer .foot-legal:hover,
  .site-footer .foot-top:hover {
    background: var(--bg-3);
    color: var(--fg);
  }
}

/* ================================================================
   13. LIGHTBOX
   ================================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: rgba(8, 8, 9, 0.96);
  padding: clamp(0px, 2vw, 24px);
}

.lightbox.is-open {
  display: grid;
  place-items: center;
}

.lightbox-content {
  position: relative;
  width: min(1280px, 100%);
  /* Hauteur liée à l'écran (un % ici serait ignoré et l'image déborderait) */
  height: min(860px, calc(100dvh - 2 * clamp(0px, 2vw, 24px)));
  display: grid;
  grid-template-columns: 1fr minmax(300px, 380px);
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  border: 1px solid var(--line-strong);
}

.lightbox-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
}

.lightbox-counter {
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
  color: var(--muted);
}

.lightbox-close {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad);
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .lightbox-close:hover {
    background: var(--bg-3);
  }
}

.lightbox-media {
  position: relative;
  margin: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.lightbox-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  transition: background-color 160ms ease, opacity 160ms var(--ease-out);
}

.lightbox-prev {
  left: 0;
  border-left: 0;
}

.lightbox-next {
  right: 0;
  border-right: 0;
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .lightbox-nav:not(:disabled):hover {
    background: var(--accent);
    border-color: var(--accent);
  }
}

.lightbox-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.lightbox-panel > * {
  padding: 20px var(--pad);
}

.lightbox-head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.lightbox-series {
  color: var(--accent-ink);
}

.lightbox-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.lightbox-desc {
  color: var(--fg-2);
}

.lightbox-series-note {
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.lightbox-series-note h4 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.lightbox-series-desc {
  font-size: 14px;
  color: var(--fg-2);
}

/* ================================================================
   14. PAGE À PROPOS
   ================================================================ */
.page-hero .frame {
  display: grid;
  grid-template-columns: 7fr 5fr;
}

.page-hero-main {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: clamp(40px, 6vw, 88px);
  padding-bottom: clamp(32px, 4vw, 56px);
}

.page-title {
  font-size: clamp(3.4rem, 10vw, 10rem);
}

/* Titre découpé en lignes (même principe que le nom sur l'accueil) */
.page-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
  margin-bottom: -0.04em;
}

.page-title .line > span {
  display: inline-block;
}

/* Intro de la page À propos : même langage que l'accueil.
   Les délais démarrent après ~150 ms pour ne pas se perdre dans le fondu du changement de page (200 ms). */
@media (prefers-reduced-motion: no-preference) {
  .page-hero .page-title .line > span {
    animation: hero-rise 900ms var(--ease-out) 150ms backwards;
  }
  .page-hero .page-title .line:nth-child(2) > span {
    animation-delay: 240ms;
  }
  .page-hero-main .lede {
    animation: hero-fade 600ms var(--ease-out) 550ms backwards;
  }
  .page-hero-main .hero-actions .btn {
    animation: hero-fade 600ms var(--ease-out) 610ms backwards;
  }
  .page-hero-main .hero-actions .btn:nth-child(2) {
    animation-delay: 670ms;
  }
  /* Carte violette : volet de haut en bas, puis le logo se pose.
     Déclenché quand la carte entre à l'écran (js/animations.js) : sur téléphone, elle est sous les boutons.
     - .wait-view : état caché en attendant (posé par le JS, donc jamais bloqué si le JS ne se charge pas)
     - .is-inview : lance l'animation */
  .profile-visual.wait-view {
    clip-path: inset(0 0 100% 0);
  }
  .profile-visual.wait-view > * {
    opacity: 0;
  }
  .profile-visual.is-inview {
    animation: hero-wipe 1000ms var(--ease-in-out) 200ms backwards;
  }
  .profile-visual.is-inview > * {
    animation: profile-mark 600ms var(--ease-out) 700ms backwards;
  }
  /* Lignes d'infos en cascade, comme la colonne d'infos de l'accueil */
  .page-hero .info-list > div {
    animation: hero-meta 500ms var(--ease-out) 450ms backwards;
  }
  .page-hero .info-list > div:nth-child(2) { animation-delay: 500ms; }
  .page-hero .info-list > div:nth-child(3) { animation-delay: 550ms; }
  .page-hero .info-list > div:nth-child(4) { animation-delay: 600ms; }
  .page-hero .info-list > div:nth-child(5) { animation-delay: 650ms; }
}

@keyframes profile-mark {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

.profile-card {
  display: flex;
  flex-direction: column;
}

.profile-visual {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  background: var(--accent);
  color: #fff;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.profile-visual svg {
  width: 38%;
  height: auto;
}

/* Portrait : recadré sur le visage et les épaules (photo verticale dans un cadre 5:4) */
.profile-visual:has(img) {
  position: relative;
}

.profile-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
}

.info-list > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 14px var(--pad);
  border-bottom: 1px solid var(--line);
}

.info-list > div:last-child {
  border-bottom: 0;
}

.info-list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}

.info-list dd {
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.info-list dd a {
  border-bottom: 1px solid var(--line-strong);
}

@media (hover: hover) and (pointer: fine) {
  .info-list dd a:hover {
    color: var(--accent-ink);
    border-color: currentColor;
  }
}

.info-highlight {
  color: var(--accent-ink);
}

/* Compétences : trois colonnes */
.skills-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.skill-group {
  border-right: 1px solid var(--line);
}

.skill-group:last-child {
  border-right: 0;
}

.skill-group h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 1;
  margin-bottom: 20px;
}

.skill-group ul {
  border-top: 1px solid var(--line);
}

.skill-group li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-2);
}

.skills-extra {
  display: grid;
  grid-template-columns: 5fr 7fr;
  border-top: 1px solid var(--line);
}

.skills-extra > .cell:first-child {
  border-right: 1px solid var(--line);
}

/* Chronologie : colonne date + contenu */
.timeline li.timeline-item {
  display: grid;
  grid-template-columns: minmax(200px, 25%) 1fr;
  border-top: 1px solid var(--line);
}

.timeline-date {
  padding: var(--pad);
  border-right: 1px solid var(--line);
  color: var(--accent-ink);
}

.timeline-body {
  padding: var(--pad);
  display: grid;
  gap: 14px;
  align-content: start;
}

.timeline-body h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.timeline-body p {
  color: var(--fg-2);
  max-width: 68ch;
}

.timeline-body ul {
  display: grid;
  gap: 8px;
  max-width: 72ch;
}

.timeline-body ul li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-2);
}

.timeline-body ul li::before {
  content: "/";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--accent-ink);
}

.timeline-body strong {
  color: var(--fg);
  font-weight: 600;
}

/* Liens dans le texte courant (page confidentialité, mention du formulaire) */
.timeline-body a,
.form-privacy a {
  color: var(--fg);
  border-bottom: 1px solid var(--line-strong);
  overflow-wrap: anywhere;
  transition: color 160ms ease, border-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .timeline-body a:hover,
  .form-privacy a:hover {
    color: var(--accent-ink);
    border-color: currentColor;
  }
}

.site-footer .foot-legal[aria-current="page"] {
  color: var(--fg);
}

.legal-head {
  display: grid;
  gap: 24px;
  padding-top: clamp(40px, 6vw, 88px);
}

/* « Confidentialité » est un mot long d'un seul bloc : taille réduite pour tenir sur un téléphone */
.legal-head .page-title {
  font-size: clamp(1.6rem, 6.4vw, 7rem);
}

.form-privacy {
  font-size: 13px;
  color: var(--muted);
  max-width: 60ch;
}

/* Page 404 */
.error-page .frame {
  display: grid;
  grid-template-columns: 5fr 7fr;
  min-height: calc(100vh - var(--header-h) - 65px);
  min-height: calc(100svh - var(--header-h) - 65px);
}

.error-code-cell {
  display: flex;
  align-items: flex-end;
  background: var(--accent);
  color: #fff;
  overflow: hidden;
}

.error-code {
  font-size: clamp(6rem, 20vw, 18rem);
  line-height: 0.8;
  margin-bottom: -0.08em;
}

.error-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 28px;
}

.error-body h1 {
  font-size: clamp(2.6rem, 6vw, 5.5rem);
}

@media (max-width: 860px) {
  .error-page .frame {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .error-code-cell {
    min-height: 40vh;
  }
}

.section-sub {
  color: var(--muted);
}

.section-title-cell {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* Langues et intérêts */
.extras .frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.extras .frame > .cell:first-child {
  border-right: 1px solid var(--line);
}

.lang-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.lang-list li:first-child {
  border-top: 1px solid var(--line);
}

.lang-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
}

.lang-level {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

.extras-note {
  margin-top: 16px;
  color: var(--fg-2);
}

/* Bande d'appel à l'action */
.cta-band {
  background: var(--accent);
  color: #fff;
}

.cta-band .frame {
  border-color: rgba(255, 255, 255, 0.22);
  display: grid;
  grid-template-columns: 7fr 5fr;
}

.cta-band .frame > .cell:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.cta-band h2 {
  font-size: clamp(2.6rem, 6vw, 5.5rem);
}

.cta-band p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 48ch;
}

.cta-band .cell:last-child {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.cta-band .btn-primary {
  background: #fff;
  border-color: #fff;
  color: var(--accent);
}

.cta-band .btn-ghost {
  border-color: #fff;
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .cta-band .btn-primary:hover {
    background: var(--bg);
    border-color: var(--bg);
    color: #fff;
  }
  .cta-band .btn-ghost:hover {
    background: #fff;
    color: var(--accent);
  }
}

/* ================================================================
   15. RESPONSIVE
   ================================================================ */
@media (max-width: 1180px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .gallery-grid .gallery-card:nth-child(4n) {
    border-right: 1px solid var(--line);
  }
  .gallery-grid .gallery-card:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 1024px) {
  .hero .frame {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    min-height: 0;
  }
  .hero-name-cell {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .hero-meta {
    grid-row: 2;
    grid-column: 1;
  }
  .hero-reel {
    grid-row: 2 / span 2;
    grid-column: 2;
    min-height: 520px;
  }
  .hero-copy {
    grid-row: 3;
    grid-column: 1;
    border-top: 1px solid var(--line);
  }

  .skills-cols {
    grid-template-columns: 1fr 1fr;
  }
  .skill-group:nth-child(2) {
    border-right: 0;
  }
  .skill-group:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    /* Fermeture (120 ms) plus rapide que l'ouverture (180 ms) : le choix est déjà fait, le menu doit s'effacer vite */
    transition: opacity 120ms var(--ease-out), transform 120ms var(--ease-out),
      visibility 0s linear 120ms;
  }
  .nav-links.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s;
  }
  .nav-links a {
    min-height: 56px;
    padding: 0 var(--pad);
    border-left: 0;
    border-top: 1px solid var(--line);
    font-size: 14px;
  }

  .about .frame,
  .contact .frame,
  .page-hero .frame,
  .extras .frame,
  .cta-band .frame,
  .skills-extra {
    grid-template-columns: 1fr;
  }
  .about-head,
  .contact-intro,
  .page-hero-main,
  .extras .frame > .cell:first-child,
  .cta-band .frame > .cell:first-child,
  .skills-extra > .cell:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .cta-band .frame > .cell:first-child {
    border-bottom-color: rgba(255, 255, 255, 0.22);
  }

  .timeline li.timeline-item {
    grid-template-columns: 1fr;
  }
  .timeline-date {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-footer .frame {
    grid-template-columns: 1fr auto;
  }
  .site-footer .foot-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid var(--line);
  }
  .site-footer .foot-links {
    grid-column: 1 / -1;
    grid-row: 3;
    border-top: 1px solid var(--line);
  }
  .site-footer .foot-links a {
    flex: 1;
    min-height: 52px;
    justify-content: center;
  }
  .site-footer .foot-links a:first-child {
    border-left: 0;
  }
  .site-footer .foot-top {
    grid-column: 2;
    grid-row: 1;
  }
  .site-footer .foot-legal {
    grid-column: 1 / -1;
    grid-row: 4;
    min-height: 52px;
    justify-content: center;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .lightbox {
    padding: 0;
  }
  .lightbox-content {
    height: 100dvh;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 58fr) minmax(0, 42fr);
    border: 0;
  }
  .lightbox-media {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 767px) {
  .hero .frame {
    grid-template-columns: 1fr;
  }
  .hero-name-cell,
  .hero-meta,
  .hero-reel,
  .hero-copy {
    grid-column: 1;
    grid-row: auto;
  }
  .hero-meta {
    border-right: 0;
  }
  .meta-list {
    grid-template-columns: 1fr 1fr;
  }
  .meta-list > div:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .hero-reel {
    min-height: 0;
  }
  .reel-frame {
    aspect-ratio: 4 / 5;
    flex: none;
  }
  .hero-copy {
    border-right: 0;
  }
  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gallery-grid .gallery-card:nth-child(3n) {
    border-right: 1px solid var(--line);
  }
  .gallery-grid .gallery-card:nth-child(2n) {
    border-right: 0;
  }
  .gallery-card figcaption {
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
  }
  .gallery-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .gallery-filters::-webkit-scrollbar {
    display: none;
  }
  .filter-btn {
    flex-shrink: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
  .contact-form .btn {
    width: 100%;
    min-width: 0;
  }

  .stat-row li {
    padding-right: 8px;
  }
  .stat-row li + li {
    padding-left: 12px;
  }

  .skills-cols {
    grid-template-columns: 1fr;
  }
  .skill-group,
  .skill-group:nth-child(2) {
    border-right: 0;
  }
  .skill-group + .skill-group {
    border-top: 1px solid var(--line);
  }

  .info-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .logo-mark .logo-text {
    display: none;
  }
  .site-footer .logo-mark .logo-text {
    display: inline;
  }
}

/* ================================================================
   16. MOUVEMENT RÉDUIT
   ================================================================ */
/* On retire les déplacements, mais on garde les fondus et les changements de couleur
   (courts, ils aident à comprendre ce qui se passe sans faire bouger la page). */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn:active,
  .btn:hover .arrow,
  .gallery-card:hover img,
  .nav-links,
  .nav-links.is-open {
    transform: none !important;
  }
  .nav-toggle .bar,
  .skip-link {
    transition: none;
  }
  /* Message du formulaire : simple fondu court, sans volet */
  .form-status {
    clip-path: none;
  }
  .form-status.is-shown {
    transition: opacity 150ms var(--ease-out);
  }
  /* Envoi : barre fixe, sans balayage */
  .btn.is-sending::after {
    animation: none;
    opacity: 0.6;
  }
}
