/* Page d'étude de cas : même colonne, même palette que l'accueil. */
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fil d'Ariane flottant */
.crumb {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
.crumb a { text-decoration: none; font-weight: 500; }
.crumb span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.case { padding-top: clamp(96px, 14vw, 140px); }

/* En-tête */
.case-head { margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.eyebrow span { margin: 0 4px; color: var(--line); }
.case-head h1 { margin: 0; font-size: clamp(26px, 5vw, 34px); font-weight: 500; line-height: 1.22; letter-spacing: -0.02em; text-wrap: balance; }
.h1-name { color: var(--muted); font-weight: 400; }
.h1-sep { color: var(--line); font-weight: 300; margin: 0 2px; }

.hero-card { aspect-ratio: 4 / 3; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--sunk)), var(--sunk)); }
.case-tags { justify-content: center; margin: 16px 0 0; }

/* Mission */
.mission { margin-top: clamp(48px, 8vw, 72px); }
.label { margin: 0 0 6px; font-size: 14px; font-weight: 500; }
.mission > p { margin: 0 0 28px; color: var(--muted); }
.mission strong { color: var(--fg); font-weight: 500; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin: 0; }
.facts dt { font-size: 14px; font-weight: 500; }
.facts dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.facts .todo { color: var(--accent-text); font-style: italic; }

/* Sommaire collant */
.toc {
  position: sticky; z-index: 10; top: calc(68px + env(safe-area-inset-top, 0px));
  margin: clamp(48px, 8vw, 72px) auto 0; width: fit-content; max-width: 100%;
  display: flex; gap: 2px; padding: 4px; border-radius: 999px; overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
.toc::-webkit-scrollbar { display: none; }
.toc a { flex: none; padding: 6px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--muted); transition: background .2s, color .2s; }
.toc a:hover { color: var(--fg); }
.toc a[aria-current] { background: var(--sunk); color: var(--fg); }

/* Chapitres */
.chapter { margin-top: clamp(64px, 10vw, 96px); }
.chapter h2 { margin: 0 0 10px; font-size: 22px; font-weight: 500; letter-spacing: -0.015em; }
.chapter h3 { margin: 32px 0 10px; font-size: 16px; font-weight: 500; }
.chapter p { margin: 0 0 14px; color: var(--muted); }
.chapter em { color: var(--fg); font-style: normal; font-weight: 500; }
.list { margin: 0; padding-left: 1.1em; color: var(--muted); display: grid; gap: 6px; }
.list li::marker { color: var(--accent); }

/* Cartes numérotées */
.numbered { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.numbered li { display: flex; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.numbered li > span { font: 400 12.5px var(--mono); color: var(--accent-text); padding-top: 3px; }
.numbered h3 { margin: 0 0 4px; font-size: 15px; }
.numbered p { margin: 0; font-size: 15px; }

/* Comparaison avant / après */
.compare { position: relative; aspect-ratio: 16 / 10; max-width: 100%; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); user-select: none; }
.compare-pane { position: absolute; inset: 0; display: grid; place-items: center; }
.compare-pane.before { background: var(--sunk); }
.compare-pane.after { background: color-mix(in srgb, var(--accent) 9%, var(--sunk)); clip-path: inset(0 0 0 var(--pos)); }
.mini { width: min(320px, 78%); background: #fff; color: #111; border: 1px solid #dcdcd8; border-radius: 12px; padding: 18px; }
.mini p { margin: 0; }
.mini-k { font-size: 11px; color: #5a5a5a; margin-bottom: 8px !important; }
.mini-raw { font: 400 13.5px/1.7 var(--mono); color: #333; }
.mini-verdict { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 15px; margin-bottom: 8px !important; color: #111; }
.mini-verdict i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #b42318; }
.mini-sub { font-size: 13px; color: #444; }
.compare-tag { position: absolute; left: 12px; bottom: 12px; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.compare-tag.right { left: auto; right: 12px; color: var(--accent-text); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--fg); pointer-events: none; }
.compare-handle::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-size: 14px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.caption { margin-top: 10px !important; font-size: 13px; text-align: center; }

/* Cartes de conception */
.step-card { margin-top: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.step-card h3 { margin: 0 0 10px; }
.step-card p:last-child { margin-bottom: 0; }
.formula { font: 400 14px var(--mono); color: var(--fg) !important; background: var(--sunk); padding: 10px 12px; border-radius: 8px; }
.chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.verdicts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.verdicts li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdicts b { font-weight: 500; }
.verdicts span { color: var(--muted); font-size: 14px; margin-left: auto; }
.v-ok, .v-warn, .v-ko { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.v-ok { background: #1b7f3b; } .v-warn { background: #8a5a00; } .v-ko { background: #b42318; }

/* Résultats */
.outcomes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.outcomes div { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.outcomes b { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.outcomes span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 480px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }

/* Projet suivant */
.next { display: grid; gap: 4px; margin-top: clamp(72px, 10vw, 104px); padding: 22px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .2s; }
.next:hover { border-color: var(--fg); }
.next-k { font-size: 13px; color: var(--muted); }
.next-t { font-size: 18px; font-weight: 500; }

@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 14px; }
  .outcomes { grid-template-columns: 1fr; }
  .verdicts span { margin-left: 18px; flex-basis: 100%; margin-top: -6px; }
}

@media (max-width: 440px) {
  .hero-card { aspect-ratio: auto; padding-block: 32px; }
  .compare { aspect-ratio: 4 / 5; }
}
