/* ==========================================================================
   Portfolio · Ayoub Azzakhnini
   Palette : ivoire, noir profond, gris neutres, un seul bleu en accent.
   Typographie : Newsreader pour les titres, Inter pour tout le reste.
   Grille : 12 colonnes. Les sections ont une colonne d'étiquettes à gauche
   (colonnes 1 à 3) et leur contenu à droite (colonnes 4 à 12).
   ========================================================================== */

:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-2: #f1efea;
  --text: #121317;
  --text-2: #3c3f47;
  --muted: #62666f;
  --line: #e4e1da;
  --line-strong: #cdc9c1;
  --accent: #2f47c4;
  --accent-soft: #e8ebfa;
  --ink: #121317;
  --on-ink: #f8f7f4;
  --accent-on-ink: #a9b7ff;
  --ok: #17a34a;
  --photo-bg: #eeebe5;
  --shadow-sm: 0 1px 2px rgba(18, 19, 23, .05);
  --shadow: 0 1px 2px rgba(18, 19, 23, .04), 0 18px 40px -24px rgba(18, 19, 23, .22);
  --icon-sun: none;
  --icon-moon: block;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 10px;
  --container: 1160px;
  --gutter: 24px;
  --space-section: clamp(88px, 9vw, 128px);
  --ff-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --ff-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f12;
    --surface: #15171c;
    --surface-2: #121419;
    --text: #f1efe9;
    --text-2: #c6c8ce;
    --muted: #979ca6;
    --line: #24272e;
    --line-strong: #383c45;
    --accent: #9aabff;
    --accent-soft: #1a2140;
    --ink: #f1efe9;
    --on-ink: #0e0f12;
    --accent-on-ink: #2f47c4;
    --ok: #4ade80;
    --photo-bg: #d9d6cf;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -24px rgba(0, 0, 0, .8);
    --icon-sun: block;
    --icon-moon: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0f12;
  --surface: #15171c;
  --surface-2: #121419;
  --text: #f1efe9;
  --text-2: #c6c8ce;
  --muted: #979ca6;
  --line: #24272e;
  --line-strong: #383c45;
  --accent: #9aabff;
  --accent-soft: #1a2140;
  --ink: #f1efe9;
  --on-ink: #0e0f12;
  --accent-on-ink: #2f47c4;
  --ok: #4ade80;
  --photo-bg: #d9d6cf;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -24px rgba(0, 0, 0, .8);
  --icon-sun: block;
  --icon-moon: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }

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

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

/* « hidden » l'emporte toujours, même sur un display: grid */
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

/* Grille de 12 colonnes */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.rail { grid-column: 1 / span 3; }
.main-col { grid-column: 4 / -1; }

/* Lien « Aller au contenu » : invisible, il apparaît juste sous le header quand on navigue
   au clavier, avec le style des boutons du site, sans recouvrir le nom ni le menu */
