/* ==========================================================================
   style.css — Portfolio Thibault Choderlos de Laclos
   1. Design system (variables)   2. Polices   3. Base   4. Utilitaires
   5. En-tête   6. Composants signature   7. Sections   8. Pied de page
   9. Animations
   ========================================================================== */

/* 1. DESIGN SYSTEM ------------------------------------------------------- */
:root {
  /* Couleurs */
  --c-accent:      #7A1F33;  /* bordeaux */
  --c-accent-dark: #4A1220;  /* bordeaux foncé */
  --c-text:        #141414;  /* noir */
  --c-muted:       #595959;  /* gris : texte secondaire */
  --c-card:        #F6F1F2;  /* fond des cartes */
  --c-rule:        #E3D9DB;  /* filets */
  --c-pill:        #F6E4E8;  /* pastille « Work mode » (rose pâle) */
  --c-bg:          #FFFFFF;

  /* Typographie */
  --f-head: "Caladea", Georgia, "Times New Roman", serif;
  --f-body: "TCdL Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Japonais et chinois : polices système uniquement (aucune police CJK embarquée).
     Les caractères latins restent en Caladea / Carlito (charte) ; les caractères CJK
     prennent une gothique (sans empattement), y compris dans les titres.
     macOS / iOS : Hiragino, PingFang · Android / Linux : Noto Sans CJK · Windows : Yu Gothic, Microsoft YaHei */
  --f-cjk-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Source Han Sans JP",
              "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  --f-cjk-zh: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC",
              "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;

  --fs-xs:   0.8125rem;                          /* 13 px */
  --fs-sm:   0.9375rem;                          /* 15 px */
  --fs-base: 1.0625rem;                          /* 17 px */
  --fs-md:   1.25rem;                            /* 20 px */
  --fs-lg:   clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --fs-xl:   clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --fs-xxl:  clamp(2.125rem, 1.5rem + 3vw, 3.5rem);
  --lh-tight: 1.15;
  --lh-base:  1.6;
  --ls-caps:  0.12em;                            /* petites capitales espacées */

  /* Espacements */
  --s-1: 0.25rem;  --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;    --s-7: 3rem;    --s-8: 4.5rem; --s-9: 6rem;

  /* Mise en page */
  --container: 70rem;                            /* 1120 px */
  --gutter: clamp(1.125rem, 4vw, 2rem);
  --header-h: 3.5rem;                            /* 56 px mobile */
  /* Zones sûres (encoche, barre d'accueil iPhone) — nécessite viewport-fit=cover */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --header-total: calc(var(--header-h) + var(--safe-t));
  --radius: 4px;
  --border-accent: 4px solid var(--c-accent);
  --rule: 1px solid var(--c-rule);
  --focus: 3px solid var(--c-accent);

  /* Mouvement */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 600ms;
}
@media (min-width: 60em) { :root { --header-h: 4rem; } }

/* 2. POLICES (auto-hébergées, SIL OFL — voir README) --------------------- */
@font-face { font-family: "Caladea"; src: url("../assets/fonts/caladea-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Caladea"; src: url("../assets/fonts/caladea-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "TCdL Text"; src: url("../assets/fonts/carlito-subset-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "TCdL Text"; src: url("../assets/fonts/carlito-subset-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "TCdL Text"; src: url("../assets/fonts/carlito-subset-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* 3. BASE ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-total) + var(--s-4));
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Évite d'afficher la page vide avant l'insertion des textes par JS.
   SÉCURITÉ : la page s'affiche quoi qu'il arrive au bout de 1,5 s
   (polices de secours si les polices ne sont pas prêtes). */
html:not(.i18n-ready) body { visibility: hidden; animation: show-anyway 0s 1.5s forwards; }
@keyframes show-anyway { to { visibility: visible; } }

/* Tant que main.js n'a pas démarré (JS désactivé, bloqué ou en retard),
   seul le bloc de secours est montré : jamais de page blanche ni de titres vides. */
html:not(.js) .skip-link,
html:not(.js) .site-header,
html:not(.js) main > section,
html:not(.js) .site-footer { display: none; }
html:not(.js) main { padding-top: 0; }
.js .boot-fallback { display: none; }

h1, h2, h3, h4 {
  font-family: var(--f-head);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-text);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }
img, svg { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--c-accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--c-accent-dark); }

:focus { outline: none; }
:focus-visible { outline: var(--focus); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }

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

/* 4. UTILITAIRES --------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto;
  padding-left: max(var(--gutter), var(--safe-l)); padding-right: max(var(--gutter), var(--safe-r)); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: var(--s-2); left: var(--s-2); z-index: 1000;
  padding: var(--s-2) var(--s-4); background: var(--c-accent); color: #fff;
  font-weight: 700; text-decoration: none; border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; color: #fff; outline-color: var(--c-accent-dark); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 2.75rem; padding: var(--s-2) var(--s-5);
  font: 700 var(--fs-sm)/1.2 var(--f-body); letter-spacing: 0.02em;
  text-decoration: none; text-align: center;
  border: 2px solid var(--c-accent); border-radius: var(--radius);
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--c-accent); color: #fff; }
.btn--primary:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-accent); }
.btn--ghost:hover { background: var(--c-card); color: var(--c-accent-dark); }
.btn--sm { min-height: 2.25rem; padding: var(--s-1) var(--s-4); }

/* 5. EN-TÊTE ------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-total); padding-top: var(--safe-t);
  background: var(--c-bg);
  border-bottom: var(--rule);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--s-4); }
.brand { display: inline-flex; flex-shrink: 0; padding: var(--s-1) 0; }
.brand img { width: 4.25rem; height: auto; }

.site-header__tools { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

/* Sélecteur de langue : bouton « Français ▾ » + panneau de 4 choix */
.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 2.75rem; padding: 0 var(--s-3);
  font: 400 var(--fs-sm)/1 var(--f-body); color: var(--c-text);
  background: var(--c-bg); border: 1px solid var(--c-rule); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
}
.lang-switch__btn:hover, .lang-switch__btn[aria-expanded="true"] { border-color: var(--c-accent); color: var(--c-accent); }
.lang-switch__current { font-family: var(--f-body); }
.lang-switch__chevron {
  width: 0.45rem; height: 0.45rem; margin-top: -0.2rem;
  border-right: 2px solid var(--c-accent); border-bottom: 2px solid var(--c-accent);
  transform: rotate(45deg); transition: transform .2s;
}
.lang-switch__btn[aria-expanded="true"] .lang-switch__chevron { transform: rotate(-135deg); margin-top: 0.2rem; }
.lang-switch.is-loading .lang-switch__btn { cursor: progress; opacity: .7; }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + var(--s-1)); z-index: 120;
  min-width: 11rem; margin: 0; padding: var(--s-1) 0; list-style: none;
  background: var(--c-bg); border: 1px solid var(--c-rule); border-top: 3px solid var(--c-accent);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 10px 28px rgba(20, 20, 20, .14);
}
.lang-switch__menu[hidden] { display: none; }
.lang-switch__opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  width: 100%; min-height: 2.75rem; padding: 0 var(--s-4);
  font: 400 var(--fs-base)/1.2 var(--f-body); color: var(--c-text); text-align: left;
  background: none; border: 0; cursor: pointer;
}
.lang-switch__opt:hover { background: var(--c-card); color: var(--c-accent); }
.lang-switch__opt:focus-visible { background: var(--c-card); color: var(--c-accent); outline-offset: -3px; }
.lang-switch__opt[aria-current="true"] { color: var(--c-accent); font-weight: 700; }
.lang-switch__opt[aria-current="true"]::after {          /* coche (dessinée, sans police) */
  content: ""; flex-shrink: 0; width: 0.4rem; height: 0.75rem; margin-top: -0.2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}

