/* ═══════════════════════════════════════════════════════════
   EDITORIAL-V1 — feuille de style canonique
   NE PAS MODIFIER en dehors des tokens :root (écrits par bake.mjs).
   Thème : <html data-theme="dark"> ; accent : --accent / --accent-ink.
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink-rgb: 21, 21, 19;
  --bg: #f5f4f0;
  --ink: #151513;
  --muted: #64676c;
  --surface: #ffffff;
  --line: rgba(var(--ink-rgb), 0.14);

  --accent: #3f6b4a;
  --accent-ink: #1a1915;

  --sans: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(20px, 4vw, 64px);
  --t-xl: clamp(44px, 8.4vw, 148px);
  --t-l: clamp(30px, 4.4vw, 68px);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-inout: cubic-bezier(0.77, 0, 0.175, 1);
}
html[data-theme="dark"] {
  --ink-rgb: 241, 240, 235;
  --bg: #121210;
  --ink: #f1f0eb;
  --muted: #8e918d;
  --surface: #1d1c1a;
  --line: rgba(var(--ink-rgb), 0.14);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 19px; line-height: 1.35;
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
h1, h2, h3 { font-weight: 400; }
mark { background: none; color: inherit; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.45; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 300; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 999px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ═══ LOADER (si-core) ═══ */
.si-loader {
  position: fixed; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--bg);
  transition: clip-path .9s var(--ease-inout);
  clip-path: inset(0 0 0 0);
}
.si-loader p { font-size: 22px; font-weight: 500; }
.si-loader span { width: 120px; height: 1px; background: var(--line); overflow: hidden; }
.si-loader i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out); }
.si-loader.run i { transform: scaleX(1); }
.si-loader.out { clip-path: inset(0 0 100% 0); }

/* ═══ SCÈNES (sticky natif) ═══ */
.scene { position: relative; height: calc(var(--len, 2) * 100vh); }
.sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* ═══ RÉVÉLATIONS ═══ */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }

/* ═══ BARRE ═══ */
.ed-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px var(--gutter);
  transition: background .4s, border-color .4s, transform .6s var(--ease-out);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%);
}
body.is-ready .ed-bar { transform: none; }
body.is-scrolled .ed-bar { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--line); }
.ed-wordmark { font-size: 20px; font-weight: 500; white-space: nowrap; }
.ed-nav { display: flex; gap: 28px; }
.ed-nav a { position: relative; }
.ed-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease-inout); }
.ed-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.ed-cta { background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 999px; white-space: nowrap; transition: transform .4s var(--ease-out); }
.ed-cta:hover { transform: translateY(-2px); }

/* ═══ HERO ═══ */
.ed-hero .sticky { background: var(--bg); }
.ed-hero-copy {
  position: absolute; left: 0; right: 0; top: 0; height: 52%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 0 var(--gutter) 3.5vh; text-align: center; z-index: 2;
  transform-origin: 50% 100%;
}
.ed-kicker { margin-bottom: 22px; }
.ed-title { font-size: var(--t-xl); line-height: 0.98; letter-spacing: -0.035em; }
.ed-title span { display: block; }
.ed-title em {
  font-style: normal;
  color: color-mix(in srgb, var(--accent) 55%, var(--ink) 45%);
}
body:not(.static) .ed-title span { opacity: 0; transform: translateY(40%); transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out); }
body.is-ready .ed-title span { opacity: 1; transform: none; }
body.is-ready .ed-title .ed-l2 { transition-delay: .12s; }
.ed-hero-media {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  clip-path: inset(52% 34% 8% 34% round 6px);
  will-change: clip-path;
}
.ed-hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); will-change: transform; }
.ed-hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 45%); pointer-events: none; }
.ed-pos {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 7vh; z-index: 2;
  color: #fff; font-size: var(--t-l); letter-spacing: -0.025em; line-height: 1.05;
}
.ed-pos .pw { display: inline-block; opacity: 0; }

/* ═══ MANIFESTE ═══ */
.ed-manifesto .sticky { display: flex; align-items: center; justify-content: center; padding: 0 var(--gutter); }
.ed-man-text { font-size: clamp(28px, 4.1vw, 64px); line-height: 1.12; letter-spacing: -0.025em; max-width: 19em; }
.ed-man-text .mw { color: rgba(var(--ink-rgb), 0.16); transition: color .35s var(--ease-out); }
.ed-man-text .mw.on { color: var(--ink); }
.ed-mark {
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 82% / calc(var(--mk, 0) * 100%) 0.42em;
  padding: 0 .04em;
}

