/* ============================================================
   nicolassempere.com — refonte phase 1
   Fondations : palette + typographie uniquement.
   --bg / --ink / --accent.  Archivo Black · JetBrains Mono · Instrument Serif.
   border-radius: 0 partout. Aucun dégradé, aucune ombre, aucun blur.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --bg:        #0A0A0A;
  --ink:       #EDE9DF;
  --accent:    #6D4FFF;

  /* Aliases conservés pour limiter les retouches selecteur-par-selecteur. */
  --fg:        var(--ink);
  --fg-soft:   var(--ink);
  --rule:      rgba(237, 233, 223, 0.14);

  /* Typo */
  --font-display: 'Archivo Black', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body:    'Newsreader', 'Iowan Old Style', 'Georgia', serif;
  --font-ui:      'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-quote:   'Instrument Serif', 'Iowan Old Style', 'Georgia', serif;

  /* Échelle — mins abaissées pour le mobile, maxes inchangées. */
  --fs-mono:      11px;
  --fs-ui:        13px;
  --fs-body:      clamp(15px, 0.95vw, 17px);
  --fs-lede:      clamp(17px, 1.4vw, 22px);
  --fs-h3:        clamp(24px, 2.6vw, 44px);
  --fs-h2:        clamp(36px, 6.6vw, 96px);
  --fs-quote:     clamp(28px, 5.2vw, 76px);
  --fs-hero:      clamp(40px, 9.4vw, 144px);

  /* Spacing — section-y plus compact sur mobile. */
  --gutter:       clamp(18px, 4vw, 80px);
  --section-y:    clamp(80px, 14vw, 220px);
  --max:          1320px;

  /* Motion */
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft:    cubic-bezier(0.32, 0.72, 0, 1);
  --dur:          440ms;
  --dur-fast:     220ms;
}

/* Alternance dark / light pilotée par body[data-theme] (JS ScrollTrigger).
   Les sections n'imposent plus leur propre couleur : elles héritent
   de --bg / --ink définis au niveau body, ce qui fait crossfader
   l'intégralité du viewport au passage entre deux sections. */


/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; padding: 0; max-width: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  width: 100%;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
/* Filet anti-overflow pour les sections : aucune ne peut élargir le viewport. */
.section, main { max-width: 100vw; overflow-x: clip; }
body[data-theme="paper"] {
  --bg:   #EDE9DF;
  --ink:  #0A0A0A;
  --rule: rgba(10, 10, 10, 0.14);
  --pet-sprite: url('/assets/pet-light.svg');
}
body[data-theme="ink"] {
  --bg:   #0A0A0A;
  --ink:  #EDE9DF;
  --rule: rgba(237, 233, 223, 0.14);
  --pet-sprite: url('/assets/pet-dark.svg');
}

