/* ───────────────────────── Intedge UI ───────────────────────── */
:root {
  --ink: #06070b;
  --ink-2: #0d0f17;
  --pearl: #f4f2ee;
  --mist: #c9ccd6;
  --edge-a: #7b7bff;
  --edge-b: #4fe3ff;
  --edge-c: #ffb98a;
  --fg: #ffffff;
  --fg-dim: rgba(255, 255, 255, 0.62);
  --fg-faint: rgba(255, 255, 255, 0.32);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.13);
  --glass-line: rgba(255, 255, 255, 0.16);
  --glass-hi: rgba(255, 255, 255, 0.35);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --cta-bg: #f4f2ee;
  --cta-fg: #06070b;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: 'Geist Mono', ui-monospace, monospace;
  --sans: 'Geist', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
}
body[data-theme='light'] {
  --fg: #0b0c12;
  --fg-dim: rgba(11, 12, 18, 0.62);
  --fg-faint: rgba(11, 12, 18, 0.32);
  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(10, 12, 20, 0.10);
  --glass-hi: rgba(255, 255, 255, 0.9);
  --shadow: 0 10px 40px rgba(20, 24, 40, 0.12);
  --cta-bg: #0b0c12;
  --cta-fg: #f4f2ee;
}

#ui { font-family: var(--sans); color: var(--fg); -webkit-font-smoothing: antialiased; }
#ui * { box-sizing: border-box; }
:where(#ui) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
/* pointer-events are inherited: a container turns them on only while it is visible */
.hud-el.is-on { pointer-events: auto; }
.scroll-hint, .scroll-hint.is-on { pointer-events: none !important; }
#ui :focus-visible { outline: 2px solid var(--edge-b); outline-offset: 3px; }

/* glass recipe: layered fill + edge light + highlight, then backdrop blur */
.glass {
  position: relative;
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(0, 0, 0, 0.08), var(--shadow);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  transition: background 0.6s var(--ease), border-color 0.6s var(--ease), color 0.6s var(--ease);
}
.glass::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 30% -20%, rgba(255, 255, 255, 0.22), transparent 55%);
  mix-blend-mode: soft-light;
}

.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }

/* fade-in helpers */
.hud-el { opacity: 0; transition: opacity 0.8s var(--ease), translate 0.8s var(--ease); translate: 0 6px; }
.hud-el.is-on { opacity: 1; translate: 0 0; }

/* ── top-left menu button ── */
.hud-menu { position: fixed; top: 20px; left: 20px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.hud-menu svg { width: 16px; height: 16px; transition: transform 0.6s var(--ease); }
.hud-menu:hover svg { transform: translateY(2px); }

/* ── memory pill (top-right) ── */
.hud-memory { position: fixed; top: 20px; right: 20px; height: 40px; padding: 0 14px 0 10px; border-radius: 999px; display: flex; align-items: center; gap: 10px; }
.hud-memory .ring { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; opacity: 0.9; }
.hud-memory .ring::after { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--edge-b); top: -3px; right: -2px; box-shadow: 0 0 10px var(--edge-b); }
.hud-memory .label { color: var(--fg-dim); }
.hud-memory .count { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; min-width: 2ch; text-align: right; }
.hud-memory.flash { animation: memFlash 0.9s var(--ease); }
@keyframes memFlash { 0% { box-shadow: 0 0 0 0 rgba(79, 227, 255, 0.7), var(--shadow); } 100% { box-shadow: 0 0 0 16px rgba(79, 227, 255, 0), var(--shadow); } }
.hud-toast { position: fixed; top: 70px; right: 20px; max-width: 300px; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.35; opacity: 0; transform: translateY(-6px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); pointer-events: none; }
.hud-toast.is-on { opacity: 1; transform: none; }
.hud-toast b { display: block; font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.14em; color: var(--fg-dim); margin-bottom: 4px; }

