@font-face {
  font-family: "Cabinet Grotesk";
  src: url(../fonts/cabinet-grotesk.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(../fonts/jetbrains-mono.woff2) format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Terre vivante : fond humus, os pour le texte, vert acide en unique accent.
   Rayons : 0 pour les cadres « planche », pilule pour les boutons. */
:root {
  --bg: #110b07;
  --bg-2: #19110b;
  --bg-3: #23180f;
  --line: rgb(237 228 211 / .12);
  --line-2: rgb(237 228 211 / .24);
  --ink: #ede4d3;
  --ink-2: #b4a592;
  --ink-3: #7f705f;
  --acid: #c9f25b;
  --acid-ink: #18210a;
  --vert: #9bd256;
  --brun: #c9894a;
  --worm: #e48a7d;
  --hot: #ff8a3d;
  --water: #7cc4e0;
  --display: "Cabinet Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 450;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--acid); color: var(--acid-ink); }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
canvas { display: block; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.ic { width: 1.2em; height: 1.2em; flex: none; }

.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }

/* ---------- typographie ---------- */
.h2 {
  font-size: clamp(2.9rem, 12.5vw, 8.6rem);
  font-weight: 800;
  line-height: .86;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.lead { font-size: clamp(1.05rem, 1.2vw, 1.25rem); line-height: 1.5; color: var(--ink-2); max-width: 36ch; text-wrap: pretty; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font: 600 .66rem/1 var(--mono);
  text-transform: uppercase; letter-spacing: .08em; font-style: normal;
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-g { color: var(--vert); }
.tag-b { color: var(--brun); }
.split-line { display: block; overflow: clip; padding-bottom: .06em; margin-bottom: -.06em; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 26px;
  border-radius: 999px; font-weight: 700; font-size: 1.02rem; text-decoration: none; white-space: nowrap;
  transition: transform .4s var(--spring), background .3s, color .3s;
}
.btn:active { transform: scale(.96); }
.btn-acid { background: var(--acid); color: var(--acid-ink); }
.btn-ghost { box-shadow: inset 0 0 0 1px var(--line-2); }
@media (hover: hover) {
  .btn-acid:hover { transform: translateY(-2px); }
  .btn-ghost:hover { background: rgb(237 228 211 / .06); }
}

/* ---------- navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) var(--gutter) 14px; pointer-events: none;
  background: linear-gradient(to bottom, rgb(17 11 7 / .85), rgb(17 11 7 / 0));
}
.nav > * { pointer-events: auto; }
.nav-mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; }
.nav-dot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e7ff9c, var(--acid) 45%, #6e9a1e); box-shadow: 0 0 18px rgb(201 242 91 / .55); }
.nav-links { display: none; gap: 28px; font: 500 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.nav-links a { text-decoration: none; color: var(--ink-2); transition: color .3s; }
.nav-links a:hover { color: var(--ink); }
.nav-sound {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  font: 500 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  box-shadow: inset 0 0 0 1px var(--line-2); background: rgb(17 11 7 / .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.nav-sound .ic-off, .nav-sound[aria-pressed="false"] .ic-on { display: none; }
.nav-sound[aria-pressed="false"] .ic-off { display: block; }

/* ---------- le composteur vivant ---------- */
.hero {
  position: relative; height: 100svh; min-height: 560px; max-height: 1100px;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px; padding: calc(env(safe-area-inset-top) + 66px) 10px 12px;
}
.hero-title {
  position: relative; z-index: 1; padding-left: 6px; margin-bottom: -.42em;
  font-size: clamp(3.3rem, 15.4vw, 10.5rem); font-weight: 800; line-height: .84; letter-spacing: -.055em;
}
.hero-title span { display: block; }
.hero-lead { display: none; }

.viv { position: relative; z-index: 2; min-height: 0; --under: 42px; }
.viv::before { /* vitre : léger voile et reflet */
  content: ""; position: absolute; inset: 0 0 var(--under); pointer-events: none;
  background: linear-gradient(115deg, rgb(237 228 211 / .05), rgb(237 228 211 / 0) 38%), rgb(237 228 211 / .015);
  box-shadow: inset 0 0 0 1px var(--line);
}
.viv-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--under) + 4px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--under) + 4px), transparent);
}
.viv-frame i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--ink-2); pointer-events: none; }
.viv-frame i:nth-child(1) { left: -1px; top: -1px; border-width: 1.5px 0 0 1.5px; }
.viv-frame i:nth-child(2) { right: -1px; top: -1px; border-width: 1.5px 1.5px 0 0; }
.viv-frame i:nth-child(3) { left: -1px; bottom: calc(var(--under) - 1px); border-width: 0 0 1.5px 1.5px; }
.viv-frame i:nth-child(4) { right: -1px; bottom: calc(var(--under) - 1px); border-width: 0 1.5px 1.5px 0; }
.viv-ruler {
  position: absolute; left: 8px; top: 12%; bottom: var(--under); width: 26px; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  font: 500 .58rem/1 var(--mono); color: var(--ink-3); letter-spacing: .04em;
  background: repeating-linear-gradient(to bottom, var(--line-2) 0 1px, transparent 1px 10%) left / 5px 100% no-repeat;
}
.viv-ruler span { padding-left: 9px; transform: translateY(-50%); white-space: nowrap; color: var(--ink-2); text-shadow: 0 1px 4px rgb(0 0 0 / .9); }
.viv-ruler span:last-child { transform: translateY(50%); }

