/* ============================================================
   process.css — Platypus Works · page « Le processus »
   Hérite de platypus-works.css + lego-theme.css.
   ============================================================ */

.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;
}

.proc-main { background: #fff; }

/* ── Démonstration : texte à gauche, plateau collant à droite ── */
.proc-hero {
  max-width: 1360px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 1rem) clamp(1.25rem, 3.5vw, 3rem) 3rem;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(1.5rem, 3.5vw, 4.5rem);
  align-items: start;
}

.proc-stage {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  height: min(calc(100svh - var(--nav-h) - 2rem), 800px);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  border: 3px solid var(--mist);
  background: #F5F9FF radial-gradient(circle, rgba(0,85,191,0.10) 2.5px, transparent 3px) 0 0 / 34px 34px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 60, 138, 0.12);
}

.proc-steps { grid-column: 1; grid-row: 1; padding-bottom: 12svh; }

.stage-top {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.85rem 1rem 0;
  position: relative; z-index: 2;
}
.stage-badge {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lego-blue); background: #fff; border: 2px solid var(--cloud);
  padding: 0.3rem 0.75rem; border-radius: 999px;
}
.stage-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.stage-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font: 600 0.76rem/1 var(--font-sans);
  padding: 0.55rem 0.9rem; border-radius: 999px;
  color: var(--lego-blue); background: #fff; border: 2px solid var(--cloud);
  cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.stage-btn:hover:not(:disabled) { border-color: var(--lego-blue); }
.stage-btn:active:not(:disabled) { transform: translateY(1px); }
.stage-btn[aria-pressed="true"] { background: var(--lego-blue); color: #fff; border-color: var(--lego-blue); }
.stage-btn[hidden] { display: none; }
.stage-btn:focus-visible, .stage-nav button:focus-visible, .story-pick button:focus-visible,
.rail-tabs button:focus-visible, .rail-list li:focus-visible {
  outline: 3px solid var(--lego-blue); outline-offset: 2px;
}

.stage-view { position: relative; flex: 1; min-height: 0; }
.stage-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Briques isométriques (SVG) */
.world .ib { transition: opacity 0.3s ease, transform 0.25s ease; }
.world .ib[data-from]:not(.in) { opacity: 0; pointer-events: none; }
.world .ib.in { animation: ib-drop 0.8s cubic-bezier(0.2, 0.9, 0.25, 1.12) backwards; animation-delay: calc(var(--i, 0) * 75ms); }
@keyframes ib-drop {
  from { transform: translateY(-90px); opacity: 0; }
}
.proc-stage[data-step="3"] .world .ib.in[data-m="tower"],
.proc-stage[data-step="3"] .world .ib.in[data-m="bridge"],
.proc-stage[data-step="3"] .world .ib.in[data-m="lone"] { cursor: pointer; }
.proc-stage[data-step="3"] .world .ib.in[data-m="tower"]:hover,
.proc-stage[data-step="3"] .world .ib.in[data-m="bridge"]:hover,
.proc-stage[data-step="3"] .world .ib.in[data-m="lone"]:hover { transform: translateY(-5px); }

.proc-stage[data-sel="tower"] .world .ib.in:not([data-m="tower"]):not(.plate-base),
.proc-stage[data-sel="bridge"] .world .ib.in:not([data-m="bridge"]):not(.plate-base),
.proc-stage[data-sel="lone"] .world .ib.in:not([data-m="lone"]):not(.plate-base) { opacity: 0.3; }

.pin { opacity: 0; transition: opacity 0.35s ease 0.15s; pointer-events: none; }
.pin.show { opacity: 1; }

/* Question de l'animateur (étape 1) : une bulle de parole, pas une carte */
.stage-q {
  position: absolute; left: 50%; top: 0.9rem;
  width: min(88%, 440px);
  transform: translate(-50%, -14px);
  opacity: 0; pointer-events: none;
  background: #fff; border-radius: 22px 22px 22px 6px;
  padding: 0.9rem 1.15rem 1rem;
  box-shadow: 0 14px 28px rgba(20, 33, 61, 0.16);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.1);
}
.stage-q p { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.4; color: var(--ink); }
.stage-q strong { color: var(--lego-red); font-weight: 600; }
.proc-stage[data-step="1"] .stage-q { opacity: 1; transform: translate(-50%, 0); }