/* ── ruler (top-center) ── */
.ruler { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); width: min(520px, 62vw); height: 52px; }
.ruler-window { position: absolute; inset: 0 0 18px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent); }
.ruler-track { position: absolute; top: 0; left: 50%; height: 100%; will-change: transform; }
.tick { position: absolute; bottom: 4px; width: 1px; background: var(--fg); opacity: 0.35; transform-origin: bottom; }
.tick.minor { height: 7px; }
.tick.major { height: 13px; opacity: 0.8; }
.tick-label { position: absolute; bottom: 20px; transform: translateX(-50%); white-space: nowrap; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--fg-dim); }
.ruler-indicator { position: absolute; left: 50%; bottom: 18px; width: 1.5px; height: 22px; background: var(--fg); transform: translateX(-50%); border-radius: 1px; box-shadow: 0 0 10px rgba(255,255,255,0.4); }
.ruler-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; }
.ruler-nav button { position: relative; font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--fg-faint); padding: 2px 4px; transition: color 0.4s var(--ease); }
.ruler-nav button:hover, .ruler-nav button.is-active { color: var(--fg); }
.ruler-nav button.is-loading::after { content: ''; position: absolute; right: -10px; top: 3px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--fg-dim); border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) { .ruler { width: 70vw; top: 12px; } .ruler-nav button { font-size: 8px; letter-spacing: 0.08em; } }

/* ── bottom bar ── */
.hud-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: 999px; }
.hud-bar .mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ffffff 0%, #c9d2ff 18%, #6f6cff 48%, #1f1d55 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), 0 0 18px rgba(111, 108, 255, 0.45); }
.hud-bar .mark i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.95); position: relative; }
.hud-bar .mark i::after { content: ''; position: absolute; width: 5px; height: 5px; background: #fff; border-radius: 50%; top: -4px; right: -3px; }
.hud-bar .cta { height: 38px; padding: 0 30px; border-radius: 999px; background: var(--cta-bg); color: var(--cta-fg) !important; font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em; transition: transform 0.4s var(--ease), background 0.6s var(--ease); white-space: nowrap; }
.hud-bar .cta:hover { transform: scale(1.03); }
.hud-bar .more { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.hud-bar .more span { display: block; width: 14px; height: 1.5px; background: currentColor; box-shadow: 0 5px 0 currentColor; transform: translateY(-2.5px); }

/* ── sound (bottom-right) ── */
.hud-sound { position: fixed; right: 20px; bottom: 24px; height: 36px; padding: 0 14px; border-radius: 999px; display: flex; align-items: center; gap: 10px; }
.hud-sound .bars { display: flex; align-items: center; gap: 2.5px; height: 14px; }
.hud-sound .bars i { width: 2px; height: 100%; background: currentColor; border-radius: 1px; transform-origin: center; animation: bar 1.1s ease-in-out infinite; }
.hud-sound .bars i:nth-child(2) { animation-delay: -0.3s; } .hud-sound .bars i:nth-child(3) { animation-delay: -0.6s; } .hud-sound .bars i:nth-child(4) { animation-delay: -0.9s; }
.hud-sound.is-off .bars i { animation: none; transform: scaleY(0.18); }
@keyframes bar { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }
@media (max-width: 767px) { .hud-sound { bottom: 82px; right: 14px; } .hud-sound .mono { display: none; } }

/* ── scroll hint ── */
.scroll-hint { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); height: 28px; padding: 0 14px; border-radius: 999px; display: flex; align-items: center; gap: 9px; font-size: 10px; }
.scroll-hint i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: bob 1.6s var(--ease) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(-2px); opacity: 0.4; } 50% { transform: translateY(2px); opacity: 1; } }
@media (max-width: 767px) { .scroll-hint { bottom: 80px; } }

/* ── hold button ── */
.hold { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; pointer-events: none; transition: opacity 0.5s var(--ease); }
.hold.is-on { opacity: 1; }
.hold.is-on .hold-btn { pointer-events: auto; }
.hold-hint { font-size: 10.5px; color: var(--fg-dim); white-space: nowrap; }
.hold-btn { position: relative; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.hold-btn svg { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.hold-btn .track { stroke: var(--fg-faint); }
.hold-btn .prog { stroke: var(--fg); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(79, 227, 255, 0.8)); }
.hold-btn .lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; line-height: 1.5; text-align: center; white-space: pre; }
.hold-btn.is-pressed { transform: scale(0.94); transition: transform 0.3s var(--ease); }
.hold-btn::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--fg); opacity: 0; }
.hold.is-on .hold-btn::before { animation: ripple 2.2s var(--ease) infinite; }
@keyframes ripple { 0% { transform: scale(1); opacity: 0.45; } 100% { transform: scale(1.7); opacity: 0; } }

