/* Accueil « quasi 3D » : un vrai monde jouable dans une fenêtre inclinée en perspective, décor flottant en parallaxe,
   sections qui se déplient dans la profondeur. Chargé après app.css. */

body.home-page { background: radial-gradient(120% 80% at 70% 0%, #e9eef6 0%, var(--bg) 55%); overflow-x: clip; }
.home { max-width: 1320px; }

/* ---------- scène d'accueil ---------- */
.hero3d { --mx: 0; --my: 0; position: relative; display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.6fr); gap: 36px; align-items: center;
  min-height: min(780px, calc(100svh - 64px)); padding: 28px 0 40px; perspective: 1500px; perspective-origin: 62% 40%; }
.h3-bg { position: absolute; inset: -20px -60px 0; pointer-events: none; transform-style: preserve-3d; z-index: 0; }
.h3-floor { position: absolute; left: -10%; right: -10%; bottom: -6%; height: 58%; transform-origin: 50% 100%; transform: rotateX(68deg) translateZ(-40px);
  background-image: linear-gradient(rgba(15, 107, 122, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 107, 122, .22) 1px, transparent 1px);
  background-size: 64px 64px; background-position: calc(var(--mx) * 40px) 0; animation: h3-scroll 9s linear infinite;
  -webkit-mask-image: linear-gradient(to top, #000 15%, transparent 92%); mask-image: linear-gradient(to top, #000 15%, transparent 92%); }
@keyframes h3-scroll { to { background-position: calc(var(--mx) * 40px) 64px; } }
.h3-layer { position: absolute; transform-style: preserve-3d; --d: 30; transform: translate3d(calc(var(--mx) * var(--d) * -1px), calc(var(--my) * var(--d) * -.6px), 0); will-change: transform; }
.h3-layer .hv-obj { position: relative; }
.h3-layer .hv-cube { left: auto; top: auto; --s: 64px; }
.h3-layer .hv-orb { right: auto; top: auto; }
.h3-layer .hv-portal { left: auto; top: auto; margin: 0; }
.hero3d .hv-tag { position: absolute; }

.h3-copy { position: relative; z-index: 2; transform: translateZ(60px); }
.h3-copy h1 { font-size: clamp(2rem, 3.6vw, 3.2rem); margin: 16px 0 14px; }
.h3-copy .lead { font-size: 1.02rem; margin-bottom: 22px; }
.h3-copy .hero-actions .btn { flex: 0 0 auto; }

/* ---------- fenêtre sur le monde ---------- */
.h3-stage { position: relative; z-index: 1; transform-style: preserve-3d; }
.vp { --rx: 4; --ry: -9; --lift: 0; position: relative; border-radius: 22px; background: #10131c; padding: 0; transform-style: preserve-3d; transform-origin: 30% 50%;
  transform: rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg)) translateZ(calc(var(--lift) * 1px)); will-change: transform;
  box-shadow: calc(var(--ry) * -2.2px) 40px 80px -30px rgba(16, 19, 28, .55), 0 0 0 1px rgba(255, 255, 255, .06) inset, 0 2px 0 rgba(255, 255, 255, .5) inset; }
.vp::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: -34px; height: 40px; background: radial-gradient(ellipse at center, rgba(16, 19, 28, .35), transparent 70%); transform: translateZ(-60px); filter: blur(6px); pointer-events: none; }
.vp-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: #c9d1e0; font-size: .8rem; }
.vp-dots { display: flex; gap: 6px; } .vp-dots i { width: 9px; height: 9px; border-radius: 50%; background: #3a4152; }
.vp-dots i:first-child { background: #ff5f57; } .vp-dots i:nth-child(2) { background: #febc2e; } .vp-dots i:nth-child(3) { background: #28c840; }
.vp-title { flex: 1; text-align: center; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-state { font-size: .72rem; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: #232a3a; color: #9fb0c9; }
.vp-state.live { background: rgba(40, 200, 64, .16); color: #5fe07d; }
.vp-screen { position: relative; aspect-ratio: 16 / 9.4; overflow: hidden; border-radius: 0 0 22px 22px; background: linear-gradient(180deg, #dfe4ee, #c4ccd9); }
.vp-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; opacity: 0; transition: opacity .5s; }
.vp-screen.ready iframe { opacity: 1; }
.vp-loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: #475467; font-weight: 600; transition: opacity .4s; }
.vp-screen.ready .vp-loading { opacity: 0; pointer-events: none; }
.vp-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(15, 107, 122, .25); border-top-color: var(--accent); animation: h3-spin .9s linear infinite; }
@keyframes h3-spin { to { transform: rotate(360deg); } }
.vp-fs { position: absolute; right: 12px; bottom: 12px; z-index: 5; opacity: 0; transition: opacity .2s; }
.vp-screen:hover .vp-fs, .vp-fs:focus-visible, .vp-screen:fullscreen .vp-fs { opacity: 1; }
.vp-screen:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.vp-screen:-webkit-full-screen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }

/* barre d'outils sous la fenêtre */
.vp-dock { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px 12px; transform: translateZ(24px); }
.vp-worlds { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vp-chip { font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 13px; border-radius: 999px; border: 1px solid #343c50; background: #1a2030; color: #c9d1e0; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.vp-chip:hover { background: #232b3f; color: #fff; }
.vp-chip[aria-pressed="true"] { background: #fff; color: #10131c; border-color: #fff; }
.vp-dock select.vp-chip { appearance: none; padding-right: 13px; max-width: 190px; }
.vp-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.vp .btn { background: #1a2030; border-color: #343c50; color: #e3e8f2; box-shadow: none; }
.vp .btn:hover { background: #232b3f; color: #fff; }
.vp .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.vp .btn.on { background: #fff; color: #10131c; }
.vp-hint { flex-basis: 100%; margin: 2px 2px 0; font-size: .76rem; color: #8b96ad; }
.vp-hint kbd { background: #232a3a; border-color: #343c50; color: #c9d1e0; }

/* ---------- apparition en profondeur ---------- */
.rv { opacity: 0; transform: perspective(1000px) translate3d(0, 34px, -60px) rotateX(9deg); transition: opacity .7s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }
.tilt { transform-style: preserve-3d; }
.tilt.tilting { transition: transform .08s linear, box-shadow .25s, border-color .25s; transform: perspective(800px) rotateX(calc(var(--tx, 0) * 1deg)) rotateY(calc(var(--ty, 0) * 1deg)) translateZ(10px); box-shadow: var(--shadow); }
.features .feature, .steps li, .cards .card { backface-visibility: hidden; }
.feature .fi { transform: translateZ(26px); }
.section-head h2::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--accent); transform: rotate(45deg) translateY(-1px); border-radius: 2px; }

@media (max-width: 1000px) {
  .hero3d { grid-template-columns: minmax(0, 1fr); min-height: 0; perspective-origin: 50% 30%; }
  .h3-copy, .h3-stage { min-width: 0; }
  .vp { transform: none !important; }
  .vp-screen { aspect-ratio: 4 / 4.2; }
  .vp-tools { margin-left: 0; }
  .vp-hint { display: none; }
  .h3-copy { transform: none; }
  .vp { --lift: 0; }
  .h3-bg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .h3-floor, .vp-spin { animation: none; }
  .rv { opacity: 1; transform: none; transition: none; }
  .h3-layer { transform: none; }
}
