/* ==========================================================================
   Portfolio Yanis Durand — feuille de style unique (toutes les pages)

   Sommaire
   01. Variables
   02. Base, accessibilité
   03. Grille de fond, header, barre de progression
   04. Menu mobile
   05. Animations d'apparition (reveal, titres, lignes)
   06. Accueil : hero
   07. Sections : libellés, titres
   08. Projets (cartes)
   09. À propos
   10. Boutons
   11. Compétences
   12. Contact, footer
   13. Transition entre les pages
   14. Pages projet
   15. Page 404
   16. Responsive (du plus grand au plus petit écran)
   17. Écrans tactiles
   18. Mouvement réduit
   19. Téléphone et tablette (placé avant le 18 pour que le mouvement réduit garde le dernier mot)
   ========================================================================== */

/* 01. VARIABLES ============================================================ */
:root {
  --bg-color: #050505;
  --text-main: #ffffff;
  --text-muted: #888888;
  --text-nav: #b5b5b5;
  --accent-green: #00ff66;
  --grid-line: rgba(255, 255, 255, 0.12);
  --font-heading: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* marge latérale : 5 % de l'écran, et le contenu ne dépasse jamais 1800 px */
  --margin-m: max(5vw, calc((100vw - 1800px) / 2));
  --content-w: calc(100vw - (var(--margin-m) * 2));
  --header-h: 80px;
  --section-gap: clamp(72px, 9vw, 130px);
  --radius: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 02. BASE, ACCESSIBILITÉ ================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 140px;          /* les ancres s'arrêtent sous le header */
  scrollbar-width: none;              /* barre de défilement masquée : la barre de progression la remplace */
}
html::-webkit-scrollbar { display: none; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg { display: block; max-width: 100%; }

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

:focus-visible { outline: 2px solid var(--accent-green); outline-offset: 4px; border-radius: 4px; }

/* texte lu par les lecteurs d'écran mais invisible à l'écran */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: -64px; z-index: 3000;
  padding: 10px 16px; border-radius: 6px;
  background: #fff; color: #050505;
  font-size: 14px; text-decoration: none;
  transition: top 0.3s var(--ease-out);
}
.skip:focus { top: 12px; }

/* 03. GRILLE DE FOND, HEADER, BARRE DE PROGRESSION ========================= */
.grid-wrapper {
  position: fixed;
  top: 0; bottom: 0;                  /* suit la vraie hauteur visible (barres mobiles comprises) */
  left: var(--margin-m);
  width: var(--content-w);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  pointer-events: none;
  z-index: 1;
  border-left: 1px solid var(--grid-line);
  border-right: 1px solid var(--grid-line);
  /* les traits apparaissent sous le header, très progressivement */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 130px,
    rgba(0,0,0,.03) 160px, rgba(0,0,0,.1) 200px, rgba(0,0,0,.22) 250px, rgba(0,0,0,.4) 310px,
    rgba(0,0,0,.62) 370px, rgba(0,0,0,.82) 420px, rgba(0,0,0,.95) 460px, #000 500px);
  mask-image: linear-gradient(to bottom, transparent 0, transparent 130px,
    rgba(0,0,0,.03) 160px, rgba(0,0,0,.1) 200px, rgba(0,0,0,.22) 250px, rgba(0,0,0,.4) 310px,
    rgba(0,0,0,.62) 370px, rgba(0,0,0,.82) 420px, rgba(0,0,0,.95) 460px, #000 500px);
}
.grid-wrapper .col { height: 100%; border-right: 1px solid var(--grid-line); transform-origin: top; }
.grid-wrapper .col:last-child { border-right: none; }
/* entrée : les colonnes se dessinent une à une */
.js:not(.ready) .grid-wrapper .col { transform: scaleY(0); }
.js.ready .grid-wrapper .col { animation: colIn 1.8s var(--ease-out) calc(var(--i, 0) * 90ms + 100ms) backwards; }
@keyframes colIn { from { transform: scaleY(0); } }

header {
  position: fixed;
  top: 0; left: var(--margin-m);
  width: var(--content-w);
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  -webkit-backdrop-filter: blur(30px) saturate(0.8);
  backdrop-filter: blur(30px) saturate(0.8);
  /* vignette longue et progressive sur les côtés, qui finit en noir plein
     pour se fondre sans coupure dans le fond de la page */
  background-image: linear-gradient(to right,
    #000 0,
    rgba(5, 5, 5, 0.94)  8px,
    rgba(5, 5, 5, 0.8)   28px,
    rgba(5, 5, 5, 0.62)  56px,
    rgba(5, 5, 5, 0.48)  92px,
    rgba(5, 5, 5, 0.42) 140px,
    rgba(5, 5, 5, 0.42) calc(100% - 140px),
    rgba(5, 5, 5, 0.48) calc(100% - 92px),
    rgba(5, 5, 5, 0.62) calc(100% - 56px),
    rgba(5, 5, 5, 0.8)  calc(100% - 28px),
    rgba(5, 5, 5, 0.94) calc(100% - 8px),
    #000 100%);
  transition: transform 1s var(--ease-out), opacity 0.8s ease;
}
.js:not(.ready) header { transform: translateY(-100%); opacity: 0; }

.header-logo a { display: block; line-height: 0; }
.header-logo img { height: 34px; width: auto; }

.header-nav { display: flex; align-items: center; gap: 40px; }
.header-nav a {
  position: relative;
  color: var(--text-nav);
  text-decoration: none;
  font-size: 15px;
  font-weight: 450;
  white-space: nowrap;
  transition: color 0.3s var(--ease-out), opacity 0.8s ease, transform 0.8s var(--ease-out);
  transition-delay: 0s, calc(0.5s + var(--n, 0) * 70ms), calc(0.5s + var(--n, 0) * 70ms);
}
.js:not(.ready) .header-nav a { opacity: 0; transform: translateY(-8px); }
.header-nav a:hover,
.header-nav a.is-active { color: #fff; }

/* contact : toujours vert, avec soulignement animé */
.header-nav a.contact-link,
.header-nav a.contact-link.is-active { color: var(--accent-green); }
.header-nav a.contact-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease-out);
}
.header-nav a.contact-link:hover::after { transform: scaleX(1); transform-origin: left; }

.header-line,
.progress-bar {
  position: fixed;
  top: var(--header-h); left: var(--margin-m);
  width: var(--content-w);
  height: 1px;
  transform-origin: left;
}
.header-line {
  z-index: 1000;
  background-color: var(--grid-line);
  transition: transform 1.8s var(--ease-out) 0.3s;
}
.js:not(.ready) .header-line { transform: scaleX(0); }
.progress-bar {
  z-index: 1001;
  background-color: #fff;
  transform: scaleX(0);
  will-change: transform;
}

/* 04. MENU MOBILE ========================================================== */
.nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  margin-right: -8px;
  background: none; border: 0; color: #fff; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  position: absolute; left: 11px; right: 11px; height: 1.5px;
  background: currentColor;
  transition: transform 0.5s var(--ease-out), top 0.5s var(--ease-out);
}
.nav-toggle span:nth-child(1) { top: 17px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0;
  z-index: 960;                       /* au-dessus du bouton retour des pages projet, sous le header */
  display: none;
  flex-direction: column; justify-content: center;
  padding: 100px var(--margin-m) calc(40px + env(safe-area-inset-bottom));
  background: rgba(5, 5, 5, 0.97);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 0.5s ease, visibility 0s 0.5s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transition: opacity 0.5s ease; }