.skip {
  position: fixed;
  top: 76px;
  left: 50%;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  color: var(--on-ink);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(18, 19, 23, .16), 0 8px 24px -12px rgba(18, 19, 23, .4);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.skip:focus {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
  outline-offset: 2px;
  border-radius: 999px;
}

/* Typographie */
h1, h2, h3 {
  font-family: var(--ff-display);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 em, h2 em {
  font-style: italic;
  color: var(--accent);
}

h1 {
  font-size: clamp(2.4rem, 1.4rem + 3.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* Petites étiquettes en capitales : numéros de section, légendes, rubriques */
.eyebrow,
.label,
.cv-title,
.project-kicker {
  font-family: var(--ff-body);
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.eyebrow span {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Lien texte : le soulignement se dessine au survol */
.link {
  font-weight: 500;
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 1px;
  transition: background-size .35s var(--ease), color .2s ease;
}
.link:hover { background-size: 100% 1px; }

/* Lien avec flèche : seul le texte se souligne, la flèche avance */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
}
.link-arrow > span:not(.sr-only) {
  padding-bottom: 1px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .35s var(--ease);
}
.link-arrow:hover > span { background-size: 100% 1px; }

/* Flèche des boutons et des liens : au survol, la tige apparaît et la pointe avance */
.arrow {
  flex: none;
  width: 10px;
  height: 10px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arrow-line {
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.arrow-head { transition: transform .2s var(--ease); }
a:hover > .arrow .arrow-line,
a:focus-visible > .arrow .arrow-line { opacity: 1; }
a:hover > .arrow .arrow-head,
a:focus-visible > .arrow .arrow-head { transform: translateX(3px); }

/* Lien externe : flèche en diagonale, qui part vers le haut au survol */
.arrow--out { transition: transform .2s var(--ease); }
.arrow--out .arrow-line { opacity: 1; }
a:hover > .arrow--out,
a:focus-visible > .arrow--out { transform: translate(2px, -2px); }
a:hover > .arrow--out .arrow-head,
a:focus-visible > .arrow--out .arrow-head { transform: none; }

/* Retour : la pointe part vers la gauche */
a:hover > .arrow--back .arrow-head,
a:focus-visible > .arrow--back .arrow-head { transform: translateX(-3px); }

/* Haut de page : flèche entière, qui monte au survol */
.arrow--up { transition: transform .2s var(--ease); }
.arrow--up .arrow-line { opacity: 1; }
a:hover > .arrow--up,
a:focus-visible > .arrow--up { transform: translateY(-2px); }
a:hover > .arrow--up .arrow-head,
a:focus-visible > .arrow--up .arrow-head { transform: none; }

/* Le contour de focus suit la forme arrondie des boutons */
.btn:focus-visible,
.menu-cta:focus-visible,
.icon-btn:focus-visible,
.burger:focus-visible,
.copy-btn:focus-visible { border-radius: 999px; }

/* Barre de progression */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1;
}

/* Navigation : chaque lien porte le numéro de sa section, comme les titres de la page */
.menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: .875rem;
}
.menu a {
  border-radius: 6px;
  transition: color .25s var(--ease);
}
.menu a:not(.menu-cta) {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  color: var(--muted);
}
.menu-num {
  font-size: .6875rem;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  transition: color .25s var(--ease);
}
/* Au survol, un trait fin se dessine sous le mot, de gauche à droite */
.menu-label { position: relative; }
.menu-label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .35s var(--ease), background-color .25s var(--ease);
}
.menu a:hover,
.menu a.is-active { color: var(--text); }
.menu a:hover .menu-label::after,
.menu a:focus-visible .menu-label::after {
  transform: scaleX(1);
  transform-origin: left center;
}
/* Section en cours de lecture : numéro et trait en bleu */
.menu a.is-active .menu-num,
.menu a:hover .menu-num { color: var(--accent); }
.menu a.is-active .menu-label::after {
  transform: scaleX(1);
  background: var(--accent);
}

/* Contact : pilule claire et pastille sombre avec une flèche, qui passe au bleu au survol */
.menu .menu-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  margin-left: 14px;
  padding: 0 4px 0 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.menu-cta-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--on-ink);
  background: var(--ink);
  border-radius: 50%;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.menu-cta-icon .arrow {
  width: 9px;
  height: 9px;
  transition: transform .25s var(--ease);
}
.menu-cta-icon .arrow-line { opacity: 1; }
.menu .menu-cta:hover,
.menu .menu-cta.is-active {
  background: color-mix(in srgb, var(--text) 4%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
}
.menu .menu-cta:hover .menu-cta-icon,
.menu .menu-cta:focus-visible .menu-cta-icon { background: var(--accent); }
.menu .menu-cta:hover .arrow,
.menu .menu-cta:focus-visible .arrow { transform: translateX(2px); }

/* Langue et thème : séparés du menu par un trait court, centré sur la ligne */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 14px;
}
.nav-actions::before {
  content: "";
  width: 1px;
  height: 18px;
  margin-right: 8px;
  background: var(--line-strong);
}

.icon-btn,
.burger {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}
.icon-btn:hover,
.burger:hover {
  color: var(--text);
  background: var(--surface-2);
}
.icon-btn svg { width: 17px; height: 17px; }
.lang-btn {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
}
.icon-sun { display: var(--icon-sun); }
.icon-moon { display: var(--icon-moon); }

.burger {
  display: none;
  gap: 5px;
  align-content: center;
}
.burger span {
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform .2s ease;
}
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* Boutons : forme pilule et relief très léger. Au survol, seuls le fond et la flèche bougent */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  font-size: .9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease), transform .15s var(--ease);
}
/* Avec une flèche à droite : un peu plus d'air côté texte, pour un équilibre optique */
.btn:has(> .arrow:last-child) { padding: 0 20px 0 24px; }
/* Avec une icône à gauche (GitHub) : l'inverse */
.btn:has(> svg:first-child:not(.arrow)) {
  gap: 8px;
  padding: 0 22px 0 19px;
}
/* Logo à 16 px : la grille d'origine des icônes GitHub, net à l'écran */
.btn > svg:not(.arrow) {
  flex: none;
  width: 16px;
  height: 16px;
  transition: color .25s var(--ease);
}

/* Un liseré clair en haut et une ombre d'un pixel : le bouton a de la matière, sans effet lourd */
.btn-primary {
  color: var(--on-ink);
  background: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 1px 2px rgba(18, 19, 23, .16);
}
.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}
.btn-invert {
  color: var(--ink);
  background: var(--on-ink);
}