/* Message discret : échec de chargement d'une langue */
.lang-notice {
  position: fixed; z-index: 95; right: max(var(--gutter), var(--safe-r)); top: calc(var(--header-total) + var(--s-2));
  max-width: min(24rem, calc(100vw - 2 * var(--gutter)));
}
.lang-notice.is-visible {
  display: flex; align-items: flex-start; gap: var(--s-2);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  background: var(--c-card); color: var(--c-text); border-left: var(--border-accent);
  border-radius: var(--radius); box-shadow: 0 6px 20px rgba(20, 20, 20, .12);
  font-size: var(--fs-sm);
}
.lang-notice__text { margin: 0; padding-block: var(--s-2); }
.lang-notice__close {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.75rem; height: 2.75rem; padding: 0;
  color: var(--c-accent); background: none; border: 0; border-radius: var(--radius); cursor: pointer;
}
.lang-notice__close:hover { background: var(--c-bg); }

/* Burger */
.burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; padding: 0;
  background: none; border: 1px solid var(--c-rule); border-radius: var(--radius); cursor: pointer;
}
.burger__bar, .burger__bar::before, .burger__bar::after {
  display: block; width: 1.25rem; height: 2px; background: var(--c-accent); border-radius: 1px;
  transition: transform .25s var(--ease), background-color .2s;
}
.burger__bar { position: relative; }
.burger__bar::before, .burger__bar::after { content: ""; position: absolute; left: 0; }
.burger__bar::before { top: -6px; }
.burger__bar::after  { top: 6px; }
.burger[aria-expanded="true"] .burger__bar { background: transparent; }
.burger[aria-expanded="true"] .burger__bar::before { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__bar::after  { transform: translateY(-6px) rotate(-45deg); }

/* Menu : panneau mobile */
.site-nav {
  display: none;
  position: fixed; top: var(--header-total); left: 0; right: 0; z-index: 99;
  height: calc(100vh - var(--header-total)); height: calc(100dvh - var(--header-total));
  padding: var(--s-6) var(--gutter);
  background: var(--c-bg); overflow-y: auto;
}
.site-nav.is-open { display: block; }
.site-nav__list { list-style: none; }
.site-nav__list a {
  display: block; padding: var(--s-4) 0;
  font: 700 var(--fs-lg)/1.2 var(--f-head); color: var(--c-text); text-decoration: none;
  border-bottom: var(--rule);
}
.site-nav__list a:hover, .site-nav__list a[aria-current="true"] { color: var(--c-accent); }
.site-nav__pdf { margin-top: var(--s-6); width: 100%; }
body.nav-open { overflow: hidden; }

/* Bouton PDF de la navigation + panneau anglais / français (même principe que le sélecteur de langue).
   Menu mobile : le panneau s'ouvre dans le flux, sous le bouton ; ordinateur : en surimpression. */
.pdf-switch { position: relative; }
.pdf-switch__btn { min-height: 2.75rem; }
.pdf-switch__chevron {
  flex-shrink: 0; width: 0.45rem; height: 0.45rem; margin-top: -0.2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s;
}
.pdf-switch__btn[aria-expanded="true"] .pdf-switch__chevron { transform: rotate(-135deg); margin-top: 0.2rem; }
.pdf-switch__menu {
  margin: var(--s-1) 0 0; padding: var(--s-1) 0; list-style: none;
  background: var(--c-bg); border: 1px solid var(--c-rule); border-top: 3px solid var(--c-accent);
  border-radius: 0 0 var(--radius) var(--radius);
}
.pdf-switch__menu[hidden] { display: none; }
.pdf-switch__opt {
  display: flex; align-items: center; min-height: 2.75rem; padding: var(--s-2) var(--s-4);
  font: 400 var(--fs-base)/1.3 var(--f-body); color: var(--c-text); text-decoration: none;
}
.pdf-switch__opt:hover { background: var(--c-card); color: var(--c-accent); }
.pdf-switch__opt:focus-visible { background: var(--c-card); color: var(--c-accent); outline-offset: -3px; }

/* Menu : desktop */
@media (min-width: 60em) {
  .burger { display: none; }
  .site-nav {
    display: flex !important; align-items: center; gap: var(--s-5);
    position: static; padding: 0; margin-left: auto; background: none; overflow: visible;
  }
  .site-nav__list { display: flex; gap: var(--s-5); }
  .site-nav__list a {
    padding: var(--s-2) 0; border: 0;
    font: 400 var(--fs-sm)/1.2 var(--f-body); letter-spacing: 0.04em;
    border-bottom: 2px solid transparent;
  }
  .site-nav__list a[aria-current="true"] { border-bottom-color: var(--c-accent); }
  .site-nav__pdf { margin: 0; width: auto; }
  .pdf-switch__menu {
    position: absolute; right: 0; top: calc(100% + var(--s-1)); z-index: 120;
    width: max-content; min-width: 100%; max-width: 20rem; margin: 0;
    box-shadow: 0 10px 28px rgba(20, 20, 20, .14);
  }
  .site-header__tools { margin-left: 0; order: 3; }
  .brand img { width: 4.75rem; }
}

/* 6. COMPOSANTS SIGNATURE ------------------------------------------------ */
/* Sous-titre en petites capitales espacées bordeaux */
.eyebrow {
  font: 700 var(--fs-xs)/1.4 var(--f-body);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--c-accent); margin: 0 0 var(--s-3);
}
/* Carré bordeaux numéroté (01–04) */
.num-square {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.75rem; height: 2.75rem;
  background: var(--c-accent); color: #fff;
  font: 700 var(--fs-md)/1 var(--f-head);
}
/* Carte de chiffre clé */
.keyfig {
  background: var(--c-card); border-left: var(--border-accent);
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
}
.keyfig__value { display: block; font: 700 var(--fs-xl)/1.1 var(--f-head); color: var(--c-accent); }
.keyfig__label { display: block; margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--c-muted); line-height: 1.35; }
/* Pastille « Work mode » */
.pill {
  display: inline-block; padding: var(--s-1) var(--s-3);
  background: var(--c-pill); color: var(--c-accent-dark);
  font-size: var(--fs-sm); line-height: 1.4; border-radius: 999px;
}
/* Encadré « Key takeaway » */
.takeaway {
  background: var(--c-card); border-left: var(--border-accent);
  padding: var(--s-5);
}
/* Notes de confidentialité */
.conf-note { font-size: var(--fs-sm); color: var(--c-muted); }
.conf-note--box { background: var(--c-card); border-left: var(--border-accent); padding: var(--s-3) var(--s-4); }
/* Pastille de matrice */
.dot { color: var(--c-accent); font-size: 1.1em; line-height: 1; }