/* ── loader ── */
.loader { position: fixed; left: 2.083vw; bottom: 3.7svh; display: flex; align-items: flex-end; gap: 1.2vw; color: #fff; pointer-events: none; }
.loader .odo { display: flex; font-family: var(--mono); font-weight: 400; font-size: 16.667svh; line-height: 1; letter-spacing: -0.04em; margin-bottom: -0.09em; }
.odo-box { display: inline-block; height: 1em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; }
.odo-strip span { display: block; height: 1em; line-height: 1; }
.loader .meta { padding-bottom: 1.6svh; display: flex; flex-direction: column; gap: 6px; }
.loader .meta .pct { font-family: var(--mono); font-size: 2.2svh; opacity: 0.85; }
.loader .meta .what { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); white-space: nowrap; }
.loader .wordmark { font-family: var(--serif); font-size: 13svh; line-height: 0.9; letter-spacing: -0.02em; display: none; }
@media (max-width: 767px) { .loader { left: 4.17vw; } .loader .odo { font-size: 10.185svh; } .loader .wordmark { font-size: 8svh; } }

.gesture-hint { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 18px; pointer-events: none; opacity: 0; transition: opacity 0.8s var(--ease); color: #fff; }
.gesture-hint.is-on { opacity: 1; }
.gesture-hint svg { width: 120px; height: 120px; overflow: visible; }
.gesture-hint .ghost { stroke: rgba(255,255,255,0.55); stroke-width: 1.5; fill: none; stroke-dasharray: 340; stroke-dashoffset: 340; animation: ghost 2.6s var(--ease) infinite; }
.gesture-hint .dot { fill: #fff; filter: drop-shadow(0 0 6px #fff); offset-path: path('M60 6 A54 54 0 1 1 59.9 6'); animation: dotrun 2.6s var(--ease) infinite; }
@keyframes ghost { 0% { stroke-dashoffset: 340; opacity: 0; } 15% { opacity: 1; } 70% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes dotrun { 0% { offset-distance: 0%; opacity: 0; } 15% { opacity: 1; } 70% { offset-distance: 100%; opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
.gesture-hint .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; }
.stroke-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── overlays: menu, memory panel, waitlist ── */
.veil { position: fixed; inset: 0; background: rgba(4, 5, 10, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease); }
.veil.is-on { opacity: 1; pointer-events: auto; }

.panel { position: fixed; top: 72px; right: 20px; width: min(380px, calc(100vw - 40px)); max-height: calc(100svh - 160px); border-radius: 22px; padding: 22px; display: flex; flex-direction: column; gap: 14px; opacity: 0; transform: translateY(-8px) scale(0.98); transform-origin: top right; pointer-events: none; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); color: #fff; background: rgba(14, 16, 26, 0.72); border: 1px solid rgba(255,255,255,0.12); -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%); }
.panel.is-on { opacity: 1; transform: none; pointer-events: auto; }
.panel h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; }
.panel p.sub { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.6); }
.panel ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.panel li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 12px 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.07); font-size: 13.5px; line-height: 1.4; animation: memIn 0.6s var(--ease); }
@keyframes memIn { from { opacity: 0; transform: translateY(6px); } }
.panel li small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-top: 4px; }
.panel li button { font-family: var(--mono) !important; font-size: 9.5px !important; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.55) !important; padding: 4px 8px !important; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12) !important; flex: none; }
.panel li button:hover { color: #fff !important; border-color: rgba(255,255,255,0.4) !important; }
.panel .empty { font-size: 13px; color: rgba(255,255,255,0.5); padding: 8px 0; }
.panel .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel .lock { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.45); display: flex; align-items: center; gap: 6px; }
.panel .lock::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #5dffb0; box-shadow: 0 0 8px #5dffb0; }
.btn-ghost { font-family: var(--mono) !important; font-size: 10px !important; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 12px !important; border-radius: 10px; border: 1px solid rgba(255,255,255,0.18) !important; color: rgba(255,255,255,0.75) !important; }
.btn-ghost:hover { color: #fff !important; border-color: rgba(255,255,255,0.5) !important; }

.menu { position: fixed; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease); color: #fff; }
.menu.is-on { opacity: 1; pointer-events: auto; }
.menu-inner { width: min(980px, 92vw); display: grid; grid-template-columns: 1.1fr 1fr; gap: 6vw; align-items: end; }
.menu ol { list-style: none; margin: 0; padding: 0; counter-reset: act; }
.menu li button { display: flex; align-items: baseline; gap: 18px; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.12) !important; font-family: var(--serif) !important; font-size: clamp(30px, 4.4vw, 58px); line-height: 1; letter-spacing: -0.01em; transition: padding 0.5s var(--ease), color 0.4s; color: rgba(255,255,255,0.75) !important; }
.menu li button:hover { padding-left: 14px; color: #fff !important; }
.menu li button em { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; color: rgba(255,255,255,0.45); }
.menu .about { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.7); }
.menu .about h4 { font-family: var(--serif); font-weight: 400; font-size: 34px; color: #fff; margin: 0 0 14px; line-height: 1.05; }
.menu .about .tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-top: 22px; display: block; }
.menu .close { position: fixed; top: 20px; left: 20px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
@media (max-width: 767px) { .menu-inner { grid-template-columns: 1fr; gap: 28px; } .menu .about { display: none; } }

.modal { position: fixed; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease); color: #fff; padding: 20px; }
.modal.is-on { opacity: 1; pointer-events: auto; }
.modal-card { width: min(520px, 100%); max-height: calc(100svh - 40px); overflow-y: auto; border-radius: 28px; padding: 34px; background: rgba(12, 14, 24, 0.78); border: 1px solid rgba(255,255,255,0.12); -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); box-shadow: 0 40px 120px rgba(0,0,0,0.5); transform: translateY(14px) scale(0.98); transition: transform 0.7s var(--ease); }
.modal.is-on .modal-card { transform: none; }
.modal h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 0.98; margin: 6px 0 12px; letter-spacing: -0.01em; }
.modal h2 em { font-style: italic; }
.modal p { font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,0.68); margin: 0 0 22px; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.5); display: flex; flex-direction: column; gap: 8px; }
.modal input, .modal select { font: 15px var(--sans); color: #fff; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 13px 14px; outline: none; transition: border-color 0.3s; text-transform: none; letter-spacing: 0; }
.modal select option { color: #000; }
.modal input:focus, .modal select:focus { border-color: rgba(79, 227, 255, 0.8); }
.modal .submit { margin-top: 8px; height: 50px; border-radius: 999px; background: #f4f2ee; color: #06070b !important; font-weight: 500; font-size: 15px; transition: transform 0.4s var(--ease); }
.modal .submit:hover { transform: scale(1.015); }
.modal .submit[disabled] { opacity: 0.6; }
.modal .fine { font-size: 12px; color: rgba(255,255,255,0.45); margin: 4px 0 0; }
.modal .x { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18) !important; font-size: 16px; display: grid; place-items: center; }
.modal-card { position: relative; }
.modal .err { color: #ff9a8a; font-size: 13px; min-height: 1em; }
.card-stage { width: 100%; aspect-ratio: 1.25; border-radius: 18px; overflow: hidden; margin: 6px 0 18px; background: radial-gradient(circle at 50% 40%, #1a1d3c, #07080e 75%); }
.card-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.card-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-actions button { flex: 1; min-width: 120px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2) !important; font-size: 13.5px; }
.card-actions button.primary { background: #f4f2ee; color: #06070b !important; border: 0 !important; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint i, .hud-sound .bars i, .gesture-hint .ghost, .gesture-hint .dot, .hold.is-on .hold-btn::before { animation: none !important; }
}

/* ── scenario panel (product UI scrubbed by scroll) ── */
.scn { position: fixed; top: 50%; width: min(380px, 88vw); padding: 16px; border-radius: 26px; display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(-46%) scale(0.98); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); pointer-events: none; color: #fff;
  background: linear-gradient(180deg, rgba(22,24,38,0.62), rgba(10,11,20,0.52)); border: 1px solid rgba(255,255,255,0.14);
  -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 30px 80px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18); }
.scn.is-on { opacity: 1; transform: translateY(-50%); }
.scn-right { right: max(4vw, 24px); }
.scn-left { left: max(4vw, 24px); }
.scn-head { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
.scn-orb { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #8ec9ff 25%, #6b63ff 60%, #1b1950); box-shadow: 0 0 12px rgba(107,99,255,0.8); }
.scn-title { flex: 1; }
.scn-badge { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.scn-badge i { width: 6px; height: 6px; border-radius: 50%; background: #5dffb0; box-shadow: 0 0 8px #5dffb0; }
.scn-body { display: flex; flex-direction: column; gap: 8px; }
.scn-item { display: none; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); font-size: 14px; line-height: 1.4; animation: none; }
.scn-item.is-on { display: flex; animation: scnIn 0.6s var(--ease) both; }
@keyframes scnIn { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.scn-item p { margin: 0; flex: 1; }
.scn-item small { display: block; font-size: 12px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.scn-item .ic { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,0.08); }
.scn-item .ic svg { width: 17px; height: 17px; }
.scn-item .ic.big { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(140deg, #6b63ff, #3fdcff); }
.scn-item .ic.big svg { width: 22px; height: 22px; }
.scn-user { background: rgba(255,255,255,0.92) !important; color: #0b0c12; font-size: 15px; }
.scn-user .ic { background: #0b0c12; color: #fff; }
.scn-user .caret { display: none; width: 2px; height: 1em; background: #0b0c12; vertical-align: -2px; margin-left: 1px; animation: blink 0.8s steps(2) infinite; }
.scn-user.is-typing .caret { display: inline-block; }
@keyframes blink { 50% { opacity: 0; } }
.scn-step { font-size: 13px; color: rgba(255,255,255,0.85); background: transparent !important; border-color: transparent !important; padding: 4px 6px; }
.scn-step .st { flex: none; width: 20px; height: 20px; display: grid; place-items: center; }
.scn-step .st svg { width: 16px; height: 16px; color: #5dffb0; display: none; }
.scn-step .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.scn-step.is-done .spin { display: none; }
.scn-step.is-done .st svg { display: block; }
.scn-ai { font-family: var(--serif); font-size: 21px !important; line-height: 1.22 !important; background: transparent !important; border-color: transparent !important; padding: 4px 6px; }
.scn-ai em { color: #9fd8ff; }
.scn-card b { display: block; font-weight: 500; font-size: 15px; }
.scn-card em { margin-left: auto; font-style: normal; font-family: var(--mono); font-size: 11px; color: #9fd8ff; }
.scn-photo .ph { width: 56px; height: 56px; border-radius: 12px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.scn-photo b { display: block; font-weight: 500; }
.scn-ask { flex-direction: column; align-items: stretch !important; }
.scn-ask .chips { display: flex; gap: 8px; }
.scn-ask .chip { padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2); font-size: 13px; }
.scn-ask .chip.on { background: #fff; color: #0b0c12; border-color: #fff; }
.scn-confirm { flex-direction: column; align-items: stretch !important; background: rgba(255,255,255,0.1) !important; }
.scn-confirm .cf-h { display: flex; gap: 10px; align-items: center; }
.scn-confirm .cf-h svg { width: 18px; height: 18px; color: #ffd27a; }
.scn-confirm ul { margin: 0; padding-left: 18px; font-size: 13px; color: rgba(255,255,255,0.75); }
.scn-light { color: #0b0c12; background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.55)); border-color: rgba(10,12,20,0.08); box-shadow: 0 30px 80px rgba(20,24,40,0.15), inset 0 1px 0 #fff; }
.scn-light .scn-head { color: rgba(11,12,18,0.6); }
.scn-light .scn-item { background: rgba(255,255,255,0.6); border-color: rgba(10,12,20,0.06); }
.scn-light .scn-step, .scn-light .scn-ai { color: #0b0c12; }
.scn-light small { color: rgba(11,12,18,0.55) !important; }
@media (max-width: 767px) {
  .scn { top: auto; bottom: 150px; left: 50%; right: auto; width: 92vw; transform: translate(-50%, 8px); max-height: 46svh; overflow: hidden; }
  .scn.is-on { transform: translate(-50%, 0); }
  .scn-ai { font-size: 18px !important; }
}

.callout { position: fixed; max-width: 260px; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 1.4; color: #fff; background: rgba(14,16,26,0.82); border: 1px solid rgba(255,255,255,0.14); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; transform: translateY(-6px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); pointer-events: none; }
.callout.is-on { opacity: 1; transform: none; }
.callout::before { content: ''; position: absolute; top: -6px; right: 26px; width: 12px; height: 12px; background: inherit; border-left: 1px solid rgba(255,255,255,0.14); border-top: 1px solid rgba(255,255,255,0.14); transform: rotate(45deg); }
.callout b { font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #9fd8ff; display: block; margin-bottom: 4px; }

/* ── roadmap (Act V) ── */
.roadmap { position: fixed; left: max(4vw, 24px); top: 50%; transform: translateY(-46%); display: flex; flex-direction: column; gap: 12px; width: min(400px, 88vw); opacity: 0; pointer-events: none; transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); color: #fff; }
.roadmap.is-on { opacity: 1; transform: translateY(-50%); }
.rm-card { padding: 20px 22px; border-radius: 22px; background: rgba(20,20,26,0.55); border: 1px solid rgba(255,255,255,0.12); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%); }
.rm-card .mono { color: #9fd8ff; }
.rm-card h4 { margin: 8px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1; }
.rm-card p { margin: 0; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,0.7); }
@media (max-width: 767px) { .roadmap { top: auto; bottom: 150px; transform: none; left: 50%; translate: -50% 0; } .roadmap.is-on { transform: none; } .rm-card p { font-size: 13px; } }

/* ── finale CTA ── */
.finale { position: fixed; left: max(4vw, 24px); bottom: 110px; width: min(460px, 88vw); display: flex; flex-direction: column; gap: 16px; opacity: 0; transform: translateY(10px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); pointer-events: none; color: #fff; }
.finale.is-on { opacity: 1; transform: none; pointer-events: auto; }
.finale .lead { margin: 0; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,0.78); }
.finale .attrs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.finale .attrs li { padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); color: rgba(255,255,255,0.75); font-size: 9.5px; }
.finale .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.finale .btns button { height: 48px; padding: 0 26px; border-radius: 999px; font-size: 14.5px; transition: transform 0.4s var(--ease); }
.finale .btns .primary { background: #f4f2ee; color: #06070b; }
.finale .btns .ghost { border: 1px solid rgba(255,255,255,0.25); color: #fff; }
.finale .btns button:hover { transform: scale(1.03); }
.finale .drag { color: rgba(255,255,255,0.4); font-size: 9.5px; }
@media (max-width: 767px) { .finale { bottom: 96px; } .finale .lead { font-size: 14px; } }

.rm-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; margin-bottom: 14px; display: block; }

/* narrow screens: keep the top row from colliding */
@media (max-width: 767px) {
  .hud-menu { top: 14px; left: 14px; }
  .hud-memory { top: 14px; right: 14px; padding: 0 12px 0 10px; gap: 8px; }
  .hud-memory .label { display: none; }
  .ruler { width: calc(100vw - 168px); top: 10px; }
  .hud-toast { top: 62px; right: 14px; max-width: 72vw; }
  .panel { top: 62px; right: 14px; }
}

.scn-photo.has-img { flex-direction: column; align-items: stretch !important; gap: 10px; }
.scn-photo.has-img .ph { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 10px 30px rgba(0,0,0,0.35); }
@media (max-width: 767px) { .scn-photo.has-img .ph { aspect-ratio: 16 / 9; } }

/* tall panels on short screens: keep the newest steps in view, fade the oldest out at the top */
.scn { max-height: calc(100svh - 170px); }
.scn-body { flex: 1 1 auto; min-height: 0; overflow: hidden; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 36px); mask-image: linear-gradient(to bottom, transparent 0, #000 36px); }
.scn-photo.has-img .ph { aspect-ratio: auto; height: min(26svh, 210px); }

/* act III d — the send */
.scn-sent { background: linear-gradient(120deg, rgba(48,209,88,0.22), rgba(48,209,88,0.08)) !important; border-color: rgba(93,255,176,0.35) !important; }
.scn-sent b { display: block; font-weight: 500; }
.scn-sent .ic.ok { background: #30d158; color: #fff; box-shadow: 0 0 18px rgba(48,209,88,0.6); }
.scn-confirm.is-pending { box-shadow: 0 0 0 1px rgba(255,210,122,0.45), 0 0 28px rgba(255,210,122,0.18); animation: scnIn 0.6s var(--ease) both, scnPend 1.6s ease-in-out 0.6s infinite; }
@keyframes scnPend { 50% { box-shadow: 0 0 0 1px rgba(255,210,122,0.8), 0 0 36px rgba(255,210,122,0.3); } }

/* act III b — label floating over the real corner in the footage */
.ar-label { position: fixed; left: 0; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 9px; border-radius: 999px; color: #0b0c12;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(236,244,255,0.88)); box-shadow: 0 10px 30px rgba(5,10,30,0.35), inset 0 1px 0 #fff; opacity: 0; pointer-events: none; transform-origin: 50% 100%; white-space: nowrap; }
/* (no will-change: transform here: the label is rescaled every frame, and Chrome would keep
   the text rasterised at its first size and stretch it, which looks soft on a 1x monitor) */
.ar-label::after { content: ''; position: absolute; left: calc(50% + var(--tail, 0px)); bottom: -7px; width: 14px; height: 14px; background: rgba(236,244,255,0.9); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.ar-label .ar-arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #2b9dff; color: #fff; box-shadow: 0 0 16px rgba(43,157,255,0.6); }
.ar-label .ar-arrow svg { width: 19px; height: 19px; }
.ar-label b { display: block; font: 600 15px/1.15 var(--sans, Geist, system-ui); letter-spacing: -0.01em; }
.ar-label small { display: block; font: 12px/1.3 var(--sans, Geist, system-ui); color: rgba(11,12,18,0.6); }
.ar-label.is-now .ar-arrow { background: #30d158; box-shadow: 0 0 18px rgba(48,209,88,0.7); animation: arPulse 1s ease-in-out infinite; }
@keyframes arPulse { 50% { transform: scale(1.12); } }

/* finale in the warm studio (light theme) */
body[data-theme='light'] .finale { color: #1b1814; }
body[data-theme='light'] .finale .lead { color: rgba(27,24,20,0.74); }
body[data-theme='light'] .finale .attrs li { border-color: rgba(27,24,20,0.16); color: rgba(27,24,20,0.7); }
body[data-theme='light'] .finale .btns .primary { background: #1b1814; color: #f4f0ea; }
body[data-theme='light'] .finale .btns .ghost { border-color: rgba(27,24,20,0.25); color: #1b1814; }
body[data-theme='light'] .finale .drag { color: rgba(27,24,20,0.45); }

/* ── legibility: the controls sit on a darker, more frosted glass that blurs whatever is
   behind them, so their labels read over bright photos, footage and busy 3D ── */
.hud-bar.glass, .hud-menu.glass, .hud-memory.glass, .hud-sound.glass, .scroll-hint.glass {
  background: linear-gradient(180deg, rgba(22, 24, 34, 0.62), rgba(10, 11, 18, 0.55));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 30px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  color: #fff;
}
body[data-theme='light'] .hud-bar.glass, body[data-theme='light'] .hud-menu.glass, body[data-theme='light'] .hud-memory.glass,
body[data-theme='light'] .hud-sound.glass, body[data-theme='light'] .scroll-hint.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 244, 240, 0.74));
  border-color: rgba(10, 12, 20, 0.1);
  box-shadow: inset 0 1px 0 #fff, 0 10px 30px rgba(20, 24, 40, 0.14);
  color: #0b0c12;
}
.hud-bar .more { color: inherit; }
.hud-bar .more:hover { background: rgba(255, 255, 255, 0.1); }
body[data-theme='light'] .hud-bar .more:hover { background: rgba(10, 12, 20, 0.06); }

/* overlays (menu, memory, waitlist): blur the whole scene behind them, darker tint */
.veil { background: rgba(4, 5, 10, 0.55); -webkit-backdrop-filter: blur(18px) saturate(115%); backdrop-filter: blur(18px) saturate(115%); }
.menu .about, .menu li button { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }

.ar-label.is-here .ar-arrow { background: #30d158; box-shadow: 0 0 18px rgba(48,209,88,0.7); }

/* ── phones and touch screens ──────────────────────────────────────────────────
   Everything below only applies to narrow screens or a finger as the main input,
   so laptops and desktops keep exactly the layout above. */
@media (max-width: 767px) {
  /* the assistant panel becomes a compact sheet showing the latest few lines, so the scene
     above it (the floor guide, the route, the apps) stays in view */
  .scn { bottom: 132px; max-height: 31svh; padding: 12px; gap: 8px; border-radius: 22px; }
  .scn-item { padding: 9px 11px; font-size: 13px; gap: 10px; }
  .scn-user { font-size: 14px; }
  .scn-ai { font-size: 16px !important; }
  .scn-confirm ul { font-size: 12px; }
  .scn-photo.has-img .ph { height: 13svh; }
  /* while you hold to send, the sheet moves up under the top bar and shows just the question,
     so the photo dropping into Messages stays in view between it and the button */
  #ui:has(.hold.is-on) .scn { top: 66px; bottom: auto; max-height: 196px; }
  /* an open form, menu or memory panel owns the screen: the story's own overlays step aside */
  #ui:has(.modal.is-on) :is(.scn, .ar-label, .roadmap, .callout, .finale, .hold),
  #ui:has(.menu.is-on) :is(.scn, .ar-label, .roadmap, .callout, .finale, .hold) { opacity: 0 !important; pointer-events: none !important; }
  /* the "swipe up" hint never sits under a hold button */
  #ui:has(.hold.is-on) .scroll-hint { opacity: 0 !important; }
  /* the waitlist fits a small screen, with room for the keyboard */
  .modal { padding: 12px; }
  .modal-card { padding: 26px 20px 22px; border-radius: 24px; max-height: calc(100svh - 24px); }
}
@media (pointer: coarse) {
  /* comfortable 44 pt tap targets */
  .hud-menu { width: 44px; height: 44px; }
  .hud-memory { height: 44px; }
  .hud-sound { height: 44px; min-width: 44px; justify-content: center; }
  .hud-bar .mark, .hud-bar .more { width: 44px; height: 44px; }
  .hud-bar .cta { height: 44px; }
  .modal .x { width: 44px; height: 44px; top: 12px; right: 12px; }
  .btn-ghost { padding: 12px 14px !important; }
  /* 16 px text in form fields stops iPhone zooming the page when you tap one */
  .modal input, .modal select { font-size: 16px; }
  /* no keyboard on a phone: drop the "or press enter" hint */
  .gesture-hint > .mono { display: none; }
  /* nothing smaller than ~10.5 px on a phone */
  .finale .attrs li, .finale .drag { font-size: 10.5px; }
  .scroll-hint { font-size: 11px; }
}
/* a phone held sideways: the story is composed for portrait */
.rotate-hint { display: none; }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .rotate-hint { position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 18px; background: #06070b; color: #fff; font: 15px/1.4 var(--sans); text-align: center; }
  .rotate-hint p { margin: 0; color: rgba(255,255,255,0.8); }
  .rot-phone { width: 34px; height: 58px; border: 2px solid rgba(255,255,255,0.85); border-radius: 9px; position: relative; animation: rotPhone 2.6s var(--ease) infinite; }
  .rot-phone::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 12px; height: 2px; margin-left: -6px; border-radius: 2px; background: rgba(255,255,255,0.7); }
}
@keyframes rotPhone { 0%, 25% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
