/* ==========================================================
   François Veysset, portfolio
   Pour changer l'ambiance : modifie les variables de :root.
   ========================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #101114;          /* fond général */
  --surface: #1A1B20;     /* cartes */
  --line: #2C2E35;        /* filets */
  --text: #F3F2EE;        /* texte principal */
  --muted: #A6A8B0;       /* texte secondaire */
  --accent: #A7B1FF;      /* couleur d'accent : liens, repères */
  --dot: rgba(243, 242, 238, 0.11);  /* points du fond */
  --shine-band: #FFFFFF;  /* reflet qui balaie les mots en couleur */
  --veil: 0.86;           /* plus haut = halo de la lueur plus discret */
  color-scheme: dark;

  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --max: 1200px;
  --pad: clamp(20px, 5vw, 64px);
  --section: clamp(80px, 11vw, 160px);
  --radius-lg: 28px;
  --radius-md: 18px;
  --dot-gap: 24px;        /* écart entre les points du fond */
}

/* ---------- Mode clair (bouton en bas à droite) ---------- */
[data-theme="light"] {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --line: #E3E1DA;
  --text: #15161B;
  --muted: #5A5C66;
  --accent: #4553D8;      /* plus foncé que le lavande : lisible sur fond clair */
  --dot: rgba(21, 22, 27, 0.13);
  --shine-band: #B9C1FF;
  --veil: 0.88;
  color-scheme: light;
}
/* Pendant le changement de mode, les couleurs passent en fondu */
.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, stroke 0.45s ease, opacity 0.45s ease, transform 0.35s var(--ease-out) !important;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* ---------- Fond : grille de points + lueur qui suit la souris ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at center, var(--dot) 1px, transparent 1.6px);
  background-size: var(--dot-gap) var(--dot-gap);
}
/* Lueur et traînée sous la souris : dessinées par assets/js/site.js.
   Le voile, percé à l'emplacement de chaque point, laisse voir la lueur en plein
   à travers les points et en léger halo autour. */