/* 7. SECTIONS ------------------------------------------------------------ */
main { padding-top: var(--header-total); }
.section { padding-block: var(--s-8); border-top: var(--rule); }
.section:first-child, .hero { border-top: 0; }
.section-head { margin-bottom: var(--s-6); }
.section-title { font-size: var(--fs-xl); margin-bottom: var(--s-2); }
.section-head .eyebrow { margin: 0; }
@media (min-width: 60em) { .section { padding-block: var(--s-9); } }

/* Lien qui ressemble à du texte (bouton « Show e-mail ») */
.link-button {
  padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; color: var(--c-accent);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
.link-button:hover { color: var(--c-accent-dark); }
.icon { flex-shrink: 0; }

/* --- Hero --- */
.hero { padding-block: var(--s-6) var(--s-7); }
.hero__grid { display: grid; gap: var(--s-5); }
.hero__portrait { width: 10.5rem; }                      /* 168 px */
.hero__portrait img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border: 2px solid var(--c-accent); padding: 5px; background: var(--c-bg);
}
.hero__text .eyebrow { margin-bottom: var(--s-2); }
.hero__name { font-size: var(--fs-xxl); margin-bottom: var(--s-4); }
.hero__status { margin: 0 0 var(--s-1); color: var(--c-muted); }
.hero__status--main { color: var(--c-text); font-weight: 700; }
.hero__location { margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: var(--c-muted); }
.hero__available {
  margin: var(--s-5) 0 0;
  background: var(--c-card); border-left: var(--border-accent);
  padding: var(--s-3) var(--s-4); font-size: var(--fs-sm);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.hero__actions .btn { flex: 1 1 14rem; }
.hero__links {
  list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5);
  margin-top: var(--s-5); font-size: var(--fs-sm);
}
.hero__links li, .hero__links a { display: inline-flex; align-items: center; gap: var(--s-2); }
.hero__links li { min-height: 2.75rem; color: var(--c-accent); }
.hero__links a { min-height: 2.75rem; }
.hero__conf { margin: var(--s-6) 0 0; padding-top: var(--s-4); border-top: var(--rule); font-size: var(--fs-xs); max-width: 60rem; }
/* Chiffres clés du hero : sur ordinateur seulement (sur téléphone et tablette, ils restent dans les projets) */
.keyfigs.hero__figs { display: none; }

@media (min-width: 48em) {
  .hero__actions .btn { flex: 0 0 auto; }
}
@media (min-width: 60em) {
  .hero { padding-block: var(--s-8) var(--s-7); }
  .hero__grid { grid-template-columns: 1fr 20rem; gap: var(--s-8); align-items: center; }
  .hero__portrait { order: 2; width: 20rem; }
  .hero__portrait img { padding: 8px; }
  .keyfigs.hero__figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-5); max-width: 46rem; }
  .hero__figs .keyfig { padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); }
  .hero__figs .keyfig__value { font-size: var(--fs-lg); }
  .hero__figs .keyfig__label { font-size: var(--fs-xs); text-wrap: balance; }
}

/* --- Grille des chiffres clés --- */
.keyfigs { list-style: none; display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 60em) {
  .keyfigs--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
  .keyfigs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
  .keyfigs--2 { gap: var(--s-4); max-width: 46rem; }
}

/* --- Cartes de projet (cliquables entièrement) --- */
.project-cards { list-style: none; display: grid; gap: var(--s-4); margin-top: var(--s-6); }
@media (min-width: 48em) { .project-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 75em) { .project-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.project-card {
  position: relative; display: flex; flex-direction: column;
  padding: var(--s-5); background: var(--c-bg);
  border: var(--rule); border-top: 3px solid var(--c-accent);
  transition: border-color .2s, box-shadow .2s;
}
.project-card:hover { border-color: var(--c-accent); box-shadow: 0 6px 20px rgba(74, 18, 32, .08); }
.project-card:focus-within { border-color: var(--c-accent); }
.project-card .num-square { margin-bottom: var(--s-4); }
.project-card__title { font-size: var(--fs-md); margin-bottom: var(--s-3); }
.project-card__title a { color: var(--c-text); text-decoration: none; }
.project-card__title a::after { content: ""; position: absolute; inset: 0; }     /* carte entière cliquable */
.project-card__title a:focus-visible { outline: none; }
.project-card:has(a:focus-visible) { outline: var(--focus); outline-offset: 3px; }
.project-card__title a:hover { color: var(--c-accent); }
.project-card__summary { font-size: var(--fs-sm); color: var(--c-muted); }
.project-card__figure {
  margin-top: auto; padding: var(--s-2) var(--s-3);
  background: var(--c-card); border-left: 3px solid var(--c-accent);
  font: 700 var(--fs-sm)/1.35 var(--f-head); color: var(--c-accent);
}
.project-card__tags { margin: var(--s-3) 0 0; font-size: var(--fs-xs); color: var(--c-muted); letter-spacing: 0.02em; }
.project-card__arrow { align-self: flex-end; margin-top: var(--s-2); color: var(--c-accent); font-size: var(--fs-md); line-height: 1; transition: transform .2s; }
.project-card:hover .project-card__arrow { transform: translateX(4px); }

/* --- Sous-titre de bloc (h3) en petites capitales bordeaux --- */
.subhead {
  font: 700 var(--fs-xs)/1.4 var(--f-body);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--c-accent); margin: 0 0 var(--s-5);
  padding-bottom: var(--s-2); border-bottom: var(--rule);
}