img, svg, video { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; padding: 0; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

.skip-link {
  position: absolute; top: -100px; left: 12px;
  background: var(--ink); color: var(--bg);
  padding: 12px 16px;
  font-family: var(--font-mono); font-size: 12px;
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

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

.kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  padding: 1px 8px;
  border: 1px solid var(--rule);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  margin: 0 2px;
  letter-spacing: 0.02em;
}

/* Brand pills (n8n, Anthropic) — logo SVG monochrome (currentColor)
   + wordmark mono. Rendu cohérent avec les deux thèmes. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 8px;
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: -2px;
  white-space: nowrap;
  color: var(--ink);
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}
.brand:hover { background: var(--ink); color: var(--bg); }
.brand__mark {
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.brand__name { line-height: 1; }

/* ---------- PROGRESS BAR ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 60;
  background: transparent;
  pointer-events: none;
}
.progress__bar {
  display: block;
  height: 100%; width: 0%;
  background: var(--accent);
  transform-origin: left center;
  will-change: width;
  transition: width 80ms linear;
}

/* ---------- GRAIN ---------- */
.grain {
  position: fixed; inset: 0;
  background-image: url('/assets/grain.svg');
  background-size: 220px 220px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: screen;
}
body[data-theme="paper"] .grain { mix-blend-mode: multiply; opacity: 0.06; }

/* ---------- PIXEL PET ---------- */
.pet {
  position: fixed;
  left: 0; top: 0;
  width: 32px; height: 32px;
  z-index: 40;
  pointer-events: none;
  /* Sprite suit le thème de section actif (var pilotée par body[data-theme]). */
  background: var(--pet-sprite, url('/assets/pet-light.svg')) 0 0 / 128px 32px no-repeat;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  transform: translate3d(var(--pet-x, 0px), var(--pet-y, 30vh), 0) scaleX(var(--pet-flip, 1));
  will-change: transform;
}

.pet[data-pet-frame="idle1"] { background-position: 0     0; }
.pet[data-pet-frame="idle2"] { background-position: -32px 0; }
.pet[data-pet-frame="walk1"] { background-position: -64px 0; }
.pet[data-pet-frame="walk2"] { background-position: -96px 0; }
.pet[data-pet-frame="turn1"] { background-position: 0     0; }
.pet[data-pet-frame="turn2"] { background-position: -32px 0; }

@media (max-width: 768px) {
  .pet { display: none; }
}

/* ---------- SECTION SHELL ---------- */
.section {
  position: relative;
  padding: var(--section-y) var(--gutter);
  background: var(--bg);
  color: var(--ink);
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.section + .section { border-top: 1px solid var(--rule); }

.section__label {
  display: block;
  margin: 0 0 clamp(72px, 9vw, 140px);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
}
.section__num {
  display: inline-block;
  margin-right: 14px;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- CTAS ---------- */
.cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.cta__arr { width: 18px; height: 18px; transition: transform var(--dur-fast) var(--ease); }
.cta:hover .cta__arr { transform: translateX(4px); }
.cta:hover .cta__arr--down { transform: translateY(3px); }

.cta--primary {
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink);
}
.cta--primary:hover { background: var(--bg); color: var(--ink); }

.cta--invert {
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink);
}
.cta--invert:hover { background: var(--bg); color: var(--ink); }

.cta--ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
}
.cta--ghost:hover { background: var(--ink); color: var(--bg); }

/* ============================================================
   01 — HERO
   ============================================================ */
.section--hero {
  min-height: 100dvh;
  display: grid;
  align-content: end;
  padding-top: clamp(48px, 8vh, 120px);
  padding-bottom: clamp(40px, 6vw, 80px);
}
/* Mobile : contenu en haut, pas de min-height qui crée un vide. */
@media (max-width: 720px) {
  .section--hero {
    min-height: auto;
    align-content: start;
    padding-top: clamp(28px, 6vh, 60px);
    padding-bottom: clamp(40px, 8vw, 64px);
  }
}

.hero {
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}
.hero__line { display: block; }
.hero__line--soft { color: var(--ink); }
.hero__line--italic {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  color: var(--ink);
  font-size: 0.62em;
  letter-spacing: -0.04em;
  margin-top: 0.18em;
  text-transform: uppercase;
}
.hero__period,
.hero__dash { color: var(--ink); }
.hero__bullet { color: var(--ink); margin: 0 0.3em; opacity: 0.55; }

/* Sous-titre meta : mono small uppercase, sur une ligne. */
.hero__meta {
  margin: clamp(28px, 4.5vh, 64px) 0 0;
  font-family: var(--font-mono);
  font-size: clamp(11px, 0.85vw, 14px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero__meta .hero__bullet { opacity: 0.55; margin: 0 0.5em; }

.hero__bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 72px);
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--rule);
  align-items: end;
}
@media (min-width: 920px) {
  .hero__bottom { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.hero__sub {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--ink);
  max-width: 56ch;
}
.hero__clients,
.hero__loc {
  display: block;
  color: var(--ink);
  font-weight: 500;
}
.hero__clients { margin-top: 6px; }
.hero__loc { margin-top: 6px; }

.hero__actions {
  display: grid;
  gap: 24px;
  justify-items: start;
}
@media (min-width: 920px) {
  .hero__actions { justify-items: end; text-align: right; }
}
.hero__tag {
  margin: 0;
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--ink);
  max-width: 28ch;
}
.hero__tag em { font-style: italic; }