.gauges {
  position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; gap: 4px; min-width: 120px;
  font: 500 .56rem/1.1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); pointer-events: none;
}
.gauges > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.gauges dd { color: var(--ink); white-space: nowrap; }
.gauges dd b { font-weight: 600; font-variant-numeric: tabular-nums; }
.gauges dd::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--acid); vertical-align: 1px; transition: background .4s; }
.gauges .bad dd { color: var(--hot); }
.gauges .bad dd::before { background: var(--hot); box-shadow: 0 0 10px var(--hot); }

.zones { position: absolute; inset: 0 0 var(--under); pointer-events: none; z-index: 3; }
.zone {
  position: absolute; right: 10px; top: calc(var(--y, .5) * 100%); translate: 0 -50%;
  display: grid; justify-items: end; gap: 2px; padding: 5px 8px; text-align: right;
  background: rgb(17 11 7 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 0; transition: top 1.2s var(--ease), opacity .6s;
}
.zone.on { opacity: 1; }
.zone::before { /* trait de rappel vers la couche */
  content: ""; position: absolute; right: 100%; top: 50%; width: 34px; height: 1px; background: var(--ink-2);
}
.zone::after { content: ""; position: absolute; right: calc(100% + 34px); top: 50%; width: 5px; height: 5px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--ink); }
.zone b { font: 600 .62rem/1.1 var(--mono); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.zone > span { display: none; font-size: .78rem; line-height: 1.1; color: var(--ink-2); }
.zone[data-zone="warm"] b { color: #ffb37a; }
.zone[data-zone="mature"] b { color: var(--acid); }

.steam { position: absolute; left: 0; right: 0; top: calc(var(--surface, .5) * 100%); height: 0; pointer-events: none; opacity: var(--heat, 0); transition: top 1.2s var(--ease), opacity 1s; z-index: 2; }
.steam i {
  position: absolute; bottom: 0; width: 46px; height: 70px; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(237 228 211 / .16), transparent);
  filter: blur(6px); animation: steam 3.6s ease-out infinite;
}
.steam i:nth-child(1) { left: 22%; }
.steam i:nth-child(2) { left: 48%; animation-delay: 1.2s; }
.steam i:nth-child(3) { left: 72%; animation-delay: 2.4s; }
@keyframes steam { 0% { transform: translateY(20px) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-60px) scale(1.4); opacity: 0; } }