/* --- Profil --- */
.profile { display: grid; gap: var(--s-7); }
.profile__summary { font-size: var(--fs-md); line-height: 1.6; }
.profile__more { margin-top: var(--s-5); font-weight: 700; }
.profile__more a { text-decoration: none; border-bottom: 1px solid currentColor; }
@media (min-width: 60em) {
  .profile { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-8); align-items: start; }
  .profile__intro { position: sticky; top: calc(var(--header-total) + var(--s-6)); }
}

/* --- Frise chronologique --- */
.timeline { list-style: none; position: relative; }
.timeline::before {                                    /* ligne verticale */
  content: ""; position: absolute; left: 5px; top: 0.5rem; bottom: 0.5rem;
  width: 2px; background: var(--c-rule);
}
.timeline__item {
  position: relative; padding: 0 0 var(--s-6) var(--s-6);
  display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--s-4);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {                              /* point bordeaux */
  content: ""; position: absolute; left: 0; top: 0.3rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--c-bg); border: 2px solid var(--c-accent);
}
.timeline__item:nth-child(-n+3)::before { background: var(--c-accent); }   /* en cours */
.timeline__date {
  margin: 0 0 var(--s-1);
  font: 700 var(--fs-xs)/1.4 var(--f-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-accent);
}
.timeline__title { font-size: var(--fs-md); margin: 0 0 var(--s-2); text-wrap: pretty; }
.timeline__title a { color: inherit; text-decoration-color: var(--c-accent); }
.timeline__title a:hover { color: var(--c-accent); }
.timeline__desc { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
/* Logos : au-dessus du titre sur mobile, à droite à partir de 48em */
.timeline__logo { order: -1; margin-bottom: var(--s-2); }
/* Hauteur commune à tous les logos (ESIX, Orano, SS2E Conseil, Era Card), largeur selon les proportions d'origine */
.timeline__item--logo .timeline__date { order: -2; }
@media (min-width: 48em) {
  .timeline__item--logo { grid-template-columns: minmax(0, 1fr) auto; }
  .timeline__item--logo > :not(.timeline__logo) { grid-column: 1; }
  .timeline__logo { order: 0; margin: 0; grid-column: 2; grid-row: 1 / span 3; align-self: start; }
}

/* --- Projets --- */
.project { padding-block: var(--s-6) var(--s-7); }
.project + .project { border-top: var(--rule); padding-top: var(--s-7); }
.project__head { display: flex; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap; }
.project__heading { flex: 1 1 14rem; min-width: 0; }
.project__title { font-size: var(--fs-lg); margin: 0.35rem 0 var(--s-2); text-wrap: pretty; }
.project__meta { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.project__logo { flex-shrink: 0; }
@media (min-width: 48em) { .project__logo img { margin-top: 0.25rem; } }

.project__banner { margin: var(--s-5) 0 0; }
.project__banner img { width: 100%; aspect-ratio: 1620 / 580; object-fit: cover; }
.project__banner figcaption { margin-top: var(--s-2); font-size: var(--fs-xs); color: var(--c-muted); font-style: italic; }

.project > .conf-note--box { margin: var(--s-4) 0 0; }
.project__figs { margin-top: var(--s-5); }

.project__body { margin-top: var(--s-6); display: grid; gap: var(--s-6); }
.project__cols { display: grid; gap: var(--s-6); }
@media (min-width: 60em) { .project__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7); } }

.block-title {
  font: 700 var(--fs-xs)/1.4 var(--f-body);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--c-accent); margin: 0 0 var(--s-3);
}
.project__block p { max-width: 70ch; }
.project__block .pill { margin-bottom: var(--s-1); }
.project__skills { font-size: var(--fs-sm); color: var(--c-muted); }

/* Listes à puces bordeaux */
.bullets { list-style: none; display: grid; gap: var(--s-3); }
.bullets li { position: relative; padding-left: 1.1rem; }
.bullets li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 6px; height: 6px; background: var(--c-accent);
}
.bullets strong { color: var(--c-text); }

/* Encadré Key takeaway */
.takeaway__title {
  font: 700 var(--fs-xs)/1.4 var(--f-body);
  text-transform: uppercase; letter-spacing: var(--ls-caps);
  color: var(--c-accent); margin: 0 0 var(--s-2);
}
.takeaway p { font: 400 var(--fs-md)/1.5 var(--f-head); }

/* Projets repliables (toutes largeurs) : résumé toujours visible, détail derrière « Lire le détail ».
   Le détail n'est replié que par main.js (hidden="until-found") : sans JavaScript et à l'impression,
   tout est déplié ; Ctrl+F et les liens d'ancre l'ouvrent. */
.more-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 2.75rem; width: 100%; padding: var(--s-2) var(--s-5);
  font: 700 var(--fs-sm)/1.2 var(--f-body); color: var(--c-accent);
  background: var(--c-bg); border: 1px solid var(--c-accent); border-radius: var(--radius);
  cursor: pointer;
}
.more-toggle:hover { background: var(--c-card); }
.more-toggle__icon {
  flex-shrink: 0; width: 0.55rem; height: 0.55rem; margin-top: -0.2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s;
}
.more-toggle[aria-expanded="true"] .more-toggle__icon { transform: rotate(-135deg); margin-top: 0.2rem; }
@media (min-width: 48em) { .more-toggle { width: auto; } }