.cursor-trail, .cursor-veil { display: none; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.cursor-trail { width: 100%; height: 100%; }
.cursor-veil {
  background: var(--bg); opacity: var(--veil);
  -webkit-mask-image: radial-gradient(circle at center, transparent 1.3px, #000 2px);
          mask-image: radial-gradient(circle at center, transparent 1.3px, #000 2px);
  -webkit-mask-size: var(--dot-gap) var(--dot-gap);
          mask-size: var(--dot-gap) var(--dot-gap);
}
.has-trail .cursor-trail, .has-trail .cursor-veil { display: block; }

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

.skip { position: absolute; left: 16px; top: -80px; z-index: 50; padding: 10px 16px; background: var(--text); color: var(--bg); border-radius: 8px; }
.skip:focus { top: 16px; }

/* ---------- En-tête ---------- */
/* Dès qu'on défile : verre dépoli. Tout en haut de la page : transparent.
   assets/js/site.js ajoute .is-scrolled au défilement. La règle « transparent » ne vaut
   que si le script du <head> a tourné (data-theme) : sans JavaScript, l'en-tête garde
   son verre et reste lisible. */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background-color: color-mix(in srgb, var(--bg) 66%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: background-color 0.4s var(--ease-out), backdrop-filter 0.4s var(--ease-out), -webkit-backdrop-filter 0.4s var(--ease-out);
}
html[data-theme] .site-header:not(.is-scrolled) {
  background-color: transparent;
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--text); color: var(--bg);
  font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 600; font-size: 15px; }
.nav { display: flex; gap: 28px; }
.nav a { display: inline-block; padding: 12px 0; font-size: 15px; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
/* Bouton « Travaillons ensemble » : s'ouvre en menu déroulant au survol, au clic ou au clavier.
   La hauteur du bloc est figée : le panneau s'agrandit vers le bas sans pousser l'en-tête. */
.contact-menu { position: relative; height: 46px; }
.contact-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 23px; overflow: hidden;
}
.contact-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 14px 0 18px;
  border: 0; border-radius: 22px; background: none; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chevron { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.contact-drop { display: grid; grid-template-rows: 0fr; }
.contact-links {
  min-height: 0; overflow: hidden; visibility: hidden; opacity: 0;
  display: grid; align-content: start; gap: 2px; padding: 0 6px;
}
.contact-links li:last-child { padding-bottom: 6px; }
.contact-links a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 16px;
  font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none;
}
.contact-links svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.contact-links a:hover, .contact-links a:focus-visible { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.contact-links a:hover svg, .contact-links a:focus-visible svg { color: var(--accent); }
.contact-links a:focus-visible { outline-offset: -2px; }
.contact-menu.is-open .contact-panel { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.contact-menu.is-open .contact-drop { grid-template-rows: 1fr; }
.contact-menu.is-open .contact-links { visibility: visible; opacity: 1; }
.contact-menu.is-open .chevron { transform: rotate(180deg); color: var(--text); }

/* ---------- Accroche ---------- */
.hero { padding: clamp(72px, 12vw, 168px) 0 var(--section); }
.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.75rem, 7.6vw, 6.6rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 13ch;
  text-wrap: balance;
}
/* Mots mis en valeur : couleur d'accent, reflet qui balaie le mot au survol */
.shine { color: var(--accent); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .shine {
    background-image: linear-gradient(100deg, var(--accent) 0%, var(--accent) 42%, var(--shine-band) 50%, var(--accent) 58%, var(--accent) 100%);
    background-size: 250% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
  .shine:hover { background-position: 0% 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .shine { transition: background-position 0.9s cubic-bezier(.3,.6,.2,1); }
}

.hero-lede { margin-top: 32px; max-width: 36em; font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); }
.hero-cta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }

/* Une seule animation : l'accroche apparaît au chargement */
@media (prefers-reduced-motion: no-preference) {
  .hero-title, .hero-lede, .hero-cta { animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both; }
  .hero-lede { animation-delay: 0.14s; }
  .hero-cta { animation-delay: 0.24s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.btn {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px; font-family: inherit; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--bg); }

.quick-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.quick-links a { display: inline-block; padding: 10px 0; font-weight: 500; }

/* ---------- Survol : simple changement de couleur, en douceur ---------- */
:root { --ease-out: cubic-bezier(.22, .8, .24, 1); }
a { transition: color 0.35s var(--ease-out), text-decoration-color 0.35s var(--ease-out); }
.btn, .brand-mark, .contact-panel, .contact-links a, .contact-links svg {
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.brand:hover .brand-mark { background: var(--accent); }
.chevron { transition: transform 0.4s var(--ease-out), color 0.4s var(--ease-out); }
.contact-drop { transition: grid-template-rows 0.4s var(--ease-out); }
.contact-links { transition: opacity 0.25s var(--ease-out), visibility 0s linear 0.4s; }
.contact-menu.is-open .contact-links { transition: opacity 0.3s var(--ease-out) 0.05s, visibility 0s; }
@media (prefers-reduced-motion: reduce) {
  .chevron, .contact-drop, .contact-links, .contact-menu.is-open .contact-links { transition: none; }
}

/* ---------- Sections ---------- */
.section { padding-top: var(--section); }
.section-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.4rem, 5.4vw, 4.4rem); line-height: 1.02; letter-spacing: -0.035em;
  margin-bottom: clamp(36px, 5vw, 64px);
}

/* ---------- Projets : cartes de l'accueil ----------
   Chaque carte a sa couleur, réglée dans le HTML (--case-bg). Texte blanc :
   choisis une couleur assez foncée (contraste d'au moins 4,5:1 avec le blanc).
   Au clic, la couleur de la carte s'agrandit jusqu'à l'en-tête de la page projet
   (voir « Transition carte → page projet », plus bas). */
.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.case { position: relative; border-radius: var(--radius-lg); overflow: hidden; scroll-margin-top: 100px; }   /* lien « Retour aux projets » : sous l'en-tête */
.case-wide { grid-column: 1 / -1; }
.case-link {
  position: relative; display: flex; flex-direction: column; gap: 36px; height: 100%;
  padding: clamp(24px, 4vw, 48px) clamp(24px, 4vw, 48px) 0;
  color: #fff; text-decoration: none;
}
.case-link:hover { color: #fff; }
/* Le fond de couleur, avec la grille de points du site qui s'estompe vers le texte */
.case-field, .study-field { position: absolute; inset: 0; background-color: var(--case-bg); }
.case-field::after, .study-field::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 1px, transparent 1.6px);
  background-size: var(--dot-gap) var(--dot-gap);
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 90%);
          mask-image: linear-gradient(100deg, transparent 30%, #000 90%);
}
.case-field { transition: background-color 0.4s var(--ease-out); }
.case-link:hover .case-field { background-color: color-mix(in srgb, var(--case-bg) 88%, #fff); }
.case-text { position: relative; }
.case-client { font-weight: 600; color: rgba(255, 255, 255, 0.86); }
.case-title { font-family: var(--display); font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; margin: 6px 0 12px; text-wrap: balance; }
.case-summary { max-width: 32em; color: rgba(255, 255, 255, 0.9); }
.case-metrics { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 24px; font-size: 15px; color: rgba(255, 255, 255, 0.86); }
.case-metrics strong { display: block; font-family: var(--display); font-size: 2rem; line-height: 1.1; color: #fff; }
.case-more {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-weight: 600;
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1.5px; text-underline-offset: 5px;
  transition: text-decoration-color 0.35s var(--ease-out);
}
.case-link:hover .case-more { text-decoration-color: currentColor; }
.case-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Le visuel, posé en bas de la carte */
.case-img {
  position: relative; width: 100%; margin-top: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
/* Repère du clavier : autour de toute la carte */
@supports selector(:has(*)) {
  .case-link:focus-visible { outline: none; }
  .case:has(.case-link:focus-visible) { outline: 3px solid var(--accent); outline-offset: 4px; }
}
/* Carte large, sur grand écran : texte à gauche, visuel à droite */
@media (min-width: 961px) {
  .case-wide .case-link { flex-direction: row; align-items: flex-end; gap: clamp(32px, 5vw, 64px); }
  .case-wide .case-text { flex: 1 1 44%; align-self: center; padding-bottom: clamp(24px, 4vw, 48px); }
  .case-wide .case-img { flex: 1 1 56%; min-width: 0; }
}

/* ---------- Projets : encart « Bientôt disponible » ---------- */
.soon { position: relative; border-radius: var(--radius-lg); overflow: hidden; color: #fff; }
.soon-text { position: relative; max-width: 40em; padding: clamp(32px, 5vw, 64px); }
.soon-badge {
  display: inline-block; padding: 5px 14px; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.92);
}
.soon-title { font-family: var(--display); font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; margin: 20px 0 14px; text-wrap: balance; }
.soon-lede { max-width: 34em; color: rgba(255, 255, 255, 0.9); }
.soon-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 20px;
  font-weight: 600; color: #fff; text-decoration-color: rgba(255, 255, 255, 0.45);
}
.soon-link:hover { color: #fff; text-decoration-color: #fff; }
.soon-link:focus-visible { outline-color: #fff; }
.soon-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Emplacements à compléter (ne doivent pas partir en ligne) ---------- */
.todo {
  background: color-mix(in srgb, currentColor 12%, transparent);
  text-decoration: underline dashed color-mix(in srgb, currentColor 55%, transparent);
  text-decoration-thickness: 1px; text-underline-offset: 0.22em;
  border-radius: 4px; padding: 0 0.2em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.visual-todo {
  display: grid; place-items: center; padding: 24px; text-align: center;
  font-size: 15px; font-weight: 500; line-height: 1.4;
  border: 1.5px dashed color-mix(in srgb, currentColor 55%, transparent);
  background-color: color-mix(in srgb, currentColor 6%, transparent);
}
.case-img.visual-todo { border-bottom: 0; }

/* ---------- Page projet (dossier projets/) ---------- */
.study-hero { position: relative; color: #fff; }
.study-hero-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(48px, 7vw, 96px);
}
.study-back {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: clamp(24px, 4vw, 48px);
  font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, 0.86); text-decoration: none;
}
.study-back:hover { color: #fff; }
.study-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.study-hero :focus-visible { outline-color: #fff; }
.study-client { font-weight: 600; color: rgba(255, 255, 255, 0.86); }
.study-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1; letter-spacing: -0.035em; margin-top: 8px; text-wrap: balance;
}
.study-lede { margin-top: 24px; max-width: 32em; font-size: clamp(18px, 1.6vw, 20px); color: rgba(255, 255, 255, 0.9); }
.study-visual { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-md); }

.glance { padding-top: clamp(48px, 6vw, 80px); }
.glance-facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px;
  padding-bottom: clamp(32px, 4vw, 48px); border-bottom: 1px solid var(--line);
}
.glance-facts dt { font-size: 14px; color: var(--muted); }
.glance-facts dd { margin: 6px 0 0; font-weight: 500; }

.chapter { padding-top: clamp(64px, 9vw, 128px); }
.chapter-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 4vw, 3.1rem);
  line-height: 1.08; letter-spacing: -0.03em; max-width: 22ch; text-wrap: balance;
}
.chapter-kicker { display: block; margin-bottom: 14px; font-family: var(--body); font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--accent); }
.chapter-body { margin-top: clamp(24px, 3vw, 36px); max-width: 40em; }
.chapter-body > p, .chapter-body li { color: var(--muted); font-size: 18px; }
.chapter-body > p + p { margin-top: 16px; }
.chapter-body strong { color: var(--text); font-weight: 600; }
.study-list { display: grid; gap: 10px; padding-left: 1.1em; list-style: disc; }
.study-list li::marker { color: var(--accent); }
.study-steps { display: grid; gap: 28px; }
.study-steps li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 8px; }
.study-step-num { grid-row: span 2; padding-top: 5px; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--accent); font-variant-numeric: tabular-nums; }
.study-steps h3 { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.3; color: var(--text); }
.study-figure { margin-top: clamp(40px, 5vw, 64px); }
.study-figure img, .study-figure .visual-todo { width: 100%; border-radius: var(--radius-lg); }
.study-figure .visual-todo { aspect-ratio: 16 / 9; color: var(--muted); }
.study-figure figcaption { margin-top: 14px; max-width: 40em; font-size: 14px; color: var(--muted); }
.study-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(24px, 3vw, 36px); }
.study-metrics li { padding: 24px 24px 28px; border-radius: var(--radius-md); background: var(--surface); color: var(--muted); }
.study-metrics strong { display: block; margin-bottom: 6px; font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; color: var(--text); }
.study-next { padding-top: clamp(80px, 11vw, 160px); }
.study-next-title { margin-bottom: 20px; font-size: 15px; font-weight: 600; color: var(--muted); }

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