/* ═══ PREUVE ═══ */
.ed-proof { padding: 18vh var(--gutter) 14vh; background: var(--surface); }
.ed-head { display: grid; grid-template-columns: 1fr 2fr; gap: 10px 40px; margin-bottom: 9vh; align-items: end; }
.ed-h2 { font-size: var(--t-l); letter-spacing: -0.03em; line-height: 1; grid-column: 1 / -1; }
.ed-sub { color: var(--muted); max-width: 32em; }
.ed-head > p:last-child { justify-self: end; }
.ed-index { border-bottom: 1px solid var(--line); }
.ed-row {
  display: grid; grid-template-columns: 70px 1fr auto; align-items: baseline; gap: 20px;
  padding: 26px 0; border-top: 1px solid var(--line); cursor: default;
}
.ed-row-title { font-size: clamp(26px, 3.5vw, 54px); letter-spacing: -0.03em; line-height: 1.05; transition: transform .6s var(--ease-out), color .4s; }
.ed-index:hover .ed-row-title { color: rgba(var(--ink-rgb), 0.3); }
.ed-index .ed-row:hover .ed-row-title { color: var(--ink); transform: translateX(14px); }
.ed-row-thumb { display: none; }
.ed-preview {
  position: fixed; left: 0; top: 0; z-index: 90; width: min(340px, 26vw);
  pointer-events: none; opacity: 0; transition: opacity .35s var(--ease-out);
}
.ed-preview img { width: 100%; height: auto; border-radius: 4px; transform: scale(.9); transition: transform .5s var(--ease-out); }
.ed-preview.on { opacity: 1; }
.ed-preview.on img { transform: scale(1); }

.ed-bento { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.ed-tile { margin: 0; }
.ed-big { grid-column: span 3; }
.ed-tall { grid-column: span 2; }
.ed-tile-img { height: clamp(340px, 40vw, 600px); border-radius: 6px; overflow: hidden; background: var(--bg); }
.ed-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.ed-tile figcaption { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; align-items: baseline; }
.ed-tile-title { font-size: 22px; letter-spacing: -0.015em; }

/* ═══ DEVISE ═══ */
.ed-motto { background: var(--accent); color: var(--accent-ink); }
.ed-motto .sticky { display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter); }
.ed-motto-kicker { margin-bottom: 4vh; opacity: .7; }
.ed-words { display: flex; flex-direction: column; }
.ed-mw { position: relative; font-size: clamp(60px, 13.5vw, 236px); line-height: 0.92; letter-spacing: -0.045em; white-space: nowrap; }
.ed-mw-base { color: rgba(26, 25, 21, 0.14); }
html[data-theme="dark"] .ed-mw-base { color: rgba(26, 25, 21, 0.14); }
.ed-mw-fill { position: absolute; left: 0; top: 0; color: var(--accent-ink); clip-path: inset(0 calc((1 - var(--fill, 0)) * 100%) 0 0); }
.ed-hints { position: absolute; right: var(--gutter); bottom: 8vh; width: min(360px, 40vw); height: 3em; }
.ed-hints li { position: absolute; inset: 0; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease-out), transform .4s var(--ease-out); font-size: 13px; }
.ed-hints li.on { opacity: 1; transform: none; }

/* ═══ PROCESSUS ═══ */
.ed-intro { padding: 20vh var(--gutter) 8vh; }
.ed-intro-line { font-size: var(--t-xl); letter-spacing: -0.04em; line-height: .95; margin-bottom: 8vh; }
.ed-accent-word { background: var(--accent); color: var(--accent-ink); padding: 0 .12em; border-radius: .08em; }
.ed-band { border-radius: 6px; overflow: hidden; aspect-ratio: 3 / 1.15; }
.ed-band img { width: 100%; height: 100%; object-fit: cover; }

.ed-steps .sticky { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0 var(--gutter); gap: 4vw; }
.ed-step-num { font-size: clamp(150px, 27vw, 440px); line-height: 1; height: 1em; overflow: hidden; letter-spacing: -0.06em; font-weight: 300; }
.ed-num-roll { display: block; will-change: transform; }
.ed-num-roll i { display: block; height: 1em; font-style: normal; }
.ed-step-list { position: relative; height: 60vh; }
.ed-step { position: absolute; left: 0; right: 0; top: 34%; }
.ed-step h3 { font-size: var(--t-l); letter-spacing: -0.03em; line-height: 1.02; margin: 14px 0 18px; }
.ed-step p { color: var(--muted); max-width: 26em; font-size: 20px; }
.ed-rail { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 7vh; height: 1px; background: var(--line); }
.ed-rail i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.ed-step-cta {
  position: absolute; right: var(--gutter); bottom: 12vh;
  background: var(--accent); color: var(--accent-ink);
  font-size: 22px; padding: 16px 26px; border-radius: 999px; opacity: 0; white-space: nowrap;
}

/* ═══ TÉMOIGNAGE ═══ */
.ed-quote { padding: 22vh var(--gutter); max-width: 1400px; margin: 0 auto; }
.ed-glyph { display: block; font-size: clamp(120px, 14vw, 220px); line-height: .6; color: var(--ink); opacity: .9; height: .5em; }
.ed-q p { font-size: clamp(28px, 3.7vw, 58px); letter-spacing: -0.025em; line-height: 1.12; max-width: 21em; }
.ed-sign { margin-top: 6vh; display: grid; grid-template-columns: auto 1fr; gap: 8px 28px; align-items: baseline; }
.ed-rule { grid-column: 1 / -1; height: 1px; background: var(--line); margin-bottom: 18px; }
.ed-author { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }
.ed-fig { grid-column: 1 / -1; font-size: clamp(54px, 7vw, 112px); letter-spacing: -0.04em; line-height: 1; margin-top: 4vh; font-weight: 300; }
.ed-fig-unit { font-size: .4em; margin-left: .12em; letter-spacing: 0; }