@media (hover: hover) {
  /* Une pointe de bleu dans le noir, la couleur d'accent du site */
  .btn-primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); }
  /* Accent bleu discret : la bordure bleuit et le logo prend la couleur d'accent */
  .btn-secondary:hover {
    background: color-mix(in srgb, var(--text) 4%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  }
  .btn-secondary:hover > svg:not(.arrow) { color: var(--accent); }
  .btn-invert:hover { background: color-mix(in srgb, var(--on-ink) 88%, var(--accent-on-ink)); }
}

/* Appui : le bouton s'enfonce à peine */
.btn:active { transform: scale(.98); }

@media (prefers-reduced-motion: reduce) {
  .skip,
  .btn,
  .menu a,
  .menu .menu-cta,
  .menu-num,
  .menu-label::after,
  .menu-cta-icon,
  .arrow,
  .arrow-line,
  .arrow-head { transition: none; }
  .btn:active,
  a:hover > .arrow--out,
  a:hover > .arrow--up,
  a:hover > .arrow--back .arrow-head { transform: none; }
}

/* Fiche d'informations (légende de la photo, détails des projets) */
.specs {
  margin-top: 24px;
  font-size: .875rem;
  line-height: 1.5;
}
.specs > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.specs > div:last-child { border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }

.specs--compact {
  margin-top: 0;
  font-size: .8125rem;
}
.specs--compact > div {
  grid-template-columns: 5.5rem minmax(0, 1fr);
  padding: 9px 0;
}
.specs--compact dd { font-weight: 500; }

/* Hero : texte sur 7 colonnes, photo sur 4 */
.hero { padding: 88px 0 112px; }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: end;
}
.hero-text { grid-column: 1 / span 7; }
.portrait { grid-column: 9 / span 4; }
.facts { grid-column: 1 / -1; }

.hero-text > *,
.portrait,
.facts { animation: rise .7s var(--ease) both; }
.hero-text > :nth-child(2) { animation-delay: .06s; }
.hero-text > :nth-child(3) { animation-delay: .12s; }
.hero-text > :nth-child(4) { animation-delay: .18s; }
.portrait { animation-delay: .1s; }
.facts { animation-delay: .24s; }

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: .9375rem;
  color: var(--muted);
}
.hero-kicker strong {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: var(--text);
}
.hero-kicker strong::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}

.hero h1 { margin-top: 20px; }

.lead {
  max-width: 33em;
  margin-top: 24px;
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Photo : fond assorti à la page, bord fin, ombre légère */
.portrait { margin: 0; }
.portrait-frame {
  overflow: hidden;
  background: var(--photo-bg);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent), var(--shadow);
}
.portrait img {
  width: 100%;
  aspect-ratio: 9 / 10;
  object-fit: cover;
  object-position: 50% 25%;
  /* Le fond blanc de la photo prend la couleur du cadre */
  mix-blend-mode: multiply;
}
.portrait figcaption { margin-top: 16px; }

/* Chiffres clés */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin-top: 88px;
}
.fact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 18px;
  align-items: center;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
}
.fact-num {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--ff-display);
  font-size: 2.75rem;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums;
}
.fact dt {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.35;
}
.fact-note {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  font-size: .8125rem;
  line-height: 1.45;
  color: var(--muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Sections */
.section {
  padding: var(--space-section) 0;
  border-top: 1px solid var(--line);
}
.section-muted { background: var(--surface-2); }

.section-head {
  align-items: baseline;
  margin-bottom: 64px;
}
.section-head h2 { max-width: 17em; }
.section-intro {
  max-width: 34em;
  margin-top: 20px;
  font-size: 1.0625rem;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Travaux : un projet principal en pleine largeur, puis deux projets côte à côte */
.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 96px;
}
.project {
  grid-column: span 6;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.project--featured { grid-column: 1 / -1; }

.project-media {
  display: grid;
  place-items: center;
  align-content: center;
  height: 520px;
  padding: 40px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.project--featured .project-media {
  height: auto;
  aspect-ratio: 2.2 / 1;
  padding: 56px;
}
.project-media > :first-child { transition: transform .5s var(--ease); }
@media (hover: hover) {
  .project:hover .project-media > :first-child { transform: translateY(-6px); }
}

.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: 32px;
}
/* Les fiches des projets côte à côte s'alignent en bas, même si les textes n'ont pas la même longueur */
.project:not(.project--featured) .specs {
  margin-top: auto;
  padding-top: 28px;
}
.project--featured .project-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-top: 40px;
}
.project--featured .project-main { grid-column: 1 / span 6; }
.project--featured .project-specs {
  grid-column: 8 / -1;
  margin-top: 0;
}

.project-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 14px;
}
.project-num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.project h3 {
  font-size: clamp(1.5rem, 1.15rem + 1vw, 1.875rem);
  line-height: 1.15;
}
.project--featured h3 {
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.5rem);
  line-height: 1.1;
}
.project h3 + p {
  max-width: 36em;
  margin-top: 14px;
  color: var(--text-2);
  text-wrap: pretty;
}
.project-ai {
  margin-top: 14px;
  padding-left: 12px;
  font-size: .875rem;
  color: var(--muted);
  border-left: 2px solid var(--accent);
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 24px;
  font-size: .9375rem;
}

