@charset "UTF-8";
:root {
  --paper: #f3eee3;
  --paper-2: #e8dfcc;
  --cream: #fffbf3;
  --ink: #0f1f19;
  --ink-2: #44564d;
  --ink-3: #5c6b62;
  --line: rgba(15, 31, 25, 0.14);
  --line-strong: rgba(15, 31, 25, 0.9);
  --pop-shadow: #0f1f19;
  --fixed-ink: #0f1f19;
  --dark-shadow: rgba(243, 238, 227, 0.28);
  /* Couleurs de ressource : une couleur par type, jamais réutilisée ailleurs. */
  --c-prefix: #cdf25a;
  --c-prefix-tint: #eef9c4;
  --c-prefix-deep: #5c7600;
  --c-suffix: #4fd1c5;
  --c-suffix-tint: #d4f3ef;
  --c-suffix-deep: #0d746a;
  --c-lang: #8f7bf0;
  --c-lang-tint: #e5e0fc;
  --c-lang-deep: #5541c2;
  --c-family: #f59ac1;
  --c-family-tint: #fde3ee;
  --c-family-deep: #a8336a;
  --c-pli: #f4b740;
  --c-pli-tint: #fcecc6;
  --c-pli-deep: #8f6200;
  /* Couleur d'action et de marque, avec ses états. */
  --c-action: #ff6b4a;
  --c-action-hover: #ff8667;
  --c-action-active: #e24e2d;
  --c-action-tint: #ffe2d9;
  --c-action-deep: #c23d1f;
  --night: #0c1814;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", Futura, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, monospace;
  --pad: clamp(20px, 5vw, 80px);
  --radius: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  /* Ressort amorti (raideur 170, amortissement 14) : un dépassement, puis un léger rebond, sans bibliothèque. */
  --ease-ressort: linear(0, 0.22 4%, 0.62 10%, 0.96 18%, 1.1 26%, 1.08 34%, 0.98 46%, 0.99 58%, 1.01 70%, 1);
  /* Cinq durées (design-system.html, 1.6 Mouvement). */
  --dur-instant: 120ms;
  --dur-rapide: 240ms;
  --dur-base: 360ms;
  --dur-lent: 480ms;
  --dur-rituel: 1.8s;
}

body.nocturne {
  --paper: #0f1f19;
  --paper-2: #172a23;
  --cream: #182c24;
  --ink: #f3eee3;
  --ink-2: #b8c6bd;
  --ink-3: #809088;
  --line: rgba(243, 238, 227, 0.14);
  --line-strong: rgba(243, 238, 227, 0.8);
  --pop-shadow: #000;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}
h1, h2, h3, p, ol, ul { margin: 0; }
a, button { color: inherit; }
button { font: inherit; }
::selection { background: var(--c-action-tint); color: var(--fixed-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Navigation ---------- */
.progress {
  position: fixed; z-index: 70; inset: 0 0 auto;
  height: 3px; background: var(--c-action);
  transform: scaleX(0); transform-origin: 0 50%;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  letter-spacing: -0.01em; text-decoration: none;
}
.seal {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--c-action); color: var(--fixed-ink);
  border: 1.5px solid var(--fixed-ink);
  box-shadow: 3px 3px 0 var(--fixed-ink);
  font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: -0.02em;
  rotate: -6deg; transition: rotate 0.5s var(--ease-spring);
}
.wordmark:hover .seal { rotate: 8deg; }
body.nocturne .seal { box-shadow: 3px 3px 0 var(--dark-shadow); }
.theme-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1.5px solid currentColor; border-radius: 50%;
  background: transparent; cursor: pointer; font-size: 18px;
  transition: transform 0.6s var(--ease-spring);
}
.theme-btn:hover { transform: rotate(180deg); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px;
  border: 1.5px solid var(--fixed-ink); border-radius: 12px;
  font-family: var(--sans); font-size: 13px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), background-color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translate(-2px, -2px); }
.btn:active { transform: translate(2px, 2px); }
.btn:disabled, .btn:disabled:hover { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
/* Principal : une seule action principale par écran, toujours en Corail. */
.btn-primary { background: var(--c-action); color: var(--fixed-ink); box-shadow: 4px 4px 0 var(--pop-shadow); }
.btn-primary:hover { background: var(--c-action-hover); box-shadow: 6px 6px 0 var(--pop-shadow); }
.btn-primary:active { background: var(--c-action-active); box-shadow: 1px 1px 0 var(--pop-shadow); }
.btn-primary:focus-visible { outline-color: var(--ink); }
/* Secondaire : contour Encre, fond transparent, teinte Encre au survol. */
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--ink) 14%, transparent); }
/* Secondaire sur fond sombre. */
.btn-ghost { background: transparent; color: #f3eee3; border-color: rgba(243, 238, 227, 0.4); }
.btn-ghost:hover { border-color: #f3eee3; background: rgba(243, 238, 227, 0.08); }
.btn-ghost:active { background: rgba(243, 238, 227, 0.16); }

/* ---------- Hero ---------- */
.hero { --pop-shadow: var(--dark-shadow); }
.hero {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh; min-height: 100svh;
  padding: 120px var(--pad) 96px;
  overflow: hidden;
  background: var(--night); color: #f3eee3;
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px circle at var(--gx, 72%) var(--gy, 40%), rgba(255, 107, 74, 0.16), transparent 62%),
    radial-gradient(700px circle at 12% 88%, rgba(243, 238, 227, 0.07), transparent 62%),
    radial-gradient(520px circle at 92% 96%, rgba(255, 107, 74, 0.14), transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(243, 238, 227, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 238, 227, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 60% 50%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at 60% 50%, #000 20%, transparent 72%);
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(40px, 6vw, 100px); align-items: center;
  width: 100%; max-width: 1400px; margin: 0 auto;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 32px; padding: 8px 14px 8px 10px;
  border: 1px solid rgba(243, 238, 227, 0.2); border-radius: 999px;
  background: rgba(243, 238, 227, 0.04);
  color: rgba(243, 238, 227, 0.78);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.kicker .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-action); animation: ping 2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 74, 0.6); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(255, 107, 74, 0); }
}
.title {
  margin-bottom: 28px;
  font-family: var(--serif); font-size: clamp(64px, 10vw, 168px); font-weight: 600;
  letter-spacing: -0.055em; line-height: 0.84;
}
.t-line { display: block; }
.t-italic { padding-left: 0.45em; color: var(--c-action); font-style: italic; }
.char {
  display: inline-block; opacity: 0;
  transform: translateY(0.45em) rotate(5deg);
  animation: rise 1s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }
.lede {
  max-width: 540px; margin-bottom: 28px;
  color: rgba(243, 238, 227, 0.72);
  font-family: var(--serif); font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45;
}
.morph-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px;
  max-width: 560px; margin-bottom: 32px; padding: 16px 0;
  border-block: 1px solid rgba(243, 238, 227, 0.14);
}
.morph-label {
  color: rgba(243, 238, 227, 0.5);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.morph {
  min-width: 9ch; color: #fffbf3;
  font-family: var(--serif); font-size: clamp(26px, 2.8vw, 38px); font-style: italic; line-height: 1.1;
}
.morph .glitch { color: var(--c-action); font-style: normal; opacity: 0.8; }
.morph-lang {
  margin-left: auto; padding: 5px 10px; border-radius: 999px;
  background: rgba(243, 238, 227, 0.08); color: var(--fixed-ink);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background-color 0.4s;
}
.morph-lang { background: var(--c-lang); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.stage {
  position: relative;
  display: grid; place-items: center;
  height: clamp(460px, 46vw, 620px);
}
.stage-ring {
  position: absolute; inset: 6%;
  border: 1px dashed rgba(243, 238, 227, 0.16); border-radius: 50%;
  animation: spin 60s linear infinite;
}
.stage-ring.r2 {
  inset: 20%;
  border-style: solid; border-color: rgba(243, 238, 227, 0.08);
  animation-direction: reverse; animation-duration: 38s;
}
.stage-ring::before {
  position: absolute; top: -5px; left: 50%;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-action); box-shadow: 0 0 18px var(--c-action);
  content: "";
}
.stage-ring.r2::before { top: auto; bottom: -5px; background: #f3eee3; box-shadow: 0 0 18px #f3eee3; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-card {
  position: relative; z-index: 3;
  width: min(86%, 380px); padding: 24px;
  border: 1.5px solid var(--fixed-ink); border-radius: 20px;
  background: #fffbf3; color: var(--fixed-ink);
  box-shadow: 12px 12px 0 var(--c-action), 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  rotate: -3deg;
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
}
.hc-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
}
.hc-badge {
  padding: 5px 9px; border: 1px solid var(--fixed-ink); border-radius: 999px;
  background: var(--c-action); animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.07); } }