/* ---------- Transition carte → page projet ----------
   Navigateurs récents seulement (View Transitions entre deux pages) : ailleurs,
   la page projet s'ouvre normalement. assets/js/transitions.js désigne la carte
   cliquée ; sa couleur s'agrandit jusqu'à l'en-tête de la page projet, et
   rétrécit dans sa carte au retour. Désactivée si les animations sont réduites. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
/* Ce qui ne change pas d'une page à l'autre reste en place */
.site-header { view-transition-name: site-header; }
.theme-switch { view-transition-name: theme-switch; }
.consent { view-transition-name: consent; }
/* Les trois morceaux qui voyagent : le fond de couleur, le texte, le visuel */
.study-field { view-transition-name: case-field; }
.study-hero-text { view-transition-name: case-hero-text; }
.study-visual { view-transition-name: case-visual; }
.case.vt-target .case-field { view-transition-name: case-field; }
.case.vt-target .case-text { view-transition-name: case-card-text; }
.case.vt-target .case-img { view-transition-name: case-visual; }
.vt-card .study-hero *, .vt-plain .study-hero * { view-transition-name: none; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.4s; }
::view-transition-group(case-field), ::view-transition-group(case-visual) {
  animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.65, 0, 0.2, 1);
}
/* Le fond est une couleur unie : il s'étire, sans garder ses proportions */
::view-transition-old(case-field), ::view-transition-new(case-field) { width: 100%; height: 100%; object-fit: fill; }
.vt-expand::view-transition-image-pair(case-field) { animation: vt-unround 0.6s cubic-bezier(0.65, 0, 0.2, 1) both; }
.vt-collapse::view-transition-image-pair(case-field) { animation: vt-round 0.6s cubic-bezier(0.65, 0, 0.2, 1) both; }
/* Le texte de départ s'efface vite, celui d'arrivée apparaît une fois la couleur en place */
::view-transition-old(case-card-text), ::view-transition-old(case-hero-text) { animation: vt-fade-out 0.2s ease both; }
::view-transition-new(case-card-text), ::view-transition-new(case-hero-text) { animation: vt-fade-in 0.4s ease 0.3s both; }
@keyframes vt-unround { from { clip-path: inset(0 round var(--radius-lg)); } to { clip-path: inset(0 round 0); } }
@keyframes vt-round { from { clip-path: inset(0 round 0); } to { clip-path: inset(0 round var(--radius-lg)); } }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }

/* ---------- Expérience : frise verticale ---------- */
.timeline { position: relative; max-width: 760px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px; background: var(--line);
}
.tl-item { position: relative; padding: 0 0 44px 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted);
}
.tl-current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); }
.tl-date { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-org { font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.2; letter-spacing: -0.02em; margin-top: 2px; }
.tl-role { color: var(--text); opacity: 0.85; margin-top: 2px; }
.tl-desc { color: var(--muted); margin-top: 10px; max-width: 40em; }

.schools { margin-top: clamp(56px, 7vw, 88px); padding-top: 32px; border-top: 1px solid var(--line); }
.schools + .schools { margin-top: 32px; }
.schools-title { font-size: 15px; font-weight: 500; color: var(--muted); margin-bottom: 10px; }
.schools-list { font-family: var(--display); font-weight: 600; font-size: clamp(1.25rem, 2.6vw, 1.9rem); line-height: 1.35; letter-spacing: -0.015em; }
.schools-list span { color: var(--muted); font-weight: 400; margin: 0 0.3em; }

/* ---------- Expertise ---------- */
.expertise { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 64px) clamp(32px, 6vw, 96px); max-width: 1000px; }
.skill-icon { width: 28px; height: 28px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.skill-title { font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.015em; line-height: 1.25; margin-bottom: 8px; }
.skill p { color: var(--muted); max-width: 30em; }
.tools { margin-top: clamp(48px, 6vw, 72px); color: var(--muted); }
.tools-label { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ---------- À propos ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.about-text p { color: var(--muted); font-size: 18px; max-width: 34em; }
.about-text p + p { margin-top: 18px; }
.portrait { margin-top: clamp(0px, 9vw, 120px); }
.portrait img, .portrait-placeholder { border-radius: var(--radius-lg); aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.portrait-placeholder {
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--display); font-weight: 800; font-size: clamp(4rem, 9vw, 7rem); color: var(--line); letter-spacing: -0.04em;
}

/* ---------- Méthode ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.step { padding: 28px 24px 32px; border-radius: var(--radius-md); background: var(--surface); }
.step-num { display: block; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--accent); margin-bottom: 40px; font-variant-numeric: tabular-nums; }
.step-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.015em; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 16px; }

/* ---------- Contact ---------- */
.closing { padding: var(--section) 0; }
.closing-title { font-family: var(--display); font-weight: 700; font-size: clamp(3rem, 9vw, 7.5rem); line-height: 0.95; letter-spacing: -0.045em; }
.closing-lede { margin-top: 24px; max-width: 34em; color: var(--muted); font-size: 19px; }
.closing-mail {
  display: inline-block; margin-top: 36px;
  font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3.6vw, 2.6rem); letter-spacing: -0.025em; line-height: 1.2;
  text-decoration-thickness: 2px; text-underline-offset: 8px; word-break: break-word;
}
.quick-links-lg { margin-top: 20px; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; padding-top: 28px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { display: inline-block; padding: 8px 0; }

/* ---------- Bandeau de consentement (mesure d'audience), en bas à gauche ---------- */
.consent[hidden] { display: none; }
.consent {
  position: fixed; left: 20px; bottom: 20px; z-index: 40; width: min(400px, calc(100vw - 40px));
  padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text);
}
.consent-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; margin-bottom: 6px; }
.consent-text { font-size: 14px; line-height: 1.55; color: var(--muted); }
.consent-text a { color: var(--text); }
/* Refuser et Accepter : même taille, même style (exigence de la CNIL) */
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.consent-btn {
  min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color 0.4s var(--ease-out), color 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
}
.consent-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Page Confidentialité ---------- */
.back-link { font-size: 15px; color: var(--muted); text-decoration: none; padding: 12px 0; }
.back-link:hover { color: var(--text); }
.legal { padding-bottom: var(--section); }
.legal .wrap { max-width: 820px; }
.legal .section-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.legal h2 { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.015em; margin: 44px 0 10px; }
.legal p, .legal li { color: var(--muted); max-width: 40em; }
.legal p + p { margin-top: 12px; }
.legal ul { display: grid; gap: 10px; padding-left: 1.1em; list-style: disc; }
.legal strong { color: var(--text); font-weight: 600; }
.legal code { font-size: 0.92em; color: var(--text); }
.legal-lede { font-size: 19px; }
.legal [data-consent-only] { margin-top: 20px; }
.legal-date { margin-top: 48px; font-size: 14px; }