.mobile-menu a {
  display: block;
  padding: 0.35em 0;
  border-bottom: 1px solid var(--grid-line);
  font-size: clamp(2rem, 10vw, 3.4rem);
  font-weight: 450; letter-spacing: -0.03em; line-height: 1.15;
  color: var(--text-nav); text-decoration: none;
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.8s var(--ease-out), color 0.3s ease;
}
.mobile-menu.open a {
  opacity: 1; transform: none;
  transition-delay: calc(0.15s + var(--n, 0) * 60ms), calc(0.15s + var(--n, 0) * 60ms), 0s;
}
.mobile-menu a.is-active { color: #fff; }
.mobile-menu a.contact-link { color: var(--accent-green); }

/* 05. ANIMATIONS D'APPARITION ============================================== */
/* Tout est visible par défaut : les états cachés ne s'appliquent que si le
   JavaScript tourne (classe .js posée dans le <head>). Sans JS, rien ne reste invisible. */
.reveal {
  transition:
    opacity   0.9s var(--ease-out),
    transform 1.1s var(--ease-out),
    filter    0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
:where(.js) .reveal:not(:where(.in-view)) { opacity: 0; transform: translateY(40px); filter: blur(10px); }

/* gros titres ligne par ligne ; le masque est agrandi vers le bas pour ne pas couper les jambages (g, p) */
.line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.22em;
  margin-bottom: -0.22em;
}
.line-mask > span {
  display: block;
  transition: transform 1s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
:where(.js) .line-mask > span:not(.sp) { transform: translateY(105%); }
.in-view .line-mask > span { transform: none; }

/* titres découpés en mots (JS) : chaque mot monte avec un léger basculement */
.wm {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.22em;
  margin-bottom: -0.22em;
}
.wd {
  display: inline-block;
  transform: translateY(112%) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0ms) + var(--i, 0) * 55ms);
}
.in-view .wd { transform: none; }

/* ces blocs ont leur propre animation interne : pas de fondu/flou global */
.hero-title-container.reveal,
.section-title.reveal,
.contact-title.reveal,
.pj-title.reveal,
.project-card.reveal,
.pcover.reveal,
.pvid.reveal { opacity: 1; transform: none; filter: none; }

/* 06. ACCUEIL : HERO ======================================================= */
.hero-container {
  position: relative;
  z-index: 2;
  display: flex; flex-direction: column;
  margin-left: var(--margin-m);
  width: var(--content-w);
  min-height: 100vh;
  min-height: 100svh;
  padding-top: 98px;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.status-badge { display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.8); }
}

.hero-title-container {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  width: 100%;
  padding: 2rem 0 118px;              /* compense la barre du haut : centre réel sur l'écran */
}
.hero-title {
  font-size: clamp(3rem, 6.7vw, 7rem);
  font-weight: 450;
  line-height: 1.24;
  letter-spacing: -0.03em;
}

/* mot qui change, lettre par lettre */
.dynamic-line {
  display: block;
  position: relative;
  height: 1.45em;                     /* assez haut pour les jambages */
  overflow: hidden;
  width: 100%;
}
.dynamic-text {
  position: absolute;
  top: 0; left: 0;
  white-space: nowrap;
  color: var(--accent-green);
}
html:not(.js) .dynamic-text:not(.active) { display: none; }
.dl {
  display: inline-block;
  white-space: pre;
  transform: translateY(130%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 26ms);
}
.dynamic-text.active .dl { transform: none; transition-delay: calc(0.12s + var(--i, 0) * 26ms); }
.dynamic-text.exit .dl {
  transform: translateY(-130%);
  transition-duration: 0.7s;
  transition-delay: calc(var(--i, 0) * 16ms);
}
.dynamic-text.reset .dl { transition: none !important; }
.js:not(.ready) .dynamic-text.active .dl { transform: translateY(130%); transition: none; }

/* 07. SECTIONS : LIBELLÉS, TITRES ========================================== */
.overlay-section {
  position: relative;
  z-index: 10;
  margin-left: var(--margin-m);
  width: var(--content-w);
  padding-top: 60px;
}
.section { position: relative; padding-bottom: var(--section-gap); }