.hc-word {
  font-family: var(--serif); font-size: clamp(36px, 4vw, 52px); font-weight: 600;
  letter-spacing: -0.04em; line-height: 1;
}
.hc-def { margin-top: 10px; font-size: 14px; line-height: 1.4; }
.hc-trans { margin: 4px 0 18px; color: var(--c-action-deep); font-family: var(--serif); font-size: 16px; font-style: italic; }
.chain { display: grid; gap: 6px; margin-bottom: 18px; padding: 0; list-style: none; }
.chain li {
  display: grid; grid-template-columns: 12px 84px 1fr; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid transparent; border-radius: 10px;
  transition: background-color 0.4s, border-color 0.4s, transform 0.5s var(--ease-spring);
}
.chain li.on { background: #f3eee3; border-color: var(--fixed-ink); transform: translateX(8px); }
.lang-dot { width: 10px; height: 10px; border: 1px solid var(--fixed-ink); border-radius: 50%; }
.lang-dot { background: var(--c-lang); }
.c-lang { color: #44564d; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.c-form { font-family: var(--serif); font-size: 18px; }
.hc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 14px; border-top: 1px solid rgba(15, 31, 25, 0.14);
  color: #44564d; font-size: 12px;
}
.conf {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}
.conf i { width: 3px; height: 11px; border: 1px solid currentColor; border-radius: 2px; background: currentColor; }
.conf b { margin-left: 4px; font-weight: 600; }

.float { position: absolute; z-index: 4; transition: translate 0.7s var(--ease-out); }
.float > span {
  display: block; padding: 10px 16px;
  border: 1.5px solid var(--fixed-ink); border-radius: 10px;
  color: var(--fixed-ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  font-family: var(--serif); font-size: 22px; white-space: nowrap;
  animation: bob var(--dur, 6s) ease-in-out infinite var(--delay, 0s);
}
@keyframes bob { 50% { transform: translateY(-14px); } }
.f1 { top: 3%; right: 6%; rotate: 8deg; }
.f1 > span { background: #fffbf3; }
.f2 { bottom: 7%; left: 2%; rotate: -9deg; }
.f2 > span { background: #fffbf3; }
.f3 { top: 13%; left: 3%; rotate: -5deg; }
.f3 > span { background: var(--c-suffix); }
.f4 { bottom: 1%; left: 46%; rotate: 5deg; }
.f4 > span { background: #fffbf3; }
.f5 { top: 2%; left: 34%; rotate: -3deg; }
.f5 > span { background: var(--c-lang); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; }

.cue {
  position: absolute; bottom: 24px; left: 50%; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(243, 238, 227, 0.5);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
}
.cue i { position: relative; width: 1px; height: 42px; overflow: hidden; background: rgba(243, 238, 227, 0.2); }
.cue i::after {
  position: absolute; top: -40%; left: 0; width: 100%; height: 40%;
  background: var(--c-action); content: "";
  animation: drip 1.8s var(--ease-out) infinite;
}
@keyframes drip { to { top: 100%; } }

/* ---------- Bandeaux défilants ---------- */
.marquees { overflow: hidden; padding: 34px 0; background: var(--paper); }
.marquee {
  width: 104%; margin-left: -2%; padding: 16px 0;
  overflow: hidden;
  border-block: 1.5px solid var(--fixed-ink);
  background: var(--fixed-ink); color: #f3eee3;
  rotate: -1.4deg;
}
.marquee.alt { margin-top: -6px; background: var(--c-action); color: var(--fixed-ink); rotate: 1deg; }
.track { display: flex; width: max-content; animation: marq 40s linear infinite; }
.marquee.alt .track { animation-direction: reverse; animation-duration: 52s; }
.marquee:hover .track { animation-play-state: paused; }
.track > span {
  display: flex; align-items: center; gap: 28px; padding-right: 28px;
  font-family: var(--serif); font-size: clamp(24px, 3vw, 38px); white-space: nowrap;
}
.track > span::after { content: "✦"; color: var(--c-action); font-size: 0.6em; }
.marquee.alt .track > span::after { color: var(--fixed-ink); }
.track em { font-style: italic; }
.mq-item { padding-block: 4px 8px; }
.mq-item .brick { min-width: 0; padding: 8px 16px; cursor: default; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55); rotate: -2deg; }
.mq-item:nth-child(even) .brick { rotate: 2deg; }
.mq-item .b-label { font-size: clamp(22px, 2.4vw, 30px); }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(80px, 11vw, 160px) var(--pad); }
.wrap { max-width: 1320px; margin: 0 auto; }
.sec-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.sec-num {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
  color: var(--c-action-deep); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
}
.sec-num::before { width: 28px; height: 1.5px; background: currentColor; content: ""; }
h2 {
  font-family: var(--serif); font-size: clamp(44px, 6.4vw, 96px); font-weight: 600;
  letter-spacing: -0.045em; line-height: 0.92;
}
h2 em { color: var(--c-action-deep); font-style: italic; }
.sec-intro { max-width: 560px; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 20px); line-height: 1.6; }

[data-reveal] {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Identité visuelle ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border: 1.5px solid var(--line-strong); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.id-block { margin-top: clamp(56px, 7vw, 96px); }
.id-block:first-of-type { margin-top: 0; }
.id-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; font-family: var(--serif); font-size: clamp(28px, 2.8vw, 38px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.id-title small { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.id-lead { max-width: 72ch; margin-bottom: 24px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.id-lead strong { color: var(--ink); }
.id-card { padding: 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.id-k { display: block; margin-bottom: 6px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.id-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.45; }
.id-list li { display: grid; grid-template-columns: 12px 1fr; gap: 8px; }
.id-list li > span { min-width: 0; }
.id-list li::before { width: 6px; height: 6px; margin-top: 6px; background: var(--ink); content: ""; rotate: 45deg; }
.id-list.no li::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.id-list.no { color: var(--ink-2); }
/* Textures de carte (ADR 0023) */
.tx-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 14px; margin-bottom: 14px; }
.tx-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.tx-cards .mini { cursor: default; }
.tx-cards .mini:hover { transform: none; box-shadow: none; }
.on-day-tx {
  --paper: #f3eee3; --paper-2: #e8dfcc; --cream: #fffbf3;
  --ink: #0f1f19; --ink-2: #44564d; --ink-3: #5c6b62;
  --line: rgba(15, 31, 25, 0.14); --line-strong: rgba(15, 31, 25, 0.9); --pop-shadow: #0f1f19;
  color: var(--ink);
}
.on-night-tx {
  --paper: #0f1f19; --paper-2: #172a23; --cream: #182c24;
  --ink: #f3eee3; --ink-2: #b8c6bd; --ink-3: #809088;
  --line: rgba(243, 238, 227, 0.14); --line-strong: rgba(243, 238, 227, 0.8); --pop-shadow: #000;
  color: var(--ink);
}
.tx-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.tx-rules-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.tx-sub { margin: clamp(32px, 4vw, 48px) 0 14px; font-family: var(--serif); font-size: clamp(22px, 2vw, 26px); font-weight: 600; letter-spacing: -0.01em; }
.tx-note { max-width: 72ch; margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.id-card .tx-note { margin: 0; }
.tx-unique { margin-top: 14px; }
.tx-anat { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.tx-fig { display: grid; gap: 8px; margin: 0; }
.tx-fig figcaption { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.tx-frame { position: relative; width: min(300px, 80vw); aspect-ratio: 3 / 4; overflow: hidden; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.tx-frame .card-art { inset: 0; opacity: 0.16; }
.tx-overlay { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tx-guide { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 6; vector-effect: non-scaling-stroke; }
.tx-zone { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.tx-label { fill: var(--ink-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
.tx-arrow { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tx-badges circle { fill: var(--ink); }
.tx-badges text { fill: var(--paper); font-family: var(--mono); font-size: 12px; font-weight: 700; text-anchor: middle; }
.tx-legend { display: grid; gap: 10px; margin: 0; padding: 0; counter-reset: tx; list-style: none; }
.tx-legend li { display: grid; grid-template-columns: 26px 1fr; column-gap: 12px; counter-increment: tx; font-size: 14px; line-height: 1.5; }
.tx-legend li::before { display: grid; place-items: center; grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); content: counter(tx); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.tx-legend b { font-weight: 700; }
.tx-legend span { color: var(--ink-2); }
.tx-spec-wrap { overflow-x: auto; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.tx-spec { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.tx-spec th, .tx-spec td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tx-spec tr:last-child td { border-bottom: 0; }
.tx-spec th { color: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.tx-spec td:first-child { font-family: var(--serif); font-size: 16px; font-weight: 600; white-space: nowrap; }
.tx-spec td:nth-child(2) { color: var(--ink-2); line-height: 1.5; }
.tx-spec td:last-child { color: var(--ink); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
@media (max-width: 760px) { .tx-anat { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .tx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.neutral-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.nswatch {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--cream); color: var(--ink); cursor: pointer; text-align: left;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
}
.nswatch:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--pop-shadow); }
.nswatch > i { height: 84px; border-bottom: 1.5px solid var(--line-strong); background: var(--c); }
.nswatch > span { display: grid; gap: 4px; padding: 12px; }
.nswatch b { font-family: var(--serif); font-size: 17px; }
.nswatch code, .tone code { font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; }
.nswatch small { color: var(--ink-2); font-size: 12px; line-height: 1.4; }

.res-list { display: grid; gap: 12px; }
.res {
  position: relative;
  display: grid; grid-template-columns: 150px minmax(180px, 1fr) 1.3fr 1fr; gap: 20px; align-items: center;
  padding: 18px 20px 18px 26px; overflow: hidden;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--cream);
}
.res::before { position: absolute; top: 0; bottom: 0; left: 0; width: 8px; background: var(--c); content: ""; }
.res-sample { display: grid; place-items: center; min-height: 110px; }
.res-name { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.res-type { display: block; margin-bottom: 2px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.tones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tone {
  display: flex; flex-direction: column; width: 70px; padding: 0; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--cream); color: var(--ink); cursor: pointer; text-align: left;
  transition: transform 0.2s var(--ease-spring);
}
.tone:hover { transform: translateY(-2px); }
.tone > i { height: 26px; background: var(--c); border-bottom: 1px solid var(--line); }
.tone > span { display: grid; padding: 4px 6px 5px; font-size: 9px; }
.tone b { font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.s-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  width: 92px; aspect-ratio: 3 / 4; padding: 22px 8px 8px; overflow: hidden;
  border: 1.5px solid #0f1f19; border-radius: 10px;
  background: #fffbf3; color: #0f1f19;
  font-family: var(--serif); font-size: 14px; font-weight: 600; line-height: 1.1;
}
.s-card::before { position: absolute; inset: 0 0 auto; height: 16px; border-bottom: 1.5px solid #0f1f19; background: var(--band); content: ""; }
.s-card small { font-family: var(--mono); font-size: 8px; font-weight: 400; color: #44564d; }
.s-ring { width: 34px; height: 34px; border: 4px solid rgba(15, 31, 25, 0.15); border-top-color: #0f1f19; border-right-color: #0f1f19; border-radius: 50%; rotate: 20deg; }
.s-pack {
  position: relative; display: grid; place-items: center;
  width: 78px; height: 106px; border: 2px solid #0f1f19; border-radius: 10px;
  background: repeating-linear-gradient(135deg, #fcecc6 0 7px, #fffbf3 7px 14px);
  box-shadow: inset 0 0 0 4px #fffbf3, inset 0 0 0 5px #0f1f19;
}
.s-pack::after { width: 30px; height: 30px; border: 1.5px solid #0f1f19; border-radius: 50%; background: var(--c-pli); box-shadow: 0 0 16px rgba(244, 183, 64, 0.6); content: ""; }
.s-stack { display: grid; justify-items: center; gap: 8px; }

.action-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.action-demo { display: grid; align-content: center; gap: 22px; padding: 28px; border-radius: var(--radius); background: var(--cream); border: 1.5px solid var(--line-strong); }
.action-demo .row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* Logo : sceau ÉL (ADR 0021) */
.logo-mark { --seal-fill: var(--c-action); --seal-edge: var(--fixed-ink); --seal-shadow: var(--fixed-ink); --seal-ink: var(--fixed-ink); display: block; flex: none; width: 64px; height: 64px; overflow: visible; }
.logo-mark.is-night, body.nocturne .logo-mark { --seal-shadow: var(--dark-shadow); }
.logo-mark.is-mono, body.nocturne .logo-mark.is-mono { --seal-fill: #fffbf3; --seal-shadow: var(--fixed-ink); }
body .logo-mark.is-day { --seal-shadow: var(--fixed-ink); }
.logo-mark.is-wrong-fill { --seal-fill: var(--c-pli); }
.logo-mark.is-flat { --seal-shadow: transparent; rotate: 6deg; }
.logo-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; margin-bottom: 12px; }
.logo-stage { display: grid; place-items: center; align-content: center; gap: 28px; padding: 36px 28px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.logo-lock { display: inline-flex; align-items: center; gap: 0.35em; font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); font-weight: 700; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.logo-lock .logo-mark { width: 1.9em; height: 1.9em; }
.logo-lock.sm { font-size: 17px; }
.logo-lock:hover .logo-mark { rotate: 14deg; transition: rotate 0.5s var(--ease-spring); }
.logo-lock .logo-mark { transition: rotate 0.5s var(--ease-spring); }
.logo-sizes { display: flex; align-items: flex-end; gap: 16px; }
.logo-sizes .logo-mark:nth-child(2) { width: 32px; height: 32px; }
.logo-sizes .logo-mark:nth-child(3) { width: 16px; height: 16px; }
.logo-sizes code { margin-left: 6px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.logo-anat li b { display: inline-block; min-width: 9.5em; color: var(--ink); }
.logo-variants { margin-bottom: 12px; }
.shape-demo.logo-bg-paper, .logo-bg-paper { background: #f3eee3; color: var(--fixed-ink); }
.shape-demo.logo-bg-night, .logo-bg-night { background: var(--night); color: #f3eee3; }
.shape-demo.logo-bg-coral, .logo-bg-coral { background: var(--c-action); color: var(--fixed-ink); }
.shape-demo.logo-bg-pli, .logo-bg-pli { background: var(--c-pli-tint); color: var(--fixed-ink); }
.logo-bg-lang { background: var(--c-lang); }
.logo-donts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.logo-donts .rule-demo { grid-template-rows: 110px auto; }
.logo-donts .logo-mark { width: 56px; height: 56px; }
.logo-donts .rd-surface { padding: 10px 14px; }
@media (max-width: 1100px) { .logo-donts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .logo-grid { grid-template-columns: 1fr; } .logo-donts { grid-template-columns: 1fr 1fr; } .logo-anat li b { min-width: 0; margin-right: 6px; } }
@media (prefers-reduced-motion: reduce) { .logo-lock:hover .logo-mark { rotate: 0deg; } }

.fb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fb { display: grid; align-content: start; gap: 10px; padding: 18px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.fb-icon { display: flex; align-items: center; gap: 10px; min-height: 30px; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.fb-icon i { width: 14px; height: 14px; flex: none; border-radius: 50%; }
.fb p { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.conf-demo { display: grid; gap: 8px; margin-top: 16px; }
.conf-demo .conf { justify-content: space-between; width: 100%; color: var(--ink); }
.conf-demo .conf > span { display: inline-flex; gap: 4px; }
.fb-icon .conf { color: var(--ink); }
.fb-icon .conf i { width: 3px; height: 11px; border-radius: 2px; }
.conf.p2 i:nth-child(3), .conf.p1 i:nth-child(n + 2) { background: transparent; }

.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.shape { display: grid; grid-template-rows: 120px auto; overflow: hidden; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.shape-demo { display: grid; place-items: center; background: var(--paper); border-bottom: 1px solid var(--line); }
.shape-demo .s-card { width: 74px; }
.shape-body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.shape-body b { font-family: var(--serif); font-size: 18px; }
.shape-body p { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.shape-body code { color: var(--ink-3); font-family: var(--mono); font-size: 10px; line-height: 1.5; }
.sh-panel { width: 110px; height: 70px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--cream); }
.sh-pill { padding: 6px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.sh-circle { width: 64px; height: 64px; border: 6px solid var(--line); border-top-color: var(--c-pli); border-right-color: var(--c-pli); border-radius: 50%; }
.sh-dashed { display: grid; place-items: center; width: 110px; height: 64px; border: 2px dashed var(--line-strong); border-radius: 12px; color: var(--ink-3); font-family: var(--serif); font-size: 28px; font-style: italic; }
.sh-diamond { display: flex; gap: 12px; }
.sh-diamond i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.sh-diamond i:nth-child(2) { background: var(--c-action); }
.sh-diamond i:nth-child(3) { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.sh-shadows { display: flex; align-items: flex-end; gap: 14px; }
.shape-wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto; }
.shape-wide .shape-demo { border-right: 1px solid var(--line); border-bottom: 0; }
@media (max-width: 760px) { .shape-wide { grid-template-columns: 1fr; } .shape-wide .shape-demo { border-right: 0; border-bottom: 1px solid var(--line); } }
.sh-rarity { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; padding: 12px; }
.sh-rarity span { display: grid; justify-items: center; gap: 3px; }
.sh-rarity .rar { width: 30px; height: 30px; stroke-width: 1.1; margin-bottom: 4px; }
.sh-rarity b { font-family: var(--serif); font-size: 14px; font-weight: 500; }
.sh-rarity small { color: var(--ink-3); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.sh-shadows span { display: grid; place-items: end center; width: 34px; height: 34px; padding-bottom: 2px; border: 1.5px solid #0f1f19; border-radius: 8px; background: #fffbf3; color: #44564d; font-family: var(--mono); font-size: 8px; }

.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.size-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 12px; }
.sp { display: grid; justify-items: center; gap: 6px; color: var(--ink-3); font-family: var(--mono); font-size: 9px; }
.sp i { width: var(--v); height: var(--v); background: var(--ink); border-radius: 2px; }
.rd i { width: 40px; height: 40px; border: 1.5px solid var(--ink); border-radius: var(--v); background: var(--paper-2); }
.bd i { width: 40px; height: 40px; border: var(--v) solid var(--ink); border-radius: 8px; background: transparent; }
.size-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 13px; }
.size-table td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.size-table td:last-child { color: var(--ink-2); font-family: var(--mono); font-size: 11px; text-align: right; white-space: nowrap; }
.touch { display: grid; place-items: center; width: 44px; height: 44px; margin-top: 12px; border: 1.5px dashed var(--c-action); border-radius: 10px; color: var(--c-action-deep); font-family: var(--mono); font-size: 10px; }

.table-wrap { overflow-x: auto; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.state-table, .map-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.state-table th, .state-table td, .map-table th, .map-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.state-table tr:last-child td, .map-table tr:last-child td { border-bottom: 0; }
.state-table th, .map-table th { color: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.state-table td:first-child, .map-table td:first-child { font-family: var(--serif); font-size: 16px; font-weight: 600; white-space: nowrap; }
.state-table td { min-width: 120px; }
.state-table .btn { min-height: 40px; padding: 8px 14px; font-size: 11px; }
.state-table .brick { min-width: 0; cursor: default; }
.state-rule td { color: var(--ink-2); font-family: var(--mono); font-size: 10px; line-height: 1.5; }
.map-table td { font-size: 13px; }
.map-table td:first-child { font-size: 15px; }
.sw-dot { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 1px solid #0f1f19; border-radius: 3px; background: var(--c); vertical-align: -1px; }


.rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rule-card { display: grid; align-content: start; gap: 12px; padding: 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.rule-head { display: flex; align-items: baseline; gap: 12px; }
.rule-num { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.rule-head b { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.rule-card > p { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.rule-demos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rule-demo { display: grid; grid-template-rows: 104px auto; overflow: hidden; border: 1.5px solid var(--line-strong); border-radius: 10px; }
.rule-stage { display: grid; place-items: center; padding: 10px; background: var(--paper); color: #0f1f19; text-align: center; }
.verdict { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.verdict::before { font-weight: 700; }
.rule-demo.bad .verdict { background: var(--paper-2); color: var(--ink-2); }
.rule-demo.bad .verdict::before { content: "✕ Interdit"; }
.rule-demo.good .verdict::before { content: "✓ Correct"; }
.rule-demo .brick { min-width: 0; cursor: default; }
.rd-card { display: grid; justify-items: center; gap: 12px; width: 150px; padding-bottom: 12px; overflow: hidden; border: 1.5px solid #0f1f19; border-radius: 12px; background: #fffbf3; }
.rd-card > i { width: 100%; height: 18px; border-bottom: 1.5px solid #0f1f19; background: #8f7bf0; }
.rd-surface { padding: 14px 18px; border: 1.5px solid #0f1f19; border-radius: 12px; }
.rd-text { padding: 10px 16px; border: 1.5px solid #0f1f19; border-radius: 10px; font-family: var(--serif); font-size: 18px; font-weight: 700; }
.rd-kicker { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.rd-dots { display: flex; gap: 10px; }
.rd-dots i { width: 16px; height: 16px; border: 1px solid #0f1f19; border-radius: 50%; }
.rd-signals { display: grid; justify-items: center; gap: 6px; font-size: 12px; }
.rd-bar { width: 80%; height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.rd-bar i { display: block; width: 64%; height: 100%; }
.rd-word { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.rd-word span { padding: 0 0.02em; background: linear-gradient(var(--c), var(--c)) no-repeat 0 88% / 100% 34%; }
.rd-word.gap span { background-size: calc(100% - 3px) 34%; }
.ratio-list { display: grid; gap: 6px; }
.ratio { display: grid; grid-template-columns: 54px 1fr auto auto; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.ratio > i { display: grid; place-items: center; height: 30px; border: 1px solid #0f1f19; border-radius: 6px; background: var(--bg); color: var(--fg); font-family: var(--serif); font-size: 16px; font-style: normal; font-weight: 700; }
.ratio b { font-family: var(--mono); font-size: 12px; }
.ratio span:last-child { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.ratio.ko span:last-child { color: var(--ink-3); }
.extra-rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; margin-top: 16px; }

/* États forcés des démonstrations */
.btn-primary.is-hover { background: var(--c-action-hover); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--pop-shadow); }
.btn-primary.is-active { background: var(--c-action-active); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop-shadow); }
.btn-secondary.is-hover { background: color-mix(in srgb, var(--ink) 7%, transparent); transform: translate(-2px, -2px); }
.btn-secondary.is-active { background: color-mix(in srgb, var(--ink) 14%, transparent); transform: translate(2px, 2px); }
.is-focus { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn-primary.is-focus { outline-color: var(--ink); }
.is-disabled { opacity: 0.4; box-shadow: none !important; transform: none !important; }
.brick.is-hover { transform: translate(-2px, -3px) rotate(-1.5deg); box-shadow: 6px 7px 0 var(--pop-shadow); }
.brick.is-active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop-shadow); }
.brick.is-selected { box-shadow: 4px 4px 0 var(--pop-shadow); } /* posée : dans sa case, jamais d’anneau Corail (ADR 0033) */
.cb-chip.is-hover { transform: translateY(-2px); }
.cb-chip.is-active { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.s-mini { display: inline-block; vertical-align: middle; width: 70px; aspect-ratio: 3 / 4; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--paper); box-shadow: inset 0 16px 0 var(--band, #0f1f19); transition: none; }
.s-mini.is-hover { transform: translateY(-5px) rotate(-1.2deg); box-shadow: inset 0 16px 0 var(--band, #0f1f19), 5px 6px 0 var(--pop-shadow); }
.s-mini.is-active { transform: translateY(1px); box-shadow: inset 0 16px 0 var(--band, #0f1f19), 1px 1px 0 var(--pop-shadow); }
.s-mini.is-selected { visibility: visible; opacity: 0.25; border-style: dashed; }

/* ---------- Typographie ---------- */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.glyph-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 520px; padding: 32px; overflow: hidden;
  border-radius: var(--radius); background: var(--night); color: #f3eee3;
}
.glyph-card::before {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255, 107, 74, 0.14), transparent 55%);
  content: "";
}
.glyph-meta {
  position: relative; display: flex; justify-content: space-between;
  color: rgba(243, 238, 227, 0.6);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.glyph {
  position: relative;
  font-family: var(--serif); font-size: clamp(160px, 19vw, 290px);
  letter-spacing: -0.05em; line-height: 0.8;
  transition: opacity 0.35s, transform 0.5s var(--ease-out), filter 0.35s;
}
.glyph em { color: var(--c-action); }
.glyph.swap { opacity: 0; transform: translateY(-24px) rotate(-3deg); filter: blur(6px); }
.scale { display: flex; flex-direction: column; justify-content: center; }
.scale-row {
  display: grid; grid-template-columns: 96px 1fr; align-items: baseline; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.scale-row:first-child { border-top: 1px solid var(--line); }
.scale-row small { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.s-display { font-family: var(--serif); font-size: clamp(40px, 4.6vw, 64px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.s-title { font-family: var(--serif); font-size: clamp(28px, 3vw, 40px); font-style: italic; line-height: 1.1; }
.s-ui { font-size: 22px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.s-body { color: var(--ink-2); font-size: 17px; line-height: 1.55; }
.s-meta { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Table de fusion ---------- */
#jeu {
  background-color: var(--paper-2);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.4px);
  background-size: 22px 22px;
}
.game { display: grid; grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.6fr); gap: 20px; }
.panel-link { display: inline-block; margin-top: 12px; color: var(--c-action-deep); font-size: 13px; font-weight: 700; text-decoration: none; }
.panel-link:hover { text-decoration: underline; }
.panel-link.is-urgent { padding: 8px 12px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--c-pli-tint); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); animation: eqFade 0.4s ease-out; }
.panel {
  position: relative; padding: 20px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--cream);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
}
.count {
  padding: 3px 9px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
}
.tray { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; min-height: 180px; }
.panel-tip { margin-top: 16px; color: var(--ink-3); font-size: 12px; }

.brick {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-width: 108px; padding: 11px 14px;
  border: 1.5px solid var(--fixed-ink); border-radius: 10px;
  background: var(--c-prefix); color: var(--fixed-ink);
  box-shadow: 4px 4px 0 var(--pop-shadow);
  cursor: grab; text-align: left; user-select: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out), opacity 0.2s;
}
.brick[data-kind="suffixe"] { background: var(--c-suffix); }
button.brick:hover { transform: translate(-2px, -3px) rotate(-1.5deg); box-shadow: 6px 7px 0 var(--pop-shadow); }
button.brick:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop-shadow); cursor: grabbing; }
.brick.dragging { opacity: 0.4; }
/* Rationnement : exemplaires tous posés (désactivé) ou épuisés (pointillé = ce qui manque) */
.brick.is-out { opacity: 0.4; box-shadow: none; cursor: not-allowed; }
.brick.is-spent {
  border-style: dashed; box-shadow: none; cursor: not-allowed;
  background: repeating-linear-gradient(135deg, var(--paper-2) 0 6px, var(--cream) 6px 12px);
}
.brick.is-spent .b-label, .brick.is-spent .b-meta { color: var(--ink-3); }
button.brick.is-out:hover, button.brick.is-spent:hover, button.brick.is-out:active, button.brick.is-spent:active { transform: none; box-shadow: none; }
.b-count.zero { border-style: dashed; background: var(--cream); color: var(--ink); text-transform: uppercase; letter-spacing: 0.06em; font-size: 9px; }
.b-minus {
  position: absolute; top: -10px; left: 50%; z-index: 2;
  padding: 1px 7px; border: 1.5px solid var(--fixed-ink); border-radius: 999px;
  background: var(--cream); color: var(--fixed-ink); font-family: var(--mono); font-size: 11px; font-weight: 700;
  pointer-events: none; animation: minusUp 1.3s var(--ease-out) forwards;
}
@keyframes minusUp { 0% { opacity: 0; transform: translate(-50%, 6px) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }
.r-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.r-cost > span:first-child { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.r-cost > span + span { display: inline-flex; align-items: center; gap: 6px; }
.r-cost small { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.r-cost[hidden] { display: none; }
.brick.new { animation: newBrick 1.2s var(--ease-spring); }
@keyframes newBrick {
  0% { transform: scale(0.3) rotate(-20deg); box-shadow: 0 0 0 0 rgba(255, 107, 74, 0.8); }
  50% { transform: scale(1.12) rotate(4deg); }
  100% { transform: none; box-shadow: 4px 4px 0 var(--pop-shadow), 0 0 0 14px rgba(255, 107, 74, 0); }
}
.b-label { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.1; }
.b-meta { font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.72; }

.table-panel { display: flex; flex-direction: column; min-height: 460px; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3); content: "";
  transition: background-color 0.3s;
}
.table-panel.ready .status::before { background: var(--c-action); animation: ping-coral 1.4s infinite; }
@keyframes ping-coral {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 74, 0.6); }
  100% { box-shadow: 0 0 0 9px rgba(255, 107, 74, 0); }
}
.slots {
  position: relative;
  display: flex; flex: 1; align-items: center; justify-content: center; gap: 14px;
  min-height: 220px;
}
.slot {
  display: grid; place-items: center;
  width: 150px; height: 108px; padding: 0;
  border: 2px dashed var(--line-strong); border-radius: 12px;
  background: transparent; color: var(--ink-3);
  cursor: pointer;
  transition: transform 0.55s var(--ease-out), opacity 0.45s, background-color 0.2s, border-color 0.2s;
}
.slot-num { font-family: var(--serif); font-size: 40px; font-style: italic; opacity: 0.5; }
.slot.over { border-style: solid; background: var(--c-action-tint); transform: scale(1.05); }
.slot.filled { border-color: transparent; }
.slot.filled .brick { cursor: pointer; animation: land 0.45s var(--ease-spring); }
@keyframes land { from { transform: translateY(-18px) scale(0.9); } }
.op { font-family: var(--serif); font-size: 42px; transition: opacity 0.3s, transform 0.5s var(--ease-out); }
.fusing .slot[data-slot="0"] { transform: translateX(84px) scale(0.6) rotate(-10deg); opacity: 0; }
.fusing .slot[data-slot="1"] { transform: translateX(-84px) scale(0.6) rotate(10deg); opacity: 0; }
.fusing .op { opacity: 0; transform: scale(2.4) rotate(90deg); }
.shake { animation: shake 0.5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px); }
  40%, 60% { transform: translateX(9px); }
}
.burst { position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; translate: -50% -50%; pointer-events: none; }
.burst::before, .burst::after {
  position: absolute; inset: 0; border: 2px solid var(--c-action); border-radius: 50%;
  content: ""; opacity: 0;
}
.fusing .burst::before { animation: ring 0.8s var(--ease-out) 0.25s; }
.fusing .burst::after { border-color: var(--ink); animation: ring 0.8s var(--ease-out) 0.38s; }
@keyframes ring { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(30); } }
.confetti {
  position: absolute; top: 50%; left: 50%; z-index: 6;
  width: 9px; height: 13px; border: 1px solid var(--fixed-ink); border-radius: 2px;
  background: var(--c); pointer-events: none;
  animation: fly 1s var(--ease-out) forwards;
}
@keyframes fly { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn-primary { flex: 1; }
.table-panel.ready .btn-primary { animation: readyPulse 1.5s infinite; }
@keyframes readyPulse {
  0% { box-shadow: 4px 4px 0 var(--pop-shadow), 0 0 0 0 rgba(255, 107, 74, 0.5); }
  100% { box-shadow: 4px 4px 0 var(--pop-shadow), 0 0 0 14px rgba(255, 107, 74, 0); }
}
.feedback {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; margin-top: 14px;
  color: var(--ink-2); font-size: 14px;
}
.feedback::before { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--ink-3); content: ""; }
.feedback[data-tone="win"]::before { background: var(--c-action); }
.feedback[data-tone="hint"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
.feedback[data-tone="fail"]::before { background: var(--ink-3); }
.feedback[data-tone="known"]::before { background: var(--ink); }
.feedback.bump { animation: bump 0.4s var(--ease-spring); }
@keyframes bump { from { transform: translateY(6px); opacity: 0.3; } }

.result {
  position: absolute; z-index: 5; inset: 62px 16px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 10px;
  padding: 24px; overflow-y: auto; border: 1.5px solid var(--line-strong); border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, var(--c-action-tint), transparent 60%),
    var(--cream);
  text-align: center;
  animation: pop 0.7s var(--ease-spring);
}
.result[hidden] { display: none; }
.table-panel.showing .slots,
.table-panel.showing .actions,
.table-panel.showing .feedback { display: none; }
.table-panel.showing .result { position: relative; inset: auto; flex: 1; overflow: visible; }
@keyframes pop { from { opacity: 0; transform: scale(0.75) rotate(-3deg); } }
.r-kicker { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.r-word { font-family: var(--serif); font-size: clamp(36px, 4.4vw, 56px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.r-def { max-width: 36ch; font-family: var(--serif); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.4; }
.r-eq { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0; }
.r-eq-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; }
.r-eq .brick {
  min-width: 0; padding: 8px 12px; cursor: default;
  box-shadow: 3px 3px 0 var(--pop-shadow);
  animation: eqIn 0.6s var(--ease-spring) both;
}
.r-eq .b-label { font-size: 19px; }
.r-eq .b-meta { font-size: 9px; }
.r-op { font-family: var(--serif); font-size: 28px; line-height: 1; animation: eqFade 0.4s ease-out both; }
.r-lit {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 10px;
  font-family: var(--serif); font-size: 18px; font-style: italic;
  animation: eqFade 0.5s ease-out 0.55s both;
}
.r-lit span { color: var(--ink-3); font-family: var(--mono); font-size: 10px; font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; }
@keyframes eqIn { from { opacity: 0; transform: translateY(14px) scale(0.85) rotate(-4deg); } }
@keyframes eqFade { from { opacity: 0; transform: translateY(6px); } }
.brick[data-kind="mot"] { background: #fffbf3; }
.bchip {
  display: inline-flex; align-items: center;
  padding: 2px 8px 3px; border: 1.5px solid var(--fixed-ink); border-radius: 6px;
  background: var(--c-prefix); color: var(--fixed-ink);
  box-shadow: 2px 2px 0 var(--pop-shadow);
  font-family: var(--serif); font-size: 14px; font-style: normal; font-weight: 700; letter-spacing: 0; line-height: 1.25;
  white-space: nowrap; vertical-align: 0.05em;
}
.bchip[data-kind="suffixe"] { background: var(--c-suffix); }
.bchip[data-kind="mot"] { background: #fffbf3; }
.bchip.missing { border-style: dashed; background: transparent; color: var(--ink-3); box-shadow: none; letter-spacing: 0.08em; }
.bformula { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bplus { color: var(--ink-3); font-family: var(--serif); font-size: 16px; line-height: 1; }
.feedback .bchip, .pack-back .bchip, .r-tr .bchip { margin-inline: 2px; }
.d-formula .bchip { font-size: 13px; }
.cc-formula .bchip { font-size: 15px; }
.cc-lit { margin-top: 8px; color: var(--ink-2); font-family: var(--serif); font-size: 15px; font-style: italic; }
.cc-brick { margin-top: 14px; }
.cc-brick .bchip { padding: 6px 14px 7px; border-radius: 10px; font-size: clamp(26px, 2.4vw, 34px); box-shadow: 4px 4px 0 var(--fixed-ink); }
.m-brick { align-self: flex-start; font-size: clamp(14px, 11cqi, 19px); }
.bf-brick { align-self: flex-start; padding: 14px 20px; cursor: default; box-shadow: 5px 5px 0 var(--pop-shadow); rotate: -2deg; }
.bf-brick .b-label { font-size: clamp(34px, 5vw, 48px); line-height: 1; }
.bf-brick .b-meta { font-size: 11px; }
.bb-links .bchip { font-size: 15px; }
.f-chip { align-self: flex-start; margin: 2px 0 3px; font-size: 17px; }
.f-tr .bchip { margin-left: 2px; font-size: 11px; font-style: normal; padding: 0 6px 1px; box-shadow: 1px 1px 0 var(--pop-shadow); }
.seg {
  padding: 0 0.02em;
  background: linear-gradient(var(--c), var(--c)) no-repeat 0 88% / calc(100% - 3px) 32%;
  /* `backwards` : l'état de repos reste le surlignage plein, même si le navigateur (Safari iOS) ne déroule pas l'animation. */
  animation: segIn 0.6s var(--ease-out) backwards;
}
@keyframes segIn { from { background-size: 0% 32%; } to { background-size: calc(100% - 3px) 32%; } }
.bf-body .r-eq { align-items: flex-start; }
.bf-body .r-eq-row { justify-content: flex-start; }
.bf-body .r-eq-row { flex-wrap: nowrap; gap: 8px; }
.bf-body .r-eq .brick { padding: 7px 11px; }
.bf-body .r-eq .b-label { font-size: 18px; }
.bf-body .r-eq .b-kind { display: none; }
.r-note { max-width: 44ch; color: var(--ink-3); font-size: 13px; }
.r-tr { max-width: 42ch; padding: 6px 12px; border-radius: 999px; background: var(--paper-2); font-size: 12px; }
.r-tr:empty { display: none; }
.result .btn { margin-top: 8px; min-height: 40px; }

.energy { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.energy svg { width: 60px; height: 60px; flex: none; overflow: visible; rotate: -90deg; }
.ring-track { fill: none; stroke: var(--paper-2); stroke-width: 6; }
.ring-edge { fill: none; stroke: var(--ink); stroke-width: 1; }
.ring-fill { fill: none; stroke: var(--c-pli); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 163.36; stroke-dashoffset: 0; }
.energy strong { display: block; font-family: var(--mono); font-size: 18px; }
.energy small { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; }

.discoveries { margin-top: 20px; padding: 22px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.disc-head { display: flex; justify-content: space-between; margin-bottom: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.disc-bar { height: 6px; margin-bottom: 18px; overflow: hidden; border-radius: 999px; background: var(--paper-2); }
.disc-bar i { display: block; width: 0; height: 100%; background: var(--ink); transition: width 0.8s var(--ease-out); }
.disc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.disc {
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
  min-height: 86px; padding: 12px;
  border: 1.5px dashed var(--line-strong); border-radius: 12px;
  background: transparent; color: var(--ink);
  opacity: 0.6; text-align: left;
  transition: background-color 0.4s, opacity 0.4s, transform 0.25s var(--ease-spring);
}
button.disc { font: inherit; cursor: pointer; }
button.disc:hover { transform: translateY(-3px); }
.d-word { font-family: var(--serif); font-size: 17px; overflow-wrap: anywhere; }
.disc:not(.found) .d-word { overflow: hidden; color: var(--ink-3); font-size: 14px; letter-spacing: 0.04em; white-space: nowrap; }
.d-def { color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.d-formula { color: var(--ink-3); font-family: var(--mono); font-size: 9px; letter-spacing: 0.04em; }
.disc.found { border-style: solid; background: var(--paper); opacity: 1; }
.disc.found .d-word { font-weight: 600; letter-spacing: -0.01em; }
.disc.just { animation: flipIn 0.9s var(--ease-spring); }
@keyframes flipIn { from { transform: perspective(600px) rotateY(90deg) scale(0.9); background: var(--c-action-tint); } }


/* ---------- Plis ---------- */
.pack-section {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px circle at 50% 38%, rgba(244, 183, 64, 0.2), transparent 62%),
    var(--paper);
}
.pk-layout { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.6fr) minmax(220px, 0.8fr); gap: 20px; align-items: start; }
.pk-side { display: grid; gap: 20px; }
.pk-card { padding: 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.pk-label { margin-bottom: 14px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.pk-note { margin-top: 12px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.pack-section .energy { margin-bottom: 0; }
.pack-section .energy small { color: var(--ink-3); }
.pk-pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.pk-pool .bchip.missing { animation: poolPulse 2.4s ease-in-out infinite; }
.pk-pool .bchip.missing:nth-child(2n) { animation-delay: -1.2s; }
@keyframes poolPulse { 50% { border-color: var(--c-pli-deep); color: var(--c-pli-deep); } }
.pk-history { display: grid; gap: 8px; }
.pk-hist-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; animation: eqIn 0.6s var(--ease-spring) both; }
.pk-hist-item small { color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.pk-empty { color: var(--ink-3); font-size: 13px; }
.pk-rules { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 13px; }
.pk-rules li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; }
.pk-rules li::before { width: 8px; height: 8px; margin-top: 6px; background: var(--c-pli-deep); content: ""; rotate: 45deg; }

.pk-stage {
  position: relative; isolation: isolate;
  display: grid; grid-template-areas: "main" "scribe" "status" "actions"; grid-template-rows: minmax(310px, 1fr) auto auto auto;
  justify-items: center; align-items: center; gap: 10px;
  min-height: 600px; padding: 32px 24px 28px; overflow: hidden;
  border: 1.5px solid var(--line-strong); border-radius: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(244, 183, 64, 0.26), transparent 58%), var(--cream);
  cursor: default;
}
.pk-stage[data-state="opening"] { cursor: pointer; }
.pk-rays {
  position: absolute; z-index: -1; top: 38%; left: 50%;
  width: 980px; height: 980px; translate: -50% -50%;
  background: repeating-conic-gradient(rgba(244, 183, 64, 0.3) 0deg 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 58%);
  mask-image: radial-gradient(circle, #000 8%, transparent 58%);
  opacity: 0; transition: opacity 0.6s ease;
  animation: spin 22s linear infinite;
}
.pk-stage.pk-writing .pk-rays { opacity: 0.35; animation-duration: 6s; }
.pk-stage.pk-revealed .pk-rays { opacity: 1; }
.pk-flash {
  position: absolute; z-index: 3; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, #fffbf3 0 12%, rgba(244, 183, 64, 0.85) 28%, rgba(252, 236, 198, 0.6) 45%, transparent 65%);
  opacity: 0;
}
.pk-stage.pk-burst .pk-flash { animation: pkFlash 0.7s ease-out; }
@keyframes pkFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

.pk-pack {
  grid-area: main; position: relative;
  width: 200px; height: 272px; padding: 0; border: 0;
  background: none; cursor: pointer;
  filter: drop-shadow(0 26px 30px rgba(15, 31, 25, 0.22));
  animation: pkFloat 4s ease-in-out infinite;
  transition: filter 0.4s, scale 0.4s var(--ease-spring);
}
.pk-pack:disabled { cursor: default; pointer-events: none; }
.pk-pack:not(:disabled):hover { animation-play-state: paused; }
@keyframes pkFloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.pk-half { position: absolute; inset: 0; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease 0.1s; }
.pk-half.top { clip-path: inset(0 0 50% 0); }
.pk-half.bottom { clip-path: inset(50% 0 0 0); }
.pk-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 22px 12px;
  border: 2px solid #0f1f19; border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 183, 64, 0.35), transparent 52%),
    repeating-linear-gradient(135deg, #fcecc6 0 12px, #fffbf3 12px 24px);
  box-shadow: inset 0 0 0 7px #fffbf3, inset 0 0 0 8.5px #0f1f19;
  color: #0f1f19; font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
}
.pk-top b { color: var(--c-pli-deep); font-weight: 700; }
.pk-seal {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  display: grid; place-items: center;
  width: 78px; height: 78px; border: 2px solid #0f1f19; border-radius: 50%;
  background: var(--c-pli); color: #0f1f19;
  box-shadow: 0 0 0 8px rgba(244, 183, 64, 0.18), 0 0 34px rgba(244, 183, 64, 0.5);
  font-family: var(--serif); font-size: 28px; font-weight: 700;
  animation: sealPulse 2.4s ease-in-out infinite;
  transition: transform 0.35s ease-out, opacity 0.35s ease-out;
}
@keyframes sealPulse { 50% { box-shadow: 0 0 0 14px rgba(244, 183, 64, 0.1), 0 0 48px rgba(244, 183, 64, 0.7); } }
.pk-stage.pk-charging .pk-pack { animation: pkShake 0.32s linear infinite; }
@keyframes pkShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-5px, 2px) rotate(-3deg); }
  40% { transform: translate(5px, -2px) rotate(3deg); }
  60% { transform: translate(-4px, -1px) rotate(-2deg); }
  80% { transform: translate(4px, 1px) rotate(2deg); }
}
.pk-stage.pk-writing .pk-pack { scale: 1.14; animation: pkTremble 0.09s linear infinite; filter: drop-shadow(0 0 34px rgba(244, 183, 64, 0.8)); }
@keyframes pkTremble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1.5px, 1px); } 75% { transform: translate(1.5px, -1px); } }
.pk-stage.pk-writing .pk-seal { animation: sealCharge 1.4s ease-in forwards; }
@keyframes sealCharge { to { transform: scale(1.3); box-shadow: 0 0 0 22px rgba(244, 183, 64, 0.2), 0 0 90px var(--c-pli); } }
.pk-stage.pk-burst .pk-pack { animation: none; pointer-events: none; }
.pk-stage.pk-burst .pk-seal { transform: scale(2.6); opacity: 0; animation: none; }
.pk-stage[data-state="recharging"] .pk-pack { opacity: 0.5; filter: grayscale(1) drop-shadow(0 26px 30px rgba(15, 31, 25, 0.15)); animation-play-state: paused; }
.pk-stage[data-state="recharging"] .pk-seal { animation: none; box-shadow: none; }
.pk-stage.pk-entering .pk-pack { animation: pkEnter 0.8s var(--ease-spring); }
@keyframes pkEnter { from { opacity: 0; transform: translateY(80px) scale(0.6) rotate(10deg); } }
.pk-stage.pk-no-trans .pk-half, .pk-stage.pk-no-trans .pk-seal { transition: none; }

.pk-glyph {
  position: absolute; z-index: 4; top: 38%; left: 50%;
  color: var(--c); font-family: var(--serif); font-size: var(--s, 22px); font-weight: 700;
  pointer-events: none; text-shadow: 0 0 12px currentColor;
  animation: fly 1.2s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

/* Fenêtre d'écriture : elle s'ouvre au cœur du pli et tremble avec lui */
.pk-scribe {
  position: absolute; z-index: 2; top: 50%; left: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0;
  width: 164px; height: 156px; padding: 8px 6px 14px; overflow: hidden;
  border: 1.5px solid #0f1f19; border-radius: 12px;
  background: radial-gradient(circle at 50% 80%, rgba(244, 183, 64, 0.22), transparent 70%), #fffbf3;
  box-shadow: 0 0 0 5px rgba(255, 251, 243, 0.75), 0 0 24px rgba(244, 183, 64, 0.45);
  opacity: 0; transform: translate(-50%, -50%) scale(0.4);
  pointer-events: none;
  transition: opacity 0.18s ease-out, transform 0.32s var(--ease-spring);
}
.pk-scribe::before {
  position: absolute; z-index: 1; inset: 0 0 auto; height: 34%;
  background: linear-gradient(#fffbf3 10%, rgba(255, 251, 243, 0));
  content: ""; pointer-events: none;
}
.pk-stage.pk-writing .pk-scribe { opacity: 1; transform: translate(-50%, -50%); animation: scribeCharge 1.4s ease-in forwards; }
@keyframes scribeCharge { to { box-shadow: 0 0 0 7px rgba(255, 251, 243, 0.8), 0 0 70px var(--c-pli); } }
.pk-stage.pk-burst .pk-scribe { opacity: 0; transform: translate(-50%, -50%) scale(1.25); transition-duration: 0.22s; }
.pk-stage.pk-writing .pk-seal { animation: none; opacity: 0; transform: scale(0.5); }
.pk-tagline {
  grid-area: scribe; z-index: 2; min-height: 36px;
  color: var(--ink-3);
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;
  font-size: 22px; line-height: 1.5; text-align: center;
  animation: idleInk 3s ease-in-out infinite;
  transition: opacity 0.25s;
}
.pk-stage:is(.pk-charging, .pk-writing, .pk-burst, .pk-revealed) .pk-tagline { opacity: 0; animation: none; }
.sc-line {
  position: relative; display: block; flex: none;
  color: var(--ink);
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;
  font-size: 24px; line-height: 1.3; white-space: nowrap;
  transition: opacity 0.3s, transform 0.3s;
}
.sc-line.old { opacity: 0.45; transform: scale(0.84); }
@keyframes idleInk { 50% { opacity: 0.45; } }
.sc-line::after {
  position: absolute; top: 55%; right: -8px; left: -8px;
  height: 2.5px; border-radius: 2px; background: var(--c-action);
  content: ""; rotate: -4deg;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.14s ease-out;
}
.sc-line.struck::after { transform: scaleX(1); }
.sc-line.final { color: var(--ink); font-family: var(--serif); font-size: 26px; font-weight: 700; }
.sc-line.final::after { display: none; }
.sc-line.inked { text-shadow: 0 0 18px rgba(244, 183, 64, 0.9); }
.sc-line.sc-brick {
  margin-top: 6px; padding: 0 10px 2px;
  border: 2px solid #0f1f19; border-radius: 9px;
  background: var(--c-prefix); color: #0f1f19;
  box-shadow: 3px 3px 0 #0f1f19;
  font-size: 24px; text-shadow: none;
}
.sc-line.sc-brick[data-kind="suffixe"] { background: var(--c-suffix); }
.sc-line.sc-brick.inked { box-shadow: 3px 3px 0 #0f1f19, 0 0 30px rgba(244, 183, 64, 0.85); }
.sc-brick .sc-ch.flick { color: #0f1f19; opacity: 0.35; }
.sc-brick .sc-caret { background: #0f1f19; }
.sc-ch { display: inline-block; animation: inkIn 0.16s ease-out; }
.sc-ch.flick { color: var(--c-pli-deep); opacity: 0.85; }
@keyframes inkIn { from { opacity: 0; transform: translateY(-6px) scale(1.4); filter: blur(2px); } }
.sc-caret { display: inline-block; width: 2px; height: 0.9em; margin-left: 3px; background: var(--c-pli-deep); vertical-align: -0.08em; animation: blink 0.5s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.pk-status { grid-area: status; z-index: 2; min-height: 22px; color: var(--ink-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
.pk-stage[data-state="opening"] .pk-status { color: var(--ink-3); animation: blink 1.2s steps(2) infinite; }
.pk-actions { grid-area: actions; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }



.pk-odds { display: grid; gap: 6px; }
.pk-odd { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.pk-odd b, .pk-brickodd b { color: var(--ink); font-family: var(--mono); font-size: 12px; }
/* Rareté : le nombre de côtés monte avec la rareté (triangle → carré → pentagone → diamant étiré) */
.rar { flex: none; width: 1.15em; height: 1.15em; fill: var(--c-pli); stroke: var(--fixed-ink); stroke-width: 1.4; stroke-linejoin: round; overflow: visible; vertical-align: -0.2em; }
.rar.rar-l { width: 22px; height: 22px; stroke-width: 1.2; }
.pk-pity { height: 8px; overflow: hidden; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper-2); }
.pk-pity i { display: block; width: 0; height: 100%; background: var(--c-pli); transition: width 0.6s var(--ease-out); }
.pk-inkbox { display: flex; align-items: baseline; gap: 8px; }
.pk-inkbox strong { font-family: var(--serif); font-size: 34px; line-height: 1; }
.pk-inkbox small { color: var(--ink-3); font-family: var(--mono); font-size: 11px; }
.pk-drop { width: 14px; height: 14px; border: 1.5px solid #0f1f19; border-radius: 50% 0 50% 50%; background: var(--c-pli); rotate: -45deg; align-self: center; }
.pk-hintbtn { width: 100%; margin-top: 14px; min-height: 40px; }
.pk-hintbtn[hidden] { display: none; }
.pk-glass { width: 16px; height: 20px; align-self: center; fill: var(--c-pli); stroke: var(--fixed-ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.pk-sandbtn { min-height: 44px; }
.pk-pool { display: grid; gap: 6px; }
.pk-brickodd { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; }
.pk-brickodd small { color: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.pk-hist-item { display: grid; grid-template-columns: auto auto 1fr; }
.pk-hist-item small { text-align: right; }
.pk-hist-item.dup { opacity: 0.85; border-style: dashed; }
.pk-rarity { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; animation: eqFade 0.4s ease-out 0.45s both; }
.pk-rarity .rar { width: 22px; height: 22px; stroke-width: 1.2; }
.pk-stage[data-rarity="legendaire"] .pk-rarity .rar { animation: rarGlint 1.6s var(--ease-out) 0.5s both; }
@keyframes rarGlint { 0% { transform: scale(0) rotate(-40deg); } 55% { transform: scale(1.35) rotate(8deg); filter: drop-shadow(0 0 8px var(--c-pli)); } 100% { transform: none; filter: drop-shadow(0 0 3px var(--c-pli)); } }
.pk-ink { color: var(--c-pli-deep); font-family: var(--serif); font-size: 20px; font-style: italic; animation: eqFade 0.4s ease-out 0.55s both; }
.pk-brick.is-dup { animation: pkDup 0.6s var(--ease-spring) both; }
@keyframes pkDup { 0% { opacity: 0; transform: scale(0.7); } 60% { opacity: 1; transform: scale(1.05) rotate(2deg); } 100% { transform: rotate(-2deg); } }
.b-count { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; min-width: 24px; height: 22px; padding: 0 5px; border: 1.5px solid var(--fixed-ink); border-radius: 999px; background: var(--fixed-ink); color: #f3eee3; font-family: var(--mono); font-size: 10px; font-weight: 700; }
button.brick { position: relative; }
/* Intensité du rituel selon la rareté */
.pk-stage[data-rarity="rare"].pk-revealed .pk-rays { animation-duration: 10s; }
.pk-stage[data-rarity="legendaire"].pk-revealed .pk-rays { animation-duration: 5s; opacity: 1; filter: saturate(1.6); }
.pk-stage[data-rarity="legendaire"].pk-burst .pk-flash { animation-duration: 1.1s; }
.pk-stage[data-rarity="legendaire"] .pk-kicker, .pk-stage[data-rarity="rare"] .pk-kicker { font-size: 16px; }

.pk-reveal { grid-area: main; position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.pk-reveal[hidden] { display: none; }
.pk-kicker { color: var(--c-pli-deep); font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; animation: eqFade 0.4s ease-out 0.35s both; }
.pk-brick { padding: 18px 26px; cursor: default; box-shadow: 6px 6px 0 #0f1f19; animation: pkLand 0.75s var(--ease-spring) both; }
.pk-brick .b-label { font-size: clamp(44px, 6vw, 64px); line-height: 1; }
.pk-brick .b-meta { font-size: 12px; }
@keyframes pkLand {
  0% { opacity: 0; transform: translateY(-80px) scale(0.3) rotate(-28deg); }
  60% { opacity: 1; transform: translateY(10px) scale(1.12) rotate(4deg); }
  100% { transform: rotate(-2deg); }
}
.pk-origin { color: var(--ink-2); font-family: var(--serif); font-size: 18px; font-style: italic; animation: eqFade 0.4s ease-out 0.5s both; }
.pk-hint-card { max-width: 30ch; padding: 18px 20px; border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--ink); font-size: 16px; line-height: 1.5; animation: pkLand 0.75s var(--ease-spring) both; }

/* ---------- Pastille ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid currentColor; border-radius: 999px; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- Codex : vue globale ---------- */
.codex-browser {
  margin-top: clamp(48px, 6vw, 80px); padding: clamp(20px, 3vw, 32px);
  border: 1.5px solid var(--line-strong); border-radius: 22px;
  background: var(--cream);
}
.cb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.cb-title { font-family: var(--serif); font-size: clamp(32px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.cb-title em { color: var(--c-action-deep); }
.cb-sub { max-width: 52ch; margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.cb-count { padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.cb-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 22px; padding: 14px 0; border-block: 1px solid var(--line);
}
.cb-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  transition: transform 0.25s var(--ease-spring), background-color 0.25s, color 0.25s;
}
.cb-chip:hover { transform: translateY(-2px); }
.cb-chip i { width: 11px; height: 11px; border: 1px solid var(--fixed-ink); border-radius: 3px; background: var(--c); }
.cb-chip b { font-weight: 700; opacity: 0.55; }
.cb-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.cb-sort-wrap { display: inline-flex; align-items: center; gap: 10px; }
.cb-sort-label { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.cb-sort { display: inline-flex; gap: 2px; padding: 4px; border: 1.5px solid var(--line-strong); border-radius: 12px; }
.cb-sort button {
  padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 11px; transition: background-color 0.25s, color 0.25s;
}
.cb-sort button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }

.mini {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  aspect-ratio: 3 / 4; padding: 32px 12px 12px; overflow: hidden;
  border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--paper); color: var(--ink);
  cursor: pointer; text-align: left;
  container-type: inline-size;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}
.mini[hidden] { display: none; }
.mini::before {
  position: absolute; inset: 0 0 auto; height: 24px;
  border-bottom: 1.5px solid var(--line-strong); background: var(--tc);
  content: "";
}
.mini:hover, .mini:focus-visible { transform: translateY(-5px) rotate(-1.2deg); box-shadow: 5px 6px 0 var(--pop-shadow); }
.mini.away { visibility: hidden; }
.m-top {
  position: absolute; z-index: 1; top: 5px; right: 10px; left: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 14px;
  color: var(--tt); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.m-glyph { font-family: var(--serif); font-size: 46px; line-height: 0.9; }
.m-word { font-family: var(--serif); font-size: clamp(14px, 12cqi, 22px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; -webkit-hyphens: auto; hyphens: auto; }
.m-lit { display: -webkit-box; overflow: hidden; color: var(--ink-2); font-family: var(--serif); font-size: clamp(11px, 11cqi, 15px); font-style: italic; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.m-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--ink-2); font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em; }
.m-lang { display: inline-flex; align-items: center; gap: 5px; }
.m-lang i { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.m-dots { display: inline-flex; gap: 3px; }
.m-dots i { width: 6px; height: 6px; border: 1px solid var(--ink-2); border-radius: 50%; }
.m-dots i.on { border-color: var(--ink); background: var(--ink); }
.mini.locked { background: repeating-linear-gradient(-45deg, var(--paper) 0 8px, var(--paper-2) 8px 16px); }
.m-q { color: var(--ink-3); font-family: var(--serif); font-size: 52px; font-style: italic; line-height: 1; text-align: center; }
/* Carte nouvelle : un halo Corail diffus, jusqu’à la première consultation. */
.mini.is-new { --new-halo: 0 0 30px 8px color-mix(in srgb, var(--c-action) 60%, transparent); box-shadow: var(--new-halo); }
.mini.is-new:hover, .mini.is-new:focus-visible { box-shadow: 5px 6px 0 var(--pop-shadow), var(--new-halo); }
/* Texture de carte (ADR 0023) : silhouette d'une seule teinte, sous le contenu, jamais sous le bandeau. */
.card-art { position: absolute; z-index: 0; inset: 25px 0 0; overflow: hidden; color: var(--ink); opacity: 0.1; pointer-events: none; --art-bg: var(--paper); }
.card-art svg { display: block; width: 100%; height: 100%; }
.mini > :not(.card-art):not(.cv-art):not(.m-top) { position: relative; z-index: 1; }
.big-face .card-art { inset: 0; opacity: 0.085; --art-bg: var(--cream); }
.big-face .bf-top, .big-face .bf-body, .big-face .bf-foot { position: relative; z-index: 1; }
/* Sur une texture, le sens littéral passe en Crème cerné de Gris encre pour rester une pastille distincte. */
.big-face:has(.card-art) .bf-lit { border: 1px solid var(--ink-3); background: var(--cream); }
/* Gris encre et Corail profond tombent sous 4,5:1 sur la texture : texte secondaire et liens passent en Encre secondaire, le lien reste souligné. */
.big-face:has(.card-art) .bf-note, .big-face:has(.card-art) .r-lit span { color: var(--ink-2); }
.big-face:has(.card-art) .bf-lang.is-link { color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* Cartes statiques (charte, maquettes) : la texture passe sous le contenu, le bandeau la recouvre. */
.has-card-art { position: relative; isolation: isolate; }
.has-card-art > .card-art { z-index: -1; inset: var(--art-top, 0) 0 0; opacity: var(--art-o, 0.1); color: var(--art-ink, var(--ink)); --art-bg: var(--host-bg, var(--paper)); }
.has-card-art :is(.mq-k, .d, .mq-lit small) { color: var(--ink-2); }
.s-card { --art-top: 17px; --host-bg: #fffbf3; --art-ink: var(--fixed-ink); }

.viewer {
  position: fixed; z-index: 90; inset: 0;
  display: grid; grid-template-areas: "trail trail trail" "prev card next" "hint hint hint";
  place-content: center; align-items: center; gap: 18px 28px;
  padding: 24px;
}
.viewer[hidden] { display: none; }
.viewer > .viewer-nav, .viewer > .big-wrap, .viewer > .viewer-hint, .viewer > .viewer-trail { position: relative; z-index: 1; }
.viewer-trail {
  grid-area: trail;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px;
  min-height: 36px; color: #f3eee3; font-family: var(--serif); font-size: 16px;
}
.viewer-trail[data-empty] { visibility: hidden; }
.trail-back {
  display: grid; place-items: center; width: 32px; height: 32px; margin-right: 4px;
  border: 1.5px solid rgba(243, 238, 227, 0.4); border-radius: 50%;
  background: transparent; color: #f3eee3; cursor: pointer; font-size: 15px;
  transition: background-color 0.2s, transform 0.25s var(--ease-spring);
}
.trail-back:hover { background: rgba(243, 238, 227, 0.12); transform: translateX(-2px); }
.trail-sep { color: rgba(243, 238, 227, 0.4); }
.crumb { padding: 2px 4px; border: 0; border-radius: 6px; background: none; color: rgba(243, 238, 227, 0.7); cursor: pointer; font: inherit; }
.crumb:hover { color: #f3eee3; text-decoration: underline; text-underline-offset: 3px; }
.crumb[aria-current] { color: #f3eee3; font-weight: 700; cursor: default; text-decoration: none; }
.crumb .bchip { font-size: 14px; }
.big-face .is-link { cursor: pointer; }
.big-face .brick.is-link, .big-face .bchip.is-link { transition: transform 0.2s var(--ease-spring), box-shadow 0.2s; }
.big-face .brick.is-link:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--pop-shadow); }
.big-face .bchip.is-link:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--pop-shadow); }
.big-face .brick.is-link:active, .big-face .bchip.is-link:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--pop-shadow); }
.big-face .seg.is-link { transition: background-size 0.25s var(--ease-out); }
.big-face .seg.is-link:hover { background-size: calc(100% - 3px) 100%; }
.bf-lang.is-link, .f-lang.is-link, .f-from.is-link, .bb-link.is-link { color: var(--c-action-deep); }
.bf-lang.is-link::after, .bb-link.is-link::after { content: " →"; }
.bf-lang.is-link:hover, .f-lang.is-link:hover, .f-from.is-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.bb-link.is-link { transition: background-color 0.2s; }
.bb-link.is-link:hover { background: var(--c-action-tint); border-color: var(--c-action-deep); }
.viewer-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 16, 13, 0.8);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.viewer-close {
  position: absolute; z-index: 2; top: 18px; right: 18px;
  width: 48px; height: 48px; border: 1.5px solid rgba(243, 238, 227, 0.5); border-radius: 50%;
  background: transparent; color: #f3eee3; cursor: pointer; font-size: 26px; line-height: 1;
  transition: transform 0.4s var(--ease-spring), background-color 0.2s;
}
.viewer-close:hover { transform: rotate(90deg); background: rgba(243, 238, 227, 0.1); }
.viewer-nav {
  width: 52px; height: 52px; border: 1.5px solid rgba(243, 238, 227, 0.4); border-radius: 50%;
  background: rgba(243, 238, 227, 0.06); color: #f3eee3; cursor: pointer; font-size: 20px;
  transition: transform 0.25s var(--ease-spring), background-color 0.2s, color 0.2s, border-color 0.2s;
}
.viewer-nav.prev { grid-area: prev; }
.viewer-nav.next { grid-area: next; }
.viewer-nav:hover { border-color: #f3eee3; background: #f3eee3; color: var(--fixed-ink); transform: scale(1.08); }
.viewer-hint { grid-area: hint; color: rgba(243, 238, 227, 0.6); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-align: center; }
@media (pointer: coarse) { .kbd-hint { display: none; } }
.big-wrap {
  grid-area: card;
  width: min(410px, 78vw, calc((100svh - 200px) * 0.714));
  aspect-ratio: 5 / 7;
  perspective: 1600px; transform-origin: 0 0;
}
.big-card {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; cursor: pointer;
  transition: transform 0.85s var(--ease-spring);
}
.big-card.flipped { transform: rotateY(180deg); }
.big-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border: 2px solid #0f1f19; border-radius: 22px;
  background: var(--cream); color: var(--ink);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.65);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.big-back { transform: rotateY(180deg); }
.bf-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 22px; border-bottom: 2px solid #0f1f19;
  background: var(--tc); color: var(--tt);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.bf-type { padding: 4px 10px; border: 1.5px solid currentColor; border-radius: 999px; }
.bf-body { display: flex; flex: 1; flex-direction: column; justify-content: safe center; gap: 12px; padding: 22px 26px; overflow-y: auto; }
.bb-body { justify-content: flex-start; }
.bf-glyph { color: var(--tc); font-family: var(--serif); font-size: clamp(80px, 12vw, 120px); line-height: 0.85; -webkit-text-stroke: 1.5px #0f1f19; }
.bf-word { font-family: var(--serif); font-size: clamp(34px, 5.4vw, 52px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; overflow-wrap: anywhere; }
.bf-lang { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.bf-lang i { width: 10px; height: 10px; border: 1px solid var(--fixed-ink); border-radius: 50%; }
.bf-def { font-family: var(--serif); font-size: clamp(17px, 2vw, 20px); line-height: 1.4; }
.bf-lit { align-self: flex-start; padding: 6px 12px; border-radius: 10px; background: var(--paper-2); font-family: var(--mono); font-size: 12px; line-height: 1.5; }
.bf-note { color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.bf-q { color: var(--ink-3); font-family: var(--serif); font-size: 120px; font-style: italic; line-height: 0.9; }
.bf-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12px; }
.flip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1.5px solid #0f1f19; border-radius: 10px;
  background: var(--c-action); color: #0f1f19;
  box-shadow: 3px 3px 0 #0f1f19; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
}
.flip-btn:hover { background: var(--c-action-hover); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #0f1f19; }
.flip-btn:active { background: var(--c-action-active); transform: translate(2px, 2px); box-shadow: 1px 1px 0 #0f1f19; }
.flip-btn em { display: inline-block; font-size: 16px; font-style: normal; transition: transform 0.6s var(--ease-spring); }
.flip-btn:hover em { transform: rotate(180deg); }
.bb-title { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.bb-progress { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; }
.bb-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--paper-2); }
.bb-bar i { display: block; height: 100%; background: var(--ink); transition: width 0.9s var(--ease-out) 0.3s; }
.bb-forms { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bb-forms li {
  display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: var(--paper);
}
.bb-forms li > i { width: 10px; height: 10px; border: 1px solid var(--fixed-ink); border-radius: 50%; }
.bb-forms li.missing { border-style: dashed; background: transparent; }
.f-text { display: flex; flex-direction: column; min-width: 0; }
.f-form { font-family: var(--serif); font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.missing .f-form { color: var(--ink-3); letter-spacing: 0.15em; }
.f-tr { color: var(--ink-3); font-family: var(--serif); font-size: 13px; font-style: italic; }
.f-lang { color: var(--ink-2); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-align: right; text-transform: uppercase; }
.bb-links-title { margin-top: 4px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.bb-links { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-link { padding: 4px 11px; border: 1.5px solid var(--line-strong); border-radius: 999px; font-family: var(--serif); font-size: 15px; }
.bb-link.missing { border-style: dashed; color: var(--ink-3); letter-spacing: 0.12em; }

@media (max-width: 760px) {
  .codex-browser { padding: 16px 14px; }
  .cb-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .mini { padding: 28px 8px 8px; border-radius: 12px; }
  .m-word { font-size: clamp(13px, 13cqi, 18px); }
  .m-glyph { font-size: 34px; }
  .m-lit { font-size: clamp(10px, 12cqi, 13px); }
  .m-q { font-size: 38px; }
  .m-kind { display: none; }
  .m-foot .m-dots { display: none; }
  .viewer { grid-template-areas: "trail trail" "card card" "prev next" "hint hint"; gap: 12px; padding: 16px; }
  .viewer-nav.prev { justify-self: end; }
  .viewer-nav.next { justify-self: start; }
  .big-wrap { width: min(410px, 88vw, calc((100svh - 240px) * 0.714)); }
  .bf-body { padding: 18px; }
  .bf-top, .bf-foot { padding-inline: 16px; }
  .viewer-close { top: 10px; right: 10px; width: 42px; height: 42px; }
}

/* ---------- Filiation ---------- */
.graph-wrap {
  padding: 24px; overflow-x: auto;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--cream);
}
.graph-wrap svg { display: block; width: 100%; min-width: 760px; height: auto; }
.edge {
  fill: none; stroke: var(--ink); stroke-width: 1.6;
  stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400);
  transition: stroke-dashoffset 1.3s var(--ease-out) var(--d, 0ms);
}
.graph-wrap.in .edge { stroke-dashoffset: 0; }
.node, .elabel {
  opacity: 0; transform: translateY(12px); transform-box: fill-box;
  transition: opacity 0.6s var(--d, 0ms), transform 0.7s var(--ease-spring) var(--d, 0ms);
}
.graph-wrap.in .node, .graph-wrap.in .elabel { opacity: 1; transform: none; }
.node rect { stroke: #0f1f19; stroke-width: 1.5; }
.node .n-main { fill: #0f1f19; font-family: var(--serif); font-size: 20px; text-anchor: middle; }
.node .n-sub { fill: #0f1f19; font-family: var(--mono); font-size: 9px; letter-spacing: 0.03em; text-anchor: middle; opacity: 0.72; }
.elabel { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-anchor: middle; text-transform: uppercase; }
.spark { fill: var(--c-action); }
.graph-note { margin-top: 14px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.swipe-hint { display: none; color: var(--c-action-deep); }
@media (max-width: 860px) { .swipe-hint { display: inline; } }

/* ---------- Mouvement ---------- */
.motion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mtile { overflow: hidden; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.mdemo { position: relative; display: grid; place-items: center; height: 220px; overflow: hidden; background: var(--night); }
.mcap { padding: 18px 20px 22px; }
.mcap h3 { margin-bottom: 6px; font-family: var(--serif); font-size: 24px; }
.mcap p { color: var(--ink-2); font-size: 14px; }
.token { display: inline-block; margin-top: 12px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; }
.pop-card {
  position: relative; z-index: 2;
  padding: 14px 24px; border: 1.5px solid var(--fixed-ink); border-radius: 12px;
  background: #fffbf3; color: var(--fixed-ink);
  font-family: var(--serif); font-size: 30px; font-weight: 600;
  animation: popLoop 2.8s var(--ease-spring) infinite;
}
@keyframes popLoop {
  0%, 12% { opacity: 0; transform: scale(0.4) rotate(-8deg); }
  32% { opacity: 1; transform: scale(1.1); }
  42%, 84% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}
.pop-ring { position: absolute; width: 60px; height: 60px; border: 2px solid var(--c-action); border-radius: 50%; animation: ringLoop 2.8s var(--ease-out) infinite; }
.pop-ring.b { border-color: #fffbf3; animation-delay: 0.12s; }
@keyframes ringLoop { 0%, 18% { opacity: 0; transform: scale(0.5); } 22% { opacity: 1; } 60%, 100% { opacity: 0; transform: scale(5); } }
.shake-pair { display: flex; gap: 10px; animation: shakeLoop 2.6s infinite; }
.shake-pair .brick { min-width: 0; cursor: default; }
@keyframes shakeLoop {
  0%, 55%, 85%, 100% { transform: none; }
  60%, 70%, 80% { transform: translateX(-9px); }
  65%, 75% { transform: translateX(9px); }
}
.no-mark {
  position: absolute; top: 34px; right: 34px;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink-3); color: var(--fixed-ink); font-weight: 800;
  animation: markLoop 2.6s infinite;
}
@keyframes markLoop { 0%, 55% { opacity: 0; transform: scale(0.4); } 62%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.reveal-demo { display: grid; gap: 14px; width: 72%; }
.rv { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 12px; color: rgba(243, 238, 227, 0.65); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.rv i { height: 12px; border-radius: 3px; background: var(--c); transform: scaleX(0); transform-origin: left; animation: barLoop 3.4s var(--ease-out) infinite var(--d); }
@keyframes barLoop { 0% { transform: scaleX(0); } 25%, 80% { transform: scaleX(var(--w)); } 100% { transform: scaleX(0); opacity: 0; } }
.tokens { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tokens .pill b { color: var(--c-action-deep); font-weight: 700; }

/* ---------- Boussole ---------- */
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rule-col { padding: clamp(24px, 3vw, 40px); border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.rule-col.do { border-color: var(--line-strong); background: var(--cream); }
.rule-col.dont { background: var(--paper-2); }
.rule-col h3 { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-family: var(--serif); font-size: 34px; }
.rule-col h3 span {
  display: grid; place-items: center;
  width: 36px; height: 36px; border: 1.5px solid currentColor; border-radius: 50%;
  font-family: var(--mono); font-size: 16px;
}
.dont h3 span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.rule-col ol { padding: 0; list-style: none; counter-reset: r; }
.rule-col li {
  display: grid; grid-template-columns: 30px 1fr; gap: 12px;
  padding: 14px 0; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  line-height: 1.5; counter-increment: r;
}
.rule-col li::before { content: counter(r, decimal-leading-zero); font-family: var(--mono); font-size: 11px; opacity: 0.6; padding-top: 3px; }

/* ---------- Pied ---------- */
.footer { position: relative; overflow: hidden; padding: clamp(80px, 12vw, 160px) var(--pad) 36px; background: var(--c-action); color: var(--fixed-ink); }
.foot-phrase { max-width: 12ch; font-family: var(--serif); font-size: clamp(52px, 9vw, 150px); font-weight: 600; letter-spacing: -0.055em; line-height: 0.92; }
.foot-phrase em { font-style: italic; background: linear-gradient(transparent 64%, #fffbf3 64% 88%, transparent 88%); }
.foot-phrase .glitch { color: var(--c-action-deep); }
.foot-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  margin-top: 64px; padding-top: 20px; border-top: 1.5px solid var(--fixed-ink);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.foot-seal {
  position: absolute; top: 12%; right: 6%;
  display: grid; place-items: center;
  width: clamp(120px, 14vw, 190px); aspect-ratio: 1;
  animation: spin 24s linear infinite;
}
.foot-seal svg { width: 100%; height: 100%; }
.foot-seal text { fill: var(--fixed-ink); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
/* Sur la bande Corail, le logo passe en monochrome (ADR 0021). */
.foot-seal b {
  position: absolute; display: grid; place-items: center; width: 34%; aspect-ratio: 1;
  border: 2px solid var(--fixed-ink); border-radius: 27%;
  background: #fffbf3; box-shadow: 5px 5px 0 var(--fixed-ink); color: var(--fixed-ink);
  font-family: var(--serif); font-size: clamp(18px, 2.2vw, 26px); font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  rotate: -6deg; animation: spin 24s linear infinite reverse;
}

.toast {
  position: fixed; z-index: 80; right: 20px; bottom: 20px;
  padding: 12px 16px; border: 1.5px solid var(--fixed-ink); border-radius: 10px;
  background: var(--fixed-ink); color: #f3eee3;
  box-shadow: 4px 4px 0 rgba(15, 31, 25, 0.25);
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.2s, transform 0.3s var(--ease-spring);
}
.toast.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; }
  .stage { height: 520px; }
  .game { grid-template-columns: 1fr; }
  .table-panel { order: -1; }
  .pk-layout { grid-template-columns: 1fr 1fr; }
  .pk-stage { grid-column: 1 / -1; order: -1; }
  .motion-grid { grid-template-columns: 1fr 1fr; }
  .disc-grid { grid-template-columns: repeat(3, 1fr); }
  .neutral-grid { grid-template-columns: repeat(3, 1fr); }
  .res { grid-template-columns: 130px 1fr 1fr; }
  .res > :last-child { grid-column: 2 / -1; }
  .fb-grid { grid-template-columns: repeat(3, 1fr); }
  .shape-grid { grid-template-columns: repeat(2, 1fr); }
  .size-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .theme-btn { margin-left: auto; }
  .sec-head, .type-grid, .rules { grid-template-columns: 1fr; }
  .neutral-grid { grid-template-columns: repeat(2, 1fr); }
  .res { grid-template-columns: 1fr; gap: 12px; }
  .res-sample { justify-content: start; min-height: 0; }
  .action-grid, .size-grid { grid-template-columns: 1fr; }
  .fb-grid { grid-template-columns: 1fr 1fr; }
  .shape-grid { grid-template-columns: 1fr 1fr; }
  .rule-grid, .extra-rules { grid-template-columns: 1fr; }
  .glyph-card { min-height: 380px; }
  .game, .motion-grid, .pk-layout { grid-template-columns: 1fr; }
  .pk-stage { min-height: 540px; padding: 24px 14px; }
  .pk-rays { width: 640px; height: 640px; }
  .disc-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-seal { top: 24px; right: 20px; width: 96px; }
  .footer { padding-top: 150px; }
  .stage { height: 500px; }
  .hero-card { width: min(78%, 360px); }
  .f1 { top: 0; right: 2%; }
  .f2 { display: none; }
  .f3 { top: 2%; left: 0; }
  .f4 { display: none; }
  .f5 { display: none; }
  .foot-seal b { font-size: 13px; border-width: 1.5px; box-shadow: 3px 3px 0 var(--fixed-ink); }
}
@media (max-width: 520px) {
  .hero { padding-top: 100px; }
  .title { font-size: clamp(56px, 19vw, 88px); }
  .stage { height: 480px; }
  .float > span { padding: 7px 11px; font-size: 16px; }
  .hero-card { padding: 18px; box-shadow: 8px 8px 0 var(--c-action), 0 30px 60px -20px rgba(0, 0, 0, 0.6); }
  .morph-lang { margin-left: 0; }
  .palette { grid-template-columns: 1fr; }
  .slots { gap: 6px; }
  .slot { width: 124px; height: 96px; }
  .fusing .slot[data-slot="0"] { transform: translateX(64px) scale(0.6) rotate(-10deg); }
  .fusing .slot[data-slot="1"] { transform: translateX(-64px) scale(0.6) rotate(10deg); }
  .brick { min-width: 94px; padding: 9px 11px; }
  .b-label { font-size: 18px; }
  .op { font-size: 30px; }
  .scale-row { grid-template-columns: 1fr; gap: 6px; }
  .result { inset: 56px 10px 10px; padding: 16px 14px; gap: 8px; }
  .r-eq-row { flex-wrap: nowrap; gap: 6px; }
  .r-eq .brick { padding: 7px 10px; }
  .r-eq .b-label { font-size: 17px; }
  .r-eq .b-kind { display: none; }
  .r-op { font-size: 22px; }
  .r-tr { border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .char { opacity: 1; transform: none; }
  .seg { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
  

/* ==========================================================================
   Pages distinctes : sommaire, introductions, renvois et compléments de page
   ========================================================================== */
.skip-link {
  position: absolute; z-index: 100; top: 8px; left: 8px;
  padding: 10px 14px; border: 1.5px solid var(--fixed-ink); border-radius: 10px;
  background: var(--cream); color: var(--ink); font-weight: 700; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }
main > .section:first-child { padding-top: clamp(56px, 7vw, 104px); }
div.sec-intro p + .xrefs { margin-top: 16px; }
.hero { min-height: calc(100svh - 58px); padding-top: 72px; }
.section + .section { padding-top: clamp(40px, 6vw, 96px); }

/* ---------- Sommaire ---------- */
.hub .sec-head { margin-bottom: clamp(32px, 4vw, 56px); }
.demo-status { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; color: var(--ink-3); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.demo-status b { color: var(--ink); }
.hub-groups { display: grid; gap: clamp(40px, 5vw, 64px); }
.hub-group h2 {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px;
  font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -0.03em; line-height: 1;
}
.hub-group h2 span { color: var(--c-action-deep); font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; }
.hub-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.hub-card {
  position: relative; display: grid; grid-template-rows: 132px auto auto 1fr; gap: 6px;
  overflow: hidden; padding: 0 20px 20px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream);
  color: var(--ink); text-decoration: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out);
}
.hub-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--pop-shadow); }
.hub-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.hub-art {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 -20px 12px; border-bottom: 1px solid var(--line); background: var(--paper);
}
.hub-num { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; }
.hub-card b { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.hub-desc { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.hub-go { position: absolute; right: 18px; bottom: 16px; color: var(--c-action-deep); font-size: 20px; font-weight: 700; transition: translate 0.25s var(--ease-spring); }
.hub-card:hover .hub-go { translate: 4px 0; }
.art-swatches i { width: 30px; height: 44px; border: 1.5px solid var(--fixed-ink); border-radius: 8px; background: var(--c); }
.art-type { font-family: var(--serif); font-size: 54px; font-weight: 600; letter-spacing: -0.04em; }
.art-type em { color: var(--c-action-deep); }
.art-type small { margin-left: 6px; color: var(--ink-3); font-size: 26px; font-style: italic; }
.art-ds .btn { min-height: 36px; padding: 6px 14px; font-size: 11px; pointer-events: none; }
.art-motion span { width: 16px; height: 16px; border: 1.5px solid var(--fixed-ink); border-radius: 50%; background: var(--c-action); animation: artHop 1.6s var(--ease-spring) infinite; }
.art-motion span:nth-child(2) { background: var(--cream); animation-delay: 0.15s; }
.art-motion span:nth-child(3) { background: var(--ink); animation-delay: 0.3s; }
@keyframes artHop { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-16px); } }
.art-rar .rar { width: 30px; height: 30px; stroke-width: 1.1; }
.art-cards span { width: 52px; height: 70px; border: 1.5px solid var(--fixed-ink); border-radius: 8px; background: var(--cream); box-shadow: 3px 3px 0 var(--pop-shadow); }
.art-cards span:nth-child(1) { rotate: -8deg; border-top: 10px solid var(--c-prefix); }
.art-cards span:nth-child(2) { z-index: 1; border-top: 10px solid var(--ink); }
.art-cards span:nth-child(3) { rotate: 8deg; border-top: 10px solid var(--c-lang); }
.art-cards { gap: 0; }
.art-cards span + span { margin-left: -14px; }
.art-adr { flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 12px; }
.art-adr span { padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--cream); }
.art-adr span:last-child { border-color: var(--fixed-ink); background: var(--c-action); color: var(--fixed-ink); font-weight: 700; }
.art-compass span { display: grid; place-items: center; width: 44px; height: 44px; border: 1.5px solid var(--ink); border-radius: 50%; font-family: var(--mono); font-size: 18px; }
.art-compass span:last-child { background: var(--ink); color: var(--paper); }

/* ---------- Typographie : rôles, écritures, règles ---------- */
.type-block { margin-top: clamp(40px, 5vw, 72px); }
.type-block > h3 { margin-bottom: 16px; font-family: var(--serif); font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -0.02em; }
.type-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.trole { display: grid; grid-template-rows: auto 96px auto 1fr; gap: 10px; padding: 18px 20px 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.trole-k { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.trole-spec { display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.trole p { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.trole .xrefs { align-self: end; margin-top: 4px; }
.trole-serif { font-family: var(--serif); font-size: 36px; font-weight: 600; letter-spacing: -0.02em; }
.trole-sans { font-family: var(--sans); font-size: 18px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.trole-mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.trole-script { position: relative; font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive; font-size: 34px; }
.trole-script::after { position: absolute; top: 55%; right: -6px; left: -6px; height: 2.5px; border-radius: 2px; background: var(--c-action); content: ""; rotate: -4deg; }
.type-scripts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.type-scripts figure { display: grid; gap: 8px; margin: 0; padding: 24px; }
.type-scripts figure + figure { border-left: 1px solid var(--line); }
.type-scripts b { font-family: var(--serif); font-size: clamp(26px, 2.6vw, 38px); font-weight: 600; overflow-wrap: anywhere; }
.type-scripts em { color: var(--ink-3); font-family: var(--serif); font-size: 15px; }
.type-scripts figcaption { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.type-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.type-rules li { display: grid; gap: 6px; padding: 16px 18px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-s, 10px); background: var(--cream); }
.type-rules li b { font-family: var(--serif); font-size: 22px; }
.type-rules li span { color: var(--ink-2); font-size: 13px; }

/* ---------- Mouvement : démonstrations complémentaires ---------- */
.motion-grid + .motion-grid { margin-top: 20px; }
.mcap .xref { margin-top: 12px; margin-left: 6px; }
.mv-ink { display: grid; justify-items: center; gap: 4px; font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive; font-size: 28px; color: #f3eee3; }
.mv-ink span { position: relative; opacity: 0; animation: mvInk 3.2s infinite; animation-delay: var(--d); }
.mv-ink span::after { position: absolute; top: 55%; right: -6px; left: -6px; height: 2.5px; border-radius: 2px; background: var(--c-action); content: ""; rotate: -4deg; transform: scaleX(0); transform-origin: left; animation: mvStrike 3.2s infinite; animation-delay: var(--d); }
.mv-ink .mv-final { padding: 0 12px 2px; border: 2px solid var(--fixed-ink); border-radius: 9px; background: var(--c-suffix); color: var(--fixed-ink); font-family: var(--serif); font-size: 24px; font-weight: 700; box-shadow: 3px 3px 0 #000; }
.mv-ink .mv-final::after { display: none; }
@keyframes mvInk { 0%, 5% { opacity: 0; transform: translateY(-6px); } 12%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes mvStrike { 0%, 20% { transform: scaleX(0); } 26%, 100% { transform: scaleX(1); } }
.mv-fly { position: relative; width: 100%; height: 100%; }
.mv-fly span { position: absolute; top: 50%; left: 50%; width: 44px; height: 58px; border: 1.5px solid var(--fixed-ink); border-top: 9px solid var(--fixed-ink); border-radius: 8px; background: #fffbf3; animation: mvFly 3s cubic-bezier(0.2, 0.9, 0.25, 1.08) infinite; }
.mv-fly i { position: absolute; top: 50%; left: 18%; width: 44px; height: 58px; border: 1.5px dashed rgba(243, 238, 227, 0.4); border-radius: 8px; translate: 0 -50%; }
@keyframes mvFly { 0%, 15% { transform: translate(calc(-50% - 110px), -50%) scale(1); } 45%, 80% { transform: translate(-50%, -50%) scale(2.2); } 100% { transform: translate(calc(-50% - 110px), -50%) scale(1); } }
.mv-minus { position: relative; }
.mv-minus .brick { min-width: 0; cursor: default; }
.mv-minus .b-minus { animation-iteration-count: infinite; animation-duration: 2s; }
.mv-minus .b-count { transition: none; }

/* ---------- Boussole : piliers et renvois ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: clamp(40px, 5vw, 64px); }
.pillar { display: grid; grid-template-rows: auto auto 1fr; gap: 8px; padding: 22px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.pillar > span { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }
.pillar h3 { font-family: var(--serif); font-size: 26px; }
.pillar p { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.pillar .xrefs { align-self: end; margin-top: 8px; }
.rule-col li > span { display: grid; justify-items: start; gap: 8px; }
.rule-col li .xref { font-size: 12px; }

/* ---------- Démo persistante ---------- */
.demo-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; color: var(--ink-3); font-size: 13px; }
.demo-reset {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1.5px solid var(--c-danger-line); border-radius: 999px;
  background: transparent; color: var(--c-danger-line); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.demo-reset:hover { background: color-mix(in srgb, var(--c-danger-line) 8%, transparent); }
.demo-reset.is-armed { border-color: var(--fixed-ink); background: var(--c-danger); color: #fffbf3; box-shadow: 2px 2px 0 var(--pop-shadow); }
.demo-reset:focus-visible { outline: 2px solid var(--c-danger-line); outline-offset: 3px; }
.pk-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pk-hint[hidden] { display: none; }
.r-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.disc-head .xref { font-size: 11px; }

/* ---------- ADR ---------- */
.adr-layout > * { min-width: 0; }
.adr-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.adr-toc { position: sticky; top: 132px; display: grid; gap: 4px; max-height: calc(100vh - 150px); overflow: auto; padding: 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.adr-toc a { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--ink); font-size: 13px; line-height: 1.35; text-decoration: none; }
.adr-toc a:hover { background: var(--paper); }
.adr-toc a.active { background: var(--ink); color: var(--paper); }
.adr-toc a span { color: inherit; font-family: var(--mono); font-size: 11px; opacity: 0.7; }
.adr-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.adr {
  scroll-margin-top: 130px; padding: clamp(22px, 3vw, 40px);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream);
}
.adr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.adr-num { padding: 4px 10px; border: 1.5px solid var(--fixed-ink); border-radius: 8px; background: var(--c-action); color: var(--fixed-ink); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.adr-status { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.adr-status.is-partial { border-style: dashed; }
.adr h2 { margin-bottom: 18px; font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.03em; line-height: 1.05; }
.adr-body { color: var(--ink-2); font-size: 15.5px; line-height: 1.65; }
.adr-body > * + * { margin-top: 12px; }
.adr-body h3 { margin-top: 26px; color: var(--ink); font-family: var(--serif); font-size: 24px; }
.adr-body h4 { margin-top: 18px; color: var(--ink); font-family: var(--serif); font-size: 19px; }
.adr-body ul, .adr-body ol { padding-left: 22px; }
.adr-body li + li { margin-top: 4px; }
.adr-body li > ul, .adr-body li > ol { margin-top: 4px; }
.adr-body strong { color: var(--ink); }
.adr-body a { color: var(--c-action-deep); font-weight: 600; }
.adr-body code { padding: 1px 6px; border-radius: 5px; background: var(--paper); font-family: var(--mono); font-size: 0.88em; }
.adr-body blockquote { padding: 12px 16px; border-left: 3px solid var(--ink); border-radius: 0 10px 10px 0; background: var(--paper); }
.adr-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adr-body .table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.adr-body th, .adr-body td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.adr-body th { color: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.adr-body tr:last-child td { border-bottom: 0; }
.adr .xrefs { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .type-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adr-layout { grid-template-columns: 1fr; }
  .adr-toc { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 760px) {
  .hero { min-height: auto; padding-top: 56px; }
  .type-roles, .pillars, .type-scripts { grid-template-columns: 1fr; }
  .adr-toc { grid-template-columns: 1fr; }
  .type-scripts figure + figure { border-top: 1px solid var(--line); border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .art-motion span, .mv-ink span, .mv-ink span::after, .mv-fly span, .mv-minus .b-minus { animation: none; opacity: 1; }
  .hub-card, .hub-go { transition: none; }
}

html { scroll-padding-top: 140px; }

/* Tri du codex : le fond Encre glisse vers l'option choisie */
.cb-sort { position: relative; isolation: isolate; }
.cb-sort button { transition: color 0.24s var(--ease-out); }
.cb-sort.has-slider button[aria-pressed="true"] { background: transparent; }
.cb-sort.has-slider::before {
  position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; width: var(--slide-w, 0px);
  border-radius: 8px; background: var(--ink); content: "";
  transform: translateX(var(--slide-x, 0px));
  transition: transform 380ms var(--ease-spring), width 380ms var(--ease-spring);
}
.has-slider.no-slide::before { transition: none; }
@media (prefers-reduced-motion: reduce) { .cb-sort.has-slider::before, .cb-sort button { transition: none; } }

/* Danger : Corail profond de la palette, réservé aux actions irréversibles (jamais pour un échec de jeu) */
:root { --c-danger: #c23d1f; --c-danger-line: #c23d1f; }
body.nocturne { --c-danger-line: #ff6b4a; }
.btn-danger { background: var(--c-danger); color: #fffbf3; box-shadow: 4px 4px 0 var(--pop-shadow); }
.btn-danger:hover { box-shadow: 6px 6px 0 var(--pop-shadow); }
.btn-danger:active { box-shadow: 1px 1px 0 var(--pop-shadow); }
.btn-danger:focus-visible { outline-color: var(--c-danger-line); }
.btn-danger-ghost { border-color: var(--c-danger-line); background: transparent; color: var(--c-danger-line); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--c-danger-line) 8%, transparent); }
.dg-ic { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Jaquettes de pli ---------- */
.pk-pack { width: 236px; height: 320px; }
.pk-face { padding: 20px 12px; background: #fffbf3; }
.pk-top { letter-spacing: 0.08em; }
.pk-art {
  position: absolute; inset: 9px; overflow: hidden;
  border-radius: 10px; background: #fcecc6;
}
.pk-art svg, .jk-art svg { display: block; width: 100%; height: 100%; }
.pk-top, .pk-bottom {
  position: relative; z-index: 1; max-width: calc(100% - 12px);
  padding: 3px 8px; border: 1px solid #0f1f19; border-radius: 999px;
  background: #fffbf3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pk-bottom { font-size: 8px; }
/* Logo monochrome : la face du pli reste en neutres et Ambre (ADR 0021). */
.pk-brand {
  display: inline-grid; place-items: center; width: 13px; height: 13px; margin: -2px 5px 0 0;
  border: 1px solid #0f1f19; border-radius: 3.5px; background: #fffbf3; color: #0f1f19;
  font-family: var(--serif); font-size: 6px; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  vertical-align: middle; rotate: -6deg;
}
/* En recharge : une silhouette en pointillé (ce qui manque), jamais une carte grisée qui laisserait croire à un contenu */
.pk-stage[data-state="recharging"] .pk-pack { opacity: 1; filter: none; animation: none; transform: rotate(-2deg); }
.pk-stage[data-state="recharging"] .pk-face {
  border-style: dashed; border-color: var(--ink-3);
  background: repeating-linear-gradient(135deg, #e8dfcc 0 8px, #fffbf3 8px 16px);
  box-shadow: none;
}
.pk-stage[data-state="recharging"] .pk-art { opacity: 0; }
.pk-stage[data-state="recharging"] .pk-top, .pk-stage[data-state="recharging"] .pk-bottom { border-style: dashed; color: #5c6b62; }
.pk-stage[data-state="recharging"] .pk-seal { border-style: dashed; background: #fffbf3; color: #5c6b62; }
body.nocturne .pk-stage[data-state="recharging"] .pk-face { border-color: var(--ink-3); }

.jk-block { margin-top: clamp(56px, 7vw, 96px); }
.jk-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: end; margin-bottom: 28px; }
.jk-title { font-family: var(--serif); font-size: clamp(32px, 4vw, 56px); font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.jk-title em { color: var(--c-action-deep); }
.jk-intro p { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.jk-rules { display: grid; gap: 6px; margin-top: 12px; padding: 0; list-style: none; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.jk-rules li { padding-left: 16px; position: relative; }
.jk-rules li::before { position: absolute; top: 7px; left: 0; width: 6px; height: 6px; background: var(--ink); content: ""; rotate: 45deg; }
.jk-rules b { color: var(--ink); }
.jk-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.jk {
  display: grid; gap: 10px; justify-items: center; padding: 16px 12px 14px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream);
  color: var(--ink); cursor: pointer; font: inherit; text-align: center;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out);
}
.jk:hover { transform: translate(-2px, -3px); box-shadow: 5px 5px 0 var(--pop-shadow); }
.jk:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.jk[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 4px 4px 0 2px var(--pop-shadow); }
.jk-mini {
  position: relative; width: 100%; max-width: 132px; aspect-ratio: 200 / 272;
  border: 2px solid #0f1f19; border-radius: 12px; background: #fffbf3;
  box-shadow: inset 0 0 0 5px #fffbf3, inset 0 0 0 6.5px #0f1f19;
  rotate: -2deg; transition: rotate 0.35s var(--ease-spring);
}
.jk:hover .jk-mini { rotate: 2deg; }
.jk-art { position: absolute; inset: 7px; overflow: hidden; border-radius: 7px; }
.jk-mini::after {
  position: absolute; top: 50%; left: 50%; width: 28%; aspect-ratio: 1; translate: -50% -50%;
  border: 1.5px solid #0f1f19; border-radius: 50%; background: #f4b740; content: "";
}
.jk-num { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; }
.jk b { font-family: var(--serif); font-size: 19px; line-height: 1.1; }
.jk-era { color: var(--c-pli-deep); font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
body.nocturne .jk-era { color: var(--c-pli); }
.jk-idea { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
@media (max-width: 1100px) { .jk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .jk-head { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .jk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .jk, .jk-mini { transition: none; } }

/* ---------- Modèle de données : types, tables et exemple ---------- */
.dm-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.dm-type { display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; overflow: hidden; padding: 0 20px 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); box-shadow: 4px 4px 0 var(--pop-shadow); }
.dm-type p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.dm-band { display: flex; justify-content: space-between; margin: 0 -20px; padding: 12px 20px; border-bottom: 1.5px solid var(--fixed-ink); background: var(--c-band); color: var(--fixed-ink); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.dm-type[data-type="langue"] { --c-band: var(--c-lang); }
.dm-type[data-type="prefixe"] { --c-band: var(--c-prefix); }
.dm-type[data-type="suffixe"] { --c-band: var(--c-suffix); }
.dm-type[data-type="mot"] .dm-band { border-bottom-color: var(--line-strong); background: var(--ink); color: var(--paper); }
.dm-type .dm-example { display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); }
.dm-example .bchip { padding: 4px 12px 5px; border-radius: 10px; font-size: 26px; box-shadow: 3px 3px 0 var(--fixed-ink); }
.dm-example .chip { color: var(--ink); font-family: var(--mono); font-size: 12px; }
.dm-word { color: var(--ink); font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.dm-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.dm-facts dt { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; line-height: 1.9; text-transform: uppercase; }
.dm-facts dd { margin: 0; color: var(--ink); font-weight: 600; }

.dm-principles { margin-top: clamp(32px, 4vw, 56px); padding: clamp(22px, 3vw, 36px); border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--paper-2); }
.dm-principles h3 { margin-bottom: 16px; font-family: var(--serif); font-size: 30px; }
.dm-principles ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 28px; padding: 0; list-style: none; counter-reset: p; }
.dm-principles li { display: grid; grid-template-columns: auto 1fr; gap: 10px; color: var(--ink-2); font-size: 14px; line-height: 1.5; counter-increment: p; }
.dm-principles li::before { padding-top: 2px; color: var(--c-action-deep); content: counter(p, decimal-leading-zero); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.dm-principles b { color: var(--ink); }

.dm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 16px; color: var(--ink-3); font-size: 13px; }
.dm-block { margin-top: clamp(28px, 3vw, 44px); padding-top: clamp(22px, 2.4vw, 32px); border-top: 1.5px solid var(--line-strong); }
.dm-block:first-of-type { margin-top: 0; }
.dm-block-head { display: grid; grid-template-columns: 150px minmax(0, 260px) 1fr; gap: 8px 24px; align-items: baseline; margin-bottom: 18px; }
.dm-block-head > span { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.dm-block-head h3 { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.dm-block-head p { max-width: 60ch; color: var(--ink-2); font-size: 14px; }
.dm-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; gap: 14px; }
.dm-table { scroll-margin-top: 150px; padding: 14px 16px 16px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--cream); transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-spring); }
.dm-table h4 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1.5px solid var(--line-strong); font-family: var(--mono); font-size: 14px; letter-spacing: 0.02em; }
.dm-table.is-core { border-color: var(--ink); box-shadow: 4px 4px 0 var(--pop-shadow); }
.dm-table.is-core h4::after { margin-left: 8px; color: var(--ink-3); content: "supertype"; font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; }
.dm-table.is-derived { border-style: dashed; background: transparent; }
.dm-table.is-derived p { color: var(--ink-2); font-size: 13.5px; }
.dm-table:target { outline: 2px solid var(--c-action); outline-offset: 3px; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--pop-shadow); }
.dm-table ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dm-table li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.dm-table code { font-family: var(--mono); font-size: 12.5px; }
.dm-table small { flex-basis: 100%; color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.dm-k { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-decoration: none; }
.dm-k.pk { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.dm-k.uk { border-style: dashed; }
a.dm-k.fk::before, span.dm-k.fk::before { margin-right: 3px; content: "→"; }
a.dm-k.fk { min-height: 24px; color: var(--c-action-deep); }
a.dm-k.fk:hover { border-color: var(--c-action-deep); }
a.dm-k:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dm-block.is-game .dm-table:not(.is-derived) { background: var(--paper-2); }
.dm-vocab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.dm-vocab > span { margin-right: 4px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.dm-vocab b { padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; font-weight: 600; }
.dm-vocab small { color: var(--ink-3); font-size: 12px; font-style: italic; }

.dm-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1.2fr; gap: 18px; align-items: stretch; padding: clamp(20px, 3vw, 36px); border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.dm-col { display: grid; align-content: center; gap: 14px; }
.dm-col-k { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.dm-unit { display: grid; justify-items: start; gap: 6px; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--paper); }
.dm-unit b { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.dm-unit small { color: var(--ink-2); font-size: 13px; }
.dm-unit .bchip { font-size: 22px; }
.dm-unit.is-result { border-color: var(--ink); box-shadow: 4px 4px 0 var(--pop-shadow); }
.dm-unit.is-result .dm-word { font-size: clamp(36px, 4vw, 52px); }
.dm-id { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; }
.dm-arrows { gap: 64px; color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-align: center; }
.dm-arrows span::after { content: " →"; }
.dm-note { max-width: 80ch; margin-top: 18px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.dm-pair { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.dm-pair .brick { min-width: 0; cursor: default; }
.dm-pair .b-label { font-family: var(--serif); font-size: 22px; font-weight: 700; }
#decisions .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px) {
  .dm-types, #decisions .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm-principles ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm-block-head { grid-template-columns: 1fr; }
  .dm-flow { grid-template-columns: 1fr; }
  .dm-arrows { gap: 6px; text-align: left; }
  .dm-arrows span::after { content: " ↓"; }
}
@media (max-width: 760px) {
  .dm-types, #decisions .pillars, .dm-principles ol { grid-template-columns: 1fr; }
}
body.nocturne a.dm-k.fk, body.nocturne .dm-arrows, body.nocturne .dm-block-head > span { color: var(--c-action); }
@media (prefers-reduced-motion: reduce) { .dm-table { transition: none; } }

.art-model { gap: 8px; }
.art-model span { display: grid; gap: 4px; width: 48px; padding: 6px; border: 1.5px solid var(--fixed-ink); border-radius: 6px; background: var(--cream); box-shadow: 2px 2px 0 var(--pop-shadow); }
.art-model span::before { height: 5px; border-radius: 2px; background: var(--ink); content: ""; }
.art-model i { height: 3px; border-radius: 2px; background: var(--line-strong); opacity: 0.5; }
.art-model em { width: 14px; height: 1.5px; background: var(--ink); }

.dm-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dm-source { display: grid; align-content: start; gap: 12px; padding: 22px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.dm-source.is-reperage { border-style: dashed; background: transparent; }
.dm-source-k { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.dm-source h3 { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.dm-source p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.dm-checks { display: grid; gap: 6px; padding: 0; list-style: none; font-size: 14px; }
.dm-checks li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.dm-checks li::before { content: "✓"; font-weight: 700; }
.dm-checks li.no::before { content: "×"; }
.dm-refs { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.dm-refs dt { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; line-height: 2; text-transform: uppercase; }
.dm-refs dd { margin: 0; color: var(--ink); }
.dm-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: clamp(28px, 3vw, 44px); padding: 0; list-style: none; counter-reset: s; }
.dm-steps li { display: grid; align-content: start; gap: 6px; padding: 14px; border-top: 3px solid var(--ink); counter-increment: s; }
.dm-steps li::before { color: var(--c-action-deep); content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.dm-steps b { font-family: var(--serif); font-size: 20px; }
.dm-steps span { color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.dm-fasc { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: clamp(28px, 3vw, 44px); }
.dm-fasc-col { display: grid; align-content: start; gap: 12px; padding: 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.dm-fasc-col.is-new { border-color: var(--ink); box-shadow: 4px 4px 0 var(--pop-shadow); }
.dm-fasc-bricks { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-fasc-bricks .bchip { font-size: 18px; }
.dm-fasc-words { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.dm-fasc-words .is-cross { font-style: italic; text-decoration: underline dashed 1.5px; text-underline-offset: 5px; }
.dm-fasc-note { color: var(--ink-3); font-size: 13px; }
body.nocturne .dm-source-k, body.nocturne .dm-steps li::before { color: var(--c-action); }
@media (max-width: 1100px) {
  .dm-sources { grid-template-columns: 1fr 1fr; }
  .dm-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dm-fasc { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dm-sources, .dm-steps { grid-template-columns: 1fr; }
}

/* ---------- Plis : fascicules ---------- */
.fs-timeline { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 16px; padding: 0; list-style: none; }
.fs-item { display: grid; align-content: start; gap: 10px; padding: 20px; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); }
.fs-item.is-current { border-color: var(--ink); box-shadow: 4px 4px 0 var(--pop-shadow); }
.fs-item.is-next { border-style: dashed; background: transparent; }
.fs-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.fs-num { font-weight: 700; }
.fs-when { color: var(--ink-3); }
.fs-item.is-current .fs-when { color: var(--c-action-deep); font-weight: 700; }
body.nocturne .fs-item.is-current .fs-when { color: var(--c-action); }
.fs-count { font-family: var(--serif); font-size: 22px; }
.fs-label { margin-top: 4px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.fs-bricks { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-bricks .bchip { font-size: 17px; }
.fs-words { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.fs-words .is-cross { font-style: italic; text-decoration: underline dashed 1.5px; text-underline-offset: 5px; }
.fs-note { color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.fs-announce { display: grid; gap: 4px; max-width: 720px; margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--ink); border-radius: 0 10px 10px 0; background: var(--paper-2); }
.fs-announce-k { color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.fs-announce p { font-size: 15px; font-weight: 600; }
.fs-announce small { color: var(--ink-3); font-size: 12px; }
.pk-rules a { color: var(--c-action-deep); font-weight: 600; }
body.nocturne .pk-rules a { color: var(--c-action); }
@media (max-width: 1100px) { .fs-timeline { grid-template-columns: 1fr; } }

/* ---------- Codex : fascicules, complétude et rareté ---------- */
.cb-fasc { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cb-fasc-btn {
  display: grid; gap: 8px; min-height: 44px; padding: 14px 16px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--cream); color: var(--ink);
  cursor: pointer; text-align: left;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out);
}
.cb-fasc-btn:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--pop-shadow); }
.cb-fasc-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cb-fasc-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.cb-fasc-head { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.cb-fasc-head span { opacity: 0.7; }
.cb-fasc-bar { height: 8px; overflow: hidden; border: 1px solid currentColor; border-radius: 999px; }
.cb-fasc-bar i { display: block; height: 100%; background: currentColor; transition: width 0.6s var(--ease-out); }
.cb-fasc-count { font-size: 13px; }
.cb-fasc-count b { font-family: var(--serif); font-size: 20px; }
.cb-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.cb-legend .rar { width: 12px; height: 12px; }
.cb-count .cb-legend { font-size: inherit; }
.cb-group { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; grid-column: 1 / -1; padding: 10px 0 2px; border-bottom: 1.5px solid var(--line-strong); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.cb-group[hidden] { display: none; }
.cb-group span { color: var(--ink-3); }
.cb-group:not(:first-child) { margin-top: 10px; }
.m-side { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.m-kind { overflow: hidden; text-overflow: ellipsis; }
/* Dans le bandeau, la rareté prend la teinte profonde du bandeau, sans contour : jamais d'Ambre sur une couleur vive.
   Le trait prend la couleur du bandeau, pour garder les facettes du diamant sans cerner la forme. */
.mini .m-rar { width: 12px; height: 12px; margin-right: -4px; fill: var(--rd, var(--c-pli)); stroke: var(--tc); }
.mini[data-type="prefixe"] { --rd: var(--c-prefix-deep); }
.mini[data-type="suffixe"] { --rd: var(--c-suffix-deep); }
.mini.is-legend { border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .cb-fasc-btn, .cb-fasc-bar i { transition: none; } }

/* ---------- Plis : choisir un fascicule, puis ouvrir son pli ---------- */
.pk-chooser[hidden], .pk-current[hidden], .pk-layout[hidden] { display: none; }
.pk-chooser-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 32px; align-items: end; margin-bottom: 24px; }
.pk-chooser-head .pk-label { margin-bottom: 8px; }
.pk-fasc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pk-fasc {
  display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: center; padding: 18px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--cream); color: var(--ink);
  cursor: pointer; font: inherit; text-align: left;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-out);
}
button.pk-fasc:hover { transform: translate(-2px, -3px); box-shadow: 5px 5px 0 var(--pop-shadow); }
button.pk-fasc:hover .jk-mini { rotate: 2deg; }
.pk-fasc:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.pk-fasc.is-next { border-style: dashed; background: transparent; cursor: default; }
.pk-fasc .jk-mini { max-width: 112px; }
.jk-mini.is-empty { border-style: dashed; border-color: var(--line-strong); background: transparent; box-shadow: none; }
.jk-mini.is-empty::after { border-style: dashed; background: transparent; }
.pk-fasc-info { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pk-fasc-info b { color: var(--ink); font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.pk-fasc-k { color: var(--c-pli-deep); font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
body.nocturne .pk-fasc-k { color: var(--c-pli); }
.pk-fasc-go { margin-top: 6px; color: var(--c-action-deep); font-weight: 700; }
body.nocturne .pk-fasc-go { color: var(--c-action); }
.pk-current { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding: 12px 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--cream); }
.pk-current p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pk-current .pk-label { margin: 0; }
.pk-current b { font-family: var(--serif); font-size: 20px; }
.jk.is-future { border-style: dashed; background: transparent; }
@media (max-width: 760px) {
  .pk-chooser-head { grid-template-columns: 1fr; gap: 12px; }
  .pk-fasc-list { grid-template-columns: 1fr; }
  .pk-fasc { grid-template-columns: 84px 1fr; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { .pk-fasc { transition: none; } }
.fs-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.fs-counts div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.fs-counts dt { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.fs-counts dt i { width: 10px; height: 10px; border: 1px solid var(--fixed-ink); border-radius: 3px; background: var(--c); }
.fs-counts dd { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; }

/* ---------- Interfaces ---------- */
.if-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; color: var(--ink-2); font-size: 13px; }
.if-legend > span:first-child { margin-right: 4px; color: var(--ink-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.if-legend .if-status:not(:nth-child(2)) { margin-left: 10px; }
.if-status { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.if-status.is-demo { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.if-status.is-todo { border-style: dashed; color: var(--ink-2); }
.if-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); align-items: start; gap: 14px; }
.if-card { display: grid; gap: 10px; scroll-margin-top: 150px; padding: 16px 18px 18px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--cream); }
.if-card:target { outline: 2px solid var(--c-action); outline-offset: 3px; }
.if-card.is-later { border-style: dashed; background: transparent; }
.if-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.if-num { color: var(--c-action-deep); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }
.if-card h4 { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.15; }
.if-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.if-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.if-facts dt { color: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; line-height: 1.9; text-transform: uppercase; }
.if-facts dd { margin: 0; }
.if-open { display: grid; gap: 12px; max-width: 80ch; margin: 0; padding-left: 1.4em; }
.if-open li { padding-left: 4px; color: var(--ink-2); font-size: 15px; }
.if-open b { color: var(--ink); }
.if-open .xref { margin-left: 6px; }
body.nocturne .if-num { color: var(--c-action); }
.art-screens { align-items: flex-end; gap: 10px; }
.art-screens span { border: 1.5px solid var(--fixed-ink); border-radius: 6px; background: var(--cream); box-shadow: 2px 2px 0 var(--pop-shadow); }
.art-screens span:first-child { width: 84px; height: 54px; }
.art-screens span:last-child { width: 30px; height: 54px; border-radius: 8px; }
.section.if-intro { padding-bottom: 0; }
.art-screens.is-drawn span { background: repeating-linear-gradient(180deg, var(--cream) 0 7px, var(--paper-2) 7px 9px); }


/* ==========================================================================
   Animations retenues (décisions du 2026-10-01, mouvement.html#catalogue)
   Mêmes règles que la PWA (styles.css, plis.css, codex.css du dépôt App).
   Elles remplacent les règles plus haut quand elles touchent les mêmes classes.
   ========================================================================== */
/* Sceau : un coup de tampon, il s'enfonce de son ombre puis remonte. */
.seal { transition: scale var(--dur-rapide) var(--ease-ressort), translate var(--dur-rapide) var(--ease-ressort), box-shadow var(--dur-rapide) var(--ease-out); }
.wordmark:hover .seal { rotate: -6deg; scale: 0.94; translate: 2px 2px; box-shadow: 1px 1px 0 var(--fixed-ink); }
/* Touche mécanique : l'appui descend de la longueur de l'ombre en 120 ms, puis le bouton remonte au ressort. */
.btn { transition: transform var(--dur-base) var(--ease-ressort), box-shadow var(--dur-rapide) var(--ease-out), background-color var(--dur-rapide), border-color var(--dur-rapide); }
.btn:active { transition-duration: var(--dur-instant); transition-timing-function: ease-out; }
.btn-primary:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--pop-shadow); }
/* Bouton prêt : une seule onde, puis l'ombre respire d'un pixel. */
@property --souffle { syntax: "<length>"; inherits: false; initial-value: 0px; }
.table-panel .btn-primary { position: relative; }
.table-panel.ready .btn-primary { box-shadow: calc(4px + var(--souffle)) calc(4px + var(--souffle)) 0 var(--pop-shadow); animation: souffle 3s ease-in-out var(--dur-lent) infinite; }
.table-panel.ready .btn-primary:hover { box-shadow: 6px 6px 0 var(--pop-shadow); }
.table-panel.ready .btn-primary::after { position: absolute; inset: -1.5px; border-radius: inherit; content: ""; pointer-events: none; animation: onde var(--dur-lent) var(--ease-out) both; }
@keyframes onde { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-action) 55%, transparent); } to { box-shadow: 0 0 0 16px color-mix(in srgb, var(--c-action) 0%, transparent); } }
@keyframes souffle { 50% { --souffle: 1px; } }
/* Refus doux en deux forces : « échec » 500 ms, « presque » 300 ms, une oscillation qui s'amortit. */
.shake { animation: amorti 0.5s linear; }
.shake.legere { animation: amorti-leger 0.3s ease-out; }
@keyframes amorti {
  12% { transform: translateX(-8px); } 25% { transform: translateX(8px); }
  38% { transform: translateX(-6px); } 50% { transform: translateX(6px); }
  62% { transform: translateX(-4px); } 75% { transform: translateX(4px); }
  88% { transform: translateX(-2px); }
}
@keyframes amorti-leger { 25% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
/* Découverte : les briques s'aimantent (--fx mesuré), s'écrasent au contact, leurs étiquettes se fondent en un mot ;
   huit traits d'encre et des lettres du mot jaillissent autour. Plus d'ondes ni de confettis carrés. */
.fusing .slot[data-slot] { transform: none; opacity: 1; }
.fusing .op { opacity: 0; transform: scale(0); }
.slot[data-slot="1"] { --sens: -1; }
.fusing .slot .brick { animation: aimante 0.3s var(--ease-in) forwards, ecrase 0.2s ease-out 0.28s, efface 0.15s 0.35s forwards; }
.fu-eclat { position: absolute; top: 50%; left: 50%; z-index: 6; width: 0; height: 0; pointer-events: none; }
.fu-mot {
  position: absolute; translate: -50% -50%; padding: 6px 14px;
  border: 1.5px solid var(--fixed-ink); border-radius: 10px; background: var(--cream); color: var(--ink);
  box-shadow: 4px 4px 0 var(--pop-shadow); font-family: var(--serif); font-size: 26px; font-weight: 700; white-space: nowrap;
  animation: fondu-mot 0.3s var(--ease-ressort) 0.35s both;
}
.fu-trait { position: absolute; width: 3px; height: 16px; margin: -8px -1.5px; border-radius: 2px; background: var(--ink); opacity: 0; animation: trait 0.3s ease-out 0.45s forwards; }
.fu-lettre { position: absolute; translate: -50% -50%; color: var(--c); font-family: var(--serif); font-size: 17px; font-weight: 700; opacity: 0; animation: fly 0.7s var(--ease-out) 0.35s forwards; }
@keyframes aimante { to { translate: calc(var(--sens, 1) * var(--fx, 0px)) calc(var(--sens, 1) * var(--fy, 0px)); } }
@keyframes ecrase { 50% { scale: 0.96 1; } }
@keyframes efface { to { opacity: 0; } }
@keyframes fondu-mot { from { opacity: 0; scale: 0.9; } }
@keyframes trait {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(var(--r0)) scaleY(0.2); }
  40% { opacity: 1; transform: rotate(var(--a)) translateY(calc(var(--r0) - 14px)) scaleY(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--r0) - 30px)) scaleY(0.1); }
}
@keyframes fly { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); } }
/* « −1 » : il monte et se dissout comme de l'encre qui sèche. */
.b-minus { animation: seche 0.9s var(--ease-out) forwards; }
@keyframes seche {
  0% { opacity: 0; transform: translate(-50%, 6px) scale(0.6); filter: blur(0); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -22px); filter: blur(2px); }
}
/* Codex : survols ramenés à trois gestes (soulever, souligner, teinter), une durée, une courbe. */
.mini { transition: transform var(--dur-rapide) var(--ease-out), box-shadow var(--dur-rapide) var(--ease-out); }
.mini:hover, .mini:focus-visible { transform: translateY(-3px); box-shadow: 3px 4px 0 var(--pop-shadow); }
.xref:hover { transform: none; box-shadow: none; background: var(--c-action-tint); color: var(--fixed-ink); }
/* Retournement : le ↻ reste fixe, sans aperçu incliné de la carte ; le tour lui-même se joue en 600 ms (etymo.js). */
.flip-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 #0f1f19; }
.flip-btn:hover em { transform: none; }
.big-card { transition: transform var(--dur-rapide) var(--ease-ressort); }
/* Plis : le paquet posé (plus de flottement), entré d'un geste, cacheté ; le sceau ne pulse qu'après 3 s. */
.pk-pack { animation: pose 0.3s var(--ease-out) both; }
.pk-pack:not(:disabled):hover { animation-play-state: running; }
.pk-seal { animation: cachet 0.22s ease-in 0.35s both, sealPulse 2.4s ease-in-out 3.6s infinite; }
.pk-stage.pk-charging .pk-seal { animation: cire 1.3s ease-in forwards; }
@keyframes pose { from { opacity: 0; translate: 0 -12px; } }
@keyframes cachet { from { opacity: 0; scale: 1.2; } }
@keyframes cire { to { scale: 1.3; border-radius: 46% 54% 52% 48% / 56% 44% 56% 44%; box-shadow: 0 0 0 14px rgba(244, 183, 64, 0.2), 0 0 48px rgba(244, 183, 64, 0.6); } }
/* Rayons écrits : un rayon sur deux est une ligne de texte qui part du centre. */
.pk-rays { background: repeating-conic-gradient(rgba(244, 183, 64, 0.3) 0deg 7deg, transparent 7deg 36deg); }
.pk-rays span {
  position: absolute; top: 50%; left: 50%; padding-left: 64px; opacity: 0.16;
  transform-origin: 0 50%; transform: translateY(-50%) rotate(calc(var(--a) - 90deg));
  color: var(--c-pli-deep); font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap;
}
/* Anticipation : une rare ou une légendaire teinte les rayons et la plume dès l'écriture. */
.pk-stage.pk-anticipe .pk-rays { background: repeating-conic-gradient(rgba(143, 123, 240, 0.4) 0deg 7deg, transparent 7deg 36deg); opacity: 0.5; }
.pk-stage.pk-anticipe .pk-rays span { color: var(--c-lang-deep); }
.pk-stage.pk-anticipe.pk-writing .pk-scribe { animation-name: scribeChargeRare; }
@keyframes scribeChargeRare { to { box-shadow: 0 0 0 7px rgba(255, 251, 243, 0.8), 0 0 70px var(--c-lang); } }
/* Retournement : le paquet passe sur la tranche (.pk-flip), puis la révélation se retourne à sa place (`retourne`). */
.pk-stage.pk-flip .pk-pack, .pk-stage.pk-burst .pk-pack { scale: 1.14; animation: none; pointer-events: none; transform: perspective(900px) rotateY(90deg); transition: transform 0.42s cubic-bezier(0.45, 0, 0.75, 0.5); }
.pk-stage.pk-flip .pk-seal { opacity: 0; animation: none; }
.pk-stage.pk-flip .pk-scribe { opacity: 0; transition-duration: 0.12s; }
.pk-stage.pk-flip .pk-tagline { opacity: 0; animation: none; }
.pk-reveal { animation: retourne 0.52s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes retourne { from { opacity: 0; transform: perspective(900px) rotateY(-90deg) scale(0.96); } 35% { opacity: 1; } }
/* Paquet en attente d'ouverture : halo jaune qui respire derrière, léger zoom au survol. */
.pk-pack::before { content: ""; position: absolute; z-index: -1; inset: -70px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity 0.6s var(--ease-out); background: radial-gradient(closest-side, rgba(255, 226, 150, 0.7), rgba(244, 183, 64, 0.38) 38%, rgba(244, 183, 64, 0.12) 68%, transparent); }
.pk-stage[data-state="ready"] .pk-pack::before { opacity: 1; animation: halo 4.5s ease-in-out infinite; }
@keyframes halo { 50% { opacity: 0.6; scale: 0.94; } }
.pk-stage[data-state="ready"] .pk-pack:not(:disabled):hover { scale: 1.04; }
/* Écriture : rature tracée à la main au lieu d'un trait ; curseur qui clignote doucement. */
.sc-line::after { display: none; }
.sc-rature { position: absolute; top: 0; left: -6px; width: calc(100% + 12px); height: 100%; overflow: visible; pointer-events: none; }
.sc-rature path { fill: none; stroke: var(--c-action); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 100; animation: trace 0.2s ease-out both; }
.sc-caret { animation: clignote 1s ease-in-out infinite; }
@keyframes trace { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes clignote { 50% { opacity: 0.2; } }
/* Atterrissage au tampon : grande ombre qui se resserre, impression avec un écrasement. */
.pk-brick { animation: imprime 0.5s var(--ease-out) both; }
@keyframes imprime {
  0% { opacity: 0; transform: translateY(-34px) scale(1.18); box-shadow: 20px 30px 0 rgba(15, 31, 25, 0.22); }
  55% { opacity: 1; transform: none; box-shadow: 6px 6px 0 #0f1f19; }
  72% { transform: scaleY(0.92) translateY(2px); }
  100% { transform: rotate(-2deg); box-shadow: 6px 6px 0 #0f1f19; }
}
/* États d'attente : « Touchez pour passer » n'apparaît qu'après 600 ms ; la phrase d'attente ne respire plus, ses points s'écrivent. */
.pk-stage[data-state="opening"] .pk-status { animation: eqFade 0.4s ease-out 0.6s both; }
.pk-tagline { animation: none; }
.pk-tagline .dt { display: inline-block; animation: point 2.4s steps(1, end) infinite; animation-delay: calc(var(--i) * 400ms); }
@keyframes point { 0% { opacity: 0; } 10%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* Historique : seule la nouvelle ligne entre. Inconnues : une seule scintille à la fois. */
.pk-hist-item { animation: none; }
.pk-hist-item:first-child { animation: eqIn 0.4s var(--ease-spring) both; }
.pk-pool .bchip.missing { animation: scintille 3s infinite; animation-delay: calc(var(--i, 0) * 0.5s); }
.pk-pool .bchip.missing:nth-child(2n) { animation-delay: calc(var(--i, 0) * 0.5s); }
@keyframes scintille { 0%, 14% { border-color: var(--c-pli-deep); color: var(--c-pli-deep); } 20%, 100% { border-color: var(--ink-3); } }
@media (prefers-reduced-motion: reduce) {
  .fu-eclat { display: none; }
}