/* ═══ OBJECTIONS ═══ */
.ed-obj .sticky { display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter); }
.ed-obj-list li { position: relative; display: block; width: max-content; max-width: 100%; font-size: clamp(36px, 6.2vw, 104px); letter-spacing: -0.04em; line-height: 1.02; opacity: 0; }
.ed-obj-list li i { position: absolute; left: -2%; top: 54%; height: .07em; width: calc(var(--strike, 0) * 104%); background: var(--ink); border-radius: 1em; }
.ed-finale { margin-top: 5vh; font-size: clamp(36px, 6.2vw, 104px); letter-spacing: -0.04em; line-height: 1.02; opacity: 0; }
.ed-pill {
  display: inline-block; padding: 0 .3em; border: .045em solid var(--ink); border-radius: 999px;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 0 / calc(var(--pill, 0) * 100%) 100%;
}
html[data-theme="dark"] .ed-pill { color: var(--ink); }

/* ═══ FOOTER ═══ */
.ed-footer { padding: 18vh var(--gutter) 40px; text-align: center; border-top: 1px solid var(--line); }
.ed-mail { display: inline-block; margin: 22px 0 18px; font-size: var(--t-l); letter-spacing: -0.03em; border-bottom: 1px solid var(--line); transition: border-color .4s; }
.ed-mail:hover { border-color: var(--ink); }
.ed-book { display: inline-block; margin-top: 26px; background: var(--accent); color: var(--accent-ink); padding: 14px 22px; border-radius: 999px; }
.ed-giant { margin-top: 12vh; font-size: clamp(56px, 15vw, 270px); letter-spacing: -0.05em; line-height: .95; white-space: nowrap; overflow: hidden; padding-bottom: .04em; }
.ed-giant span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 40ms); }
.ed-giant.in span { transform: none; }
.ed-bottom { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; text-align: left; }
.ed-bottom a { margin: 0 8px; }

/* ═══ MODE STATIQUE (prefers-reduced-motion) ═══ */
body.static .scene { height: auto; }
body.static .sticky { position: relative; height: auto; min-height: 0; overflow: visible; padding-top: 14vh; padding-bottom: 14vh; }
body.static .ed-hero .sticky { padding: 0; }
body.static .ed-hero-copy { position: relative; height: auto; padding: 22vh var(--gutter) 8vh; }
body.static .ed-hero-media { position: relative; height: 80vh; clip-path: none; }
body.static .ed-hero-media img { transform: none; }
body.static .ed-pos .pw { opacity: 1; }
body.static .ed-step-list { height: auto; }
body.static .ed-step { position: relative; top: auto; opacity: 1 !important; visibility: visible !important; transform: none !important; margin-bottom: 6vh; }
body.static .ed-step-num, body.static .ed-rail { display: none; }
body.static .ed-steps .sticky { grid-template-columns: 1fr; }
body.static .ed-step-cta { position: relative; right: auto; bottom: auto; opacity: 1; display: inline-block; }
body.static .ed-hints { position: relative; right: auto; bottom: auto; width: auto; height: auto; margin-top: 4vh; }
body.static .ed-hints li { position: relative; opacity: 1; transform: none; margin-bottom: 6px; }
body.static .ed-obj-list li, body.static .ed-finale { opacity: 1; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  body { font-size: 17px; }
  .ed-nav { display: none; }
  .ed-bar { padding: 12px 16px; }
  .ed-hero-copy { height: 50%; }
  .ed-pos { bottom: 6vh; }
  .ed-head { grid-template-columns: 1fr; }
  .ed-head > p:last-child { justify-self: start; }
  .ed-row { grid-template-columns: 40px 1fr; padding: 20px 0; }
  .ed-row-meta { grid-column: 2; }
  .ed-row-thumb { display: block; grid-column: 1 / -1; width: 100%; height: auto; border-radius: 4px; margin-top: 10px; }
  .ed-preview { display: none; }
  .ed-bento { grid-template-columns: 1fr; }
  .ed-big, .ed-tall { grid-column: auto; }
  .ed-tile-img { height: auto; aspect-ratio: 3 / 2; }
  .ed-tall .ed-tile-img { aspect-ratio: 600 / 820; }
  .ed-hints { left: var(--gutter); right: var(--gutter); width: auto; bottom: 6vh; }
  .ed-steps .sticky { grid-template-columns: 1fr; align-content: center; gap: 0; }
  .ed-step-num { font-size: clamp(110px, 34vw, 200px); }
  .ed-step-list { height: 42vh; }
  .ed-step { top: 4%; }
  .ed-step-cta { left: var(--gutter); right: auto; bottom: 10vh; font-size: 18px; }
  .ed-sign { grid-template-columns: 1fr; }
  .ed-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .ed-cta { padding: 9px 14px; }
  .ed-wordmark { font-size: 17px; }
  .ed-mw { font-size: clamp(48px, 17vw, 90px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