/* Bouton qui ressemble à un lien (« Gérer les cookies ») */
.link-btn {
  padding: 8px 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  transition: color 0.35s var(--ease-out);
}
.link-btn:hover { color: var(--accent); }
.footer-links { flex-wrap: wrap; }

/* ---------- Bouton clair / sombre, fixé en bas à droite ---------- */
.theme-switch {
  position: fixed; right: 20px; bottom: 20px; z-index: 30;
  width: 76px; height: 44px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.4s var(--ease-out), background-color 0.4s var(--ease-out);
}
.theme-switch:hover { border-color: var(--accent); }
.theme-switch-knob {
  position: absolute; top: 4px; left: 4px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--text);
  transition: transform 0.35s var(--ease-out), background-color 0.4s var(--ease-out);
}
.theme-switch .ts-icon {
  position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: color 0.35s var(--ease-out);
}
.ts-moon { left: 12px; color: var(--bg); }        /* dans la pastille en mode sombre */
.ts-sun { right: 12px; color: var(--muted); }
[data-theme="light"] .theme-switch-knob { transform: translateX(32px); }
[data-theme="light"] .ts-moon { color: var(--muted); }
[data-theme="light"] .ts-sun { color: var(--bg); }  /* dans la pastille en mode clair */
@media (prefers-reduced-motion: reduce) {
  .theme-switch-knob, .theme-switch .ts-icon { transition: none; }
}

