:root {
  --ink: #2b2622; --bg: #d9d1c1; --accent: #9c4630;
  --display: "Gambetta", Georgia, "Times New Roman", serif;
  --body: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#space { height: 820vh; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

.brand { position: fixed; top: 22px; left: clamp(18px, 4vw, 44px); z-index: 3; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand__mark { width: 14px; height: 18px; background: var(--accent); border-radius: 2px 2px 4px 4px; }
.brand__name { font-family: var(--display); font-size: 1.35rem; letter-spacing: -0.01em; }

.cap { padding: 18px 22px 20px; background: color-mix(in srgb, var(--bg) 86%, transparent); border-radius: 3px; box-shadow: 3px 3px 0 color-mix(in srgb, var(--ink) 14%, transparent); position: absolute; max-width: min(36ch, 40vw); opacity: 0; will-change: opacity, transform; }
.cap--bl { left: clamp(18px, 4vw, 56px); bottom: clamp(34px, 8vh, 80px); }
.cap--tl { left: clamp(18px, 4vw, 56px); top: clamp(80px, 14vh, 130px); }
.cap--br { right: clamp(88px, 8vw, 130px); bottom: clamp(34px, 8vh, 80px); text-align: right; }
.cap--bc { left: 50%; margin-left: calc(min(36ch, 40vw) / -2); bottom: clamp(34px, 8vh, 80px); text-align: center; }
/* Les étiquettes reçoivent le même papier que le livre (calque en multiply, voir MANUEL-SITE-WEB niveau 2). */
.is-textured .cap { background-image: url("../assets/textures/papier-348.webp"); background-size: 420px; background-blend-mode: multiply; }
.cap__kicker { margin: 0 0 10px; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.8; }
.cap__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.1rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -0.03em; text-wrap: balance; }
.cap__text { margin: 14px 0 0; font-size: clamp(0.98rem, 1.15vw, 1.1rem); line-height: 1.5; text-wrap: pretty; }
.cap__btn { display: inline-block; margin-top: 20px; padding: 12px 22px; border-radius: 3px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.cap__btn:hover { transform: translateY(-2px); }
.cap__btn, .tab { transition: transform 0.2s ease-out, background 0.2s ease-out; }
.cap__btn:focus-visible, .tab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Onglets d'index, comme sur un carnet : le chapitre courant sort davantage du bord. */
.tabs { position: fixed; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.tab { display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; font: inherit; color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, #fff); padding: 10px 14px 10px 12px; border-radius: 6px 0 0 6px; transform: translateX(calc(100% - 44px)); box-shadow: -2px 2px 0 color-mix(in srgb, var(--ink) 18%, transparent); }
.tab__num { font-family: var(--display); font-size: 1.1rem; width: 22px; text-align: center; }
.tab__name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.tab:hover { transform: translateX(calc(100% - 66px)); }
.tab.is-active { transform: translateX(0); background: var(--accent); color: #fff; }

.hint { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; z-index: 3; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.75; transition: opacity 0.4s; }
.nojs { position: fixed; inset: auto 20px 20px; margin: 0; padding: 16px; background: #fff; color: #222; }

@media (max-width: 700px) {
  .cap { max-width: none; left: 18px; right: 18px; bottom: 78px; text-align: left; margin: 0; }
  .cap--tl { top: auto; }
  .cap--br, .cap--bc { left: 18px; right: 18px; margin-left: 0; text-align: left; }
  .tabs { top: auto; bottom: 14px; right: 14px; transform: none; flex-direction: row; gap: 4px; }
  .tab { transform: none; padding: 8px 10px; border-radius: 6px; box-shadow: none; }
  .tab__name { display: none; } .tab:hover { transform: none; }
  .hint { display: none; }
  .cap__title { font-size: clamp(1.9rem, 9vw, 2.6rem); }
}
@media (prefers-reduced-motion: reduce) { .cap { transition: none; } .cap__btn:hover { transform: none; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
