/* MARVIX AI World — scoped stylesheet. Every selector is prefixed .mxa- and nested under .mxa-root; no globals, no resets. */
.mxa-root {
  --mxa-ink: #0c1626; --mxa-ink-soft: #3c4a5e; --mxa-pearl: #edf0f4; --mxa-blue: #1f6fff; --mxa-gold: #e08a12; --mxa-p: 0;
  position: relative; height: 850vh; background: var(--mxa-pearl); color: var(--mxa-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased;
  isolation: isolate;
}
.mxa-root *, .mxa-root *::before, .mxa-root *::after { box-sizing: border-box; }
.mxa-root[data-mxa-mode="reduced"], .mxa-root[data-mxa-state="fallback"] { height: auto; }

.mxa-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--mxa-pearl); }
.mxa-root[data-mxa-mode="reduced"] .mxa-stage { position: relative; }
.mxa-root[data-mxa-state="fallback"] .mxa-stage { display: none; }
.mxa-canvas-host { position: absolute; inset: 0; }
.mxa-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.mxa-vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 42%, rgba(237,240,244,0) 62%, rgba(237,240,244,.38) 100%), linear-gradient(to top, rgba(237,240,244,.4), rgba(237,240,244,0) 20%); }

.mxa-ui { position: absolute; inset: 0; pointer-events: none; transition: opacity .8s ease; }
.mxa-root[data-mxa-state="loading"] .mxa-ui { opacity: 0; }

/* top bar */
.mxa-top { position: absolute; left: clamp(20px, 5vw, 72px); right: clamp(20px, 5vw, 72px); top: clamp(18px, 4vh, 40px); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.mxa-brand, .mxa-chapter, .mxa-eyebrow, .mxa-state-k, .mxa-label span, .mxa-note, .mxa-btn, .mxa-rail-t { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; }
.mxa-brand { color: var(--mxa-ink); }
.mxa-chapter { color: var(--mxa-ink-soft); transition: opacity .4s; text-align: right; }

/* typographic beats */
.mxa-beat { position: absolute; left: clamp(20px, 5vw, 72px); bottom: clamp(60px, 13vh, 130px); max-width: min(560px, 88vw); opacity: 0; visibility: hidden; will-change: opacity, transform; }
.mxa-beat::before { content: ""; position: absolute; inset: -40px -60px -34px -50px; z-index: -1; background: radial-gradient(closest-side, rgba(237,240,244,.74), rgba(237,240,244,.34) 66%, rgba(237,240,244,0)); }
.mxa-eyebrow { margin: 0 0 14px; color: var(--mxa-blue); }
.mxa-title { margin: 0 0 14px; font-weight: 300; font-size: clamp(30px, 4.6vw, 66px); line-height: 1.04; letter-spacing: -.02em; color: var(--mxa-ink); }
.mxa-line { margin: 0; font-size: clamp(14px, 1.25vw, 17px); line-height: 1.6; color: var(--mxa-ink-soft); max-width: 46ch; }
.mxa-hero { bottom: auto; top: 50%; margin-top: -90px; }

/* scenario captions (stage 3) */
.mxa-scn { position: absolute; left: clamp(20px, 5vw, 72px); bottom: clamp(60px, 11vh, 110px); width: min(440px, 88vw); height: 96px; opacity: 0; visibility: hidden; }
.mxa-scn::before { content: ""; position: absolute; inset: -26px -44px -20px -36px; z-index: -1; background: radial-gradient(closest-side, rgba(237,240,244,.72), rgba(237,240,244,.32) 68%, rgba(237,240,244,0)); }
.mxa-state { position: absolute; left: 0; right: 0; top: 0; opacity: 0; visibility: hidden; }
.mxa-state-k { margin: 0 0 8px; color: var(--mxa-gold); }
.mxa-state-t { margin: 0; font-size: clamp(15px, 1.5vw, 20px); line-height: 1.45; font-weight: 400; color: var(--mxa-ink); }

/* finale */
.mxa-final { position: absolute; left: 0; right: 0; bottom: clamp(56px, 9vh, 100px); display: flex; justify-content: center; text-align: center; opacity: 0; visibility: hidden; }
.mxa-final-in { position: relative; display: grid; justify-items: center; gap: 12px; padding: 0 20px; }
.mxa-final-in::before { content: ""; position: absolute; inset: -30px -90px -26px; z-index: -1; background: radial-gradient(closest-side, rgba(237,240,244,.74), rgba(237,240,244,.34) 66%, rgba(237,240,244,0)); }
.mxa-sig { width: clamp(64px, 7vw, 100px); height: auto; display: block; }
.mxa-wordmark { margin: 0; font-size: 12px; letter-spacing: .5em; text-transform: uppercase; font-weight: 700; color: var(--mxa-ink); padding-left: .5em; }
.mxa-final-line { margin: 0; font-weight: 300; font-size: clamp(22px, 3.2vw, 44px); letter-spacing: .01em; line-height: 1.1; color: var(--mxa-ink); }
.mxa-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; pointer-events: none; }
.mxa-controls:not([inert]) { pointer-events: auto; }
.mxa-btn { appearance: none; border: 1px solid rgba(12,22,38,.28); background: rgba(255,255,255,.72); color: var(--mxa-ink); padding: 11px 18px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .2s, border-color .2s, transform .2s; font-family: inherit; }
.mxa-btn:hover { background: #fff; border-color: var(--mxa-blue); }
.mxa-btn:focus-visible { outline: 2px solid var(--mxa-blue); outline-offset: 3px; }
.mxa-controls-k { flex-basis: 100%; margin: 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mxa-ink-soft); }