/* ============================================================
   02 — SHOWREEL
   ============================================================ */
.section--showreel {
  padding-top: clamp(96px, 11vw, 160px);
  padding-bottom: clamp(96px, 11vw, 160px);
}
.reel {
  margin: 0 auto;
  max-width: var(--max);
}
.reel__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border: 1px solid var(--ink);
  overflow: hidden;
}
.reel__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--bg);
  border: 0;
}
.reel__video[data-played] + .reel__play { opacity: 0; pointer-events: none; }

.reel__play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 16px;
  align-items: center; justify-content: center;
  color: var(--bg);
  transition: opacity var(--dur) var(--ease);
}
.reel__play-icon { width: clamp(60px, 7vw, 88px); height: auto; transition: transform var(--dur) var(--ease); }
.reel__play:hover .reel__play-icon { transform: scale(1.06); }
.reel__play-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.reel__caption {
  margin: clamp(28px, 4vw, 56px) 0 0;
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.3;
  color: var(--ink);
  max-width: 60ch;
}
.reel__caption em { font-style: italic; color: var(--ink); }

/* ============================================================
   03 — APPROCHE
   ============================================================ */
.section--approche {
  display: grid;
  gap: clamp(80px, 10vw, 160px);
}
.pitch,
.piliers {
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
}

.pitch {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 3.5vw, 56px);
  max-width: 72ch;
  margin-inline: 0 auto;
}
.pitch__lede {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 1.4;
  letter-spacing: 0;
  margin: 0;
  max-width: 38ch;
  color: var(--ink);
}
.pitch__highlight {
  display: inline;
  border: 0;
  padding: 0;
  color: var(--ink);
}
.pitch__body {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 1.3vw, 22px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  max-width: 40ch;
}
.pitch__body em { font-style: italic; color: var(--ink); }
.pitch__body strong { font-weight: 500; font-style: normal; color: var(--ink); }

.piliers {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--rule);
}
@media (min-width: 880px) {
  .piliers { grid-template-columns: repeat(3, 1fr); }
}
.pilier {
  padding: clamp(48px, 6vw, 80px) clamp(20px, 3vw, 40px);
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 18px;
  align-content: start;
}
@media (min-width: 880px) {
  .pilier { border-right: 1px solid var(--rule); border-bottom: 0; }
  .pilier:last-child { border-right: 0; }
  .pilier:first-child { padding-left: 0; }
  .pilier:last-child  { padding-right: 0; }
}
.pilier__num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.pilier__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--ink);
}
.pilier__desc {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(16px, 1.1vw, 19px);
  line-height: 1.55;
  max-width: 32ch;
  color: var(--ink);
}
.pilier__stack {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  opacity: 0.8;
  margin: 8px 0 0;
}

/* ============================================================
   04 — TRAVAIL
   ============================================================ */
.section--travail { display: grid; gap: clamp(60px, 8vw, 120px); }

.travail__head,
.case,
.travail__more {
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
}

.travail__head {
  display: grid;
  gap: clamp(20px, 2.5vw, 36px);
  max-width: 64ch;
  margin-inline: 0 auto;
}
.travail__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
  max-width: 14ch;
  color: var(--ink);
}
.travail__title em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink);
  text-transform: uppercase;
}
.travail__lead {
  margin: 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--ink);
  max-width: 32ch;
}

.case {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 72px);
  padding: clamp(64px, 8vw, 120px) 0;
  border-top: 1px solid var(--rule);
}
.case__meta {
  display: grid; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}
.case__meta p { margin: 0; }
.case__period { color: var(--ink); }
.case__role { opacity: 0.75; }

.case__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 5.4vw, 88px);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
  /* overflow-wrap au lieu de word-break : ne casse que les mots
     vraiment trop longs, jamais en plein milieu d'un mot court. */
  overflow-wrap: break-word;
}
.case__sub {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  max-width: 48ch;
}