/* ---------- Intro de l'accueil : une fois par visite ----------
   Sur fond sombre, des taches de couleur arrivent de loin en courbes, s'étirent avec la
   vitesse, se rassemblent et fusionnent en un cercle ; le monogramme apparaît, puis le logo
   glisse à sa place en haut à gauche. Les taches et leurs réglages (couleurs, tailles,
   durées) sont dans assets/js/intro.js, qui ne lance pas l'intro si les animations sont
   réduites. Un clic, une touche ou la molette la passent. */
.intro { display: none; }
html.intro-on { overflow: hidden; scrollbar-gutter: stable; }
html.intro-on .intro {
  display: block; position: fixed; inset: 0; z-index: 100; cursor: default;
  animation: intro-failsafe 0.3s ease 9s forwards;   /* filet de sécurité : jamais bloquée */
}
html.intro-on .brand-mark { visibility: hidden; }
html.intro-hold .hero-title, html.intro-hold .hero-lede, html.intro-hold .hero-cta { animation-play-state: paused; }
.intro-bg { position: absolute; inset: 0; background: #101114; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.25s linear; }
/* Le logo, en grand (96 px) : mêmes proportions que celui de l'en-tête (44 px).
   Il prend le relais du cercle dessiné dans le canvas, au même endroit et à la même taille. */
.intro-mark {
  position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px;
  display: grid; place-items: center; border-radius: 50%;
  background: #F3F2EE; color: #101114;
  font-family: var(--display); font-weight: 800; font-size: 34.9px; letter-spacing: -0.02em; line-height: 1;
  opacity: 0; transition: opacity 0.2s linear;
}
.intro-mark span { opacity: 0; transition: opacity 0.35s ease 0.1s; }
.intro.is-formed .intro-canvas { opacity: 0; }
.intro.is-formed .intro-mark, .intro.is-formed .intro-mark span { opacity: 1; }
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  html.intro-on .intro { display: none; }
  html.intro-on .brand-mark { visibility: visible; }
}

/* ---------- Petit écran d'ordinateur : 4 colonnes deviennent trop étroites ---------- */
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Tablette ---------- */
@media (max-width: 960px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .portrait { margin-top: 0; max-width: 420px; }
  .cases { grid-template-columns: minmax(0, 1fr); }
  .study-hero-inner { grid-template-columns: minmax(0, 1fr); }
  .glance-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-metrics { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Mobile ---------- */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .brand-name { display: none; }
  .expertise, .steps { grid-template-columns: minmax(0, 1fr); }
  .tl-item { padding-left: 36px; }
  .theme-switch { right: 14px; bottom: 14px; }
  .consent { left: 14px; right: 14px; bottom: 72px; width: auto; }   /* au-dessus du bouton clair / sombre */
  .chapter-body > p, .chapter-body li { font-size: 17px; }
}