.project__detail { display: grid; gap: var(--s-6); }
.project__detail:not([hidden]) { margin-top: var(--s-6); }
.project__detail[hidden] { margin: 0; }
/* Navigateurs sans hidden="until-found" : main.js pose un hidden simple */
.project__detail[hidden]:not([hidden="until-found" i]) { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .project__detail.is-opening { animation: detail-in .35s var(--ease); }
}
@keyframes detail-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* « Tout déplier / Tout replier » : discret, à droite du titre « Projets » */
.section-head--tools { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: var(--s-5); row-gap: var(--s-2); }
.detail-all {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0;
  font: 400 var(--fs-sm)/1.3 var(--f-body); color: var(--c-accent);
  background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--c-rule);
}
.detail-all:hover { color: var(--c-accent-dark); text-decoration-color: currentColor; }
html:not(.js) .detail-all, html:not(.js) .more-toggle { display: none; }


/* --- Sans JavaScript --- */
.noscript-note { padding-block: var(--s-7); }
.noscript-note__name { font: 700 var(--fs-xl)/1.15 var(--f-head); }
.noscript-note__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* 8. PIED DE PAGE -------------------------------------------------------- */
.site-footer {
  border-top: 3px solid var(--c-accent);
  padding-block: var(--s-7);
  font-size: var(--fs-sm); color: var(--c-muted);
}
.site-footer__inner { display: grid; gap: var(--s-3); justify-items: start; }
.site-footer__mono { width: 4.25rem; margin-bottom: var(--s-2); }
.site-footer p { margin: 0; max-width: 46rem; }
.site-footer__links { display: flex; flex-wrap: wrap; column-gap: var(--s-5); row-gap: var(--s-1); }
.site-footer__links a { color: var(--c-muted); text-decoration: underline; text-decoration-color: var(--c-rule); text-underline-offset: 0.2em; display: inline-flex; align-items: center; min-height: 2.75rem; }
.site-footer__links a:hover { color: var(--c-accent); text-decoration-color: currentColor; }
@media (min-width: 48em) {
  .site-footer__inner { grid-template-columns: auto 1fr; column-gap: var(--s-6); align-items: start; }
  .site-footer__mono { grid-row: span 3; }
}

/* 9. ANIMATIONS (apparition au défilement) ------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .reveal.reveal--instant { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Page 404 */

/* --- Ajustements chiffres clés et pastilles --- */
.keyfig__value--long { font-size: var(--fs-lg); line-height: 1.2; padding-top: 0.2em; }
@media (max-width: 47.99em) {
  .keyfigs--3 { grid-template-columns: minmax(0, 1fr); }
  .keyfigs--3 .keyfig { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; }
  .keyfigs--3 .keyfig__label { margin-top: 0; }
}
.pill { border-radius: 1rem; }

/* --- Projet 02 : missions A, B, C --- */
.missions { list-style: none; display: grid; gap: var(--s-4); }
.mission {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5); border: var(--rule); border-top: 3px solid var(--c-accent);
}
.mission__title { font: 700 var(--fs-md)/1.25 var(--f-head); margin: 0; text-wrap: pretty; }
.mission__mode { margin: 0; }
.mission__detail { display: grid; gap: var(--s-3); font-size: var(--fs-sm); }
.mission__detail p { margin: 0; }
.mission__detail strong { color: var(--c-text); }
@media (min-width: 75em) {
  .missions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Galerie « In pictures » (projet 03) ---
   Mobile : vignettes empilées, image entière (format d'origine) + légende.
   Desktop : 3 vignettes côte à côte, recadrées au même format. */
.gallery { list-style: none; display: grid; gap: var(--s-5); }
.gallery__figure { margin: 0; }
.gallery__thumb {
  position: relative; display: block; width: 100%; padding: 0;
  background: var(--c-card); border: var(--rule); cursor: zoom-in; overflow: hidden;
}
.gallery__thumb img { width: 100%; height: auto; transition: transform .3s var(--ease); }
.gallery__thumb:hover img { transform: scale(1.03); }
.gallery__thumb:hover { border-color: var(--c-accent); }
.gallery__zoom {
  position: absolute; right: var(--s-2); bottom: var(--s-2);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--c-bg); color: var(--c-accent); box-shadow: 0 1px 4px rgba(20, 20, 20, .2);
}
.gallery__figure figcaption { margin-top: var(--s-2); font-size: var(--fs-xs); line-height: 1.45; color: var(--c-muted); font-style: italic; }
@media (min-width: 60em) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); }
  .gallery__thumb img { aspect-ratio: 3 / 2; object-fit: cover; object-position: left top; }
}

/* --- Visionneuse --- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--c-bg); color: var(--c-text);
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: var(--c-bg); }
.lightbox__bar, .lightbox__foot {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--gutter);
}
.lightbox__bar { justify-content: space-between; border-bottom: var(--rule); }
.lightbox__foot { border-top: var(--rule); }
.lightbox__count { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.lightbox__caption { flex: 1; margin: 0; font-size: var(--fs-sm); color: var(--c-muted); text-align: center; }
.lightbox__btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.75rem; height: 2.75rem; padding: 0;
  background: var(--c-bg); color: var(--c-accent);
  border: 1px solid var(--c-rule); border-radius: var(--radius); cursor: pointer;
}
.lightbox__btn:hover { border-color: var(--c-accent); }
.lightbox__btn[hidden] { display: none; }
.lightbox__stage {
  overflow: auto; overscroll-behavior: contain;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-card); padding: var(--s-3);
}
.lightbox__img { max-width: 100%; max-height: 100%; width: auto; height: auto; min-width: 0; min-height: 0; object-fit: contain; cursor: zoom-in; }
/* Zoom : taille réelle de l'image, déplacement par défilement (ou au doigt) */
.lightbox__stage.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.lightbox__stage.is-zoomed .lightbox__img { flex-shrink: 0; }
.lightbox__stage.is-zoomed .lightbox__img { max-width: none; max-height: none; height: auto; cursor: zoom-out; }
body.lightbox-open { overflow: hidden; }
.project__block > .bullets { max-width: 80ch; }

/* --- Projet 04 : texte + petite image à droite (desktop), image en dessous (mobile) --- */
.project__media-row { display: grid; gap: var(--s-6); }
.project__media-text { display: grid; gap: var(--s-6); }
.project__media { max-width: 16rem; }
.project__media .gallery__thumb img { aspect-ratio: 1 / 1; object-fit: contain; }
.project__meta a { color: var(--c-accent); }
@media (min-width: 60em) {
  .project__media-row { grid-template-columns: minmax(0, 1fr) 16.25rem; gap: var(--s-7); align-items: start; }
  .project__media { max-width: none; }
}