/* chaque section commence par son libellé + une ligne qui sert de séparateur */
.label-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.section-label {
  display: inline-block;
  min-height: 1.5em;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.label-line {
  flex: 1; height: 1px;
  background: var(--grid-line);
  transform: scaleX(0); transform-origin: left;
  transition: transform 1.8s var(--ease-out) 0.2s;
}
.label-row.in-view .label-line { transform: scaleX(1); }
html:not(.js) .label-line { transform: none; }

/* libellé tapé façon terminal (JS) */
.section-label.typing::after {
  content: '';
  display: inline-block;
  width: 0.55em; height: 1em;
  margin-left: 2px;
  background: currentColor;
  vertical-align: -0.15em;
  animation: blink 0.8s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.section-title {
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.section-title .dim { color: var(--accent-green); }
.projects-title { margin-bottom: 56px; --d: 140ms; }

/* 08. PROJETS (CARTES) ===================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
/* Chaque effet agit sur sa propre propriété ou son propre élément, pour que le
   survol ne gêne jamais l'apparition :
     apparition : clip-path sur .card-media | transform sur .rz | animation sur .card-info
     survol     : box-shadow sur .card-media | transform sur l'<img> | flèche
     parallaxe  : transform sur .pz (JS) */
.project-card {
  --accent: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
}
.card-green      { --accent: #81CFC6; }
.card-light-blue { --accent: #4DCBFF; }
.card-skyblue    { --accent: #7CC0F2; }
.card-yellow     { --accent: #ffe500; }
.card-skyblue .card-title { text-transform: uppercase; }

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  clip-path: inset(-40px round 56px);
  transition: clip-path 1.4s var(--ease-out) var(--d, 0ms), box-shadow 0.5s var(--ease-out);
}
.js .project-card:not(.in-view) .card-media { clip-path: inset(100% 0 0 0 round var(--radius)); }

.pz { position: absolute; inset: -7% 0; will-change: transform; }   /* parallaxe (JS) */
.rz { position: absolute; inset: 0; }                                /* zoom d'entrée  */
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 1.1s var(--ease-out);
}
.project-card.in-view .rz { animation: imgIn 1.9s var(--ease-out) var(--d, 0ms) backwards; }
@keyframes imgIn { from { transform: scale(1.3); } }

/* survol : zoom léger + anneau de 2 px décalé de 4 px, avec une lueur à la couleur du projet */
.project-card:hover .card-media img { transform: scale(1.07); }
.project-card:hover .card-media,
.project-card:focus-visible .card-media {
  box-shadow:
    0 0 0 4px var(--bg-color),
    0 0 0 6px var(--accent),
    0 0 28px 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.project-card:focus-visible { outline: none; }

/* barre d'infos en verre posée sur le bas de l'image */
.card-info {
  position: absolute;
  left: 14px; right: 14px; bottom: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "title arrow" "meta arrow";
  align-items: center;
  column-gap: 14px;
  row-gap: 3px;
  padding: 12px 14px 12px 16px;
  border-radius: 12px;
  background: rgba(8, 8, 8, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.js .project-card:not(.in-view) .card-info { opacity: 0; }
.project-card.in-view .card-info { animation: infoIn 1s var(--ease-out) calc(var(--d, 0ms) + 0.8s) backwards; }
@keyframes infoIn { from { opacity: 0; transform: translateY(18px); } }

.card-title {
  grid-area: title;
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.card-meta {
  grid-area: meta;
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.card-meta span + span::before { content: '·'; margin-right: 8px; }
.card-arrow {
  grid-area: arrow;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--accent);
  transition: transform 0.6s var(--ease-out);
}
.card-arrow svg {
  width: 26px; height: 26px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  transform-origin: 29% 71%;          /* pivote depuis la base du trait */
  transition: transform 0.5s var(--ease-out);
}
/* ↗ au repos, se redresse en → au survol */
.project-card:hover .card-arrow { transform: translate(3px, -3px); }
.project-card:hover .card-arrow svg { transform: rotate(45deg); }

/* 09. À PROPOS ============================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.65fr);
  gap: clamp(24px, 4.5vw, 88px);
  align-items: stretch;
}
.about-copy { display: flex; flex-direction: column; align-items: flex-start; }
.about-text {
  font-size: clamp(1.5rem, 2.7vw, 3.1rem);
  font-weight: 450;
  line-height: 1.32;
  letter-spacing: -0.025em;
}
/* chaque mot s'éclaire en continu avec le défilement (--q mis à jour en JS) */
.about-text .aw {
  opacity: calc(0.14 + 0.86 * var(--q, 0));
  transition: opacity 0.2s linear;
}
.about-copy .btn { margin-top: clamp(28px, 3.5vw, 48px); min-width: min(100%, 20rem); justify-content: center; }

/* la photo prend la hauteur du bloc de texte, sa largeur suit la grille */
.about-photo {
  position: relative;
  align-self: stretch;
  min-height: 0;
  border-radius: 4px;
  overflow: hidden;
}
/* la photo grossit avec le défilement, ancrée en bas à droite (--ps mis à jour en JS) */
.photo-scale {
  position: absolute; inset: 0;
  transform: scale(var(--ps, 0.5));
  transform-origin: 100% 100%;
  will-change: transform;
  transition: transform 0.12s linear;
}
.about-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transform: scale(1.03);
  transition: transform 1.2s var(--ease-out), filter 0.8s ease;
}
.about-photo:hover img { transform: scale(1.08); filter: grayscale(0); }

/* 10. BOUTONS ============================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 48px;
  padding: 12px 22px;
  border: 1px solid var(--grid-line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #fff;
  transform: translateY(101%);
  transition: transform 0.6s var(--ease-out);
}
.btn:hover { color: #050505; border-color: #fff; }
.btn:hover::before { transform: translateY(0); }
.btn span { position: relative; z-index: 1; transition: transform 0.5s var(--ease-out); }

/* 11. COMPÉTENCES ========================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: start;
}
.skills-tools-label {
  display: block;
  margin: 44px 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 10px;
  list-style: none;
  border: 1px dashed var(--grid-line);
  border-radius: 14px;
}
.tool {
  --brand: var(--accent-green);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: transform 0.6s var(--ease-out), opacity 0.6s ease, color 0.3s ease,
              border-color 0.3s ease, background 0.3s ease;
}
.tool svg { width: 26px; height: 26px; }
.tool-figma svg { width: 17px; height: 26px; }
.tool-figma svg * { fill: currentColor; transition: fill 0.3s ease; }
/* apparition en cascade, puis les délais sont retirés (.done) pour un survol immédiat */
.js .tools:not(.in-view) .tool { opacity: 0; transform: scale(0.5) translateY(12px); }
.tools.in-view:not(.done) .tool {
  transition-delay: calc(var(--i, 0) * 80ms + 350ms), calc(var(--i, 0) * 80ms + 350ms), 0s, 0s, 0s;
}
/* blanc au repos, couleur de marque au survol */
.tool:hover {
  transform: translateY(-3px);
  color: var(--brand);
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.tool-figma:hover { color: #fff; border-color: #A259FF; background: rgba(162, 89, 255, 0.12); }
.tool-figma:hover .f1 { fill: #F24E1E; }
.tool-figma:hover .f2 { fill: #FF7262; }
.tool-figma:hover .f3 { fill: #A259FF; }
.tool-figma:hover .f4 { fill: #1ABCFE; }
.tool-figma:hover .f5 { fill: #0ACF83; }

.skills-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.skill {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  font-weight: 450;
  letter-spacing: -0.01em;
}
.skill-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--grid-line);
  color: var(--accent-green);
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.skill-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.6; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
/* contour des icônes tracé à l'apparition (pathLength="1") */
.js .skill:not(.in-view) .skill-icon svg :is(path, rect, circle) { opacity: 0; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.skill.in-view .skill-icon svg :is(path, rect, circle) {
  stroke-dasharray: 1 1; stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.3s var(--ease-out) calc(var(--d, 0ms) + 250ms),
              opacity 0.01s linear calc(var(--d, 0ms) + 250ms);
}
.skill-name { transition: transform 0.5s var(--ease-out); }
.skill:hover .skill-icon {
  background: var(--accent-green);
  color: #050505;
  border-color: var(--accent-green);
  box-shadow: 0 0 18px rgba(0, 255, 102, 0.35);
}
.skill:hover .skill-name { transform: translateX(6px); }

/* 12. CONTACT, FOOTER ====================================================== */
.contact-title {
  max-width: 78%;
  font-size: clamp(2.2rem, 4.4vw, 4.2rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

footer {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: var(--margin-m);
  width: var(--content-w);
  padding: 34px 0 44px;
  border-top: 1px solid var(--grid-line);
  font-size: 13px;
  color: var(--text-muted);
}
footer nav { display: flex; gap: 30px; }
footer a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease; }
footer a:hover { color: #fff; }
footer a.green { color: var(--accent-green); }

/* 13. TRANSITION ENTRE LES PAGES =========================================== */
/* 8 bandes alignées sur la grille ; .wipe-cover (posé dans le <head>) couvre la page
   dès son ouverture pour éviter tout flash avant l'animation de sortie des bandes */
#pjWipe { position: fixed; inset: 0; z-index: 950; display: flex; pointer-events: none; }
#pjWipe i { flex: 1; transform: scaleY(0); background: #0b0b0b; border-left: 1px solid rgba(255, 255, 255, 0.07); }
.wipe-cover #pjWipe i { transform: scaleY(1); }

/* 14. PAGES PROJET ========================================================= */
/* fond noir conservé : seule la couleur d'accent change selon le projet */
.theme-terra  { --accent: #cee44a; }
.theme-mmi    { --accent: #4DCBFF; }
.theme-vichy  { --accent: #7CC0F2; }
.theme-choeur { --accent: #ffe500; }

/* header quasi opaque : lisible même au-dessus d'une vidéo ou d'une image claire */
body[data-page="projet"] header,
body[data-page="404"] header {
  background-image: none;
  background-color: rgba(5, 5, 5, 0.92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
body[data-page="projet"] .header-line { background-color: color-mix(in srgb, var(--accent) 28%, transparent); }
body[data-page="projet"] .progress-bar { background-color: var(--accent); }

.pj-main {
  position: relative;
  z-index: 2;
  margin-left: var(--margin-m);
  width: var(--content-w);
  padding-top: 120px;
  padding-bottom: var(--section-gap);
  text-align: center;
}

/* bouton retour qui suit le défilement : se réduit en rond en descendant, se redéploie en remontant */
.pj-top {
  position: sticky; top: 96px; z-index: 900;
  height: 44px;
  margin-bottom: clamp(8px, 1.5vw, 16px);
  text-align: left;
  pointer-events: none;
}
.pj-back {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px;
  padding: 0 18px 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 99px;
  background-color: rgba(5, 5, 5, 0.78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-mono); font-size: 12px; color: #fff;
  text-decoration: none;
  white-space: nowrap;
  pointer-events: auto;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease,
              padding 0.45s var(--ease-out), gap 0.45s var(--ease-out);
}
.pj-back .arr {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; line-height: 0;
  color: var(--accent);
  transition: transform 0.4s var(--ease-out), color 0.3s ease;
}
.pj-back .lbl { display: inline-block; overflow: hidden; max-width: 14em; transition: max-width 0.45s var(--ease-out), opacity 0.3s ease; }
.pj-back:hover { background-color: var(--accent); border-color: var(--accent); color: #050505; }
.pj-back:hover .arr { color: #050505; transform: translateX(-4px); }
.pj-back.is-compact:not(:hover):not(:focus-visible) { padding: 0 12px; gap: 0; }
.pj-back.is-compact:not(:hover):not(:focus-visible) .lbl { max-width: 0; opacity: 0; }

/* libellé centré, avec une ligne de chaque côté */
.pj-main .label-row { justify-content: center; margin-bottom: clamp(20px, 2.5vw, 32px); }
.pj-main .label-row::before {
  content: ''; flex: 1; height: 1px;
  transform: scaleX(0); transform-origin: right;
  transition: transform 1.8s var(--ease-out) 0.2s;
}
.pj-main .label-row.in-view::before { transform: scaleX(1); }
html:not(.js) .pj-main .label-row::before { transform: none; }
.pj-main .label-line, .pj-main .label-row::before { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.pj-main .section-label { color: var(--accent); }

.pj-title {
  margin: 0 0 clamp(20px, 3vw, 40px);
  font-size: clamp(2.2rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.pj-hl { color: var(--accent); }
.pj-lead {
  max-width: 62ch;
  margin: -8px auto clamp(24px, 3vw, 36px);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-muted);
}

.pj-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 24px;
  margin: 0 0 clamp(28px, 4vw, 48px);
  padding: 20px 0;
  border-top: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.pj-meta dt { margin-bottom: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.pj-meta dt::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; margin-right: 8px; vertical-align: 1px;
  border-radius: 50%; background: var(--accent);
}
.pj-meta dd { font-size: 1rem; }
.pj-meta .tag {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 99px;
  font-family: var(--font-mono); font-size: 12px;
}

/* visuel de couverture : révélé par un masque, puis zoom d'entrée et parallaxe */
.pcover {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
  aspect-ratio: var(--ar, 16 / 8);
  background: #111;
}
.pcover .pcut { position: absolute; inset: 0; transition: clip-path 1.5s var(--ease-out); }
.js .pcover:not(.in-view) .pcut { clip-path: inset(100% 0 0 0 round var(--radius)); }
.pcover.in-view .pcut { clip-path: inset(-40px round 56px); }
.pcover.in-view .rz { animation: imgIn 1.9s var(--ease-out) backwards; }
.pcover img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--op, 50% 50%);
  transform: scale(1.01);
}

/* vidéo principale en haut de page, révélée comme la couverture */
.pvid { width: min(100%, 1120px); margin: 0 auto clamp(28px, 4vw, 56px); }
.pvid .pj-vid { transition: clip-path 1.5s var(--ease-out); }
.js .pvid:not(.in-view) .pj-vid { clip-path: inset(100% 0 0 0 round var(--radius)); }
.pvid.in-view .pj-vid { clip-path: inset(-40px round 56px); }

.pj-vid {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
  aspect-ratio: var(--r, 4 / 5);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.45);
}
.pj-vid video { width: 100%; height: 100%; object-fit: cover; }

.pj-main figcaption {
  margin-top: 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.pj-main figcaption.dot::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px; margin-right: 8px;
  border-radius: 50%;
  background: var(--cc, var(--accent));
}

/* variantes de vidéo selon l'écran : 16:9 sur ordinateur et tablette, verticale 4:5 sur téléphone.
   La version masquée n'est jamais chargée ni lue (elle n'entre jamais dans l'écran). */
.only-mob { display: none !important; }

/* blocs « le projet » / « réalisations » */
.pj-block {
  display: grid;
  justify-items: center;
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(28px, 4vw, 56px);
  padding: clamp(32px, 5vw, 64px) 0;
  border-top: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.pj-block > div { width: 100%; }
.pj-block h2 { font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--accent); }

.pj-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(20px, 3vw, 32px);
}
.pj-facts h3 { margin-bottom: 8px; font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--accent); }
.pj-facts p { max-width: 46ch; margin: 0 auto; font-size: 1rem; font-weight: 300; line-height: 1.55; }

.pj-work + .pj-work { margin-top: clamp(40px, 6vw, 72px); }
.pj-work h3 { margin-bottom: 10px; font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 400; letter-spacing: -0.02em; }
.pj-desc { max-width: 62ch; margin: 0 auto 1em; font-size: 1.05rem; font-weight: 300; line-height: 1.6; }

.pj-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; transition: opacity 0.3s ease; }
.pj-link:hover { opacity: 0.75; }

/* Rangées de visuels : tous à la même hauteur (largeur proportionnelle au format, --ar),
   même écart, mêmes coins, légende centrée ; une rangée ne dépasse pas ~620 px de haut.
   --sum = somme des formats de la rangée, --n = nombre de visuels. */
.pj-row {
  --gap: clamp(12px, 2vw, 24px);
  display: flex; align-items: flex-start; gap: var(--gap);
  width: 100%;
  max-width: min(100%, calc(var(--sum) * 620px + (var(--n) - 1) * var(--gap)));
  margin: clamp(20px, 3vw, 32px) auto 0;
}
.pj-row + .pj-row { margin-top: var(--gap); }
.pj-row + .pj-dots + .pj-row { margin-top: var(--gap); }   /* les points des carrousels (téléphone) ne changent pas l'espacement */
.pj-item { flex: var(--ar) 1 0%; min-width: 0; margin: 0; }
.pj-item img { width: 100%; height: auto; border-radius: var(--radius); }

.pj-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: clamp(40px, 6vw, 72px);
  padding: 28px clamp(16px, 2.2vw, 32px) 0;
  border-top: 1px solid var(--grid-line);
}
.pj-nav a {
  display: block;
  min-height: 44px;
  color: #fff;
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  transition: color 0.3s ease;
}
.pj-nav a:hover { color: var(--accent); }
.pj-nav small { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.pj-nav .next { text-align: right; }
.pj-nav .back { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); text-align: center; }

/* 15. PAGE 404 ============================================================= */
.err-main {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  margin-left: var(--margin-m);
  width: var(--content-w);
  min-height: 100vh; min-height: 100svh;
  padding: 120px 0 60px;
}
.err-main .contact-title { max-width: 16ch; }
.err-main .dim-green { color: var(--accent-green); }

/* 16. RESPONSIVE =========================================================== */
@media (max-width: 1100px) {
  .projects-grid { gap: 20px; }
  .skills-grid { gap: 44px; }
}

@media (max-width: 900px) {
  .header-nav { gap: 20px; }
  .header-nav a { font-size: 13px; }
  .header-logo img { height: 28px; }

  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-title { max-width: 100%; }

  footer { flex-direction: column; gap: 22px; align-items: flex-start; padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
  footer nav { flex-wrap: wrap; gap: 12px 24px; }
}

@media (max-width: 900px) and (min-width: 641px) {
  .about-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
  .about-text { font-size: clamp(1.15rem, 2.6vw, 1.5rem); }
}

@media (max-width: 760px) {
  .header-nav { display: none; }
  .nav-toggle { display: block; }
  .mobile-menu { display: flex; }
  header { -webkit-backdrop-filter: blur(16px) saturate(0.8); backdrop-filter: blur(16px) saturate(0.8); }

  .grid-wrapper { grid-template-columns: repeat(4, 1fr); }
  .grid-wrapper .col:nth-child(4) { border-right: none; }
  .grid-wrapper .col:nth-child(n+5) { display: none; }

  .hero-top { flex-wrap: wrap; gap: 6px 16px; font-size: 12px; }
  .hero-title { font-size: clamp(1.6rem, 8vw, 3.2rem); line-height: 1.22; }

  .projects-title { margin-bottom: 36px; }
  .projects-grid { gap: 16px; }
  .card-media { border-radius: 14px; }
  .card-info { left: 10px; right: 10px; bottom: 10px; padding: 10px 12px 10px 14px; }
  .card-title { font-size: 16px; }

  .skills-list { gap: 18px; }
  .contact-title { font-size: clamp(1.7rem, 7.6vw, 2.4rem); }
}

@media (max-width: 700px) {
  .only-desk { display: none !important; }
  .pvid.only-mob { display: block !important; }
  .pj-row.only-mob { display: flex !important; }
  .pj-main { padding-top: 110px; }
  .pcover { aspect-ratio: 4 / 3; }
  .pj-nav { grid-template-columns: 1fr 1fr; padding-inline: 16px; }
  .pj-nav .back { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { aspect-ratio: 4 / 5; max-height: 70vh; max-height: 70svh; align-self: auto; }
}

@media (max-width: 600px) {
  .pj-row { flex-direction: column; max-width: 100%; }
  .pj-item { flex: none; width: 100%; }
}

@media (max-width: 480px) {
  .btn { width: 100%; justify-content: center; }
  .tools { gap: 8px; padding: 8px; }
}

@media (max-height: 520px) {
  .hero-title-container { padding-bottom: 2rem; }
}

/* bloc « à propos » épinglé sous le header (grands écrans uniquement) */
@media (min-width: 901px) and (min-height: 640px) {
  .about-sticky { position: sticky; top: 140px; }
  .about-pin::after { content: ''; display: block; height: 130vh; }   /* distance de défilement épinglé */
}

/* 17. ÉCRANS TACTILES ====================================================== */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  footer a { display: inline-flex; align-items: center; min-height: 44px; }
}
/* pas d'effets de survol « collés » au doigt */
@media (hover: none) {
  .project-card:hover .card-media { box-shadow: none; }
  .project-card:hover .card-media img { transform: scale(1.02); }
  .project-card:hover .card-arrow,
  .project-card:hover .card-arrow svg,
  .skill:hover .skill-name,
  .tool:hover { transform: none; }
}

/* 19. TÉLÉPHONE ET TABLETTE ================================================
   Tout ce bloc ne s'applique qu'en dessous de 1100 px de large (ou sur écran
   tactile) : l'affichage sur ordinateur reste strictement identique. */

.m-only { display: none !important; }
.pj-more { display: none; }
.pj-dots { display: none; }

/* retour tactile immédiat (pas de flash bleu, léger enfoncement au toucher) */
@media (hover: none) {
  a, button { -webkit-tap-highlight-color: transparent; }
  .project-card .card-media { transition: clip-path 1.4s var(--ease-out) var(--d, 0ms), transform 0.35s var(--ease-out); }
  .project-card:active .card-media { transform: scale(0.975); }
  .btn, .pj-back, .mm-mail, .pj-nav a, footer a { transition-property: color, background-color, border-color, transform, padding, gap; }
  .btn:active, .pj-back:active, .mm-mail:active, .pj-nav a:active { transform: scale(0.97); }
  .tool:active { transform: scale(0.92); }
}

/* --- TABLETTE (portrait) : hero plus présent ------------------------------ */
@media (min-width: 761px) and (max-width: 1100px) and (orientation: portrait) {
  .hero-title { font-size: 7.6vw; line-height: 1.16; }
  .hero-title-container { padding-bottom: 22vh; }
}

/* --- CARTES : deux colonnes dès 600 px (tablette, téléphone à l'horizontale) */
@media (min-width: 600px) and (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .card-info { left: 10px; right: 10px; bottom: 10px; padding: 10px 12px 10px 14px; column-gap: 10px; }
  .card-title { font-size: 15px; }
  .card-meta { font-size: 10px; }
  .card-arrow, .card-arrow svg { width: 22px; height: 22px; }
}

/* --- TÉLÉPHONE ------------------------------------------------------------ */
@media (max-width: 760px) {
  :root { --header-h: 64px; --section-gap: 96px; }
  html { scroll-padding-top: 100px; }
  .header-logo img { height: 28px; }
  .nav-toggle { margin-right: -10px; }

  /* menu : liens en haut, disponibilité et bouton e-mail en bas, à portée de pouce */
  .mobile-menu { justify-content: flex-start; padding-top: calc(var(--header-h) + 36px); }
  .mm-foot { margin-top: auto; padding-top: 32px; display: grid; gap: 14px; opacity: 0; transition: opacity 0.6s ease 0.35s; }
  .mobile-menu.open .mm-foot { opacity: 1; }
  .mm-status { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
  .mobile-menu .mm-foot a.mm-mail {
    display: flex; align-items: center; justify-content: center;
    min-height: 54px; padding: 0 20px; border: 0; border-radius: 99px;
    background: var(--accent-green); color: #050505;
    font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0;
    opacity: 1; transform: none;
  }


  /* sections */
  .label-row { margin-bottom: 24px; }
  .section-title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .projects-title { margin-bottom: 28px; }

  /* à propos : photo plus compacte, alignée à droite comme sur ordinateur */
  .about-text { font-size: clamp(1.35rem, 6vw, 1.6rem); line-height: 1.34; }
  .about-photo { width: 66%; margin-left: auto; aspect-ratio: 4 / 5; max-height: none; }
  .about-copy .btn { width: 100%; }

  /* compétences : les 7 outils sur une seule ligne, services séparés par des filets */
  .skills-tools-label { margin-top: 32px; }
  .tools { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; gap: 6px; padding: 8px; }
  .tool { width: auto; height: auto; aspect-ratio: 1; border-radius: 9px; }
  .tool svg { width: 58%; height: 58%; }
  .tool-figma svg { width: 40%; height: 58%; }
  .skills-grid { gap: 40px; }
  .skills-list { gap: 0; border-top: 1px solid var(--grid-line); }
  .skill { padding: 14px 0; border-bottom: 1px solid var(--grid-line); font-size: 1.08rem; }
  .skill-icon { width: 38px; height: 38px; }

  /* contact : le titre coule sans retours à la ligne forcés, bouton pleine largeur */
  .contact-title { font-size: clamp(1.9rem, 8.6vw, 2.5rem); line-height: 1.12; }
  .contact-title .line-mask, .contact-title .line-mask > span { display: inline; padding: 0; margin: 0; }
  #contact .btn { width: 100%; justify-content: center; min-height: 56px; font-size: 13px; }

  /* footer : liens plus grands et faciles à toucher */
  footer { gap: 26px; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 12px; }
  footer nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; width: 100%; }
  footer nav a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--grid-line); font-size: 15px; color: #fff; }
  footer nav a.green { color: var(--accent-green); }

  /* --- pages projet --- */
  .pj-title { font-size: clamp(2.3rem, 11vw, 3.2rem); line-height: 1.02; }
  /* fiche du projet épurée : pas de puces ni d'étiquettes encadrées, une seule ligne fine au-dessus */
  .pj-meta { grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-bottom: 28px; padding: 18px 0 0; border-bottom: 0; border-top-color: var(--grid-line); }
  .pj-meta dt { margin-bottom: 4px; font-size: 11px; }
  .pj-meta dt::before { display: none; }
  .pj-meta dd { font-size: 0.9rem; line-height: 1.4; color: #d6d6d6; }
  .pj-meta .tag { display: inline; margin: 0; padding: 0; border: 0; border-radius: 0; font-family: inherit; font-size: inherit; }
  .pj-meta .tag + .tag::before { content: ', '; }
  .pj-lead { font-size: 1rem; line-height: 1.55; margin-bottom: 24px; }

  /* bouton retour : simple rond fléché, discret */
  .pj-back, .pj-back.is-compact { width: 48px; padding: 0; gap: 0; justify-content: center; }
  .pj-back .lbl { max-width: 0; opacity: 0; }
  .pj-block { justify-items: stretch; padding: 40px 0; margin-top: 28px; }
  .pj-facts { grid-template-columns: 1fr; gap: 26px; }
  .pj-facts p, .pj-desc { margin: 0; max-width: none; }
  .pj-desc { margin-bottom: 0.6em; }
  .pj-work + .pj-work { margin-top: 48px; }


}

/* --- PAGES PROJET sur tablette et téléphone (portrait et paysage) ---------- */
@media (max-width: 900px), (max-height: 500px) and (orientation: landscape) {
  /* texte aligné à gauche : bien plus confortable à lire que des paragraphes centrés */
  .pj-main { padding-top: calc(var(--header-h) + 32px); text-align: left; }
  .pj-main .label-row { justify-content: flex-start; }
  .pj-main .label-row::before { display: none; }
  .pj-main figcaption { text-align: left; }
  .pj-lead, .pj-facts p, .pj-desc { margin-left: 0; margin-right: 0; }
  .pj-block { justify-items: stretch; }

  /* bouton retour : flotte en bas à gauche, à portée de pouce, sans masquer les images */
  .pj-top { position: fixed; top: auto; left: var(--margin-m); bottom: calc(16px + env(safe-area-inset-bottom)); height: auto; margin: 0; }
  .pj-top.reveal { opacity: 1; transform: none; filter: none; }   /* fixé en bas : toujours visible */
  .pj-back { box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.7); background-color: rgba(10, 10, 10, 0.88); height: 48px; }
  /* le bouton disparaît en bas de page, où la navigation entre projets prend le relais */
  .pj-top { transition: opacity 0.4s ease, transform 0.5s var(--ease-out); }
  .pj-top.is-away { opacity: 0 !important; transform: translateY(16px) !important; pointer-events: none; }
  .pj-top.is-away .pj-back { pointer-events: none; }

  /* navigation entre projets : la carte du projet suivant (comme sur l'accueil) + deux boutons */
  .pj-nav { display: none; }
  .pj-more { display: block; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--grid-line); }
  .pj-more-label { margin-bottom: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
  .pj-more .card-title { display: block; }
  .pj-more .card-meta { display: flex; }
  .pj-more-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
  .pj-more-actions .btn { margin: 0; justify-content: center; min-height: 50px; border-radius: 99px; color: #fff; border-color: var(--grid-line); }
}

/* --- GALERIES DES PAGES PROJET : carrousel à faire glisser sur téléphone --- */
@media (max-width: 600px) {
  .pj-row:has(> .pj-item + .pj-item) {
    flex-direction: row;
    gap: 12px;
    max-width: none;
    margin-inline: calc(var(--margin-m) * -1);
    padding-inline: var(--margin-m);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--margin-m);
    scrollbar-width: none;
  }
  .pj-row:has(> .pj-item + .pj-item)::-webkit-scrollbar { display: none; }
  .pj-row:has(> .pj-item + .pj-item) > .pj-item { flex: 0 0 80%; width: auto; scroll-snap-align: start; }
  .pj-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
  .pj-dots button {
    width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer;
    display: grid; place-items: center;
  }
  .pj-dots button::before {
    content: ''; width: 6px; height: 6px; border-radius: 99px; background: var(--grid-line);
    transition: width 0.4s var(--ease-out), background-color 0.3s ease;
  }
  .pj-dots button[aria-current="true"]::before { width: 18px; background: var(--accent); }
}

/* --- TÉLÉPHONE À L'HORIZONTALE : header plus fin, hero compact --- */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --header-h: 60px; }
  html { scroll-padding-top: 90px; }
  .header-logo img { height: 26px; }
  .hero-container { padding-top: calc(var(--header-h) + 14px); }
  .hero-title { font-size: 6.4vw; line-height: 1.1; }
  .hero-title-container { padding: 1rem 0 2rem; }
  .mobile-menu { padding-top: calc(var(--header-h) + 16px); }
  .mobile-menu a { font-size: 1.7rem; }
}

/* 20. ACCUEIL PENSÉ POUR LE TÉLÉPHONE ========================================
   Une vraie mise en page mobile, pas une réduction de l'ordinateur :
   échelle typographique propre, contenu dans la zone du pouce, infos sous les visuels.
   Échelle : titre principal 9,2 vw (≈ 36 px) · titres de section 7,4 vw (≈ 29 px)
             · texte courant 15-21 px · repères en mono 11-12 px. */
@media (max-width: 760px) {
  .m-only { display: revert !important; }
  .grid-wrapper { opacity: 0.55; }                 /* grille plus discrète : moins de bruit derrière le texte */

  /* --- hero centré : repères, titre sur les 3 lignes de l'ordinateur, actions en bas --- */
  .hero-container { display: flex; flex-direction: column; min-height: 100svh; padding-top: calc(var(--header-h) + 20px); padding-bottom: calc(22px + env(safe-area-inset-bottom)); text-align: center; }
  .hero-top { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; font-size: 12px; }
  .hero-top .status-badge {
    padding: 6px 11px 6px 9px; border: 1px solid rgba(0, 255, 102, 0.28); border-radius: 99px;
    background: rgba(0, 255, 102, 0.06); color: #d8ffe6; font-size: 11px; white-space: nowrap;
  }
  /* « disponible » seul sur téléphone ; la phrase complète reste lue par les lecteurs d'écran */
  .hero-top .status-badge span:last-child { font-size: 0; }
  .hero-top .status-badge span:last-child::after { content: 'disponible'; font-size: 11px; }
  .hero-title-container { flex: 1; justify-content: center; align-items: center; padding: 28px 0; }
  .hero-title { width: 100%; font-size: 8.6vw; line-height: 1.18; letter-spacing: -0.035em; }   /* 9,3 vw max : au-delà, « Création de contenus » ne tient plus */
  .dynamic-line { line-height: 1.2; height: 1.3em; }
  .dynamic-text { left: 50%; transform: translateX(-50%); }
  .hero-m { display: block !important; margin-top: 0; }
  .hero-sub, .hero-foot { display: none !important; }
  .hero-ctas { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; margin-top: 0; }
  .hero-cta {
    display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 16px;
    border: 1px solid var(--grid-line); border-radius: 99px;
    font-family: var(--font-mono); font-size: 12px; color: #fff; text-decoration: none;
    transition: transform 0.3s var(--ease-out), background-color 0.3s ease;
  }
  .hero-cta.is-primary { background: var(--accent-green); border-color: var(--accent-green); color: #050505; font-weight: 700; }
  .hero-cta:active { transform: scale(0.97); }

  /* --- titres de section : un cran sous le titre principal --- */
  .section { padding-bottom: 88px; }
  .label-row { margin-bottom: 18px; }
  .section-title { font-size: clamp(1.75rem, 7.4vw, 2.3rem); line-height: 1.08; letter-spacing: -0.035em; }
  .projects-title { margin-bottom: 30px; }
  #projets .label-row::after { content: '(04)'; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

  /* --- projets : visuel entier, informations numérotées dessous --- */
  .projects-grid { gap: 40px; counter-reset: pcard; }
  .project-card { counter-increment: pcard; }
  .card-media { border-radius: 14px; }
  .card-info {
    position: static; margin-top: 14px; padding: 0;
    background: none; border: 0; border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    grid-template-areas: "num arrow" "title arrow" "meta arrow";
    row-gap: 5px; column-gap: 16px;
  }
  .card-info::before { content: '0' counter(pcard); grid-area: num; font-family: var(--font-mono); font-size: 11px; color: var(--accent); }
  .card-title { font-size: 20px; letter-spacing: -0.02em; }
  .card-meta { font-size: 11px; font-weight: 400; color: var(--text-muted); }
  .card-arrow {
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  }
  .card-arrow svg { width: 18px; height: 18px; }
  .pj-more .card-info::before { content: none; }
  .pj-more .card-info { grid-template-areas: "title arrow" "meta arrow"; }

  /* --- à propos : fiche profil, puis le texte --- */
  .about-grid { display: grid; grid-template-columns: 64px 1fr; grid-template-areas: "photo id" "copy copy"; column-gap: 14px; row-gap: 26px; align-items: center; }
  .about-photo { grid-area: photo; width: 64px; height: 64px; aspect-ratio: auto; margin: 0; border-radius: 16px; max-height: none; }
  .about-photo .photo-scale { transform: none !important; }
  .about-photo img { object-position: 50% 22%; }
  .about-id { grid-area: id; display: flex !important; flex-direction: column; gap: 3px; }
  .about-id strong { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
  .about-id span { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
  .about-copy { grid-area: copy; }
  .about-text { font-size: clamp(1.25rem, 5.6vw, 1.5rem); line-height: 1.38; letter-spacing: -0.02em; }

  /* --- compétences : les services d'abord, la boîte à outils ensuite --- */
  .skills-grid { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .skills-grid > div:first-child { display: contents; }
  .skills-grid .section-title { order: 1; margin-bottom: 26px; }
  .skills-list { order: 2; }
  .skills-tools-label { order: 3; margin: 36px 0 12px; }
  .tools { order: 4; }
  .skill { padding: 15px 0; font-size: 1.05rem; }

  .btn { border-radius: 99px; min-height: 52px; }                    /* mêmes boutons arrondis partout sur téléphone */
  .btn::before { border-radius: inherit; }

  /* --- contact : titre qui coule, action principale bien visible --- */
  .contact-title { font-size: clamp(1.75rem, 7.6vw, 2.35rem); line-height: 1.12; }
  #contact .btn { margin-top: 32px; background: var(--accent-green); border-color: var(--accent-green); color: #050505; font-weight: 700; }
  #contact .btn::before { background: #fff; }
}

/* 18. MOUVEMENT RÉDUIT ===================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .reveal, :where(.js) .reveal:not(:where(.in-view)) { opacity: 1; transform: none; filter: none; }
  .line-mask > span, .wd, .dl { transform: none !important; }
  .dynamic-text:not(.active) { visibility: hidden; }
  header, .header-line, .header-nav a, .grid-wrapper .col { transform: none !important; opacity: 1 !important; }
  .card-media, .pcover .pcut, .pvid .pj-vid { clip-path: none !important; }
  .card-info, .tools .tool { opacity: 1 !important; transform: none !important; }
  .skill-icon svg :is(path, rect, circle) { opacity: 1 !important; stroke-dashoffset: 0 !important; }
  .label-line, .pj-main .label-row::before { transform: none !important; }
  .photo-scale { transform: none !important; }
  .pz { transform: none !important; }
  #pjWipe { display: none; }
}