/* Projet 01 : ordinateur et téléphone */
.devices {
  position: relative;
  width: min(100%, 600px);
  margin-right: 48px;
}
.devices .browser { width: 100%; }
.mini-phone {
  position: absolute;
  right: -56px;
  bottom: -32px;
  display: grid;
  align-content: start;
  gap: 8px;
  width: 124px;
  height: 244px;
  padding: 28px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.mini-phone::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  transform: translateX(-50%);
}
.mini-phone .mock-logo { width: 28px; height: 9px; }
.mini-phone .mock-line {
  height: 7px;
  margin-top: 4px;
}
.mini-phone .mock-line.w1 { width: 92%; }
.mini-phone .mock-line.w2 { width: 66%; margin-top: 0; }
.mini-phone .mock-btn {
  width: 56px;
  height: 14px;
  margin: 4px 0 6px;
}
.mini-card {
  height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Projet 02 : Ayron, cartes de prix et graphique. Aucun chiffre : l'application n'affiche jamais de faux prix */
.mock-prices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.mock-price {
  display: grid;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.mock-price small {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  font-size: .5625rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}
.mock-price b { font-weight: 600; color: var(--text); }
.mock-price .mock-line { width: 78%; height: 8px; }
.mock-chart {
  display: grid;
  gap: 10px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.mock-chart-head {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mock-chart-head .mock-sub {
  width: 30%;
  margin-right: 8px;
}
.mock-tab {
  padding: 2px 7px;
  font-size: .5625rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 4px;
}
.mock-tab.is-on { color: var(--text); background: var(--surface-2); }
.mock-chart svg,
.mini-chart svg {
  display: block;
  width: 100%;
  height: 92px;
}
.chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-area { fill: var(--accent-soft); }
.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.mini-chart {
  display: grid;
  align-items: center;
  padding: 6px;
}
.mini-chart svg { height: 100%; }

/* Illustration : navigateur */
.browser {
  width: min(100%, 420px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.browser-bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.browser-url {
  flex: 1;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: .625rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-page {
  display: grid;
  gap: 16px;
  padding: 16px;
}
.mock-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mock-logo {
  width: 34px;
  height: 12px;
  border-radius: 3px;
  background: var(--text);
}
.mock-link {
  width: 28px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.mock-lang {
  margin-left: auto;
  padding: 3px 8px;
  font-size: .5625rem;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  border-radius: 4px;
}
.mock-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 0 6px;
}
.mock-line {
  height: 10px;
  border-radius: 5px;
  background: var(--text);
}
.mock-line.w1 { width: 62%; }
.mock-line.w2 { width: 44%; }
.mock-sub {
  width: 52%;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.mock-btn {
  width: 74px;
  height: 18px;
  margin-top: 6px;
  border-radius: 5px;
  background: var(--accent);
}
.mock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mock-grid span {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* Illustration : téléphone avec la calculatrice */
.phone {
  width: 260px;
  height: 416px;
  overflow: hidden;
  background: #000;
  border: 7px solid var(--text);
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.phone iframe {
  display: block;
  width: 378px;
  height: 618px;
  border: 0;
  transform: scale(.651);
  transform-origin: 0 0;
}
.demo-hint {
  margin-top: 16px;
  font-size: .8125rem;
  color: var(--muted);
}

/* Illustration : chaîne de publication */
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 440px);
}
.pipe-node {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 20px 8px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.pipe-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.pipe-icon svg { width: 18px; height: 18px; }
.pipe-node strong {
  font-size: .875rem;
  font-weight: 600;
}
.pipe-node > span:last-child {
  font-size: .6875rem;
  color: var(--muted);
}
.pipe-arrow {
  position: relative;
  align-self: center;
  flex: 0 0 22px;
  height: 1.5px;
  background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 8px);
}
.pipe-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: translateY(-50%) rotate(45deg);
}

/* À propos */
.about { margin-bottom: 96px; }
.about-lead {
  max-width: 25em;
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}
.about-text {
  max-width: 36em;
  margin-top: 36px;
  font-size: 1.0625rem;
  color: var(--text-2);
}
.about-text p + p { margin-top: 16px; }
.about-text .about-goal {
  font-weight: 500;
  color: var(--text);
}

/* Parcours et compétences : étiquette à gauche, lignes à droite */
.cv { align-items: start; }
.cv + .cv { margin-top: 72px; }

.cv-title {
  padding-top: 20px;
  border-top: 1px solid var(--text);
}
.cv-list {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-columns: subgrid;
}
.cv-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-columns: subgrid;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
}
.cv-row:last-child { border-bottom: 1px solid var(--line); }

.cv-period {
  grid-column: 1 / span 2;
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cv-body { grid-column: 3 / -1; }

.cv-body h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.cv-place {
  font-size: .9375rem;
  color: var(--muted);
}
.cv-points {
  display: grid;
  gap: 6px;
  max-width: 40em;
  margin-top: 14px;
}
.cv-points li {
  position: relative;
  padding-left: 20px;
  color: var(--text-2);
}
.cv-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .8em;
  width: 8px;
  height: 1px;
  background: var(--muted);
}
.cv-tech {
  margin-top: 16px;
  font-size: .875rem;
  font-weight: 500;
}
.cv-note {
  margin-top: 4px;
  font-size: .875rem;
  color: var(--muted);
}
.cv-text {
  margin-top: 2px;
  color: var(--text-2);
}
.skill {
  font-weight: 500;
  line-height: 1.6;
}
dl.cv-list .cv-period { color: var(--text); }
dl.cv-list .cv-text {
  font-size: .9375rem;
  color: var(--muted);
}

/* Méthode */
.method {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 48px;
  align-items: center;
}

.steps {
  display: grid;
  gap: 6px;
}

.step-btn {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 2px;
  width: 100%;
  padding: 18px 20px;
  overflow: hidden;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.step-btn:hover { border-color: var(--line); }
.step.is-active .step-btn {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

/* Barre de temps de l'étape en cours, pendant le défilement automatique */
.step-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.method.is-auto .step.is-active .step-btn::after { animation: step-bar 4s linear both; }

.step-num {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: .75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.step.is-active .step-num {
  background: var(--ink);
  color: var(--on-ink);
  border-color: var(--ink);
}

.step-title {
  font-family: var(--ff-display);
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--muted);
  transition: color .3s ease;
}
.step.is-active .step-title { color: var(--text); }

.step-desc {
  font-size: .9375rem;
  color: var(--muted);
}

@keyframes step-bar {
  to { transform: scaleX(1); }
}

/* Illustration animée */
.method-art {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.method-art svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.art-blob { fill: var(--accent-soft); opacity: .75; }
.art-card { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.art-box { fill: var(--surface); stroke: var(--text); stroke-width: 1.3; }
.art-stroke { fill: none; stroke: var(--text); stroke-width: 1.1; opacity: .5; }
.art-hair { stroke: var(--line); stroke-width: 1.2; }
.art-dot,
.art-fill-line { fill: var(--line); }
.art-ink { fill: var(--text); }
.art-soft { fill: var(--surface-2); stroke: var(--line); }
.art-accent { fill: var(--accent); }
.art-accent-soft { fill: var(--accent-soft); }
.art-ok { fill: var(--ok); }
.art-tick {
  fill: none;
  stroke: var(--surface);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art-lens { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.art-handle { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.art-orbit { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 2 5; }
.art-cursor {
  fill: var(--text);
  stroke: var(--surface);
  stroke-width: 1;
  animation: art-cursor 6s ease-in-out infinite;
}
.art-text {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 500;
  fill: var(--text);
}
.art-text--accent { font-weight: 600; fill: var(--accent); }

.art-part { transition: opacity .5s ease; }
.method-art[data-active] .art-part { opacity: .32; }
.method-art[data-active="1"] [data-part="1"],
.method-art[data-active="2"] [data-part="2"],
.method-art[data-active="3"] [data-part="3"],
.method-art[data-active="4"] [data-part="4"] { opacity: 1; }

.art-link {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 3 7;
  animation: art-flow 1.4s linear infinite;
}
.art-check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16;
  stroke-dashoffset: 16;
  animation: art-check 6s ease infinite backwards;
  animation-delay: calc(var(--i) * .6s);
}
.code-line {
  fill: color-mix(in srgb, var(--text) 26%, transparent);
  transform-box: fill-box;
  transform-origin: 0 50%;
  animation: art-type 7s ease infinite backwards;
  animation-delay: calc(var(--i) * .5s);
}
.code-line.code-accent { fill: var(--accent); }
.code-cursor {
  fill: var(--accent);
  animation: art-blink 1s steps(1) infinite;
}
.art-float { animation: art-float 6s ease-in-out infinite; }
.art-float--b { animation-duration: 7s; animation-delay: -2.5s; }
.art-float--c { animation-duration: 5s; animation-delay: -1s; }
.art-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: art-pulse 3s ease-out infinite;
}
.art-live {
  transform-box: fill-box;
  transform-origin: center;
  animation: art-live 1.8s ease-in-out infinite;
}

@keyframes art-flow {
  to { stroke-dashoffset: -20; }
}
@keyframes art-check {
  0%, 8% { stroke-dashoffset: 16; }
  22%, 88% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 16; }
}
@keyframes art-type {
  0% { transform: scaleX(0); opacity: 1; }
  10%, 86% { transform: scaleX(1); opacity: 1; }
  93%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes art-blink {
  50% { opacity: 0; }
}
@keyframes art-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes art-cursor {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(-58px, -34px); }
  65% { transform: translate(-20px, 4px); }
}
@keyframes art-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes art-live {
  50% { transform: scale(1.35); opacity: .6; }
}

/* Contact : la page se termine sur un bloc sombre, pied de page compris */
.contact {
  padding-top: var(--space-section);
  color: var(--on-ink);
  background: var(--ink);
}
.contact-head { align-items: baseline; }
.contact .eyebrow { color: color-mix(in srgb, var(--on-ink) 58%, transparent); }
.contact .eyebrow span,
.contact h2 em { color: var(--accent-on-ink); }
.contact h2 {
  max-width: 13em;
  font-size: clamp(2.4rem, 1.4rem + 3.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.contact-text {
  max-width: 32em;
  margin-top: 20px;
  font-size: 1.0625rem;
  color: color-mix(in srgb, var(--on-ink) 72%, transparent);
}
.contact .actions { margin-top: 32px; }
.contact :focus-visible,
.footer :focus-visible { outline-color: var(--accent-on-ink); }

.contact-list {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-template-columns: subgrid;
  margin-top: 80px;
}
.contact-list > div {
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--on-ink) 20%, transparent);
}
.contact-list > div:first-child { grid-column: 1 / span 5; }
.contact-list > div:last-child { grid-column: 6 / -1; }
.contact-list dt {
  margin-bottom: 6px;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--on-ink) 58%, transparent);
}
.contact-list dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  font-size: 1.0625rem;
}
.contact .link {
  color: var(--on-ink);
  overflow-wrap: anywhere;
}

.copy-btn {
  display: none;
  align-items: center;
  align-self: center;
  height: 30px;
  padding: 0 12px;
  font-size: .8125rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--on-ink) 72%, transparent);
  background: none;
  border: 1px solid color-mix(in srgb, var(--on-ink) 22%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.js .copy-btn { display: inline-flex; }
.copy-btn:hover {
  color: var(--on-ink);
  border-color: color-mix(in srgb, var(--on-ink) 50%, transparent);
}
.copy-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copy-label,
.copy-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copy-done,
.copy-btn.is-copied .copy-label { display: none; }
.copy-btn.is-copied {
  color: var(--accent-on-ink);
  border-color: currentColor;
}
.copy-btn.is-copied .copy-done { display: inline-flex; }

/* Footer */
.footer {
  color: color-mix(in srgb, var(--on-ink) 58%, transparent);
  background: var(--ink);
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: baseline;
  padding-top: 112px;
  padding-bottom: 40px;
  font-size: .875rem;
}
.footer-inner > * {
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent);
}
.footer-inner > :first-child { grid-column: 1 / span 3; }
.footer-note { grid-column: 4 / span 6; }
.footer-inner > .link {
  grid-column: 10 / -1;
  justify-self: stretch;
  text-align: right;
  font-weight: 400;
  color: inherit;
  background: none;
}
.footer-inner > .link:hover { color: var(--on-ink); }
.footer-inner > .link-arrow { justify-content: flex-end; }

/* Apparition au défilement */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-text > *, .portrait, .facts { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .project-media > :first-child { transition: none; }
  .project:hover .project-media > :first-child { transform: none; }
  .method-art * { animation: none !important; }
  .art-check { stroke-dashoffset: 0; }
  .art-pulse { opacity: 0; }
}

/* Petits ordinateurs */
@media (max-width: 1080px) {
  :root { --gutter: 20px; }
  .facts { margin-top: 72px; }
  .project--featured .project-main { grid-column: 1 / span 7; }
}

@media (max-width: 960px) {
  .method {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .method-art { order: -1; }

  .fact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .fact dt,
  .fact .fact-note { align-self: auto; }
  .fact-num {
    order: -1;
    margin-bottom: 10px;
  }
}

/* Tablette : la colonne d'étiquettes passe au-dessus du contenu */
@media (max-width: 860px) {
  .hero { padding: 64px 0 88px; }
  .specs--compact > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .menu-num { display: none; }

  .rail,
  .main-col { grid-column: 1 / -1; }
  .section-head { margin-bottom: 48px; }
  .section-head .eyebrow,
  .contact-head .eyebrow { margin-bottom: 16px; }
  .cv-title { margin-bottom: 8px; }
  .cv-list,
  .cv-row,
  .contact-list { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-columns: subgrid; }
  .cv-period { grid-column: 1 / span 3; }
  .cv-body { grid-column: 4 / -1; }
  .contact-list > div:first-child { grid-column: 1 / span 7; }
  .contact-list > div:last-child { grid-column: 8 / -1; }

  .projects { row-gap: 72px; }
  .project { grid-column: 1 / -1; }
  .project-media { height: 480px; }
  .project--featured .project-media {
    aspect-ratio: auto;
    padding: 40px 40px 64px;
  }
  .project--featured .project-main,
  .project--featured .project-specs { grid-column: 1 / -1; }
  .project--featured .project-specs { margin-top: 24px; }

  .footer-inner > :first-child { grid-column: 1 / span 4; }
  .footer-note { grid-column: 5 / span 5; }
}

/* Mobile */
@media (max-width: 720px) {
  .burger { display: grid; }
  .nav-actions {
    margin-left: auto;
    padding-left: 0;
  }
  .nav-actions::before { display: none; }
  .menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 4px var(--gutter) 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .menu.is-open { display: flex; }
  .menu a:not(.menu-cta) {
    gap: 12px;
    padding: 14px 0;
    font-size: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .menu-num {
    display: inline;
    min-width: 1.5em;
    font-size: .75rem;
    color: var(--muted);
  }
  .menu-label::after { display: none; }
  .menu .menu-cta {
    justify-content: space-between;
    height: 52px;
    margin: 16px 0 0;
    padding: 0 6px 0 20px;
    font-size: 1rem;
    color: var(--on-ink);
    background: var(--ink);
    border: 0;
  }
  .menu-cta-icon {
    width: 40px;
    height: 40px;
    color: var(--ink);
    background: var(--on-ink);
  }
  .menu-cta-icon .arrow {
    width: 11px;
    height: 11px;
  }
  .menu .menu-cta:hover,
  .menu .menu-cta.is-active { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); }
  .menu .menu-cta:hover .menu-cta-icon { color: var(--on-ink); }

  .hero-text,
  .portrait { grid-column: 1 / -1; }
  .portrait {
    display: grid;
    grid-template-columns: minmax(0, 13.5rem) minmax(0, 1fr);
    column-gap: var(--gutter);
    align-items: end;
    margin-top: 48px;
  }
  .portrait figcaption { margin-top: 0; }
  .facts { margin-top: 48px; }

  .project-media { height: 460px; padding: 24px; }
  .project--featured .project-media { padding: 32px 24px 48px; }
  .devices { margin-right: 36px; }
  .mini-phone {
    right: -40px;
    bottom: -24px;
    width: 92px;
    height: 180px;
    padding: 22px 9px 9px;
    border-radius: 16px;
  }
  .mini-card { height: 30px; }
  .pipeline { gap: 6px; }

  .about { margin-bottom: 72px; }
  .about-text { margin-top: 28px; }

  .method-art { padding: 12px; }
  .step-btn {
    column-gap: 14px;
    padding: 16px;
  }
  .step-title { font-size: 1.375rem; }

  .footer-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 88px;
  }
  .footer-inner > * {
    padding-top: 0;
    border-top: 0;
  }
  .footer-inner > :first-child {
    padding-top: 20px;
    border-top: 1px solid color-mix(in srgb, var(--on-ink) 14%, transparent);
  }
  .footer-inner > .link {
    text-align: left;
    margin-top: 10px;
  }
  .footer-inner > .link-arrow { justify-content: flex-start; }
}

@media (max-width: 600px) {
  /* L'accueil commence plus haut sur téléphone : le lien d'évitement se fait plus compact */
  .skip {
    top: 68px;
    height: 32px;
    padding: 0 14px;
    font-size: .8125rem;
  }
  .hero { padding: 40px 0 64px; }
  .hero h1 { margin-top: 16px; }
  .lead { margin-top: 20px; }
  .actions { margin-top: 28px; }
  .actions .btn {
    flex: 1 1 auto;
    height: 48px;
    gap: 8px;
    padding: 0 18px;
  }

  .facts {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 40px;
  }
  .fact {
    display: grid;
    grid-template-columns: 4.75rem minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    padding: 16px 0;
  }
  .fact:last-child { border-bottom: 1px solid var(--line-strong); }
  .fact dt { align-self: end; }
  .fact .fact-note { align-self: start; }
  .fact-num {
    margin: 0;
    font-size: 2.25rem;
  }

  .specs:not(.specs--compact) > div {
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 12px;
  }

  .cv-period,
  .cv-body { grid-column: 1 / -1; }
  .cv-period { margin-bottom: 4px; }
  ol.cv-list .cv-period { font-size: .875rem; }

  .contact-list > div:first-child,
  .contact-list > div:last-child { grid-column: 1 / -1; }
  .contact-list > div + div { margin-top: 28px; }
  .contact-list { margin-top: 56px; }
}

@media (max-width: 420px) {
  .portrait {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 16px;
  }
}

/* ==========================================================================
   Étude de cas (projets/ayron.html) : mêmes grilles, couleurs et polices que l'accueil
   ========================================================================== */

.case-hero { padding: 40px 0 var(--space-section); }

.case-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color .2s ease;
}
.case-back:hover { color: var(--text); }

.case-intro {
  align-items: end;
  margin-top: 56px;
}
.case-text { grid-column: 1 / span 7; }
.case-text h1 { margin-top: 20px; }
.case-text .project-ai { margin-top: 24px; }
.case-specs { grid-column: 9 / -1; }
/* .case-hero .case-shot : plus précis que .case-shot, qui remet la marge à zéro */
.case-hero .case-shot { margin-top: 72px; }

/* Captures d'écran, et emplacements tant que la capture n'est pas fournie */
.case-shot {
  min-width: 0;
  margin: 0;
}
.case-shot img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.shot-slot {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  aspect-ratio: 16 / 10;
  padding: 24px;
  text-align: center;
  font-size: .9375rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.case-shot--phone .shot-slot { aspect-ratio: 9 / 19.5; }
.shot-tag {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.case-shot figcaption {
  margin-top: 14px;
  font-size: .875rem;
  color: var(--muted);
}

.case-prose {
  max-width: 36em;
  font-size: 1.0625rem;
  color: var(--text-2);
}
.case-prose p + p { margin-top: 16px; }
.case-row {
  color: var(--text-2);
  text-wrap: pretty;
}

/* Deux captures d'ordinateur à gauche, le téléphone à droite */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 48px;
  margin-top: 96px;
}
.case-gallery > .case-shot { grid-column: 1 / span 8; }
.case-gallery > .case-shot--phone {
  grid-column: 9 / -1;
  grid-row: 1 / span 2;
}

/* Défis techniques : numéro à gauche, problème et solution à droite */
.case-challenge {
  padding: 40px 0 48px;
  border-top: 1px solid var(--line-strong);
}
.case-challenge:last-child { padding-bottom: 0; }
.case-num {
  font-family: var(--ff-display);
  font-size: 2.75rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
}
.case-challenge h3 {
  max-width: 22em;
  font-size: clamp(1.5rem, 1.15rem + 1vw, 1.875rem);
  line-height: 1.15;
}
.case-ps {
  display: grid;
  gap: 14px;
  max-width: 42em;
  margin-top: 22px;
}
.case-ps > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 16px;
}
.case-ps dt {
  padding-top: .25em;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-ps dd {
  color: var(--text-2);
  text-wrap: pretty;
}

.case-diagram {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 42em;
  margin: 32px 0 0;
  padding: 32px 24px 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.case-diagram .pipeline { width: min(100%, 520px); }
.case-diagram figcaption {
  font-size: .875rem;
  color: var(--muted);
  text-align: center;
}

/* Prochaines étapes */
.case-next { max-width: 44em; }
.case-next li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.case-next li:last-child { border-bottom: 1px solid var(--line); }
.case-next p { color: var(--text-2); }
.case-tag {
  justify-self: start;
  padding: 2px 9px;
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.case-end h2 { max-width: 13em; }
.case-end .actions { margin-top: 32px; }


@media (max-width: 860px) {
  .case-text,
  .case-specs { grid-column: 1 / -1; }
  .case-specs { margin-top: 40px; }
  .case-hero .case-shot { margin-top: 56px; }

  .case-gallery { margin-top: 72px; }
  .case-gallery > .case-shot,
  .case-gallery > .case-shot--phone {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .case-gallery > .case-shot--phone {
    justify-self: center;
    width: min(100%, 300px);
  }

  .case-num {
    margin-bottom: 16px;
    font-size: 2.25rem;
  }
}

@media (max-width: 600px) {
  .case-hero { padding-top: 24px; }
  .case-intro { margin-top: 32px; }
  .case-ps > div,
  .case-next li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .case-next li { gap: 8px; }
  .case-diagram { padding: 24px 16px 20px; }

  /* Schéma vertical : les trois étapes se lisent de haut en bas */
  .case-diagram .pipeline {
    flex-direction: column;
    width: min(100%, 240px);
  }
  .case-diagram .pipe-arrow {
    width: 1.5px;
    height: auto;
    background: repeating-linear-gradient(180deg, var(--muted) 0 4px, transparent 4px 8px);
  }
  .case-diagram .pipe-arrow::after {
    top: auto;
    right: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }
}
