/* ==========================================================
   PORTFOLIO - styles
   Palette « Bleu sélection » :
     papier #F4F3EF, encre #121317, gris #5C5D63,
     un seul accent : le bleu de sélection des logiciels de design #2F5BFF
   Deux thèmes (clair et sombre) : les couleurs se règlent
   dans :root (clair) et [data-theme="dark"] (sombre).

   Système :
   - typographie : échelle fluide --step-*, une seule famille, Instrument Sans (comme le CV) ;
   - arrondis : 8px (petits éléments), 16px (images, cartes),
     28px (grandes scènes et panneaux), pilule (boutons) ;
   - une seule couleur d'accent, réservée aux boutons, liens et à la sélection.
   ========================================================== */

:root {
  /* couleurs de la palette (fixes) */
  --papier: #f4f3ef;
  --encre: #121317;
  --gris: #5c5d63;
  --bleu: #2f5bff;
  --bleu-clair: #8aa2ff;

  /* thème clair */
  --bg: var(--papier);
  --surface: #ebeae5;
  --surface-2: #e1e0da;
  --text: var(--encre);
  --muted: var(--gris);
  --faint: rgba(18, 19, 23, 0.46);
  --line: rgba(18, 19, 23, 0.12);
  --line-strong: rgba(18, 19, 23, 0.28);
  --accent: var(--bleu);        /* boutons, liens, sélection */
  --on-accent: #fff;
  --select-bg: var(--bleu);
  --select-fg: #fff;
  --shadow: rgba(18, 19, 23, 0.24);
  --shadow-hue: 228 12% 8%;     /* ombres teintées encre */

  --font-display: "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;

  /* échelle typographique fluide */
  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.1rem, 1.02rem + 0.4vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.15rem + 0.9vw, 1.9rem);
  --step-3: clamp(1.9rem, 1.35rem + 2.4vw, 3.4rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.4vw, 5rem);
  --step-5: clamp(3.1rem, 1.4rem + 7.4vw, 9.6rem);

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --nav-h: 76px;
  --section: clamp(104px, 17vh, 200px);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  /* courbes (animations) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* calques (z-index) */
  --z-menu: 58;
  --z-nav: 60;
  --z-progress: 61;
  --z-skip: 100;

  color-scheme: light;
}

/* thème sombre */
[data-theme="dark"] {
  --bg: var(--encre);
  --surface: #1c1d22;
  --surface-2: #26272d;
  --text: #edece8;
  --muted: #9c9da3;
  --faint: rgba(237, 236, 232, 0.44);
  --line: rgba(237, 236, 232, 0.12);
  --line-strong: rgba(237, 236, 232, 0.28);
  --accent: var(--bleu-clair);
  --on-accent: var(--encre);
  --select-bg: var(--bleu-clair);
  --select-fg: var(--encre);
  --shadow: rgba(0, 0, 0, 0.55);
  --shadow-hue: 230 14% 4%;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-padding-top: var(--nav-h); }
/* liens internes (#projets…) : défilement doux, sauf si l'ordinateur demande de réduire les animations */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3, blockquote { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--select-bg); color: var(--select-fg); }
time, .tabular { font-variant-numeric: tabular-nums; }

/* changement de thème : les couleurs glissent doucement */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, fill 0.45s ease !important;
}

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

.skip {
  position: fixed;
  left: var(--gutter);
  top: 12px;
  z-index: var(--z-skip);
  transform: translateY(-200%);
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { transform: none; }

/* Titres : Instrument Sans, serrée et posée */
.heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

/* petit titre de section */
.label { display: inline-block; color: var(--muted); font-size: 0.95rem; font-weight: 500; }

/* mots et lignes découpés pour les animations de titre */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.w > span { display: inline-block; }
.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line > span { display: block; }

/* ---------- Logo : cube C S H ---------- */
.logo { width: 100%; height: auto; }


/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s, border-color 0.4s;
}
.nav.is-solid {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav__brand {
  justify-self: start;
  display: block;
  width: 36px;
  color: var(--text);
}

/* page projet : le nom du projet rejoint la signature quand le grand titre sort de l'écran */
.nav__start { justify-self: start; display: flex; align-items: center; gap: 14px; min-width: 0; }
.nav__project {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 100%;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: -0.025em;
  white-space: nowrap;
  text-decoration: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out), visibility 0s linear 0.5s;
}
/* séparateur entre la signature et le nom */
.nav__project::before { content: ""; flex: none; width: 1px; height: 1.1em; background: var(--line-strong); transform: rotate(18deg); }
.nav__project span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav__project.is-visible { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
@media (hover: hover) and (pointer: fine) {
  .nav__project:hover { color: var(--accent); }
}


/* liens au centre ; la section affichée est soulignée */
.nav__links ul { display: flex; gap: clamp(20px, 3vw, 40px); }
.nav__links a,
.nav__cv {
  font-size: 0.95rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  white-space: nowrap;
  transition: text-decoration-color 0.25s;
}
.nav__links a[aria-current] { text-decoration-color: currentColor; }
.nav__cv { display: inline-flex; align-items: center; gap: 6px; }
@media (hover: hover) and (pointer: fine) {
  .nav__links a:hover, .nav__cv:hover { text-decoration-color: currentColor; }
}
.nav__tools { justify-self: end; display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); }

/* bouton rond (thème, menu) */
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s, transform 0.16s var(--ease-out);
}
.icon-btn i { font-size: 1.1rem; }
.icon-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { border-color: currentColor; }
}
/* une seule icône visible : la lune en thème clair, le soleil en thème sombre */
.theme-toggle .ph-sun { display: none; }
[data-theme="dark"] .theme-toggle .ph-sun { display: block; }
[data-theme="dark"] .theme-toggle .ph-moon { display: none; }