.case__media {
  position: relative;
  aspect-ratio: 8 / 5;
  background: transparent;
  border: 0;
  overflow: hidden;
}
.case__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.6s var(--ease);
}
.case:hover .case__media img { transform: scale(1.02); }

.case__story {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.5vw, 36px);
  margin: 0;
  max-width: 80ch;
}
@media (min-width: 760px) {
  .case__story { grid-template-columns: repeat(3, 1fr); max-width: none; }
}
.case__story > div { display: grid; gap: 8px; align-content: start; }
.case__story dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.case__story dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  max-width: 36ch;
  color: var(--ink);
}

.travail__more {
  margin-top: clamp(20px, 3vw, 40px);
  padding-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--rule);
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--fs-lede);
  color: var(--ink);
}
.travail__more-label {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 12px;
}

/* Clients — mur typographique. Une ligne par marque, classées par
   importance décroissante. Nom Archivo Black UPPERCASE XL, méta mono
   small à droite. Filet entre chaque ligne. */
.clients {
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
  border-top: 1px solid var(--rule);
}
.clients__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(20px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--rule);
  transition: padding-left var(--dur) var(--ease);
}
.clients__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 6.4vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--ink);
}
.clients__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.6;
  text-align: right;
  white-space: nowrap;
}
@media (hover: hover) {
  .clients__row:hover { padding-left: 12px; }
  .clients__row:hover .clients__meta { opacity: 1; color: var(--accent); }
}
@media (max-width: 720px) {
  .clients__row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: clamp(16px, 4vw, 24px) 0;
  }
  .clients__meta { text-align: left; opacity: 0.65; }
}

/* ============================================================
   05 — PRODUCTION INTELLIGENTE
   ============================================================ */
.section--production {
  position: relative;
  display: grid;
  gap: clamp(40px, 5vw, 80px);
  overflow: hidden;
}
.section--production > * { position: relative; max-width: var(--max); margin-inline: auto; width: 100%; }

.production__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.production__quote {
  margin: 0;
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-quote);
  line-height: 1.05;
  letter-spacing: 0;
  max-width: 22ch;
  color: var(--ink);
}
.production__quote strong { font-weight: 400; font-style: italic; }
.production__quote em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  margin-top: 0.18em;
  opacity: 0.75;
}

.production__body {
  display: grid;
  gap: clamp(20px, 2.5vw, 36px);
  max-width: 64ch;
  margin-inline: 0 auto;
}
.production__body p {
  font-family: var(--font-body);
  font-size: var(--fs-lede);
  font-weight: 400;
  line-height: 1.55;
  margin: 0;
  color: var(--ink);
}

.production__cta {
  margin: clamp(20px, 3vw, 40px) 0 0;
  padding-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--rule);
  display: grid;
  gap: clamp(16px, 2vw, 28px);
  align-items: start;
  justify-items: start;
}
.production__cta-pitch { margin: 0; }
.production__cta em {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 1.7vw, 28px);
  color: var(--ink);
  display: block;
  max-width: 40ch;
  line-height: 1.45;
}

/* ============================================================
   06 — PARCOURS
   ============================================================ */
.parcours__head,
.parcours {
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
}
.parcours__head { margin-bottom: clamp(40px, 5vw, 84px); }
.parcours__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 0.88;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 0;
  color: var(--ink);
}
.parcours__title em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink);
  text-transform: uppercase;
}

/* Parcours en prose éditoriale : six lignes courtes, year accent
   inline + récit en serif body. Pas de filets — différencie nettement
   du mur typographique de §04 Travail. */
