/* LH.FAMILY · le cahier dont la marge prend la route
   Vanilla, sans compilation. Tokens d'abord, puis sections dans l'ordre de la page. */

@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage.woff2') format('woff2-variations'), url('../fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Cursive FR';
  src: url('../fonts/playwrite-fr-trad.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Couleurs : papier de cahier, encre de stylo plume, marge rouge */
  --paper: #f6f7fb;
  --ink: #141a3d;
  --muted: #3a4166;
  --line: rgba(20, 26, 61, 0.14);
  --red: #d42f27;
  --red-on-ink: #ff8a7e;
  --sy-fine: rgba(120, 140, 215, 0.2);
  --sy-bold: rgba(105, 122, 208, 0.42);

  /* Typo */
  --f-sans: 'Bricolage', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-cursive: 'Cursive FR', 'Segoe Script', cursive;
  --t-xl: clamp(2.75rem, 1.2rem + 6.4vw, 8rem);
  --t-l: clamp(1.75rem, 1.2rem + 1.9vw, 3rem);
  --t-m: clamp(1.2rem, 1.05rem + 0.55vw, 1.55rem);
  --t-body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  --t-s: 0.875rem;

  /* Grille : la marge est la ligne d'accroche */
  --gutter: clamp(16px, 2.6vw, 40px);
  --mx: clamp(76px, 15vw, 248px);
  --gap: clamp(18px, 2.6vw, 40px);
  --sq: 32px; /* grand carreau Seyès */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.165, 0.84, 0.44, 1);
}
@media (max-width: 720px) {
  :root { --mx: 30px; --gap: 16px; --gutter: 16px; --sq: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  font-variation-settings: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
svg { display: block; }
::selection { background: var(--red); color: var(--paper); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.skip {
  position: fixed; left: var(--gutter); top: 10px; z-index: 50;
  padding: 10px 14px; background: var(--ink); color: var(--paper);
  font-size: var(--t-s); font-weight: 600; text-decoration: none;
  translate: 0 -160%;
}
.skip:focus, .skip:focus-visible { translate: 0 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cursive { font-family: var(--f-cursive); font-weight: 400; letter-spacing: 0; }

/* ——— Le papier Seyès ——— */
.seyes {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, var(--sy-bold) 1px, transparent 1px),
    linear-gradient(var(--sy-bold) 1px, transparent 1px),
    linear-gradient(var(--sy-fine) 1px, transparent 1px);
  background-size: var(--sq) var(--sq), 100% var(--sq), 100% calc(var(--sq) / 4);
  background-position: var(--mx) 0, 0 0, 0 0;
}

/* ——— Liens qui se tracent (nav, pied) ——— */
.trace-link {
  text-decoration: none;
  background: linear-gradient(currentColor 0 0) left 100% / 0% 1.5px no-repeat;
  transition: background-size 0.5s var(--ease-soft);
  padding-bottom: 2px;
}
@media (hover: hover) { .trace-link:hover { background-size: 100% 1.5px; } }
.trace-link:focus-visible, .trace-link[aria-current] { background-size: 100% 1.5px; }

/* ——— En-tête : coins du cahier ——— */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  color: #fff; mix-blend-mode: difference;
  transition: translate 0.6s var(--ease);
}
html.top-away .top { translate: 0 -120%; }
.top__brand {
  font-weight: 800; font-stretch: 75%; letter-spacing: 0.01em; font-size: 1.125rem;
  text-decoration: none; padding: 6px 0;
}
.top__nav ul { display: flex; gap: clamp(16px, 2.4vw, 36px); }
.top:focus-within { mix-blend-mode: normal; color: var(--ink); }
.top:focus-within .top__brand, .top:focus-within .top__nav a { background-color: var(--paper); }
.top__nav a { font-size: 0.9375rem; font-weight: 500; display: inline-block; padding: 6px 0; }

/* ——— La route (la marge qui s'échappe) ——— */
.sheet { position: relative; }
.route, .hero__margin {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; overflow: visible; will-change: transform;
}
.hero__margin { height: 100%; }
html:not(.route-on) .hero__margin { display: none; }
.route path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route__margin { stroke: var(--red); stroke-width: 2; }
.route__ghost { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 2 9; opacity: 0.35; }
.route__ink { stroke: var(--red); stroke-width: 2.5; }
.route__nib { fill: var(--red); stroke: var(--paper); stroke-width: 2.5; }
html:not(.route-on) .route { display: none; }

/* Tout le contenu passe au-dessus de la ligne, les fonds de section en dessous */
main > section > *, .end > * { position: relative; z-index: 2; }

/* ——— Révélations : écrire de gauche à droite ——— */
html.motion [data-reveal]:not([data-reveal="soft"]) > span,
html.motion .hero__title .line > span {
  display: inline-block;
  clip-path: inset(-0.1em 100% -0.25em -0.1em);
  transition: clip-path 1.25s var(--ease);
  transition-delay: var(--d, 0s);
}
html.motion [data-reveal].is-in > span,
html.motion .hero__title .line.is-in > span { clip-path: inset(-0.1em -0.1em -0.25em -0.1em); }
html.motion [data-reveal="soft"] {
  opacity: 0; translate: 0 14px;
  transition: opacity 1s var(--ease), translate 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
html.motion [data-reveal="soft"].is-in { opacity: 1; translate: 0 0; }

/* ——— HERO ——— */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: var(--mx) 1fr;
  padding: clamp(96px, 16vh, 168px) var(--gutter) clamp(72px, 12vh, 132px) 0;
}
.hero__margin-css {
  position: absolute; left: var(--mx); top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1;
}
html.route-on .hero__margin-css { display: none; }
.hero__aside {
  grid-column: 1; padding: 0 14px 0 var(--gutter);
  display: flex; flex-direction: column; gap: 10px;
}
.hero__date { font-size: clamp(0.95rem, 0.8rem + 0.45vw, 1.25rem); line-height: 1.5; color: var(--ink); }
.hero__label { font-size: var(--t-s); font-weight: 600; color: var(--muted); }
.hero__page {
  grid-column: 2; padding-left: var(--gap);
  container-type: inline-size;
  display: flex; flex-direction: column; justify-content: center;
}
.hero__title {
  font-size: clamp(2.6rem, 14.2cqi, 13rem);
  font-weight: 780; font-stretch: 75%;
  line-height: 0.92; letter-spacing: -0.022em;
  margin-left: -0.04em;
  text-wrap: balance;
}
.hero__title .line { display: block; }
.hero__title .line + .line { margin-top: 0.02em; }
.hero__foot {
  margin-top: clamp(32px, 6vh, 64px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: end;
}
.hero__lede {
  grid-column: 6 / -1; grid-row: 1;
  max-width: 36rem; font-size: var(--t-m); line-height: 1.5; color: var(--ink);
  font-weight: 380;
}
.hero__cue {
  grid-column: 1 / span 4; grid-row: 1; align-self: end; justify-self: start;
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 600; font-size: 1rem; text-decoration: none; padding: 8px 0;
}
.hero__cue-arrow { display: inline-block; color: var(--red); font-size: 1.2em; transition: translate 0.5s var(--ease-soft); }
@media (hover: hover) {
  .hero__cue:hover .hero__cue-arrow { translate: 0 6px; }
  .hero__cue:hover .trace-link { background-size: 100% 1.5px; }
}
.hero__cue:focus-visible .hero__cue-arrow { translate: 0 6px; }
.hero__exit {
  position: absolute; left: calc(var(--mx) + 20px); bottom: 52px; z-index: 2;
  color: var(--red); font-size: 1rem; rotate: -3deg;
}

/* ——— PRODUCTIONS ——— */
.h2 {
  font-size: var(--t-xl); font-weight: 760; font-stretch: 75%;
  line-height: 0.92; letter-spacing: -0.022em; margin-left: -0.03em;
}
.note { color: var(--red); font-size: clamp(1rem, 0.9rem + 0.4vw, 1.3rem); margin-top: 14px; }

.prods {
  padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(120px, 20vh, 220px) calc(var(--mx) + var(--gap));
}
.prods__head { margin-bottom: clamp(72px, 12vh, 140px); max-width: calc(50% - var(--gap)); }

.escales {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(110px, 16vh, 200px);
  counter-reset: none;
}
.escale { position: relative; }
.escale--a { grid-column: 7 / span 6; grid-row: 1; }
.escale--b { grid-column: 1 / span 6; grid-row: 2; }
.escale--c { grid-column: 7 / span 6; grid-row: 3; }
.escale--d { grid-column: 2 / span 6; grid-row: 4; }

.escale__dot, .coul__dot {
  position: absolute; left: calc(-1 * var(--gap) - 8px); top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--red);
  transition: background-color 0.4s var(--ease), scale 0.5s var(--ease);
  z-index: 3;
}
.escale__dot.is-reached, .coul__dot.is-reached { background: var(--red); }
.escale__dot.is-hot { scale: 1.55; }
html:not(.route-on) .escale__dot, html:not(.route-on) .coul__dot { background: var(--red); }

.escale__fig {
  position: absolute; top: 34%; z-index: 2;
  display: flex; flex-direction: column; gap: 4px; pointer-events: none;
}
.escale--a .escale__fig, .escale--c .escale__fig { right: calc(100% + var(--gap) + 64px); align-items: flex-end; text-align: right; }
.escale--b .escale__fig, .escale--d .escale__fig { left: calc(100% + var(--gap) + 48px); }
.escale__n {
  font-size: clamp(5rem, 2rem + 8vw, 11rem); font-weight: 800; font-stretch: 75%;
  line-height: 0.8; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.escale__fig .cursive { color: var(--red); font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.6rem); }
.escale--d .escale__fig .cursive { font-size: clamp(2.4rem, 1rem + 3.6vw, 4.6rem); rotate: -4deg; }
.escale__matiere { color: var(--red); font-size: 1.05rem; line-height: 1.6; margin-bottom: 14px; }
.cover {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  aspect-ratio: 2 / 1.15;
  padding: 4% 5%;
  overflow: hidden;
}
.cover svg { width: 100%; height: 100%; }
.cover .t {
  fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1;
}
.cover .t--red { stroke: var(--red); stroke-width: 2; }
.cover .t--dash { stroke-dasharray: 0.012 0.018; }
.cover__tag {
  position: absolute; right: 5%; bottom: 6%; color: var(--red); font-size: 1rem;
  background: var(--paper); padding: 0 6px;
}
.escale__body { padding-top: 22px; }
.escale__kicker { font-size: var(--t-s); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.escale__title {
  margin-top: 6px;
  font-size: var(--t-l); font-weight: 720; font-stretch: 78%;
  line-height: 1; letter-spacing: -0.015em;
  text-wrap: balance;
}
.escale__link { text-decoration: none; }
.escale__link .wd {
  background: linear-gradient(var(--red) 0 0) left 96% / 0% 3px no-repeat;
  transition: background-size 0.6s var(--ease);
}
.escale__link::after { content: ''; position: absolute; inset: 0; z-index: 4; }
.escale__link:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; }
.escale__pitch { margin-top: 14px; max-width: 33rem; color: var(--ink); }
.escale__url {
  margin-top: 18px; display: inline-flex; gap: 10px; align-items: baseline;
  font-size: var(--t-s); font-weight: 600; color: var(--muted);
}
.arrow { display: inline-block; color: var(--red); transition: translate 0.5s var(--ease-soft); }
.escale.is-hot .escale__link .wd, .escale:focus-within .escale__link .wd { background-size: 100% 3px; }
.escale.is-hot .escale__url, .escale:focus-within .escale__url { color: var(--ink); }
.escale.is-hot .arrow, .escale:focus-within .arrow { translate: 4px -4px; }
@media (hover: hover) {
  .escale:hover .escale__link .wd { background-size: 100% 3px; }
  .escale:hover .escale__url { color: var(--ink); }
  .escale:hover .arrow { translate: 4px -4px; }
  .escale:hover .cover { border-color: var(--red); }
}
.escale:active .cover { scale: 0.99; }
.cover { transition: scale 0.3s var(--ease-soft), border-color 0.4s; }
.escale.is-hot .cover { border-color: var(--red); }

/* ——— COULISSES : le verso, à l'encre ——— */
.coul {
  background-color: var(--ink);
  background-image:
    linear-gradient(90deg, rgba(246, 247, 251, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(246, 247, 251, 0.07) 1px, transparent 1px);
  background-size: var(--sq) var(--sq);
  background-position: var(--mx) 0, 0 0;
  color: var(--paper);
  padding: clamp(96px, 16vh, 170px) var(--gutter) clamp(110px, 18vh, 190px) calc(var(--mx) + var(--gap));
}
.coul .note, .coul .tool__matiere { color: var(--red-on-ink); }
.coul__head { position: relative; margin-bottom: clamp(64px, 10vh, 120px); }
.coul__dot { top: 0.35em; background: var(--ink); }
.coul__dot.is-reached { background: var(--red); }
.coul__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 72px;
}
.tool--carnet { grid-column: 1 / span 6; }
.tool--nada { grid-column: 8 / span 5; padding-top: clamp(0px, 14vh, 160px); }
.tool__matiere { font-size: 1.05rem; margin-bottom: 12px; }
.tool__title { font-size: var(--t-l); font-weight: 720; font-stretch: 78%; line-height: 1; letter-spacing: -0.015em; }
.tool__link { text-decoration: none; display: inline; }
.tool__link .wd {
  background: linear-gradient(var(--red-on-ink) 0 0) left 96% / 0% 3px no-repeat;
  transition: background-size 0.6s var(--ease);
}
.tool__link .arrow { margin-left: 0.25em; font-size: 0.7em; color: var(--red-on-ink); }
@media (hover: hover) {
  .tool__link:hover .wd { background-size: 100% 3px; }
  .tool__link:hover .arrow { translate: 6px -6px; }
}
.tool__link:focus-visible .wd { background-size: 100% 3px; }
.tool__link:focus-visible { outline-color: var(--red-on-ink); }
.tool__lead { margin-top: 18px; font-size: var(--t-m); line-height: 1.45; max-width: 34rem; font-weight: 360; }
.tool--carnet .tool__lead { font-size: clamp(1.35rem, 1.1rem + 1vw, 2.1rem); line-height: 1.3; }
.tool__tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.tool__tags li {
  font-size: var(--t-s); font-weight: 550; padding: 6px 12px;
  border: 1.5px solid rgba(246, 247, 251, 0.4);
}
.tool__url { margin-top: 26px; font-size: var(--t-s); font-weight: 600; color: rgba(246, 247, 251, 0.72); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 34px; border-top: 1.5px solid rgba(246, 247, 251, 0.35); padding-top: 18px; }
.facts dt {
  font-size: clamp(3rem, 2rem + 4vw, 6.5rem); font-weight: 800; font-stretch: 75%; line-height: 0.9;
  font-variant-numeric: tabular-nums; letter-spacing: -0.03em;
}
.facts dd { margin-top: 8px; font-size: var(--t-s); font-weight: 550; color: rgba(246, 247, 251, 0.82); }

/* ——— FINALE ——— */
.end {
  position: relative; overflow-x: clip;
  padding: clamp(110px, 18vh, 200px) var(--gutter) 28px var(--gutter);
  container-type: inline-size;
}
.end__mark {
  font-size: 34.4cqi; font-weight: 800; font-stretch: 75%;
  line-height: 0.8; letter-spacing: -0.012em; white-space: nowrap;
  margin-left: -0.03em;
}
.end__period { color: var(--red); }
.end__cols {
  margin-top: clamp(40px, 7vh, 80px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 28px;
  border-top: 1.5px solid var(--ink); padding-top: 22px;
}
.end__line { grid-column: 1 / span 4; font-weight: 600; font-size: var(--t-m); line-height: 1.3; }
.end__cols nav { grid-column: 6 / span 3; }
.end__links { display: grid; gap: 4px; }
.end__links a { display: inline-block; padding: 4px 0; font-weight: 500; }
.end__colophon { grid-column: 10 / span 3; font-size: var(--t-s); color: var(--muted); line-height: 1.5; }

/* ——— 404 ——— */
.torn { min-height: 100svh; display: grid; grid-template-rows: auto; align-content: center; grid-template-columns: var(--mx) 1fr; padding: 0 var(--gutter) 0 0; position: relative; }
.torn::before { content: ''; position: absolute; left: var(--mx); top: 0; bottom: 0; width: 2px; background: var(--red); }
.torn__page { grid-column: 2; padding-left: var(--gap); display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.torn__aside { grid-column: 1; padding: clamp(96px, 16vh, 168px) 14px 0 var(--gutter); }
.torn__title { font-size: clamp(3rem, 1rem + 9vw, 11rem); font-weight: 800; font-stretch: 75%; line-height: 0.88; letter-spacing: -0.025em; }
.torn__text { max-width: 30rem; font-size: var(--t-m); }
.torn__back { align-self: flex-start; font-weight: 600; display: inline-flex; gap: 10px; padding: 6px 0; text-decoration: none; }
.torn__back .arrow { transition: translate 0.5s var(--ease-soft); }
@media (hover: hover) { .torn__back:hover .arrow { translate: -6px 0; } .torn__back:hover .trace-link { background-size: 100% 1.5px; } }
.torn__back:focus-visible .arrow { translate: -6px 0; }
.torn__edge { position: absolute; left: 0; bottom: 0; width: 100%; height: 22px; color: var(--ink); }

/* ——— Téléphone : la marge devient la colonne vertébrale ——— */
@media (max-width: 960px) {
  .escale--a, .escale--b, .escale--c, .escale--d { grid-column: 1 / -1; grid-row: auto; }
  .prods__head { max-width: none; }
  .escales { row-gap: 96px; }
  .escale__fig { display: none; }
  .tool--carnet, .tool--nada { grid-column: 1 / -1; padding-top: 0; }
  .end__line { grid-column: 1 / -1; }
  .end__cols nav { grid-column: 1 / span 6; }
  .end__colophon { grid-column: 7 / span 6; }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: var(--mx) 1fr; padding-top: 92px; padding-bottom: 88px; }
  .hero__aside { grid-column: 2; grid-row: 1; padding: 0 0 22px var(--gap); flex-direction: row; justify-content: space-between; align-items: baseline; }
  .hero__page { grid-row: 2; justify-content: flex-start; }
  .hero__title { font-size: clamp(2.5rem, 15cqi, 4.2rem); line-height: 0.93; }
  .hero__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 30px; margin-top: 28px; }
  .hero__lede { font-size: 1.0625rem; }
  .hero__exit { display: none; }
  .top__brand { margin-left: calc(var(--mx) - var(--gutter) + var(--gap)); }
  .prods__head, .coul__head { margin-bottom: 56px; }
  .escale__title { font-size: 1.85rem; }
  .cover { aspect-ratio: 2 / 1.2; }
  .end { padding-top: 96px; }
  .end__cols nav, .end__colophon { grid-column: 1 / -1; }
  .facts dt { font-size: 3.4rem; }
  .torn { align-content: start; }
  .torn__aside { grid-column: 2; grid-row: 1; padding: 96px 0 0 var(--gap); }
  .torn__page { grid-row: 2; justify-content: flex-start; padding-top: 24px; }
}

/* ——— Mouvement réduit : tout est là, rien ne bouge ——— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .escale.is-hot .arrow, .tool__link:hover .arrow { translate: none; }
}