/* disclosure note */
.mxa-note { position: absolute; right: clamp(20px, 5vw, 72px); bottom: clamp(14px, 3vh, 30px); max-width: 36ch; text-align: right; letter-spacing: .06em; text-transform: none; font-size: 11px; font-weight: 500; line-height: 1.5; color: var(--mxa-ink-soft); opacity: 0; visibility: hidden; }

/* labels pinned to world points */
.mxa-label { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; will-change: left, top, opacity; }
.mxa-label::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--mxa-blue); box-shadow: 0 0 0 4px rgba(31,111,255,.18); }
.mxa-label span { position: absolute; left: 14px; top: -8px; white-space: nowrap; color: var(--mxa-ink); background: rgba(255,255,255,.8); padding: 5px 9px; border-radius: 3px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-size: 10px; }
.mxa-label[data-tone="warm"]::before { background: var(--mxa-gold); box-shadow: 0 0 0 4px rgba(224,138,18,.2); }

/* progress rail */
.mxa-rail { position: absolute; right: clamp(14px, 2.4vw, 34px); top: 50%; transform: translateY(-50%); height: min(46vh, 360px); width: 22px; pointer-events: none; }
.mxa-rail::before { content: ""; position: absolute; right: 4px; top: 0; bottom: 0; width: 1px; background: rgba(12,22,38,.18); }
.mxa-rail::after { content: ""; position: absolute; right: 3px; top: 0; width: 3px; height: calc(var(--mxa-p) * 100%); background: linear-gradient(var(--mxa-blue), var(--mxa-gold)); border-radius: 2px; }
.mxa-rail-t { position: absolute; right: 14px; transform: translateY(-50%); color: var(--mxa-ink-soft); font-size: 10px; }
.mxa-root[data-mxa-mode="reduced"] .mxa-rail { display: none; }

