/* La maquette 3D. Elle vit à deux endroits et se déplace de l'un à l'autre : à côté du grand
   titre, puis dans la section « Échelle ». Sur téléphone, elle passe au-dessus du texte. */
.stage-slot { position: relative; min-width: 0; }
.stage3d { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--expo, ease); cursor: grab; touch-action: pan-y; }
.stage3d.on { opacity: 1; } .stage3d.grab { cursor: grabbing; }
.stage3d::before { content: ""; position: absolute; inset: 12% 8% 4%; border-radius: 50%; background: radial-gradient(closest-side, rgba(143, 155, 255, .24), transparent 72%); filter: blur(30px); pointer-events: none; }
.stage3d canvas { position: relative; width: 100%; height: 100%; display: block; }
.stage-name { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font: 500 11.5px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; opacity: 0; pointer-events: none; }
.stage-name.in { animation: nameIn 1s var(--expo, ease) .25s forwards; }
:root[lang="ar"] .stage-name { letter-spacing: 0; font-size: 14px; }
@keyframes nameIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* accueil : le titre à gauche, la maquette à droite */
.hero-grid.has3d { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(16px, 3vw, 48px); }
.hero-grid.has3d .hero-left h1 { max-width: 12ch; font-size: clamp(40px, 5vw, 82px); }
.hero-grid.has3d .hero-left .lead { margin-top: 26px; max-width: 46ch; }
.hero-grid.has3d .stage-slot { height: clamp(380px, 62vh, 620px); margin-inline-end: calc(var(--pad) * -.5); }
/* dans l'accueil, le nom de la situation se lit comme la fin de la phrase */
.stage3d.in-hero .stage-name { font: 400 clamp(20px, 2vw, 28px) var(--serif); letter-spacing: -.01em; text-transform: none; color: var(--ink); bottom: 0; }
.ready .hero .stage-slot { opacity: 1; transform: none; }
.hero .stage-slot { opacity: 0; transform: translateY(26px) scale(.96); transition: opacity 1.4s var(--expo, ease) .35s, transform 1.4s var(--expo, ease) .35s; }

/* section « Échelle » */
.split.with3d { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-areas: "steps stage" "card stage"; grid-template-rows: auto 1fr; column-gap: clamp(20px, 4vw, 64px); row-gap: 22px; align-items: start; }
.split.with3d .steps { grid-area: steps; flex-direction: row; flex-wrap: wrap; gap: 6px; }
.split.with3d .steps button { border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 15px; font-size: 14.5px; color: var(--ink-2); border-image: none; }
.split.with3d .steps button[aria-selected="true"] { background: var(--ink); color: #07080c; border-color: var(--ink); }
.split.with3d .card { grid-area: card; max-width: none; }
.split.with3d .stage-slot { grid-area: stage; height: clamp(420px, 70vh, 700px); }

@media (min-width: 901px) and (max-height: 860px) {
  .hero-grid.has3d .hero-left h1 { font-size: clamp(38px, 4.4vw, 66px); }
  .hero-grid.has3d .stage-slot { height: clamp(340px, 58vh, 520px); }
}
@media (max-width: 900px) {
  .hero-grid.has3d { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-grid.has3d .hero-left h1 { max-width: none; font-size: clamp(38px, 10.6vw, 60px); }
  .hero-grid.has3d .stage-slot { order: -1; height: min(78vw, 340px); margin: -18px calc(var(--pad) * -1) 6px; }
  .split.with3d { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "steps" "card"; row-gap: 14px; }
  .split.with3d .steps { flex-wrap: nowrap; }
  .split.with3d .stage-slot { height: min(86vw, 400px); margin: -10px calc(var(--pad) * -1) 0; }
}
@media (prefers-reduced-motion: reduce) { .hero .stage-slot { opacity: 1; transform: none; } }
