/* La Batisse V3·3 — pages légales : même DA que l'accueil (papier, encre, Inter serré, mono),
   une illustration du mas en tête, une feuille de papier pour lire. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrainsmono-latin.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
  --feuille: #F2EDE3;
  --encre-texte: #15171C;
  --gris: #4A4F5A;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gut: clamp(16px, 3.4vw, 48px);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--feuille); color: var(--encre-texte); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--lien); outline-offset: 3px; }
body::after {
  content: ''; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.discret { opacity: .62; }
.evitement { position: absolute; left: -9999px; top: 8px; z-index: 30; background: var(--encre-texte); color: var(--feuille); padding: 10px 14px; border-radius: 8px; }
.evitement:focus { left: 8px; }

/* ---------- Navigation (identique à l'accueil) ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--feuille) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--encre-texte) 12%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav__logo { white-space: nowrap; font-weight: 600; letter-spacing: -0.03em; text-decoration: none; margin-right: 12px; font-size: 16px; }
.nav__lien { white-space: nowrap; font-size: 14px; text-decoration: none; padding: 8px 12px; border-radius: 999px; transition: background-color .2s ease; }
@media (hover: hover) and (pointer: fine) { .nav__lien:hover { background: color-mix(in srgb, var(--encre-texte) 8%, transparent); } }
@media (max-width: 720px) { .nav__lien { display: none; } }
.btn {
  white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px; border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: 15px; line-height: 1; background: var(--encre-texte); color: var(--feuille);
  transition: transform .16s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn--petit { padding: 10px 16px; font-size: 14px; }

/* ---------- En-tête illustré ---------- */
.entete { position: relative; min-height: min(78vh, 760px); display: flex; align-items: flex-end; overflow: hidden; background: var(--papier); color: var(--texte); }
.entete picture, .entete img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.entete::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--papier) 6%, color-mix(in srgb, var(--papier) 70%, transparent) 30%, transparent 62%);
}
.entete__texte { position: relative; z-index: 1; padding: 0 var(--gut) clamp(32px, 6vh, 64px); width: 100%; }
.titre { font-weight: 600; letter-spacing: -0.055em; line-height: .92; margin: 14px 0 18px; font-size: clamp(48px, 8.6vw, 140px); }
.maj { margin: 0; opacity: .8; }
.ligne { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
.ligne > span { display: block; animation: monte 1.1s var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 70ms); }
@keyframes monte { from { transform: translate3d(0, 120%, 0); } }

/* ---------- La feuille ---------- */
.feuille {
  display: grid; grid-template-columns: 240px minmax(0, 700px); gap: clamp(32px, 6vw, 96px); justify-content: center;
  padding: clamp(48px, 9vh, 104px) var(--gut) clamp(64px, 12vh, 140px);
}
.sommaire { position: sticky; top: 96px; align-self: start; }
.sommaire ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: s; }
.sommaire li { counter-increment: s; }
.sommaire a { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; line-height: 1.35; text-decoration: none; color: var(--gris); transition: color .2s ease; }
.deja-numerote a::before { content: none; }
.sommaire a::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 11px; padding-top: 2px; color: var(--lien); }
@media (hover: hover) and (pointer: fine) { .sommaire a:hover { color: var(--encre-texte); } }

.texte > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.texte h2 {
  font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -0.035em; line-height: 1.1;
  margin: 64px 0 18px; padding-top: 26px; border-top: 1px solid color-mix(in srgb, var(--encre-texte) 14%, transparent);
  display: flex; align-items: baseline; gap: 14px;
}
.num { color: var(--lien); font-size: 12px; letter-spacing: .08em; flex: none; }
.texte p, .texte li { color: var(--gris); }
.texte p { margin: 0 0 16px; }
.texte ul { padding-left: 1.1em; margin: 0 0 18px; }
.texte li { margin-bottom: 6px; }
.texte li::marker { color: var(--lien); }
.texte strong { color: var(--encre-texte); font-weight: 600; }
.texte a { color: var(--lien); text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.texte .avertissement {
  margin: 0 0 32px; padding: 18px 20px; border-radius: 14px; color: var(--encre-texte);
  background: color-mix(in srgb, var(--lien) 9%, var(--feuille)); border: 1px solid color-mix(in srgb, var(--lien) 22%, transparent);
}

.pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 24px var(--gut); border-top: 1px solid color-mix(in srgb, var(--encre-texte) 12%, transparent); }
.pied__liens { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.pied a { text-decoration: none; opacity: .7; display: inline-block; padding-block: 9px; } /* cible tactile d'au moins 24 px */
.pied a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 860px) {
  .feuille { grid-template-columns: 1fr; }
  .sommaire { position: static; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--encre-texte) 12%, transparent); }
  .entete { min-height: 62vh; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ligne > span { animation: none; }
}

/* Pages sans sommaire (messages, 404) : la feuille est centrée */
.feuille--seule { grid-template-columns: minmax(0, 700px); }
.texte .btn { margin-top: 12px; color: var(--feuille); }