.parcours {
  display: grid;
  gap: clamp(22px, 2.6vw, 36px);
  max-width: 64ch;
  margin-inline: 0 auto;
}
.parcours__line {
  display: grid;
  grid-template-columns: clamp(56px, 7vw, 96px) 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: baseline;
}
.parcours__year {
  font-family: var(--font-mono);
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  padding-top: 0.4em;
}
.parcours__story {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(17px, 1.3vw, 21px);
  line-height: 1.55;
  color: var(--ink);
}
.parcours__story em {
  font-style: italic;
  color: var(--ink);
}
@media (max-width: 720px) {
  .parcours__line {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .parcours__year { padding-top: 0; }
}

/* ============================================================
   07 — CONTACT
   ============================================================ */
.section--contact {
  display: grid;
  gap: clamp(36px, 4.5vw, 60px);
  padding-bottom: clamp(64px, 9vw, 140px);
}
.section--contact > * {
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
}

.closer {
  margin: 0;
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 4.8vw, 64px);
  line-height: 1.15;
  letter-spacing: 0;
  max-width: 28ch;
  color: var(--ink);
}
.closer p { margin: 0; }
.closer strong { font-weight: 400; font-style: italic; }
.closer em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  opacity: 0.7;
  margin-top: 0.3em;
  font-size: 0.66em;
}

.closer__pitch {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(20px, 1.5vw, 26px);
  font-weight: 400;
  color: var(--ink);
  max-width: 56ch;
  line-height: 1.55;
}
.closer__pitch em {
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}

.closer__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.closer__info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  padding-top: clamp(28px, 3vw, 44px);
  border-top: 1px solid var(--rule);
  margin: 0;
}
.closer__info > div { display: grid; gap: 6px; }
.closer__info dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.closer__info dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.closer__info-hint {
  font-size: 11px !important;
  letter-spacing: 0.04em !important;
  opacity: 0.6;
  margin-top: 2px !important;
}
.closer__info a {
  position: relative;
  border: 0;
  transition: color var(--dur-fast) var(--ease);
}
.closer__info a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.closer__info a:hover::after,
.closer__info a:focus-visible::after { transform: scaleX(1); }

.closer__sla {
  margin: 0;
  font-family: var(--font-mono);
  font-style: italic;
  font-weight: 500;
  font-size: var(--fs-lede);
  letter-spacing: 0.01em;
  color: var(--ink);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 28px var(--gutter);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.footer__col { margin: 0; }
.footer__col--center { text-align: center; }
.footer__col--right  { text-align: right; }
.footer__col--right a {
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.footer__col--right a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.footer__col--right a:hover::after { transform: scaleX(1); }

@media (max-width: 600px) {
  .footer { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .footer__col--right, .footer__col--center { text-align: center; }
}

/* ============================================================
   REVEALS — JS-driven, CSS fallback
   ============================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
  will-change: transform, opacity;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ============================================================
   PHASE 2 — micro-interactions et réactivité du pet
   ============================================================ */

/* ---------- CHARS (textes splittés pour triggers pet) ----------
   Effet domino : .is-pet-trigger sur une lettre la passe en accent
   pour ~320ms. Appliqué en cascade par JS avec un délai par lettre.
   Le visuel ne s'active que sur desktop (où le pet est visible). */
.char {
  display: inline;
  transition: color 320ms var(--ease);
  will-change: color;
}
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .char.is-pet-trigger {
    color: var(--accent);
  }
}

/* Pet triggers — animations one-shot par type d'élément. */
.case__media.is-pet-scanline,
.reel__frame.is-pet-scanline { position: relative; }
.case__media.is-pet-scanline::after,
.reel__frame.is-pet-scanline::after {
  content: '';
  position: absolute; left: 0; right: 0;
  top: 0; height: 2px;
  background: var(--accent);
  pointer-events: none;
  z-index: 3;
  animation: pet-scanline 760ms linear forwards;
}
@keyframes pet-scanline {
  0%   { top: 0; opacity: 1; }
  90%  { opacity: 1; }
  100% { top: calc(100% - 2px); opacity: 0.2; }
}

.cta.is-pet-bounce { animation: pet-bounce 380ms var(--ease); }
@keyframes pet-bounce {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-6px); }
  70%      { transform: translateY(-2px); }
}

.section__num.is-pet-glitch { animation: pet-glitch 280ms steps(5); }
@keyframes pet-glitch {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-1px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}