/* Stepper */
.stage-nav {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem;
  padding: 0.75rem 1rem 1rem; position: relative; z-index: 2;
}
.stage-nav button {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem; border-radius: 14px;
  background: #fff; border: 2px solid transparent;
  font: 600 0.78rem/1.15 var(--font-sans); color: var(--text-mid); text-align: left;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.stage-nav button:hover { background: #F0F6FF; }
.stage-nav .n {
  flex: none; width: 1.55rem; height: 1.55rem; border-radius: 8px;
  display: grid; place-items: center; font-size: 0.8rem;
  background: var(--c); color: #fff;
}
.stage-nav button[data-go="1"] .n { color: var(--ink); }
.stage-nav .t-short { display: none; }
.stage-nav button.is-on { border-color: var(--c); background: #fff; color: var(--ink); box-shadow: 0 6px 14px rgba(0, 60, 138, 0.14); transform: translateY(-2px); }

/* ── Panneaux de texte ─────────────────────────────────────── */
.proc-panel {
  min-height: 76svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 2.5rem 0;
  opacity: 0.6; transition: opacity 0.5s ease;
  max-width: 34rem;
}
.proc-panel.is-active, .proc-panel:focus-within { opacity: 1; }
.proc-panel[data-panel="0"] { min-height: calc(100svh - var(--nav-h) - 2.25rem); }

.proc-panel h1 {
  font-size: clamp(2.3rem, 4.4vw, 4.1rem); font-weight: 500; line-height: 1.08;
  color: var(--ink); margin-bottom: 1.4rem; text-wrap: balance;
}
.proc-lead { font-size: 1.1rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 1.8rem; max-width: 32rem; }
.proc-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 1.5rem; }
.proc-note { font-size: 0.85rem; color: var(--text-muted); max-width: 30rem; }

.step-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.step-n {
  flex: none; width: 3rem; height: 3rem; border-radius: 14px;
  display: grid; place-items: center;
  font: 600 1.4rem/1 var(--font-serif);
  background: var(--c); color: var(--t);
  box-shadow: 0 8px 16px rgba(0, 60, 138, 0.18);
}
.proc-panel h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 500; color: var(--ink); }
.proc-panel p { font-size: 1.02rem; line-height: 1.75; color: var(--text-muted); margin-bottom: 1rem; }
.proc-panel p strong { color: var(--ink); font-weight: 600; }
.proc-panel .proc-aside { font-size: 0.92rem; color: var(--text-mid); padding-top: 0.5rem; }

.proc-flags { margin: 0.25rem 0 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.proc-flags li {
  position: relative; padding-left: 1.6rem;
  font-size: 0.98rem; color: var(--ink); line-height: 1.5;
}
.proc-flags li::before {
  content: ''; position: absolute; left: 0; top: 0.42em;
  width: 0.9rem; height: 0.55rem; border-radius: 2px; background: var(--lego-green);
}

.story-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.25rem 0 0.9rem; }
.story-pick button {
  font: 600 0.82rem/1 var(--font-sans); padding: 0.6rem 0.9rem; border-radius: 999px;
  color: var(--lego-blue); background: #fff; border: 2px solid var(--cloud); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.story-pick button:hover { border-color: var(--lego-blue); }
.story-pick button[aria-pressed="true"] { background: var(--lego-blue); color: #fff; border-color: var(--lego-blue); }

.story {
  min-height: 11.5rem;
  background: #F1F6FD; border-radius: 18px;
  padding: 1.1rem 1.25rem; margin-bottom: 0.75rem;
}
.story p { margin: 0; }
.story .story-hint { font-size: 0.95rem; color: var(--text-muted); }
.story .story-who { font: 600 0.88rem/1.3 var(--font-sans); color: var(--lego-blue); margin-bottom: 0.5rem; }
.story .story-say { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.45; color: var(--ink); margin-bottom: 0.8rem; }
.story .story-ask { font-size: 0.92rem; color: var(--text-mid); border-top: 2px dashed var(--cloud); padding-top: 0.7rem; }
.story .story-ask strong { color: var(--lego-red); font-weight: 600; }

/* ── Trame par problématique ───────────────────────────────── */
.rail-inner { max-width: 1200px; margin: 0 auto; padding: var(--section-pad) 0; }
.rail-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0 auto 1.5rem; }
.rail-tabs button {
  font: 600 0.92rem/1 var(--font-sans); padding: 0.8rem 1.2rem; border-radius: 999px;
  color: var(--text-mid); background: #fff; border: 2px solid var(--cloud); cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.rail-tabs button:hover { border-color: var(--lego-blue); }
.rail-tabs button.is-on { background: var(--lego-blue); color: #fff; border-color: var(--lego-blue); }
.rail-lead { text-align: center; max-width: 44rem; margin: 0 auto 2.25rem; font-size: 1.05rem; line-height: 1.7; color: var(--text-muted); min-height: 5.2em; }

.rail-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.rail-fig { display: flex; flex-direction: column; gap: 1rem; }
.rail-svg { width: 100%; height: auto; display: block; overflow: visible; }
.rail-cap { font-size: 0.85rem; color: var(--text-muted); text-align: center; }

.rail-brick, .rail-num { opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease; }
.rail-brick.in, .rail-num.in { opacity: 1; animation: ib-drop 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.12) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
.rail-svg.has-hl .rail-brick.in:not(.hl), .rail-svg.has-hl .rail-num.in:not(.hl) { opacity: 0.4; }
.rail-brick.hl, .rail-num.hl { transform: translateY(-6px); }
.rail-brick.ghost { opacity: 0.9; }
.rail-svg.leaving .rail-brick.in, .rail-svg.leaving .rail-num.in { opacity: 0; transform: translateY(-26px); }

.rail-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; counter-reset: none; }
.rail-list li {
  display: flex; gap: 0.9rem; align-items: flex-start;
  padding: 0.75rem 1rem; border-radius: 14px; border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.rail-list li.hl { background: #fff; border-color: var(--lego-blue); }
.rail-list .sw { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 6px; margin-top: 0.2rem; border: 2px solid rgba(20, 33, 61, 0.15); }
.rail-list .tx strong { display: block; font-size: 1rem; color: var(--ink); font-weight: 600; }
.rail-list .tx span { font-size: 0.88rem; line-height: 1.55; color: var(--text-muted); }

/* ── Ce qu'elle montre / ne promet pas ─────────────────────── */
.honest-inner {
  max-width: 1100px; margin: 0 auto;
  padding: var(--section-pad) 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem);
}
.honest-inner .section-title { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.honest-inner p { font-size: 1.02rem; line-height: 1.8; color: var(--text-muted); max-width: 32rem; }
.honest-inner a { color: var(--lego-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .proc-hero { display: block; padding: calc(var(--nav-h) + 0.25rem) 1.25rem 2rem; }
  .proc-stage {
    position: sticky; top: var(--nav-h); z-index: 20;
    height: 46svh; min-height: 330px; max-height: 480px;
    margin: 0 -1.25rem; border-radius: 0 0 24px 24px; border-width: 0 0 3px;
  }
  .stage-nav { padding: 0.5rem 0.75rem 0.7rem; gap: 0.35rem; }
  .stage-nav button { padding: 0.4rem 0.45rem; font-size: 0.72rem; gap: 0.35rem; }
  .stage-nav .t-long { display: none; }
  .stage-nav .t-short { display: inline; }
  .stage-top { padding: 0.55rem 0.75rem 0; }
  .stage-btn { padding: 0.45rem 0.7rem; font-size: 0.72rem; }
  .stage-q { top: 0.4rem; padding: 0.55rem 0.8rem 0.65rem; }
  .stage-q p { font-size: 0.95rem; }
  .proc-panel { min-height: 62svh; padding: 1.75rem 0; max-width: none; }
  .proc-panel[data-panel="0"] { min-height: 52svh; }
  .rail-grid { grid-template-columns: 1fr; }
  .rail-lead { min-height: 0; }
  .honest-inner { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .stage-nav .n { width: 0.75rem; height: 0.75rem; font-size: 0; border-radius: 3px; }
  .stage-nav button { gap: 0.4rem; padding: 0.5rem 0.55rem; font-size: 0.7rem; }
  .stage-btn .lbl { display: none; }
  .stage-badge { font-size: 0.7rem; }
  .rail-tabs button { font-size: 0.85rem; padding: 0.7rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .world .ib.in, .rail-brick.in, .rail-num.in { animation: none; }
  .stage-q, .pin, .proc-panel, .world .ib, .rail-brick, .rail-num { transition: none; }
}

/* Lisibilité mobile */
body.works .stage-badge, body.works .stage-nav .t-short, body.works .stage-nav .n { font-size: 0.8125rem; }
body.works .stage-btn { min-width: 44px; min-height: 44px; }
body.works .proc-panel strong, body.works .proc-lead strong { color: #1F3340; }