/* --- Logos : poids visuel harmonisé ---
   Même hauteur pour tous = les logos larges (Orano) écrasent les logos compacts.
   On compense donc selon les proportions d'origine (aucune déformation, aucun recadrage du dessin). */
.logo--esix    { --logo-h: 2.75rem; }   /* rond, 1:1 */
.logo--orano   { --logo-h: 1.875rem; }  /* large, 3,2:1 */
.logo--ss2e    { --logo-h: 2.125rem; }  /* 2,3:1 */
.logo--eracard { --logo-h: 3.5rem; }    /* 1,1:1, trait fin doré : un peu plus grand pour que « ERA CARD » reste lisible */
.logo img { height: calc(var(--logo-h) * 0.85); width: auto; max-width: none; }
@media (min-width: 48em) { .logo img { height: var(--logo-h); } }

/* ================= SKILLS ================= */
.skills { display: grid; gap: var(--s-7); }
.skill-grid { list-style: none; display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 60em) { .skill-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.skill-card {
  background: var(--c-card); border-left: var(--border-accent);
  padding: var(--s-3) var(--s-4); font-size: var(--fs-sm); font-weight: 700; line-height: 1.35;
  display: flex; align-items: center;
}
.skills__row { display: grid; gap: var(--s-6); }
@media (min-width: 60em) { .skills__row { grid-template-columns: 1fr 1.6fr 1fr; gap: var(--s-7); } }
.plain-list { list-style: none; display: grid; gap: var(--s-2); }
.plain-list strong { color: var(--c-text); }

/* Matrice */
.matrix-block { border-top: var(--rule); padding-top: var(--s-6); }
.matrix-block__title { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.matrix-wrap { display: none; margin-top: var(--s-5); }
.matrix { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.matrix th, .matrix td { padding: var(--s-3) var(--s-3); border-bottom: var(--rule); text-align: left; vertical-align: middle; }
.matrix thead th { border-bottom: 2px solid var(--c-accent); font-weight: 700; color: var(--c-muted); font-size: var(--fs-xs); letter-spacing: 0.04em; }
.matrix tbody th { font-weight: 700; color: var(--c-text); }
.matrix tbody tr:nth-child(even) { background: #FBF8F9; }
.matrix__proj { text-align: center !important; width: 7.5rem; }
.matrix__proj a { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--c-muted); padding: var(--s-1) var(--s-2); border-radius: var(--radius); }
.matrix__proj a:hover { background: var(--c-card); color: var(--c-accent); }
.matrix__num { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; background: var(--c-accent); color: #fff; font: 700 var(--fs-sm)/1 var(--f-head); }
.matrix__pname { font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.matrix__dot { text-align: center !important; color: var(--c-accent); font-size: 1.15rem; }
.matrix__tools { color: var(--c-muted); }
.matrix__legend { margin-top: var(--s-4); font-size: var(--fs-xs); color: var(--c-muted); }

/* Version mobile : liste par compétence */
.mlist { list-style: none; display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.mlist__item { padding: var(--s-3) var(--s-4); border: var(--rule); border-left: var(--border-accent); }
.mlist__skill { margin: 0 0 var(--s-2); font-weight: 700; }
.mlist__badges { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-2); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 var(--s-2);
  background: var(--c-accent); color: #fff; text-decoration: none;
  font: 700 var(--fs-sm)/1 var(--f-head);
}
.badge:hover { background: var(--c-accent-dark); color: #fff; }
.mlist__tools { margin: 0; font-size: var(--fs-xs); color: var(--c-muted); }
@media (min-width: 48em) {
  .matrix-wrap { display: block; }
  .mlist { display: none; }
}

/* ================= INTERNATIONAL ================= */
.intl-feature { display: grid; gap: var(--s-5); margin-top: var(--s-6); }
.intl-feature__photo { max-width: 34rem; }
.intl-feature__text p { font-size: var(--fs-md); }
@media (min-width: 60em) {
  .intl-feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); align-items: center; }
  .intl-feature__photo { max-width: none; }
}
.intl-block__title { font-size: var(--fs-md); margin-bottom: var(--s-2); }
.intl-blocks { list-style: none; display: grid; gap: var(--s-4); margin-top: var(--s-6); }
.intl-block { padding: var(--s-5); background: var(--c-card); border-left: var(--border-accent); }
.intl-block p { font-size: var(--fs-sm); }
@media (min-width: 60em) { .intl-blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 59.99em) { .matrix__proj { width: 4.75rem; } .matrix th, .matrix td { padding-inline: var(--s-2); } }

/* ================= CE QUE JE PEUX APPORTER ================= */
.bring-cards { list-style: none; display: grid; gap: var(--s-4); }
@media (min-width: 60em) { .bring-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bring-card {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-5); border: var(--rule); border-top: 3px solid var(--c-accent);
}
.bring-card__title { font-size: var(--fs-md); margin: var(--s-1) 0 0; text-wrap: pretty; }
.bring-card__desc { margin: 0; }
.bring-card__meta { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.bring-card__meta strong { color: var(--c-text); }
.bring-card__builds { margin-top: auto; padding-top: var(--s-3); border-top: var(--rule); }
.bring-card__builds a { font-weight: 700; }

.plan { margin-top: var(--s-7); }
.phases { list-style: none; display: grid; gap: var(--s-2); }
@media (min-width: 48em) { .phases { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; } }
.phase { padding: var(--s-4) var(--s-5); }
.phase p { margin: 0; }
.phase__weeks { font: 700 var(--fs-xs)/1.4 var(--f-body); text-transform: uppercase; letter-spacing: var(--ls-caps); }
.phase__name { font: 700 var(--fs-lg)/1.2 var(--f-head); margin: var(--s-1) 0 var(--s-2) !important; }
.phase__text { font-size: var(--fs-sm); }
.phase--1 { background: var(--c-pill); color: var(--c-accent-dark); }
.phase--2 { background: var(--c-accent); color: #fff; }
.phase--3 { background: var(--c-accent-dark); color: #fff; }

/* ================= CERTIFICATIONS ================= */
.certs { display: grid; gap: var(--s-6); }
.certs__list { display: grid; gap: var(--s-6); }
.cert .subhead { margin-bottom: var(--s-3); }
.cert__title { margin: 0 0 var(--s-1); font-weight: 700; }
.cert__text { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }
.cert__link { margin: var(--s-2) 0 0; font-size: var(--fs-sm); }
.certs__image { max-width: 30rem; }
@media (min-width: 60em) {
  .certs { grid-template-columns: minmax(0, 1fr) 27.5rem; gap: var(--s-8); align-items: start; }
  .certs__image { max-width: none; position: sticky; top: calc(var(--header-total) + var(--s-5)); }
}

/* ================= CONTACT ================= */
.contact {
  margin-top: var(--s-8); padding: var(--s-6) var(--s-5);
  background: var(--c-card); border-top: 4px solid var(--c-accent);
  text-align: center; display: grid; justify-items: center; gap: var(--s-4);
}
.contact > * { margin: 0; }
.contact__title { font-size: var(--fs-xl); }
.contact__text { font-size: var(--fs-md); max-width: 40rem; }
.contact__links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-6); }
.contact__links li, .contact__links a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 2.75rem; }
.contact__links li { color: var(--c-accent); }
.contact__wechat span { color: var(--c-text); }
.contact__refs { font-size: var(--fs-sm); color: var(--c-muted); font-style: italic; }
/* Deux PDF : côte à côte, empilés sur téléphone */
.contact__pdf { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); width: 100%; }
.contact__pdf .btn { flex: 1 1 100%; }
@media (min-width: 48em) { .contact__pdf .btn { flex: 0 1 auto; } }
@media (min-width: 60em) { .contact { padding: var(--s-7); } }

/* ================= GLOSSAIRE ================= */
.glossary__summary {
  list-style: none; cursor: pointer; position: relative;
  padding-right: 3.5rem;
}
.glossary__summary::-webkit-details-marker { display: none; }
.glossary__summary .section-title { margin-bottom: var(--s-2); }
.glossary__summary .eyebrow { display: block; margin: 0; }
.glossary__summary:hover .section-title { color: var(--c-accent); }
.glossary__chevron {
  position: absolute; right: 0; top: 50%; translate: 0 -50%;
  width: 2.75rem; height: 2.75rem; border: 1px solid var(--c-accent); border-radius: var(--radius);
}
.glossary__chevron::before {
  content: ""; position: absolute; left: 50%; top: 45%;
  width: 0.6rem; height: 0.6rem; border-right: 2px solid var(--c-accent); border-bottom: 2px solid var(--c-accent);
  transform: translate(-50%, -50%) rotate(45deg); transition: transform .2s;
}
.glossary[open] .glossary__chevron::before { top: 55%; transform: translate(-50%, -50%) rotate(-135deg); }
.glossary__list { display: grid; gap: var(--s-4) var(--s-7); margin: var(--s-6) 0 0; }
@media (min-width: 60em) { .glossary__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.glossary__item { padding-bottom: var(--s-4); border-bottom: var(--rule); }
.glossary__item dt { font-weight: 700; color: var(--c-accent); margin-bottom: var(--s-1); }
.glossary__item dd { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }


/* ================= INTÉGRATION TÉLÉPHONE ================= */
/* Panneau du menu : marges des zones sûres */
.site-nav { padding: var(--s-6) max(var(--gutter), var(--safe-r)) calc(var(--s-6) + var(--safe-b)) max(var(--gutter), var(--safe-l)); }
@media (min-width: 60em) { .site-nav { padding: 0; height: auto; } }
/* Bouton PDF du menu mobile : zone tactile de 44 px */
@media (max-width: 59.99em) { .site-nav__pdf { min-height: 2.75rem; } }
/* Visionneuse : zones sûres */
.lightbox__bar { padding-top: calc(var(--s-2) + var(--safe-t)); padding-left: max(var(--gutter), var(--safe-l)); padding-right: max(var(--gutter), var(--safe-r)); }
.lightbox__foot { padding-bottom: calc(var(--s-2) + var(--safe-b)); padding-left: max(var(--gutter), var(--safe-l)); padding-right: max(var(--gutter), var(--safe-r)); }
/* Le pinch-zoom natif reste autorisé dans la visionneuse */
.lightbox__stage { touch-action: pan-x pan-y pinch-zoom; }

/* Pas de césure automatique : un mot trop long passe à la ligne entier, sans jamais déborder */
p, li, dd, dt, figcaption, h1, h2, h3, h4, .keyfig__label, .skill-card, .mission__title, .bring-card__title, .timeline__title { overflow-wrap: break-word; hyphens: manual; -webkit-hyphens: manual; }
/* Jamais de césure dans les adresses */
.email-link, .hero__links a, .contact__links a, .project__meta a, .cert__link a { hyphens: manual; -webkit-hyphens: manual; overflow-wrap: anywhere; }

/* Texte courant à 16 px minimum sur téléphone ; petits libellés à 14 px */
@media (max-width: 47.99em) {
  :root { --fs-sm: 1rem; --fs-xs: 0.875rem; }
}

/* Écrans tactiles : pas d'effet réservé au survol (évite les états « collés » au toucher) */
@media (hover: none) {
  .gallery__thumb:hover img, .project-card:hover .project-card__arrow { transform: none; }
  .project-card:hover { box-shadow: none; }
}

/* ================= BOUTON « RETOUR EN HAUT » ================= */
.to-top {
  position: fixed; z-index: 90;
  right: max(var(--s-4), var(--safe-r)); bottom: calc(var(--s-4) + var(--safe-b));
  width: 2.75rem; height: 2.75rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-accent); background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid var(--c-accent); border-radius: 50%;
  box-shadow: 0 2px 8px rgba(20, 20, 20, 0.12);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility 0s linear .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s, visibility 0s; }
@media (hover: hover) { .to-top:hover { background: var(--c-accent); color: #fff; } }
body.nav-open .to-top, body.lightbox-open .to-top { opacity: 0; visibility: hidden; }
@media (min-width: 60em) { .to-top { right: max(var(--s-6), var(--safe-r)); bottom: calc(var(--s-6) + var(--safe-b)); } }
/* Le bas du pied de page n'est jamais masqué par le bouton */
.site-footer { padding-bottom: calc(var(--s-7) + 3rem + var(--safe-b)); }

/* ================= PAGE 404 ================= */
.page-404 .site-header__inner { justify-content: space-between; }
.notfound { min-height: calc(100vh - var(--header-total) - 14rem); min-height: calc(100dvh - var(--header-total) - 14rem);
  display: grid; align-content: center; justify-items: center; text-align: center; gap: var(--s-4); padding-block: var(--s-8); }
.notfound__code { margin: 0; font: 700 clamp(5rem, 3rem + 10vw, 9rem)/1 var(--f-head); color: var(--c-accent); letter-spacing: 0.02em; }
.notfound__title { font-size: var(--fs-xl); margin: 0; }
.notfound__text { margin: 0; color: var(--c-muted); font-size: var(--fs-md); }
.notfound__links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-4); }
.notfound__links .btn { min-width: 12rem; }

/* Zones tactiles de 44 px minimum (liens isolés, hors phrases) */
.brand { min-height: 2.75rem; align-items: center; }
.link-button { display: inline-flex; align-items: center; min-height: 2.75rem; }
.cert__link a, .profile__more a { display: inline-block; padding-block: 0.65rem; }
.profile__more a { border-bottom: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
/* Note de confidentialité du hero : lisible sur téléphone */
@media (max-width: 47.99em) { .hero__conf { font-size: var(--fs-sm); } }

/* ================= JAPONAIS ET CHINOIS (CJK) =================
   Sélecteurs :lang() : s'appliquent à la page entière (html lang="ja" / "zh-Hans")
   et à tout élément portant son propre attribut lang (options du sélecteur). */
:lang(ja) {
  --f-head: "Caladea", var(--f-cjk-ja);
  --f-body: "TCdL Text", var(--f-cjk-ja);
}
:lang(zh) {
  --f-head: "Caladea", var(--f-cjk-zh);
  --f-body: "TCdL Text", var(--f-cjk-zh);
}
/* Un nom de langue latin (« Français », « English ») dans une page CJK garde la police de la charte */
:lang(ja) :lang(fr), :lang(ja) :lang(en), :lang(zh) :lang(fr), :lang(zh) :lang(en) {
  --f-head: "Caladea", Georgia, "Times New Roman", serif;
  --f-body: "TCdL Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html:lang(ja), html:lang(zh) {
  --lh-base: 1.75;                  /* interligne plus aéré */
  --lh-tight: 1.4;
  --fs-xs: 0.875rem;                /* 14 px minimum, même sur grand écran */
  --ls-caps: 0;
}
html:lang(ja) body, html:lang(zh) body {
  line-break: strict;               /* pas de ponctuation ni de petit kana en début de ligne */
  word-break: normal;
  font-synthesis: weight;           /* jamais d'italique synthétique ; le gras reste possible */
  text-autospace: normal;           /* fine espace automatique entre CJK et latin (navigateurs récents) */
}
/* Césure toujours désactivée ; coupure de secours n'importe où pour les chaînes trop longues */
:is(html:lang(ja), html:lang(zh)) :is(p, li, dd, dt, figcaption, h1, h2, h3, h4, a, button, .keyfig__label, .keyfig__value, .skill-card, .pill, .mission__title, .bring-card__title, .timeline__title) {
  overflow-wrap: anywhere; hyphens: manual; -webkit-hyphens: manual;
}
/* Pas de lettrage espacé ni de capitales (inutiles en CJK) */
:is(html:lang(ja), html:lang(zh)) :is(.eyebrow, .subhead, .block-title, .takeaway__title, .timeline__date, .phase__weeks, .btn, .site-nav__list a, .matrix thead th, .project-card__tags, .lang-switch__btn) {
  letter-spacing: 0; text-transform: none;
}
/* Pas d'italique : légendes et mentions en gris, droites */
:is(html:lang(ja), html:lang(zh)) :is(figcaption, .contact__refs, em, i) { font-style: normal; }
/* Interlignes des petits blocs qui passent sur plusieurs lignes */
:is(html:lang(ja), html:lang(zh)) :is(.keyfig__label, .skill-card, .pill, .project-card__figure, .mission__title, .timeline__date, .phase__weeks, .phase__name, .eyebrow, .subhead, .block-title, .takeaway__title, .btn, .more-toggle, .lang-notice__text) { line-height: 1.55; }
:is(html:lang(ja), html:lang(zh)) :is(.takeaway p, .profile__summary, .intl-feature__text p, .contact__text) { line-height: 1.8; }
:is(html:lang(ja), html:lang(zh)) .keyfig__value { line-height: 1.25; }
:is(html:lang(ja), html:lang(zh)) .gallery__figure figcaption { line-height: 1.6; }
/* Japonais : coupure de ligne entre groupes de mots (évite « マン / ション ») — Chrome, Edge ; ignoré ailleurs */
html:lang(ja) :is(h1, h2, h3, h4, .btn, .eyebrow, .pill, .keyfig__label, .skill-card, .project-card__figure, .more-toggle, .site-nav__list a, .phase__name, .mlist__skill, .matrix th) {
  word-break: auto-phrase;
}
/* Chiffres clés sur téléphone : valeurs CJK un peu plus petites (« 9〜10週間 », « 250件以上 » tiennent sur une ligne) */
@media (max-width: 47.99em) {
  :is(html:lang(ja), html:lang(zh)) .keyfig__value { font-size: var(--fs-lg); }
}
/* En-tête desktop : libellés du menu sur une ligne, bouton PDF autorisé sur deux lignes */
@media (min-width: 60em) {
  :is(html:lang(ja), html:lang(zh)) .site-nav__list a { white-space: nowrap; }
  :is(html:lang(ja), html:lang(zh)) .site-nav__list { gap: var(--s-4); }
  :is(html:lang(ja), html:lang(zh)) .site-nav { gap: var(--s-4); }
  :is(html:lang(ja), html:lang(zh)) .site-nav__pdf { max-width: 12.5rem; line-height: 1.25; padding-block: var(--s-1); }
}

/* ================= IMPRESSION =================
   Tout le contenu est imprimé : détail des projets déplié, animations neutralisées. */
@media print {
  .site-header, .skip-link, .lang-notice, .to-top, .more-toggle, .detail-all, .gallery__zoom, .lightbox { display: none !important; }
  main { padding-top: 0; }
  .project__detail[hidden] { display: grid !important; content-visibility: visible !important; margin-top: var(--s-6); }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .hero__figs { display: none !important; }
  .project, .keyfig, .takeaway, .mission, figure { break-inside: avoid; }
}