/* Trace subtile post-passage : petit carré violet 3px à gauche de
   l'élément déjà déclenché. Position absolue → pas de shift de
   layout. Uniquement desktop. */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .is-pet-seen {
    position: relative;
  }
  .is-pet-seen::before {
    content: '';
    position: absolute;
    left: -10px; top: 0.4em;
    width: 3px; height: 3px;
    background: var(--accent);
    opacity: 0.55;
    pointer-events: none;
  }
}

/* ---------- ZONES RÉACTIVES AU PASSAGE DU PET ---------- */
/* CTA tressaille brièvement quand le pet le frôle. */
.cta.is-pet-near { animation: pet-twitch 320ms var(--ease); }
@keyframes pet-twitch {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-2px); }
  55%  { transform: translateX(2px); }
  80%  { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

/* Médias : flash d'outline accent court quand le pet les frôle.
   Pas de scale, juste une bordure qui apparaît et s'efface. */
.case__media,
.reel__frame { isolation: isolate; }
.case__media.is-pet-near::before,
.reel__frame.is-pet-near::before {
  content: '';
  position: absolute; inset: 0;
  border: 1px solid var(--accent);
  pointer-events: none;
  animation: pet-flash 420ms var(--ease) forwards;
  z-index: 2;
}
@keyframes pet-flash {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Filets / bordures qui vibrent (case study + timeline rows). */
.case.is-pet-near,
.timeline__row.is-pet-near {
  border-color: var(--accent);
  animation: pet-rule-vibe 280ms var(--ease);
}
@keyframes pet-rule-vibe {
  0%, 100% { transform: translateX(0); }
  35%      { transform: translateX(-1px); }
  70%      { transform: translateX(1px); }
}

/* Section labels — léger soulignement quand le pet passe. */
.section__label.is-pet-near .section__num { color: var(--accent); }

/* ---------- HOVER LIENS (underline accent left→right) ---------- */
main a:not(.cta) {
  position: relative;
}
main p a:not(.cta)::after,
main dd a:not(.cta)::after,
main li a:not(.cta)::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms var(--ease);
}
main p a:not(.cta):hover::after,
main dd a:not(.cta):hover::after,
main li a:not(.cta):hover::after { transform: scaleX(1); }

/* ---------- HOVER CASE STUDIES ---------- */
.case { transition: transform var(--dur) var(--ease); }
.case:hover .case__title,
.case:hover .case__sub,
.case:hover .case__story { transform: translateX(3px); }
.case__title,
.case__sub,
.case__story { transition: transform var(--dur) var(--ease); }
.case:hover .case__media img { transform: scale(1.025); }

/* ---------- CARET CLIGNOTANT ---------- */
.caret {
  display: inline-block;
  width: 0.55ch;
  height: 0.95em;
  background: var(--accent);
  vertical-align: -0.12em;
  margin-left: 0.18em;
  animation: caret-blink 1.05s steps(2, end) infinite;
}
@keyframes caret-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- SCRAMBLE (état initial avant effet JS) ---------- */
[data-scramble] { font-variant-numeric: tabular-nums; }
[data-scramble].is-scrambling { color: var(--accent); }

/* ---------- TYPEWRITER (section numbers) ---------- */
[data-typewriter] { display: inline-block; white-space: pre; }

/* ---------- STAGGER REVEAL CHILDREN ---------- */
[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(12px);
  will-change: transform, opacity;
}
[data-reveal-stagger].is-revealed > * {
  opacity: 1;
  transform: none;
}

/* ---------- RAIL NAV (DESKTOP) ----------
   Discret, à droite, vertical. Chaque section = un trait court ;
   l'actif s'allonge et passe en accent. Label apparaît au hover. */
.rail {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 14px;
  mix-blend-mode: difference;
  pointer-events: auto;
}
.rail a {
  position: relative;
  display: flex; align-items: center;
  justify-content: flex-end;
  height: 14px;
  padding-right: 0;
  text-decoration: none;
}
.rail a::before {
  content: '';
  display: block;
  width: 14px; height: 1px;
  background: #EDE9DF;
  opacity: 0.45;
  transition: width 240ms var(--ease), opacity 240ms var(--ease), background-color 240ms var(--ease);
}
.rail a.is-active::before {
  width: 26px;
  opacity: 1;
  background: var(--accent);
}
.rail a:hover::before { width: 26px; opacity: 1; }
.rail__label {
  position: absolute;
  right: calc(100% + 12px);  /* toujours 12px à gauche de la barre, peu importe sa largeur */
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #EDE9DF;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
  pointer-events: none;
}
.rail a:hover .rail__label,
.rail a:focus-visible .rail__label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
/* Mobile / touch : rail bascule en bandeau horizontal en bas.
   Touch targets 44×44 (WCAG 2.5.5), safe-area iOS prise en compte,
   numéro de section toujours visible sous chaque dot. */
@media (max-width: 800px), (pointer: coarse) {
  .rail {
    top: auto;
    right: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 4px;
    padding: 6px 8px;
    background: color-mix(in oklab, currentColor 0%, transparent);
  }
  .rail a {
    /* Hit area 44×40 sans changer la taille visuelle du trait. */
    height: 44px;
    width: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .rail a::before {
    width: 18px;
    height: 1px;
  }
  .rail a.is-active::before { width: 28px; }
  /* Texte des labels (mots) caché — on garde juste le numéro
     via ::after pour orienter sans encombrer. */
  .rail__label { display: none; }
  .rail a::after {
    content: attr(data-rail-num);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #EDE9DF;
    opacity: 0.65;
    transition: opacity 200ms var(--ease), color 200ms var(--ease);
  }
  .rail a.is-active::after {
    opacity: 1;
    color: var(--accent);
  }
}

/* ============================================================
   RESPONSIVE — réglages fins mobile / tablet
   ============================================================ */
@media (max-width: 720px) {
  /* Hero : laisser respirer + éviter overflow. */
  .hero__title {
    letter-spacing: -0.035em;
    max-width: 100%;
    /* Évite l'overflow horizontal sans casser un mot en plein milieu. */
    overflow-wrap: break-word;
    hyphens: none;
  }
  .hero__line--italic { font-size: 0.55em; }
  .hero__bottom {
    margin-top: clamp(32px, 6vw, 64px);
    padding-top: 24px;
    gap: 28px;
  }
  .hero__sub { font-size: 15px; }

  /* Sections : labels plus compacts. */
  .section__label { margin-bottom: clamp(40px, 9vw, 72px); }

  /* Cases : padding interne réduit. */
  .case { padding: clamp(40px, 8vw, 64px) 0; gap: 28px; }
  .case__story { gap: 20px; }
  .case__story dd { font-size: 15px; }

  /* Travail more / pitch body : tailles serrées. */
  .pitch__body { font-size: 16px; }
  .travail__more { font-size: 16px; }

  /* Production : quote + CTAs compacts. */
  .production__body p { font-size: 17px; }
  .production__cta em { font-size: 18px; }

  /* Closer : pitch + CTAs compacts (mais pas full-width). */
  .closer__pitch { font-size: 18px; }
  .closer__ctas { gap: 10px; }
  .closer__ctas .cta {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: space-between;
    padding: 14px 18px;
    font-size: 12px;
  }

  /* Brand pills : wrap proprement. */
  .brand { font-size: 12px; padding: 3px 10px 3px 6px; }
  .brand__mark { width: 14px; height: 14px; }

  /* Footer : padding mobile. */
  .footer { padding: 24px 18px; }

  /* Rail : laisser de l'espace pour le bandeau bottom. */
  main { padding-bottom: 0; }
  .section--contact { padding-bottom: clamp(80px, 14vw, 140px); }
}

@media (max-width: 480px) {
  /* Très petit écran : compresser un peu plus. */
  .hero__title { letter-spacing: -0.03em; }
  .case__title { font-size: clamp(28px, 8vw, 44px); }
  .pilier__title { font-size: clamp(22px, 6vw, 32px); }
  .section--hero { min-height: 100svh; padding-top: clamp(40px, 8vh, 80px); }
  .closer { font-size: clamp(26px, 7vw, 40px); }
  .production__quote { font-size: clamp(26px, 8vw, 56px); }
}

/* ---------- SCROLL CUE ----------
   Indicateur en bas du hero. Visible au chargement, fade out au-delà
   de 100px de scroll, réapparaît au retour. Trait vertical descendant
   en boucle (animation linear infinite). */
/* Playground anchor invisible au top du hero (~12vh) où le pet vient
   se poser quand on est au repos en haut de page. */
.hero__pet-stage {
  position: absolute;
  top: clamp(70px, 14vh, 180px);
  left: clamp(80px, 12vw, 220px);
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.scroll-cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(24px, 4vh, 56px);
  left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}
.scroll-cue.is-visible { opacity: 1; transform: translateY(0); }
.scroll-cue__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.scroll-cue__line {
  position: relative;
  display: block;
  width: 1px;
  height: 56px;
  background: rgba(0,0,0,0); /* invisible track */
  overflow: hidden;
}
.scroll-cue__line::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -56px;
  height: 56px;
  background: var(--accent);
  animation: scroll-cue-drop 1.6s var(--ease) infinite;
}
@keyframes scroll-cue-drop {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(112px); opacity: 0; }
}
@media (max-width: 720px) {
  .scroll-cue { right: var(--gutter); left: auto; bottom: clamp(20px, 4vh, 40px); }
  .scroll-cue__line { height: 36px; }
  .scroll-cue__line::before { animation-duration: 1.4s; }
}