/* bouton menu (téléphone) : deux traits qui se croisent à l'ouverture */
.nav__burger { display: none; position: relative; }
.nav__burger span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 1.5px;
  margin-left: -8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.4s var(--ease-out);
}
.nav__burger span:nth-child(1) { transform: translateY(-3.5px); }
.nav__burger span:nth-child(2) { transform: translateY(3.5px); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { transform: rotate(-45deg); }

/* ---------- Menu plein écran (téléphone) ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--nav-h) + 32px) var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease-in-out);
}
.menu[hidden] { display: none; }
.menu.is-open { clip-path: inset(0 0 0 0); }
.menu__list li { border-bottom: 1px solid var(--line); }
.menu__list a {
  display: flex;
  padding: 14px 0;
  font: 600 clamp(2.4rem, 12vw, 3.6rem)/1 var(--font-display);
  font-stretch: 100%;
  letter-spacing: -0.035em;
  text-decoration: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out);
}
.menu.is-open .menu__list a { opacity: 1; transform: none; }
.menu.is-open .menu__list li:nth-child(2) a { transition-delay: 0.06s; }
.menu.is-open .menu__list li:nth-child(3) a { transition-delay: 0.12s; }
.menu__foot { display: grid; gap: 12px; color: var(--muted); }
.menu__foot a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; overflow-wrap: anywhere; }
.has-menu body { overflow: hidden; }

/* Lien texte avec flèche */
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.3s, color 0.3s;
}
.link i { transition: transform 0.4s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .link:hover { color: var(--accent); text-decoration-color: currentColor; }
  .link:hover .ph-arrow-right { transform: translateX(4px); }
  .link:hover .ph-arrow-up-right { transform: translate(2px, -2px); }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 1rem/1 var(--font-body);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  transition: transform 0.16s var(--ease-out), border-color 0.25s, color 0.25s, background-color 0.25s;
}
.btn i { font-size: 1.1em; transition: transform 0.45s var(--ease-out); }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--secondary, .btn--ghost { border-color: var(--line-strong); color: var(--text); }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--text); color: var(--bg); }
  .btn--secondary:hover, .btn--ghost:hover { border-color: var(--text); }
  .btn:hover .ph-arrow-right { transform: translateX(3px); }
  .btn:hover .ph-arrow-down, .btn:hover .ph-download-simple { transform: translateY(2px); }
}

/* ---------- Images (chargement / erreur) ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(110deg, var(--surface) 35%, var(--surface-2) 50%, var(--surface) 65%) 0 0 / 220% 100%;
  animation: shimmer 1.6s linear infinite;
}
.media.is-loaded, .media.is-error { animation: none; background: var(--surface); }
.media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s var(--ease-out); }
.media img.is-loaded { opacity: 1; }
.media.is-error::after {
  content: "Image introuvable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* ==========================================================
   ACCUEIL
   ========================================================== */

/* ---------- Haut de page : titre et mur d'écrans incliné ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--nav-h) + 24px) var(--gutter) clamp(28px, 5vh, 52px);
  overflow: hidden;
  isolation: isolate;
}
/* le mur se fond dans le fond de page côté texte et en bas */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 22%, color-mix(in srgb, var(--bg) 88%, transparent) 44%, color-mix(in srgb, var(--bg) 20%, transparent) 70%, transparent 86%),
    linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 22%, transparent 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 12%, transparent 30%);
}
.hero__content { position: relative; max-width: var(--max); width: 100%; margin: 0 auto; }
.hero__title {
  font-size: clamp(3rem, 1.2rem + 5.6vw, 7.6rem);
  line-height: 0.9;
  max-width: 11em;
}
.hero__foot {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 24px clamp(16px, 2vw, 32px);
  margin-top: clamp(28px, 5vh, 52px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero__intro { grid-column: 1 / span 5; max-width: 46ch; color: var(--muted); font-size: clamp(1rem, 1.1vw, 1.1rem); line-height: 1.55; }
.hero__intro strong { color: var(--text); font-weight: 500; }
.hero__index { grid-column: 7 / span 3; }
.hero__index .label { margin-bottom: 8px; }
.hero__index a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: color 0.25s;
}
.hero__index li:last-child a { border-bottom: 1px solid var(--line); }
.hero__index-title { font-weight: 500; }
.hero__index-type { color: var(--muted); font-size: 0.85rem; }
@media (hover: hover) and (pointer: fine) {
  .hero__index a:hover { color: var(--accent); }
}
.hero__cta { grid-column: 11 / span 2; justify-self: end; }

/* Le mur : colonnes d'écrans des projets, sur un plan incliné en 3D (immobile) */
.wall {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  perspective: 1700px;
  perspective-origin: 70% 30%;
  pointer-events: none;
}
.wall__plane {
  position: absolute;
  top: -34%;
  left: 36%;
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 1.6vw, 26px);
  transform: rotateX(46deg) rotateZ(-30deg) translateZ(-60px);
  transform-origin: 30% 30%;
  transform-style: preserve-3d;
}
.wall__col { flex: none; width: clamp(150px, 13vw, 230px); }
.wall__col--l { width: clamp(260px, 23vw, 410px); }
.wall__col:nth-child(even) { margin-top: -18%; }
.wall__tile {
  position: relative;
  margin-bottom: clamp(14px, 1.6vw, 26px);
  overflow: hidden;
  border-radius: 9% / 4.2%;
  background: var(--surface);
  box-shadow: 0 30px 60px -30px var(--shadow);
}
.wall__col--l .wall__tile { border-radius: 3.2% / 5%; }
.wall__tile img { width: 100%; height: auto; aspect-ratio: 360 / 780; object-fit: cover; }
.wall__col--l .wall__tile img { aspect-ratio: 720 / 450; }

/* ---------- Projets ----------
   Une grande section par projet : image à gauche, détails à droite.
   Le scroll est celui du navigateur ; chaque projet apparaît en fondu. */
.projects { position: relative; }
.panel {
  position: relative;
  height: 100dvh;
  display: flex;
  padding: calc(var(--nav-h) + 8px) var(--gutter) clamp(16px, 3vh, 28px);
}
.panel__inner {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(12px, 2vh, 22px);
  background: var(--bg);
  transform-origin: 50% 0;
}
.panel__stage { position: relative; min-height: 0; }
.panel__media {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: var(--radius-xl);
  clip-path: inset(0% 41% 0% 0% round var(--radius-xl));
  /* calque propre : sans lui, Chrome laisse dépasser un liseré de la scène au bord droit */
  transform: translateZ(0);
}
.panel__media-inner { position: absolute; inset: 0; transform: translateX(-20.5%); }
.panel__details {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 37%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 18px;
}
.panel__meta { color: var(--muted); font-size: 0.95rem; }
.panel__summary { font-size: clamp(1.1rem, 1.45vw, 1.38rem); line-height: 1.38; letter-spacing: -0.015em; }
.panel__facts { display: grid; width: 100%; border-top: 1px solid var(--line); }
.panel__facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.panel__facts dt { color: var(--muted); }
.panel__title { font-size: clamp(3rem, 7.6vw, 8.25rem); line-height: 0.86; }