/* loader */
.mxa-loader { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 16px; background: var(--mxa-pearl); transition: opacity .9s ease, visibility .9s; z-index: 5; }
.mxa-loader-t { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; font-weight: 600; color: var(--mxa-ink-soft); }
.mxa-loader-bar { width: 160px; height: 2px; background: rgba(12,22,38,.12); overflow: hidden; border-radius: 2px; }
.mxa-loader-bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--mxa-blue); animation: mxa-load 1.4s ease-in-out infinite; }
@keyframes mxa-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.mxa-root:not([data-mxa-state="loading"]) .mxa-loader { opacity: 0; visibility: hidden; pointer-events: none; }
.mxa-root[data-mxa-state="context-lost"] .mxa-loader { opacity: 1; visibility: visible; }
.mxa-root[data-mxa-state="context-lost"] .mxa-loader-t::after { content: " — restoring"; }
@media (prefers-reduced-motion: reduce) { .mxa-loader-bar::after { animation: none; width: 100%; opacity: .4; } .mxa-ui { transition: none; } }

/* reduced-motion stepper */
.mxa-steps { position: absolute; left: 50%; bottom: clamp(16px, 3.4vh, 32px); transform: translateX(-50%); display: none; align-items: center; gap: 14px; pointer-events: auto; }
.mxa-root[data-mxa-mode="reduced"]:not([data-mxa-state="fallback"]) .mxa-steps { display: flex; }
.mxa-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 1px solid var(--mxa-ink-soft); background: transparent; cursor: pointer; }
.mxa-dot.is-on { background: var(--mxa-blue); border-color: var(--mxa-blue); }
.mxa-dot:focus-visible { outline: 2px solid var(--mxa-blue); outline-offset: 3px; }
.mxa-root[data-mxa-mode="reduced"] .mxa-beat, .mxa-root[data-mxa-mode="reduced"] .mxa-state, .mxa-root[data-mxa-mode="reduced"] .mxa-final, .mxa-root[data-mxa-mode="reduced"] .mxa-note, .mxa-root[data-mxa-mode="reduced"] .mxa-label { transition: opacity .25s linear; }