/* ---------- BACK-TO-TOP ----------
   Bouton flottant carré bottom-right, visible après ~60% de viewport
   scrollé. Mix-blend-difference pour rester lisible sur les deux thèmes. */
.to-top {
  position: fixed;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(16px, 2vw, 32px);
  z-index: 50;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #EDE9DF;
  border: 1px solid #EDE9DF;
  mix-blend-mode: difference;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 280ms var(--ease),
    transform 280ms var(--ease),
    background-color 220ms var(--ease),
    color 220ms var(--ease);
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.to-top svg { width: 18px; height: 18px; display: block; }
@media (hover: hover) {
  .to-top:hover { background: #EDE9DF; color: #0A0A0A; }
}
/* Mobile : safe-area iOS ; placé bottom-right pour ne pas chevaucher
   la rail centrale en bas. */
@media (max-width: 800px), (pointer: coarse) {
  .to-top {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }
}

/* Anti-sticky-hover : sur touch, le :hover reste collé après un tap.
   Tous les changements visuels au hover sont neutralisés en touch
   pour éviter les éléments qui restent en violet/inversés. */
@media (hover: none), (pointer: coarse) {
  main a:not(.cta):hover::after,
  .closer__info a:hover::after,
  .footer__col--right a:hover::after { transform: scaleX(0) !important; }

  .brand:hover { background: transparent !important; color: var(--ink) !important; }

  .cta--primary:hover { background: var(--ink) !important; color: var(--bg) !important; }
  .cta--invert:hover { background: var(--ink) !important; color: var(--bg) !important; }
  .cta--ghost:hover { background: transparent !important; color: var(--ink) !important; }
  .cta:hover .cta__arr { transform: none !important; }

  .case:hover .case__media img { transform: none !important; }
  .case:hover .case__title,
  .case:hover .case__sub,
  .case:hover .case__story { transform: none !important; }

  .timeline__row:hover { padding-left: 0 !important; }

  .rail a:hover::before { width: 18px !important; opacity: 0.45 !important; }
  .rail a.is-active:hover::before { width: 28px !important; opacity: 1 !important; background: var(--accent) !important; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  [data-reveal-stagger] > * { opacity: 1 !important; transform: none !important; }
  .pet { transition: none !important; }
  .char.is-pet-trigger { color: inherit !important; }
  .is-pet-scanline::after, .is-pet-bounce, .is-pet-glitch { animation: none !important; }
  .is-pet-seen::before { display: none !important; }
  .caret { animation: none !important; opacity: 1 !important; }
  html { scroll-behavior: auto; }
}