/* ---------- Projets en mouvement (js/demos.js) ---------- */
.demo { position: relative; }
.demo__pin {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 20px) var(--gutter) 28px;
}
.demo__text { position: relative; z-index: 2; max-width: 26rem; }
.demo__title { margin-top: 12px; font-size: clamp(2.3rem, 4.2vw, 4.2rem); line-height: 0.95; }
.demo__lead { margin-top: 20px; color: var(--muted); font-size: clamp(1.02rem, 1.25vw, 1.15rem); line-height: 1.55; }
.demo__link { margin-top: 24px; }
.demo__stage { position: relative; height: min(80svh, 780px); display: grid; place-items: center; }
.demo__emoji { position: absolute; font-size: 3.8cqw; line-height: 1; }

/* FISHDEX : un canevas façon Figma, le téléphone au centre */
.demo--fishdex .demo__stage {
  border-radius: var(--radius-lg);
  overflow: hidden; /* la canne entre et sort par le bord du canevas */
  background:
    radial-gradient(circle, color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--surface);
}
.fx__phone {
  position: relative;
  padding: calc(var(--fx-w) * 0.034);
  border-radius: calc(var(--fx-w) * 0.17);
  background: #0b0b0d;
  box-shadow:
    inset 0 0 0 calc(var(--fx-w) * 0.006) #55565c,
    inset 0 0 0 calc(var(--fx-w) * 0.012) #151518,
    0 40px 80px -30px var(--shadow);
}
.fx__screen {
  position: relative;
  width: var(--fx-w);
  aspect-ratio: 375 / 817;
  border-radius: calc(var(--fx-w) * 0.13);
  container-type: inline-size;
}
.fx__part { position: absolute; z-index: 1; will-change: transform; --sh: 0; filter: drop-shadow(0 2.4cqw 3.6cqw rgba(29, 30, 44, calc(var(--sh) * 0.3))); }
.fx__part--rod { z-index: 2; }
/* textes : posés sur leur cadre, comme dans Figma, tant qu'ils sont hors de l'écran */
.fx__part--frame::before { content: ""; position: absolute; inset: -3cqw; z-index: -1; border-radius: 4cqw; background: var(--frame, var(--fx-bg)); opacity: var(--sh); }
.fx__part img { position: absolute; display: block; max-width: none; }
/* cadre de sélection, comme dans Figma */
.fx__sel { position: absolute; inset: -1.2cqw; border: 1.5px solid var(--accent); border-radius: 0.5cqw; opacity: 0; pointer-events: none; }
.fx__sel i { position: absolute; width: 1.9cqw; height: 1.9cqw; border: 1.5px solid var(--accent); background: #fff; }
.fx__sel i:nth-child(1) { left: -1cqw; top: -1cqw; }
.fx__sel i:nth-child(2) { right: -1cqw; top: -1cqw; }
.fx__sel i:nth-child(3) { left: -1cqw; bottom: -1cqw; }
.fx__sel i:nth-child(4) { right: -1cqw; bottom: -1cqw; }
/* la souris, avec l'étiquette du curseur partagé */
.fx__cursor { position: absolute; left: 0; top: 0; z-index: 6; display: flex; align-items: flex-start; pointer-events: none; will-change: transform; }
.fx__cursor i {
  margin: -3px 0 0 -3px;
  font-size: clamp(22px, 8cqw, 32px);
  color: var(--accent);
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 3px 4px rgba(29, 30, 44, 0.3));
  transform-origin: 20% 15%;
}
.fx__cursor span {
  margin: clamp(18px, 6.6cqw, 26px) 0 0 -6px;
  padding: 3px 9px 4px;
  border-radius: 4px 999px 999px 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.fx__click { position: absolute; left: 0; top: 0; z-index: 5; width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; pointer-events: none; }
/* la canne à pêche */
.fx__rod { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fx__stick { fill: var(--text); }
.fx__grip { fill: var(--accent); stroke: var(--text); stroke-width: 1.5; }
.fx__reel { fill: var(--bg); stroke: var(--text); stroke-width: 3.5; }
.fx__reel-hub { fill: var(--accent); }
.fx__crank path { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.fx__crank circle { fill: var(--text); }
.fx__ring { fill: none; stroke: var(--text); stroke-width: 1.5; }
.fx__line { stroke: var(--text); stroke-width: 1.4; opacity: 0.85; }
.fx__hook path { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }

/* Borne EDNA : la borne de présentation, en 3D */
.demo--borne-edna .demo__stage {
  perspective: 1400px;
  perspective-origin: 50% 18%;
  background: radial-gradient(ellipse 50% 46% at 50% 40%, var(--surface), transparent 72%);
}
.kiosk { position: relative; width: var(--k-w); display: flex; flex-direction: column; align-items: center; transform-style: preserve-3d; }
.kiosk__head {
  position: relative;
  width: 100%;
  padding: 6% 5% 10%;
  border-radius: 9% 9% 1.5% 1.5% / 13% 13% 2% 2%;
  background: linear-gradient(180deg, #2b2b2f, #151517 26%, #111113);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform-style: preserve-3d;
}
.kiosk__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 1728 / 1117;
  border-radius: 1.2cqw;
  box-shadow: 0 0 0 0.6cqw #08080a;
  container-type: inline-size;
  transform-style: preserve-3d;
}
/* emplacements vides de la grille, et l'anneau d'orbite */
.kiosk__slot { position: absolute; border: 1px dashed rgba(29, 30, 44, 0.24); border-radius: 0.9cqw; background: rgba(29, 30, 44, 0.03); }
.kiosk__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.kiosk__part {
  position: absolute;
  will-change: transform;
  --sh: 0;
  --dim: 0;
  filter: brightness(calc(1 - var(--dim))) drop-shadow(0 1.4cqw 2.2cqw rgba(29, 30, 44, calc(var(--sh) * 0.3)));
}
.kiosk__part--frame::before { content: ""; position: absolute; inset: -1.4cqw -2cqw; z-index: -1; border-radius: 1.4cqw; background: #fff; opacity: var(--sh); }
.kiosk__part img { position: absolute; display: block; max-width: none; }
.kiosk__nfc { position: absolute; right: 9%; bottom: 2.2%; width: 7%; aspect-ratio: 1; border-radius: 14%; background: #0a0a0b; box-shadow: inset 0 0 0 1px #2e2e33; }
.kiosk__body {
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(var(--k-w) * 0.78);
  margin-top: -1px;
  border-radius: 0 0 1.5% 1.5%;
  background: linear-gradient(90deg, #0d0d0f, #18181b 50%, #0d0d0f);
}
.kiosk__body img {
  width: 44%;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent);
  mask-image: radial-gradient(closest-side, #000 72%, transparent);
}
.kiosk__foot {
  width: 118%;
  height: calc(var(--k-w) * 0.05);
  margin-top: -2px;
  border-radius: 4px 4px 12px 12px;
  background: linear-gradient(180deg, #2c2c30, #0d0d0f);
  box-shadow: 0 34px 60px -24px var(--shadow);
}

/* DJ Platform : la table de mixage, le téléphone en écran central */
.dj { position: relative; width: var(--dj-w); }
.dj__console {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.84fr) minmax(0, 1fr);
  align-items: end;
  gap: 3%;
  padding: 0 4% calc(var(--dj-w) * 0.035);
}
/* le plateau : la partie basse de la console */
.dj__console::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--dj-w) * 0.42);
  border-radius: calc(var(--dj-w) * 0.035);
  background: linear-gradient(180deg, #26114f, #0d0322 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 50px 90px -40px rgba(13, 3, 34, 0.75);
}
.dj__deck { position: relative; display: grid; justify-items: center; perspective: 900px; }
/* la platine, couchée vers l'arrière */
.dj__platter { position: relative; width: 100%; aspect-ratio: 1; transform: rotateX(36deg); transform-origin: 50% 100%; }
.dj__platter::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 210deg, transparent 0 10%, rgba(255, 255, 255, 0.12) 16%, transparent 24% 60%, rgba(255, 255, 255, 0.08) 66%, transparent 74%);
  pointer-events: none;
}
.dj__vinyl {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #15111b 0 2px, #1f1828 2px 3px);
  box-shadow: 0 0 0 calc(var(--dj-w) * 0.006) #2b1d47, 0 18px 30px -12px rgba(0, 0, 0, 0.75);
}
/* l'étiquette du disque : l'écran lui-même */
.dj__label { position: absolute; inset: 31%; border-radius: 50%; background: #5e01fe 50% 0 / cover no-repeat; box-shadow: 0 0 0 3px #5e01fe; }
.dj__vinyl--b .dj__label { box-shadow: 0 0 0 3px #985dfe; }
.dj__label::after { content: ""; position: absolute; left: 46%; top: 46%; width: 8%; height: 8%; border-radius: 50%; background: #0b0710; }
.dj__arm { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dj__arm circle { fill: #1d0d3d; stroke: #985dfe; stroke-width: 1.5; }
.dj__arm path { fill: none; stroke: #d2b8ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dj__arm .dj__head { stroke: #efe6ff; stroke-width: 5; }
.dj__deck p, .dj__mixer p { color: #d2b8ff; font-size: clamp(0.72rem, 1vw, 0.85rem); font-weight: 500; text-align: center; }
.dj__deck p { margin-top: 10px; }
.dj__center { position: relative; display: grid; justify-items: center; gap: calc(var(--dj-w) * 0.024); perspective: 1500px; }
.dj__phone {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: calc(var(--dj-w) * 0.009);
  border-radius: calc(var(--dj-w) * 0.044);
  background: #0b0b0d;
  box-shadow: inset 0 0 0 2px #55565c, inset 0 0 0 4px #151518, 0 40px 70px -30px rgba(13, 3, 34, 0.7);
  --beat: 0.4;
}
/* la lueur du téléphone, au rythme */
.dj__phone::before {
  content: "";
  position: absolute;
  inset: 8% -18% -4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(152, 93, 254, 0.55), transparent);
  filter: blur(18px);
  opacity: var(--beat);
}
.dj__screen { position: relative; aspect-ratio: 402 / 874; overflow: hidden; border-radius: calc(var(--dj-w) * 0.036); background: #0a001b; }
.dj__screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.dj__wipe { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #d2b8ff; box-shadow: 0 0 16px 4px rgba(152, 93, 254, 0.85); }
.dj__island { position: absolute; top: 4.6%; left: 50%; width: 26%; height: 3%; transform: translateX(-50%); border-radius: 99px; background: #000; }
.dj__mixer { display: grid; gap: 10px; width: 100%; }
.dj__meters { display: flex; justify-content: center; gap: 10px; height: calc(var(--dj-w) * 0.07); }
.dj__meter {
  position: relative;
  width: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: repeating-linear-gradient(to top, #2b1d47 0 5px, transparent 5px 7px);
  --lvl: 0;
}
.dj__meter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #5e01fe, #985dfe 55%, #fab3a9 82%, #bd001e);
  -webkit-mask-image: repeating-linear-gradient(to top, #000 0 5px, transparent 5px 7px);
  mask-image: repeating-linear-gradient(to top, #000 0 5px, transparent 5px 7px);
  transform: scaleY(var(--lvl));
  transform-origin: bottom;
}
.dj__fader { position: relative; height: 22px; border-radius: 999px; background: #08010f; box-shadow: inset 0 0 0 1px #2b1d47; }
.dj__fader::before { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; margin-top: -1px; background: #2b1d47; }
.dj__knob { position: absolute; left: 0; top: -7px; width: 20px; height: 36px; border-radius: 6px; background: linear-gradient(180deg, #efe6ff, #b9a3e8); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }


/* ---------- Panneaux de couleur (citation, contact) ----------
   Posés en retrait des bords, avec le même arrondi que les scènes des
   pages projet : des touches d'identité, pas des bandes plein écran. */
.quote, .contact { padding: 0 var(--gutter); }
.quote__inner, .contact__inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

/* ---------- Citation (panneau gris clair) ---------- */
.quote { margin-top: clamp(40px, 7vh, 88px); }
.quote__inner {
  padding: clamp(72px, 14vh, 168px) clamp(24px, 6vw, 96px) clamp(80px, 15vh, 180px);
  background: var(--surface);
  color: var(--text);
}
.quote__text {
  max-width: 17em;
  font-family: var(--font-display);
  font-weight: 500;
  font-stretch: 100%;
  font-size: clamp(2.1rem, 5.4vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

/* ---------- À propos ---------- */
.about {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--section) var(--gutter) clamp(88px, 13vh, 150px);
}
.section-head {
  margin-bottom: clamp(28px, 5vh, 52px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.about__statement {
  max-width: 1120px;
  font-family: var(--font-display);
  font-weight: 500;
  font-stretch: 100%;
  font-size: clamp(1.9rem, 4.1vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(72px, 12vh, 140px);
}
.about__portrait {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  aspect-ratio: 4 / 5;
  perspective: 1200px;
}
.about__portrait .media {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 4px hsl(var(--shadow-hue) / 0.06), 0 40px 70px -40px hsl(var(--shadow-hue) / 0.45);
}
.about__bio { max-width: 54ch; font-size: clamp(1.1rem, 1.4vw, 1.28rem); line-height: 1.55; letter-spacing: -0.012em; }


.about__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 32px; }
.about__subtitle {
  margin-bottom: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line-strong);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Compétences : quatre colonnes, listes en lignes réglées */
.skills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px clamp(20px, 2.4vw, 36px);
  margin-top: clamp(88px, 13vh, 150px);
}
.skills li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.skills small { flex: none; color: var(--muted); font-size: 0.85em; text-align: right; }

.timeline { margin-top: clamp(56px, 8vh, 80px); }
/* la ligne qui relie les étapes du parcours */
.timeline ol { position: relative; display: grid; gap: 22px; margin-top: 18px; padding-left: 30px; }
.timeline ol::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line-strong);
}
.timeline li { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 0.5em;
  width: 11px;
  height: 11px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: var(--bg);
}
/* l'étape en cours */
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); }
.timeline time { color: var(--muted); }
.timeline strong { display: block; font-weight: 500; }
.timeline span { color: var(--muted); }

/* ---------- Contact (panneau encre, sombre dans les deux thèmes) ---------- */
.contact {
  --text: #edece8;
  --muted: #a4a5ab;
  --line: rgba(237, 236, 232, 0.16);
  --line-strong: rgba(237, 236, 232, 0.4);
  --accent: var(--bleu-clair);
  --on-accent: var(--encre);
  --select-bg: var(--bleu-clair);
  --select-fg: var(--encre);
  color: var(--text);
}
.contact__inner {
  padding: clamp(64px, 12vh, 150px) clamp(24px, 6vw, 96px) clamp(36px, 6vh, 64px);
  background: var(--encre);
}
[data-theme="dark"] .contact__inner { background: var(--surface-2); }
.contact__title { font-size: clamp(3rem, 11vw, 11rem); line-height: 0.88; }
.contact__title .line { white-space: nowrap; }
.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: clamp(36px, 6vh, 72px);
}
.contact__email {
  display: inline-block;
  padding-bottom: 4px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.4vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.3s;
}
@media (hover: hover) and (pointer: fine) {
  .contact__email:hover { text-decoration-color: currentColor; }
}
.contact__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px 36px;
  margin-top: clamp(56px, 10vh, 112px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.socials { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.socials a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: none; }
.socials a i { transition: transform 0.4s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .socials a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
  .socials a:hover i { transform: translate(2px, -2px); }
}

/* ---------- Pied de page ---------- */
.footer {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 9vh, 96px) var(--gutter) calc(24px + env(safe-area-inset-bottom));
}
.footer__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: clamp(24px, 5vh, 48px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.footer__bar > :last-child { justify-self: end; }
/* le logo du pied de page reprend le masque des arêtes défini dans la barre du haut */
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand .logo { flex: none; width: 22px; color: var(--text); }
.footer__links { display: flex; gap: 24px; }
.footer__bar a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: color 0.3s; }
@media (hover: hover) and (pointer: fine) {
  .footer__bar a:hover { color: var(--text); }
}

/* ==========================================================
   PAGE PROJET (étude de cas)
   ========================================================== */
/* progression de lecture, sous la barre du haut */
.progress {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: var(--z-progress);
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.case__head {
  max-width: var(--max);
  margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(28px, 6vh, 72px)) var(--gutter) clamp(40px, 6vh, 64px);
}
.back { margin-bottom: clamp(32px, 6vh, 56px); color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .back:hover { color: var(--text); }
  .back:hover i { transform: translateX(-4px); }
}
.case__type { margin-bottom: 18px; color: var(--muted); }
.case__title { font-size: clamp(3.6rem, 13vw, 13rem); line-height: 0.84; letter-spacing: -0.045em; }
.case__intro {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
  margin-top: clamp(36px, 6vh, 64px);
}
.case__summary {
  max-width: 34ch;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: -0.018em;
}
.facts { display: grid; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 500; }

.case__cover { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); perspective: 1800px; }
.case__cover .media { aspect-ratio: 16 / 10; border-radius: var(--radius-xl); transform-origin: 50% 0; }
.case__visual { view-transition-name: project-cover; }

.case__section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px;
}
.case__section > h2 {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 100%;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.case__text { max-width: 60ch; color: var(--muted); font-size: clamp(1.1rem, 1.45vw, 1.3rem); line-height: 1.6; letter-spacing: -0.012em; }

/* ---------- Récit du projet : chapitres et visuels ---------- */
.chapter {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 13vh, 150px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px;
}
.chapter__head {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
}
.chapter__num {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.chapter__head h2 {
  max-width: 14ch;
  font-family: var(--font-display);
  font-weight: 600;
  font-stretch: 100%;
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.chapter__points { display: grid; gap: 14px; max-width: 58ch; margin-top: 28px; }
.chapter__points li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}
.chapter__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* Scène colorée qui porte les visuels (couleurs du projet) */
.stage {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: clamp(28px, 5.5vw, 88px);
  border-radius: var(--radius-lg);
  background: var(--stage);
  color: var(--encre);
  perspective: 1800px;
}
.stage.is-dark { color: var(--papier); }
.stage__caption {
  max-width: var(--max);
  margin: 14px auto 0;
  padding: 0 var(--gutter);
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Appareils : iPhone, MacBook, écran tactile ----------
   Dessinés en CSS : nets à toutes les tailles. Les mesures en cqw
   suivent la largeur de l'appareil (1cqw = 1 % de sa largeur). */
.device { position: relative; container-type: inline-size; }
.device__screen { position: relative; overflow: hidden; background: #000; }
.device__screen.media { border-radius: 0; }
.device__screen > img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: top center;
}
/* reflet sur la vitre, qui suit l'inclinaison */
.device__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.09) 46%, rgba(255, 255, 255, 0) 62%) 0 0 / 260% 100%;
  background-position: var(--sheen, 60%) 0;
}
/* sans animation, on peut faire défiler l'écran à la main */
html:not(.has-device-scroll) .story .device__screen { overflow-y: auto; }

/* iPhone (proportions d'un iPhone 15 Pro) */
.iphone {
  position: relative;
  aspect-ratio: 1 / 2.093;
  padding: 3.4cqw;
  border-radius: 16.5cqw;
  background: #0b0b0d;
  box-shadow:
    inset 0 0 0 0.55cqw #55565c,
    inset 0 0 0 1.1cqw #151518,
    0 1.5cqw 3cqw -0.5cqw rgba(0, 0, 0, 0.3),
    0 10cqw 20cqw -6cqw rgba(0, 0, 0, 0.5);
}
/* boutons sur les côtés */
.iphone::before,
.iphone::after {
  content: "";
  position: absolute;
  width: 1.1cqw;
  border-radius: 1cqw;
  background: linear-gradient(90deg, #26272b, #5a5b61);
}
.iphone::before { left: -0.9cqw; top: 24%; height: 9%; box-shadow: 0 -14cqw 0 -0.05cqw #3c3d42, 0 21cqw 0 0 #3c3d42; }
.iphone::after { right: -0.9cqw; top: 29%; height: 14%; background: linear-gradient(270deg, #26272b, #5a5b61); }
.iphone .device__screen { height: 100%; border-radius: 13.2cqw; }
.iphone__island {
  position: absolute;
  z-index: 2;
  top: 6cqw;
  left: 50%;
  width: 27cqw;
  height: 7.6cqw;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #000;
}

/* MacBook */
.mac__lid {
  position: relative;
  width: 88cqw;
  margin: 0 auto;
  padding: 1.25cqw 1.25cqw 2.3cqw;
  border-radius: 2.6cqw 2.6cqw 0.5cqw 0.5cqw;
  background: #0c0c0e;
  box-shadow: inset 0 0 0 0.22cqw #3a3b40, 0 0 0 0.14cqw #a3a5aa;
}
.mac .device__screen { aspect-ratio: 1.54; border-radius: 1.1cqw 1.1cqw 0.2cqw 0.2cqw; }
.mac__notch {
  position: absolute;
  z-index: 2;
  top: 1.2cqw;
  left: 50%;
  width: 9cqw;
  height: 1.4cqw;
  transform: translateX(-50%);
  border-radius: 0 0 0.8cqw 0.8cqw;
  background: #0c0c0e;
}
.mac__base {
  position: relative;
  height: 2.6cqw;
  border-radius: 0.3cqw 0.3cqw 3cqw 3cqw / 0.3cqw 0.3cqw 2.2cqw 2.2cqw;
  background: linear-gradient(180deg, #f3f4f6 0%, #d4d6da 40%, #a6a8ae 100%);
  box-shadow: 0 2.4cqw 4cqw -1.6cqw rgba(0, 0, 0, 0.5);
}
/* encoche d'ouverture */
.mac__base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 14cqw;
  height: 0.9cqw;
  transform: translateX(-50%);
  border-radius: 0 0 1cqw 1cqw;
  background: linear-gradient(180deg, #9fa1a6, #c8cace);
}

/* Écran tactile (la borne) */
.display {
  padding: 1.4cqw;
  border-radius: 2.6cqw;
  background: #111214;
  box-shadow: inset 0 0 0 0.25cqw #303135, 0 3cqw 7cqw -3cqw rgba(0, 0, 0, 0.45);
}
.display .device__screen { aspect-ratio: 1600 / 1034; border-radius: 1.2cqw; }

/* Image détourée (masque de transparence) */
.device--free img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* ---------- Scènes : couvertures en appareils ---------- */
.scene { position: absolute; inset: 0; overflow: hidden; }
/* lumière de studio : un halo clair en haut, une ombre douce en bas */
.scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.2), transparent 58%),
    radial-gradient(110% 60% at 50% 115%, rgba(0, 0, 0, 0.16), transparent 62%);
  pointer-events: none;
}
.scene__item { position: absolute; top: 0; left: 0; will-change: transform; }
/* les appareils flottent doucement, chacun à son rythme */
@keyframes scene-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -1.4%; }
}
.scene__item > .device { animation: scene-float 6.5s ease-in-out infinite; }
.scene__item[data-i="1"] > .device { animation-delay: -2.2s; animation-duration: 7.2s; }
.scene__item[data-i="2"] > .device { animation-delay: -4.4s; animation-duration: 6s; }
/* les appareils sont inclinés en 3D (tilt dans js/projects.js) ; la souris accentue l'inclinaison */
.scene__item > .device {
  transform: perspective(1400px) rotateX(calc(var(--rx, 0deg) + var(--my, 0) * -7deg)) rotateY(calc(var(--ry, 0deg) + var(--mx, 0) * 9deg));
  transform-style: preserve-3d;
}
.scene:not(.is-laid) .scene__item { visibility: hidden; }
.scene__glow {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}
.panel__media-inner--scene { transform: none; }

/* iPhone en rangée */
.phones {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: clamp(20px, 3.4vw, 52px);
  max-width: calc(var(--n) * 290px);
  margin: 0 auto;
}
.phones__item { transform-style: preserve-3d; }
.phones__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-weight: 500;
}
.phones__label span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* MacBook et iPhone qui se chevauchent */
.showcase {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  max-width: 1180px;
  margin: 0 auto;
  transform-style: preserve-3d;
}
.showcase__item { margin: 0; }
.showcase__item--mac { flex: 0 1 80%; }
.showcase__item--iphone { position: relative; z-index: 1; flex: 0 0 19%; margin: 0 0 -1% -8%; }

/* Une image, seule ou dans un appareil */
.media--natural img { height: auto; }
.media--natural:not(.is-loaded) { min-height: 200px; }
.shot {
  overflow: hidden;
  max-width: 1180px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.45);
}
.shot__media { border-radius: 0; }
.shot--device { overflow: visible; max-width: 1060px; border-radius: 0; background: none; box-shadow: none; }

/* Deux images côte à côte, à la même hauteur */
.pair {
  max-width: var(--max);
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: var(--cols);
  gap: 16px;
  align-items: start;
}
.pair figcaption { margin-top: 12px; color: var(--muted); font-size: 0.95rem; }

/* Une image et ses explications */
.chapter--split { grid-template-rows: auto; }
.split { display: grid; gap: clamp(28px, 4vh, 44px); }
.split__visual { width: 100%; max-width: none; margin: 0; padding: clamp(20px, 3vw, 40px); }
.split__visual .media { background: transparent; }
.split__points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.split__points li { padding-top: 14px; border-top: 1px solid var(--line); }
.split__num { display: block; margin-bottom: 10px; color: var(--accent); font-weight: 500; font-size: 0.95rem; }
.split__points h3 { margin-bottom: 6px; font-size: 1.1rem; font-weight: 600; }
.split__points p { color: var(--muted); }

/* Versions d'un écran, avec onglets */
.versions__tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.16);
  scrollbar-width: none;
}
.versions__tabs::-webkit-scrollbar { display: none; }
.versions__tabs button {
  flex: none;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  opacity: 0.7;
  font: 500 0.95rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.25s, color 0.25s, opacity 0.25s, box-shadow 0.25s;
}
@media (hover: hover) and (pointer: fine) {
  .versions__tabs button:hover { opacity: 1; }
}
.versions__tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--encre);
  opacity: 1;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
}
.versions__view {
  position: relative;
  max-width: 1100px;
  margin: clamp(24px, 4vh, 40px) auto 0;
  aspect-ratio: 1600 / 1034;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.5);
}
.versions__device { max-width: 1100px; margin: clamp(24px, 4vh, 40px) auto 0; }
.versions__device .versions__view { max-width: none; margin: 0; border-radius: 1.2cqw; box-shadow: none; }
.versions__shot { position: absolute; inset: 0; border-radius: 0; opacity: 0; transition: opacity 0.7s var(--ease-out); }
.versions__shot.is-active { opacity: 1; }
.versions__text {
  max-width: 62ch;
  min-height: 4.8em;
  margin: 24px auto 0;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Couleurs et typographies */
.palette {
  max-width: var(--max);
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  gap: 16px;
}
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.swatch { display: grid; gap: 2px; font-size: 0.95rem; }
.swatch__chip {
  height: clamp(90px, 12vw, 150px);
  margin-bottom: 10px;
  border-radius: var(--radius);
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--line);
}
.swatch__name { font-weight: 500; }
.swatch__hex { color: var(--muted); font-variant-numeric: tabular-nums; }
.specimens { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.specimen { padding: clamp(24px, 3vw, 40px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.specimen__role { margin-bottom: 20px; color: var(--muted); font-size: 0.95rem; }
.specimen__sample { line-height: 1.08; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.specimen__glyphs { margin-top: 18px; color: var(--muted); font-size: 1.05rem; }

/* Personas */
.personas {
  max-width: var(--max);
  margin: clamp(36px, 6vh, 64px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.persona { padding: clamp(22px, 2.4vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.persona__mono {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1.2rem/1 var(--font-display);
}
.persona h3 { margin-top: 18px; font: 600 1.45rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.persona h3 span { margin-left: 4px; font: 400 1rem var(--font-body); letter-spacing: 0; color: var(--muted); }
.persona__role { margin-top: 4px; color: var(--muted); }
.persona__facts { display: grid; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.persona__facts dt { font-size: 0.85rem; color: var(--muted); }

/* Colonnes de listes, alignées sur le texte */
.offset {
  max-width: var(--max);
  margin: clamp(36px, 6vh, 56px) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px;
}
.offset > * { grid-column: 2; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 24px; }
.column { padding-top: 14px; border-top: 2px solid var(--accent); }
.column h3 { font: 600 1.4rem/1.1 var(--font-display); letter-spacing: -0.02em; }
.column__note { margin-top: 4px; color: var(--muted); font-size: 0.95rem; }
.column ul { margin-top: 14px; }
.column li { padding: 9px 0; border-bottom: 1px solid var(--line); }

/* Grande phrase */
.statement {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 13vh, 150px) var(--gutter) 0;
  font-size: clamp(2rem, 4.6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.results { display: grid; gap: 14px; }
.results li { display: flex; gap: 12px; font-size: clamp(1.05rem, 1.4vw, 1.2rem); }
.results i { flex: none; margin-top: 0.3em; color: var(--accent); }
.learning {
  max-width: 26ch;
  margin-top: clamp(48px, 8vh, 80px);
  font-family: var(--font-display);
  font-weight: 500;
  font-stretch: 100%;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}


/* Projet suivant : le titre et un aperçu de la couverture */
.next {
  display: block;
  max-width: var(--max);
  margin: clamp(100px, 16vh, 180px) auto 0;
  padding: 0 var(--gutter) 24px;
  text-decoration: none;
}
.next__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.next__text { display: block; }
.next__label { display: block; margin-bottom: 12px; color: var(--muted); }
.next__title {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  font-size: clamp(2.8rem, 9vw, 9rem);
  transition: color 0.3s;
}
.next__title i { font-size: 0.5em; transition: transform 0.6s var(--ease-out); }
.next__type { display: block; margin-top: 14px; color: var(--muted); }
.next__media { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }
.next__media img { transition: opacity 0.9s var(--ease-out), transform 1.2s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .next:hover .next__title { color: var(--accent); }
  .next:hover .next__title i { transform: translateX(0.15em); }
  .next:hover .next__media img { transform: scale(1.04); }
}

.not-found {
  max-width: var(--max);
  min-height: 80dvh;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 12vh) var(--gutter) 64px;
}
.not-found .label { margin-bottom: 20px; }
.not-found h1 { font-size: clamp(2.8rem, 8vw, 7rem); margin-bottom: 24px; }
.not-found p { max-width: 44ch; margin-bottom: 32px; color: var(--muted); font-size: 1.15rem; }
.not-found__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }

/* ---------- Transitions entre pages (Chrome, Edge, Safari récents) ---------- */
@view-transition { navigation: auto; }
::view-transition-group(project-cover) { animation-duration: 0.7s; animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); }

/* ==========================================================
   ÉTATS INITIAUX DES ANIMATIONS
   .js     : JavaScript tourne
   .motion : animations douces (absent si l'ordinateur demande de les réduire)
   Une seule sorte d'apparition sur tout le site : un fondu qui monte de 16px.
   ========================================================== */
.js.motion .hero__title,
.js.motion [data-hero-item],
.js.motion .case__title,
.js.motion .case__type,
.js.motion .back,
.js.motion [data-reveal] { opacity: 0; transform: translateY(16px); }
.js.motion .wall { opacity: 0; }

/* ==========================================================
   TABLETTE ET MOBILE
   ========================================================== */
@media (max-width: 1100px) {
  .hero__intro { grid-column: 1 / span 7; }
  .hero__index { display: none; }
  .hero__cta { grid-column: 9 / span 4; }
}

@media (max-width: 1023px) {
  /* tablette et téléphone : chaque projet est une carte qui suit le texte, sans hauteur imposée :
     titre, image entière dans son cadre, puis les détails en dessous */
  .panel { height: auto; padding: clamp(56px, 9vh, 96px) var(--gutter) 0; }
  .panel__inner { display: flex; flex-direction: column; gap: 16px; }
  .panel__title { order: -1; font-size: clamp(2.4rem, 11vw, 4.6rem); }
  .panel__stage { display: flex; flex-direction: column; gap: 18px; }
  .panel__media { position: relative; inset: auto; aspect-ratio: 4 / 3; clip-path: none; border-radius: var(--radius-lg); overflow: hidden; }
  .panel__media-inner { transform: none; }
  .panel__details { position: static; width: auto; max-width: 62ch; height: auto; gap: 14px; justify-content: flex-start; }
  .panel__summary { font-size: 1.05rem; }
  .panel__facts { display: none; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split__points { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .case__intro { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .wall__plane { left: 22%; }
}

@media (max-width: 767px) {
  :root { --nav-h: 64px; --radius-xl: 20px; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__start, .nav__project { gap: 12px; }
  .nav__project { font-size: 1.15rem; }
  .nav__links, .nav__cv { display: none; }
  .nav__burger { display: grid; }
  .icon-btn { width: 44px; height: 44px; }

  .hero::before {
    background:
      linear-gradient(0deg, var(--bg) 34%, color-mix(in srgb, var(--bg) 72%, transparent) 56%, color-mix(in srgb, var(--bg) 10%, transparent) 80%),
      linear-gradient(180deg, color-mix(in srgb, var(--bg) 80%, transparent) 0%, transparent 20%);
  }
  .hero__title { font-size: min(4.4rem, 10.4vw); }
  .hero__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
  .wall { perspective-origin: 50% 20%; }
  .wall__plane { top: -22%; left: -18%; transform: rotateX(42deg) rotateZ(-26deg); }
  .wall__col { width: 112px; }
  .wall__col--l { width: 200px; }

  .panel__media { aspect-ratio: 4 / 5; }
  .panel__details .btn { height: 48px; }

  /* projets en mouvement : texte au-dessus, animation en dessous */
  .demo__pin { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; padding-top: calc(var(--nav-h) + 14px); }
  .demo__title { font-size: clamp(2rem, 9vw, 2.8rem); }
  .demo__lead { margin-top: 10px; font-size: 0.98rem; }
  .demo__link { display: none; }
  .demo__stage { height: 60svh; }

  .quote__inner, .contact__inner { padding-left: 22px; padding-right: 22px; }
  .about__grid { grid-template-columns: minmax(0, 1fr); }
  .about__portrait { position: relative; top: 0; max-width: 420px; }
  .skills { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }

  .contact__title { font-size: clamp(2.6rem, 14vw, 4.6rem); }
  .contact__email { font-size: min(1.3rem, 4.9vw); overflow-wrap: normal; }
  .contact__foot { flex-direction: column; align-items: flex-start; }
  .footer__bar { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .footer__bar > :last-child { justify-self: start; }

  .case__section { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .case__section > h2 { position: static; }
  .chapter, .offset { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .chapter__head { position: static; }
  .offset > * { grid-column: 1; }
  .stage { width: calc(100% - 2 * var(--gutter)); padding: 22px; border-radius: var(--radius); }
  /* téléphone : les écrans en grille de 2, tous visibles en entier ;
     s'il y en a un nombre impair, le dernier est centré */
  .phones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; max-width: none; }
  .phones__item:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 9px); }
  .phones__label { margin-top: 14px; font-size: 0.95rem; }
  .showcase { flex-direction: column; align-items: center; gap: 28px; }
  .showcase__item--mac { flex: none; width: 100%; }
  .showcase__item--iphone { flex: none; width: 56%; margin: 0; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair__item:first-child .media { max-width: 70%; }
  .personas { grid-template-columns: minmax(0, 1fr); }
  .versions__tabs button { padding: 9px 12px; font-size: 0.9rem; }
  .next__inner { grid-template-columns: minmax(0, 1fr); }
  .next__media { order: -1; }
}