/* skip link */
.mxa-skip { position: absolute; left: 12px; top: 12px; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; z-index: 20; background: #fff; color: var(--mxa-ink); padding: 10px 14px; border-radius: 4px; font-size: 13px; text-decoration: none; }
.mxa-skip:focus { clip-path: none; width: auto; height: auto; overflow: visible; }

/* static fallback presentation (no WebGL / module failure / no JS) */
.mxa-fallback { display: none; background: var(--mxa-pearl); padding: clamp(56px, 10vh, 120px) clamp(20px, 5vw, 72px); }
.mxa-root[data-mxa-state="fallback"] .mxa-fallback { display: block; }
.mxa-fallback-in { max-width: 1120px; margin: 0 auto; display: grid; gap: clamp(36px, 7vh, 80px); }
.mxa-fig { margin: 0; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .mxa-fig { grid-template-columns: 1.35fr 1fr; align-items: center; } .mxa-fig:nth-child(even) .mxa-fig-img { order: 2; } }
.mxa-fig-img { width: 100%; height: auto; display: block; border-radius: 6px; background: #dfe4ea; box-shadow: 0 18px 50px rgba(12,22,38,.12); aspect-ratio: 16 / 9; object-fit: cover; }
.mxa-fig .mxa-eyebrow { margin-bottom: 10px; }
.mxa-fallback-why { margin: 0; font-size: 12px; color: var(--mxa-ink-soft); }
.mxa-fallback-final { text-align: center; display: grid; justify-items: center; gap: 14px; padding-top: 12px; }

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

@media (max-width: 640px) {
  .mxa-rail { display: none; }
  .mxa-beat::before { inset: -30px -24px -26px -24px; }
  .mxa-hero { margin-top: -120px; }
  .mxa-note { left: 20px; right: 20px; max-width: none; text-align: left; bottom: 10px; font-size: 10px; }
  .mxa-label span { font-size: 9px; padding: 4px 7px; }
  .mxa-scn { bottom: 84px; }
}

@media (max-width: 900px) { .mxa-note { left: 20px; right: 20px; max-width: none; text-align: left; bottom: 10px; } .mxa-scn { bottom: 92px; } .mxa-beat { bottom: 70px; } }

.mxa-title, .mxa-line, .mxa-state-t, .mxa-final-line, .mxa-wordmark, .mxa-eyebrow { text-shadow: 0 0 14px rgba(237,240,244,.95), 0 0 3px rgba(237,240,244,.9); }

/* ---- refinement: calm cream text zones (feathered, never an opaque box) — fade the scene behind each text change ---- */
.mxa-beat::before { inset: -46px -72px -40px -60px; background: radial-gradient(closest-side, rgba(244,243,239,.92) 0%, rgba(244,243,239,.9) 40%, rgba(244,243,239,.6) 72%, rgba(244,243,239,0) 100%); }
.mxa-scn::before { inset: -34px -56px -28px -46px; background: radial-gradient(closest-side, rgba(244,243,239,.92) 0%, rgba(244,243,239,.88) 42%, rgba(244,243,239,.58) 72%, rgba(244,243,239,0) 100%); }
.mxa-final-in::before { inset: -36px -110px -30px; background: radial-gradient(closest-side, rgba(244,243,239,.92) 0%, rgba(244,243,239,.88) 42%, rgba(244,243,239,.58) 72%, rgba(244,243,239,0) 100%); }
.mxa-title, .mxa-line, .mxa-state-t, .mxa-final-line, .mxa-wordmark, .mxa-eyebrow { text-shadow: 0 0 10px rgba(244,243,239,.9); }

/* ---- refinement: keep every caption clear of the three persistent assistants (shared .bot design untouched; only AION's own content moves) ---- */
.mxa-root { --mxa-bots: 214px; }
.mxa-beat { bottom: max(clamp(60px, 13vh, 130px), var(--mxa-bots)); }
.mxa-scn { bottom: max(clamp(60px, 11vh, 110px), var(--mxa-bots)); }
.mxa-final { bottom: max(clamp(56px, 9vh, 100px), var(--mxa-bots)); }
.mxa-note { right: clamp(20px, 5vw, 72px); bottom: calc(var(--mxa-bots) + 2px); }
@media (max-width: 1180px) { .mxa-note { max-width: 24ch; } }
@media (max-height: 640px) { .mxa-root { --mxa-bots: 208px; } .mxa-sig { width: clamp(44px, 5vw, 64px); } .mxa-final-in { gap: 8px; } }
@media (max-height: 560px) { .mxa-sig { display: none; } }
@media (max-width: 900px) { .mxa-root { --mxa-bots: 176px; } .mxa-beat { bottom: max(70px, var(--mxa-bots)); } .mxa-scn { bottom: max(92px, var(--mxa-bots)); } .mxa-note { right: 20px; left: 20px; max-width: none; text-align: left; bottom: calc(var(--mxa-bots) + 2px); } .mxa-beat { bottom: calc(var(--mxa-bots) + 64px); } .mxa-scn { bottom: calc(var(--mxa-bots) + 64px); } .mxa-final { bottom: calc(var(--mxa-bots) + 64px); } }

/* disclosure note + chapter label get the same feathered cream zone, so they stay legible over busy city / foliage */
.mxa-note, .mxa-chapter, .mxa-brand { isolation: isolate; }
.mxa-note::before, .mxa-chapter::before { content: ""; position: absolute; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(244,243,239,.9) 0%, rgba(244,243,239,.86) 45%, rgba(244,243,239,.5) 76%, rgba(244,243,239,0) 100%); }
.mxa-note::before { inset: -22px -46px -18px -40px; }
.mxa-chapter { position: relative; }
.mxa-chapter::before { inset: -16px -48px -14px -40px; }

/* brand / chapter row sits under the real (measured) header bottom, whatever height the host header has at this width */
.mxa-root .mxa-top { top: var(--mxa-hdr, 170px) !important; }