.floor { /* plancher en bois, ouvert au centre pour la trappe */
  position: absolute; left: -6px; right: -6px; bottom: calc(var(--under) - 9px); height: 10px; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, #8a5e38, #5d3c22 60%, #3e2716);
  box-shadow: 0 6px 14px rgb(0 0 0 / .5);
  -webkit-mask: linear-gradient(90deg, #000 32%, transparent 32% 68%, #000 68%);
  mask: linear-gradient(90deg, #000 32%, transparent 32% 68%, #000 68%);
}
.trap {
  position: absolute; left: 32%; width: 36%; bottom: calc(var(--under) - 9px); height: 10px; z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, #9a6a40, #6b4627); transform-origin: 0 50%; transition: transform .7s var(--spring);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .25);
}
.viv.trap-open .trap { transform: rotate(68deg); }
.harvest {
  position: absolute; right: 10px; bottom: 2px; z-index: 3; font: 500 .62rem/1 var(--mono); text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-2);
}
.harvest b { color: var(--acid); font-size: .9rem; }

.voice {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 14px 6px 6px;
  border-radius: 999px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
}
.voice-text { font-size: .88rem; font-weight: 550; line-height: 1.25; text-wrap: pretty; }
.voice-text.pop { animation: rise-in .5s var(--ease); }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.worm { width: 34px; height: 34px; flex: none; overflow: visible; }
.worm-head { fill: var(--worm); }
.worm-tint { fill: transparent; transition: fill .4s; }
.worm-eyes circle { fill: var(--bg); }
.worm-eyes { transform-box: fill-box; transform-origin: center; animation: blink 4.8s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.worm .m { display: none; fill: none; stroke: var(--bg); stroke-width: 2.6; stroke-linecap: round; }
.worm ellipse.m { fill: var(--bg); stroke: none; }
.worm[data-mood="happy"] .m-happy, .worm[data-mood="sad"] .m-sad, .worm[data-mood="sick"] .m-sick, .worm[data-mood="open"] .m-open { display: inline; }
.worm[data-mood="sick"] .worm-tint { fill: rgb(130 175 60 / .45); }
.worm[data-mood="happy"] { animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

.dock { display: grid; gap: 8px; }
.tiles {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74px; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; margin: 0 -10px; padding: 0 10px;
}
.tiles::-webkit-scrollbar { display: none; }
.tile {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; height: 72px; padding: 4px 2px;
  scroll-snap-align: start; border-radius: 16px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: .76rem; font-weight: 650; transition: box-shadow .3s, background .3s, transform .3s var(--spring);
}
.tile canvas { width: 36px; height: 36px; }
.tile .tag { position: absolute; top: 6px; left: 7px; font-size: 0; gap: 0; }
.tile[aria-pressed="true"] { background: var(--bg-3); box-shadow: inset 0 0 0 1.5px var(--acid); }
.tile:active { transform: scale(.94); }
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.act {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 999px;
  font-weight: 700; font-size: .92rem; box-shadow: inset 0 0 0 1px var(--line-2); transition: background .3s, transform .3s var(--spring);
}
.act .ic { color: var(--acid); }
.act:active { transform: scale(.95); }
.act.busy { background: rgb(201 242 91 / .12); }

/* ---------- manifeste ---------- */
.manifesto { padding: clamp(120px, 22vw, 260px) var(--gutter) clamp(90px, 16vw, 200px); }
.manifesto-text, .ready-text {
  max-width: 19ch; font-size: clamp(2rem, 8.4vw, 6.2rem); font-weight: 700; line-height: .98; letter-spacing: -.04em;
}
.word { color: rgb(237 228 211 / .16); transition: color .3s; }
.word.lit { color: var(--ink); }

/* ---------- le cycle ---------- */
.cycle-pin {
  min-height: 100svh; padding: calc(env(safe-area-inset-top) + 74px) var(--gutter) 24px;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
}
.cycle-title { font-size: clamp(2.2rem, 9.5vw, 7rem); }
.cycle-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.cycle-canvas { width: min(100%, 40svh, 560px); aspect-ratio: 1; }
.steam-cycle { top: 34%; left: 15%; right: 15%; }
.cycle-copy { display: grid; gap: 14px; }
.cycle-words { min-height: 6.4em; }
.cycle-verb { font-size: clamp(2.3rem, 10.5vw, 7.5rem); font-weight: 800; line-height: .9; letter-spacing: -.05em; color: var(--acid); }
.cycle-desc { margin-top: 8px; max-width: 34ch; color: var(--ink-2); font-size: clamp(.98rem, 1.2vw, 1.1rem); line-height: 1.45; }
.cycle-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.cycle-steps button {
  height: 34px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 .66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); transition: background .3s, color .3s;
}
.cycle-steps button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }

/* ---------- la recette ---------- */
.recipe { padding: clamp(110px, 18vw, 220px) var(--gutter) clamp(80px, 14vw, 180px); }
.recipe-title { max-width: 11ch; }
.recipe-title em { font-style: normal; }
.recipe-title .g { color: var(--vert); }
.recipe-title .b { color: var(--brun); }
.swatches { display: grid; gap: 28px; margin-top: clamp(48px, 8vw, 96px); }
.swatch { display: grid; gap: 10px; align-content: start; }
.swatch-canvas { width: 100%; aspect-ratio: 16 / 9; }
.swatch-tag { display: flex; align-items: center; gap: 10px; margin-top: 8px; font: 500 .66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.swatch h3 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.swatch > p:not(.swatch-tag) { color: var(--ink-2); max-width: 34ch; }
.swatch-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.swatch-list li { padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .9rem; font-weight: 600; }
.swatch-eq { display: none; justify-self: center; font-size: clamp(4rem, 10vw, 9rem); font-weight: 300; line-height: .7; color: var(--ink-3); }
.needs { display: grid; margin-top: clamp(64px, 10vw, 120px); border-top: 1px solid var(--line); }
.need { display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.need .ic { width: 28px; height: 28px; color: var(--acid); grid-row: span 2; }
.need h3 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.need p { color: var(--ink-2); }

/* ---------- mini-jeu : le tri ---------- */
.sort { padding: clamp(100px, 16vw, 200px) var(--gutter); display: grid; gap: 36px; overflow-x: clip; }
.sort-head .lead { margin-top: 20px; }
.sort-game { position: relative; width: 100%; max-width: 460px; justify-self: center; }
.sort-meta { display: flex; justify-content: space-between; font: 500 .68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.sort-meta b { color: var(--acid); font-weight: 600; }
.deck { position: relative; height: min(100vw, 420px); margin: 14px 0 16px; }
.card {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 18px;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 60px -30px rgb(0 0 0 / .8);
  user-select: none; -webkit-user-select: none; touch-action: pan-y;
  transform: translateY(calc(var(--depth) * 14px)) scale(calc(1 - var(--depth) * .045));
  transition: transform .5s var(--spring);
}
.card[data-top] { cursor: grab; }
.card.dragging { transition: none; cursor: grabbing; }
.card-label { display: flex; justify-content: space-between; font: 500 .62rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.card canvas { width: min(78%, 300px); aspect-ratio: 1; justify-self: center; align-self: center; }
.card-name { font-size: clamp(1.9rem, 8vw, 2.6rem); font-weight: 800; line-height: .95; letter-spacing: -.04em; }
.stamp {
  position: absolute; top: 46px; padding: 6px 12px; border: 2px solid; font: 700 .9rem/1 var(--mono); text-transform: uppercase;
  letter-spacing: .06em; pointer-events: none;
}
.stamp-yes { left: 16px; color: var(--acid); rotate: -10deg; opacity: var(--yes, 0); }
.stamp-no { right: 16px; color: var(--hot); rotate: 10deg; opacity: var(--no, 0); }
.sort-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; border-radius: 999px;
  font-weight: 750; font-size: 1rem; transition: transform .3s var(--spring);
}
.choice:active { transform: scale(.95); }
.choice-no { box-shadow: inset 0 0 0 1px rgb(255 138 61 / .55); color: #ffb37a; }
.choice-yes { background: var(--acid); color: var(--acid-ink); }
.sort-feedback { min-height: 4.6em; margin-top: 16px; color: var(--ink-2); line-height: 1.4; }
.sort-feedback b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.sort-feedback.good b { color: var(--acid); }
.sort-feedback.bad b { color: var(--hot); }
.sort-end {
  position: absolute; inset: 0; z-index: 3; display: grid; align-content: center; justify-items: start; gap: 16px; padding: 24px;
  background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.sort-end[hidden] { display: none; }
.end-score { font-size: clamp(6rem, 30vw, 10rem); font-weight: 800; line-height: .8; letter-spacing: -.06em; }
.end-score b { color: var(--acid); font-weight: 800; }
.end-score span { color: var(--ink-3); font-size: .4em; letter-spacing: -.03em; }
.end-msg { font-size: 1.3rem; font-weight: 700; max-width: 22ch; letter-spacing: -.02em; }
.sort-game.shake { animation: shake .45s; }
@keyframes shake { 20% { translate: -8px; } 40% { translate: 7px; } 60% { translate: -5px; } 80% { translate: 3px; } }

/* ---------- mini-jeu : la loupe ---------- */
.loupe { padding: clamp(100px, 16vw, 200px) var(--gutter); display: grid; gap: 28px; }
.loupe-head .lead { margin-top: 20px; }
.loupe-scene { position: relative; width: 100%; max-width: 640px; justify-self: center; aspect-ratio: 4 / 5; touch-action: none; cursor: none; outline-offset: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.loupe-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loupe-hint {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: rgb(17 11 7 / .7); font: 500 .66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .07em;
  transition: opacity .5s; pointer-events: none;
}
.loupe-hint.off { opacity: 0; }
.loupe-side { display: grid; gap: 18px; align-content: start; }
.roster { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.roster li { position: relative; aspect-ratio: 1; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; }
.roster canvas { width: 78%; height: 78%; filter: brightness(0) invert(.3); opacity: .55; transition: filter .6s, opacity .6s; }
.roster li.found { box-shadow: inset 0 0 0 1px var(--acid); }
.roster li.found canvas { filter: none; opacity: 1; }
.specimen { min-height: 9.5em; padding-top: 16px; border-top: 1px solid var(--line); }
.specimen.pop { animation: rise-in .5s var(--ease); }
.specimen-latin { font: 500 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--acid); font-style: normal; }
.specimen h3 { margin-top: 10px; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.specimen p:last-child { margin-top: 10px; color: var(--ink-2); max-width: 38ch; }
.loupe-side .btn { justify-self: start; }
.loupe-side .btn[hidden] { display: none; }

/* ---------- docteur ---------- */
.doctor { padding: clamp(100px, 16vw, 200px) var(--gutter); display: grid; gap: 40px; }
.doctor-head .lead { margin-top: 20px; }
.ailments { border-top: 1px solid var(--line); }
.ail { border-bottom: 1px solid var(--line); }
.ail > button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; text-align: left;
  font-size: clamp(1.6rem, 6.4vw, 3.6rem); font-weight: 800; line-height: 1; letter-spacing: -.04em; transition: color .3s, padding .5s var(--ease);
}
.ail > button .ic { width: 28px; height: 28px; color: var(--ink-3); transition: transform .5s var(--ease), color .3s; }
.ail > button[aria-expanded="true"] { color: var(--acid); }
.ail > button[aria-expanded="true"] .ic { transform: rotate(45deg); color: var(--acid); }
@media (hover: hover) { .ail > button:hover { padding-left: 12px; } }
.ail-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.ail-body > div { overflow: hidden; display: grid; gap: 14px; visibility: hidden; transition: visibility .6s; }
.ail.open .ail-body { grid-template-rows: 1fr; }
.ail.open .ail-body > div { visibility: visible; padding-bottom: 26px; }
.ail-body p { max-width: 44ch; color: var(--ink-2); font-size: 1.08rem; }
.ail-body b { display: block; margin-bottom: 4px; font: 600 .66rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }

/* ---------- prêt ---------- */
.ready { padding: clamp(110px, 18vw, 220px) var(--gutter) clamp(100px, 14vw, 180px); display: grid; gap: 28px; justify-items: start; }
.ready-text { max-width: 20ch; }
.ready-sub { font-size: clamp(1.1rem, 1.6vw, 1.4rem); color: var(--ink-2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 820px; margin: 40px 0 16px; }
.fact { padding-top: 16px; border-top: 1px solid var(--line-2); }
.fact-num { font-size: clamp(3.6rem, 15vw, 9rem); font-weight: 800; line-height: .85; letter-spacing: -.06em; color: var(--acid); }
.fact p:last-child { margin-top: 12px; color: var(--ink-2); font-size: .98rem; max-width: 30ch; }

/* ---------- pied de page ---------- */
.foot { overflow: clip; padding-bottom: calc(env(safe-area-inset-bottom) + 28px); border-top: 1px solid var(--line); }
.marquee { overflow: hidden; padding: 28px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee-track span {
  padding-right: .6em; white-space: nowrap; font-size: clamp(3.4rem, 12vw, 10rem); font-weight: 800; letter-spacing: -.05em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px var(--ink-3);
}
.marquee-track span:nth-child(odd) { color: var(--ink); -webkit-text-stroke: 0; }
@keyframes marquee { to { transform: translateX(-50%); } }
.foot-row { display: grid; gap: 14px; padding: 0 var(--gutter); }
.foot-mark { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; }
.foot-note { color: var(--ink-2); max-width: 40ch; }

/* ---------- effets ---------- */
.pour-ghost { position: absolute; z-index: 4; width: 34px; height: 34px; margin: -40px 0 0 -17px; pointer-events: none; opacity: 0; transition: opacity .2s; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .5)); }
.pour-ghost.on { opacity: .9; }
.flyer { position: fixed; z-index: 60; pointer-events: none; width: 44px; height: 44px; }
.reveal { opacity: 0; translate: 0 30px; }

/* ---------- grand écran ---------- */
@media (min-width: 1000px) {
  .nav-links { display: flex; }
  .hero {
    grid-template-columns: minmax(0, 1fr) min(38vw, 560px) 190px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    column-gap: 36px; row-gap: 24px; padding: 104px var(--gutter) 28px;
  }
  .hero-title { grid-column: 1 / 3; grid-row: 1; margin-bottom: 0; padding-left: 0; font-size: clamp(5rem, 9.6vw, 10.5rem); }
  .hero-lead { display: block; grid-column: 1; grid-row: 2; font-size: 1.2rem; color: var(--ink-2); max-width: 30ch; }
  .viv { grid-column: 2; grid-row: 1 / 5; --under: 56px; }
  .dock { grid-column: 1; grid-row: 3; align-self: end; max-width: 460px; }
  .voice { grid-column: 1; grid-row: 4; max-width: 460px; }
  .tiles { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; }
  .zones { right: -190px; }
  .zone { right: 0; justify-items: start; text-align: left; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; width: 170px; }
  .zone::before { right: auto; left: -150px; width: 140px; }
  .zone::after { right: auto; left: -152px; }
  .zone > span { display: block; font-size: .9rem; }
  .gauges { min-width: 168px; font-size: .7rem; gap: 6px; }

  .cycle-pin { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: 64px; padding-bottom: 56px; }
  .cycle-title { grid-column: 1 / 3; }
  .cycle-stage { grid-column: 2; grid-row: 2; }
  .cycle-copy { grid-column: 1; grid-row: 2; align-self: end; }
  .cycle-canvas { width: min(100%, 64svh, 620px); }

  .swatches { grid-template-columns: 1fr auto 1fr; gap: 40px; align-items: start; }
  .swatch-eq { display: block; align-self: center; margin-top: -10%; }
  .needs { grid-template-columns: repeat(3, 1fr); column-gap: 40px; border-top: 0; }
  .need { border-top: 1px solid var(--line); border-bottom: 0; }

  .sort { grid-template-columns: 1fr minmax(0, 460px); align-items: center; column-gap: 80px; }
  .loupe { grid-template-columns: minmax(0, 640px) 1fr; grid-template-rows: auto 1fr; column-gap: 72px; row-gap: 32px; }
  .loupe-head { grid-column: 2; grid-row: 1; align-self: end; }
  .loupe-scene { grid-column: 1; grid-row: 1 / 3; }
  .loupe-side { grid-column: 2; grid-row: 2; }
  .doctor { grid-template-columns: 1fr 1.5fr; column-gap: 80px; align-items: start; }
  .doctor-head { position: sticky; top: 120px; }
  .foot-row { grid-template-columns: 1fr auto; align-items: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; translate: none; }
}
