/* ==========================================================================
   Web Lab Technology · a laboratory of impossible interfaces
   Liquid glass = translucency + blur/saturation + specular edge + a sheen that
   follows one shared light source (--lx/--ly set by js/light.js).
   ========================================================================== */
:root {
  --ink: #f4f1ff;
  --ink-2: rgba(240, 236, 255, .74);
  --ink-3: rgba(240, 236, 255, .5);
  --night: #0b0820;
  --c1: #6ff7ff;  /* glow cyan   */
  --c2: #b98cff;  /* lumen violet */
  --c3: #ff7ad9;  /* bloom pink  */
  --c4: #ffd36e;  /* amber spark */
  --c5: #8dffb0;  /* moss light  */
  --iri: linear-gradient(100deg, var(--c1), var(--c2) 40%, var(--c3) 70%, var(--c4));
  --glass-tint: rgba(22, 16, 52, .38);
  --glass-hi: rgba(255, 255, 255, .14);
  --glass-lo: rgba(255, 255, 255, .03);
  --glass-edge: linear-gradient(140deg, rgba(255,255,255,.55), rgba(255,255,255,.10) 28%, rgba(255,255,255,.03) 60%, rgba(185,140,255,.5) 100%);
  --glass-blur: blur(22px) saturate(180%);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.38), inset 0 -1px 0 rgba(255,255,255,.06), inset 0 0 0 .5px rgba(255,255,255,.08), 0 24px 60px -24px rgba(0,0,0,.8), 0 2px 8px -2px rgba(0,0,0,.4);
  --lx: .5; --ly: .5;   /* neutral light at rest: no tilt offset on first paint */
  --tilt-x: 0; --tilt-y: 0;
  --radius: 26px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-h: 72px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--night); overflow-x: clip; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: transparent; line-height: 1.5; overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(185,140,255,.45); }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- living sky ---------- */
.sky { position: fixed; inset: 0; z-index: -3; overflow: hidden; background:
  radial-gradient(1200px 800px at 15% -10%, #2a1670 0%, transparent 60%),
  radial-gradient(900px 700px at 110% 30%, #10305e 0%, transparent 60%),
  radial-gradient(1000px 900px at 40% 120%, #3a0f4f 0%, transparent 60%), var(--night); }
.orb { position: absolute; border-radius: 50%; opacity: .55; will-change: transform; } /* radial gradients are already soft: no blur filter (it was the costliest paint on phones) */
.o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -10vmax; background: radial-gradient(circle at 30% 30%, #7b4dff, transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.o2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 18vh; background: radial-gradient(circle at 50% 50%, #1fd6ff, transparent 65%); opacity: .35; animation: drift2 31s ease-in-out infinite alternate; }
.o3 { width: 42vmax; height: 42vmax; left: 20vw; bottom: -20vmax; background: radial-gradient(circle at 50% 50%, #ff4fc3, transparent 62%); opacity: .38; animation: drift3 37s ease-in-out infinite alternate; }
.o4 { width: 20vmax; height: 20vmax; left: 55vw; top: 8vh; background: radial-gradient(circle, #ffd36e, transparent 65%); opacity: .18; animation: drift2 22s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(18vw, 14vh, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-22vw, 10vh, 0) scale(.85); } }
@keyframes drift3 { to { transform: translate3d(-14vw, -18vh, 0) scale(1.1); } }
.grain { position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
#motes { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; opacity: 0; transition: opacity 1.2s; }
#motes.on { opacity: 1; }
html[data-room="vault"] #motes.on { opacity: .25; }

/* ---------- glass primitive ---------- */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(160deg, var(--glass-hi), var(--glass-lo)) padding-box,
              linear-gradient(var(--glass-tint), var(--glass-tint)) padding-box,
              var(--glass-edge) border-box;
  border: 1px solid transparent;
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius);
}
/* Performance: backdrop-filter re-blurs everything behind it whenever anything behind moves (the sky, the motes).
   So real blur is reserved for small chrome (header, tab bar, sheet, toast, HUD pills); big panels use a denser tint. */
.glass:not(.topbar):not(.sheet-card):not(.toast):not(.blur) { --glass-tint: rgba(24, 17, 58, .62); }
.topbar, .sheet-card, .toast, .glass.blur { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.glass.sheen { overflow: hidden; }
.glass.sheen::after { content: ''; position: absolute; inset: -60%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(255,255,255,.14), rgba(255,255,255,.04) 45%, transparent 70%),
              linear-gradient(115deg, transparent 42%, rgba(255,255,255,.07) 49%, rgba(196,181,253,.08) 51%, transparent 58%);
  transform: translate3d(calc((var(--lx) - .5) * 55%), calc((var(--ly) - .5) * 55%), 0); will-change: transform; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)) padding-box, linear-gradient(rgba(22,18,48,.94), rgba(22,18,48,.94)) padding-box, var(--glass-edge) border-box; }
}
.chip { display: inline-flex; align-items: center; gap: .45em; border-radius: 999px; padding: .55em 1em; border: 1px solid rgba(255,255,255,.18);
  background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.03)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 20px -10px rgba(0,0,0,.6);
  cursor: pointer; font-weight: 650; font-size: .9rem; text-decoration: none; transition: transform .35s var(--ease-spring), background .3s; touch-action: manipulation; }
.chip:hover { background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.05)); }
.chip:active { transform: scale(.94); }
.chip.on { border-color: rgba(111,247,255,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 0 3px rgba(111,247,255,.15), 0 8px 24px -8px rgba(111,247,255,.5); }
.btn-big { display: inline-flex; align-items: center; gap: .6em; padding: 1rem 1.6rem; border-radius: 999px; font-weight: 800; font-size: 1.05rem; text-decoration: none; cursor: pointer; border: 0;
  color: #120a2c; background: var(--iri); background-size: 200% 100%; box-shadow: 0 16px 40px -14px rgba(185,140,255,.9), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .4s var(--ease-spring); }
.btn-big:hover { transform: translateY(-2px) scale(1.03); animation: iriShift 3s linear infinite; }
.btn-big:active { transform: scale(.96); }
@keyframes iriShift { to { background-position: 200% 0; } }
.iri-text { background: var(--iri); background-size: 100% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; } /* static: animating background-position repaints text every frame */

/* ---------- top bar + nav ---------- */
.topbar { position: fixed; z-index: 50; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(1180px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 999px; view-transition-name: topbar; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; user-select: none; }
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 8%, transparent 9%), conic-gradient(from 0deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c1)); box-shadow: 0 0 22px rgba(185,140,255,.7), inset 0 0 0 3px rgba(11,8,32,.55); animation: spin 9s linear infinite; }
.brand-mark i { position: absolute; inset: 7px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); transform: rotateX(70deg); }
.brand-mark i:nth-child(2) { transform: rotateY(70deg); }
.brand-mark i:nth-child(3) { inset: 13px; background: #fff; border: 0; transform: none; box-shadow: 0 0 10px #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 1.05rem; letter-spacing: .01em; }
.brand-text small { font-size: .62rem; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.sound-btn { font-variant-numeric: tabular-nums; padding: .5em .85em; }
.egg-ico { color: var(--c4); display: inline-block; transition: transform .6s var(--ease-spring); }
.sound-btn.pop .egg-ico { transform: scale(1.8) rotate(180deg); }

@media (max-width: 860px) {
  .topbar { width: auto; left: 10px; right: 10px; transform: none; top: calc(10px + var(--safe-t)); padding: 6px 8px 6px 12px; }
  /* the header's own backdrop-filter would trap the fixed tab bar, so the bar is glass but the header goes filter-free */
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.03)) padding-box, linear-gradient(rgba(20,14,46,.72), rgba(20,14,46,.72)) padding-box, var(--glass-edge) border-box; }
}

/* ---------- liquid-glass sliding nav (vanilla port of Pickers Rock .gseg / GlassSegmented) ---------- */
.gseg { position: relative; display: inline-flex; align-items: stretch; padding: 4px; gap: 0; border-radius: 999px; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  background: linear-gradient(160deg, rgba(0,0,0,.30), rgba(0,0,0,.14)); border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.45), inset 0 -1px 0 rgba(255,255,255,.08); flex-shrink: 0; max-width: 100%; }
.gseg-lens { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; pointer-events: none; z-index: 0; opacity: 0; transform-origin: 50% 50%; will-change: transform, width; contain: layout paint;
  background: linear-gradient(180deg, rgba(255,255,255,.34), rgba(255,255,255,.08) 55%, rgba(255,255,255,.16)),
              linear-gradient(120deg, rgba(111,247,255,.50), rgba(185,140,255,.50) 45%, rgba(255,122,217,.46) 80%, rgba(255,211,110,.38));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 1px rgba(255,255,255,.2), inset 0 0 0 1px rgba(255,255,255,.2), 0 6px 18px -6px rgba(185,140,255,.9), 0 0 14px -6px rgba(111,247,255,.8), 0 1px 3px rgba(0,0,0,.35);
  transition: box-shadow .2s, filter .2s, opacity .2s; }
.gseg-lens.dragging { filter: brightness(1.14) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 0 0 1px rgba(255,255,255,.3), 0 10px 26px -6px rgba(255,122,217,.95), 0 0 22px -4px rgba(111,247,255,.9), 0 0 0 4px rgba(185,140,255,.14); }
.gseg-opt { position: relative; z-index: 1; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--ink-2); cursor: pointer; font: inherit; font-weight: 650; font-size: .88rem; white-space: nowrap; border-radius: 999px; padding: 9px 15px; text-decoration: none; touch-action: pan-y; -webkit-tap-highlight-color: transparent; -webkit-user-drag: none; }
.gseg-opt.on { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.gseg-opt:hover { color: #fff; }
.gseg-opt:focus-visible { outline: 2px solid rgba(111,247,255,.9); outline-offset: 1px; }
.gseg-label { display: inline-flex; align-items: center; justify-content: center; gap: 7px; pointer-events: none; transition: transform .18s cubic-bezier(.2,.9,.3,1.3), color .15s; }
.gseg-label svg { width: 18px; height: 18px; flex: none; }
.gseg-opt.lensed .gseg-label { transform: scale(1.12); color: #fff; }
.gseg.nav { padding: 4px; background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.02)) padding-box, linear-gradient(rgba(12,8,30,.35), rgba(12,8,30,.35)) padding-box, var(--glass-edge) border-box; border: 1px solid transparent; }
@media (min-width: 861px) and (max-width: 1100px) { .gseg.nav .gseg-text { display: none; } .gseg.nav .gseg-opt { padding: 10px 14px; } }
@media (max-width: 860px) {
  /* floating glass tab bar; the header above it has no filter/transform so it can't trap position:fixed */
  .gseg.nav { position: fixed; z-index: 55; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); width: auto; max-width: 440px; margin: 0 auto; padding: 5px; border-radius: 30px; display: flex;
    background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.04)) padding-box, linear-gradient(rgba(20,14,46,.55), rgba(20,14,46,.55)) padding-box, var(--glass-edge) border-box;
    -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
    box-shadow: var(--glass-shadow), 0 18px 40px -12px rgba(0,0,0,.85); view-transition-name: tabbar; }
  .gseg.nav .gseg-opt { flex: 1 1 0; min-width: 0; padding: 7px 2px; font-size: 11px; border-radius: 24px; }
  .gseg.nav .gseg-label { flex-direction: column; gap: 2px; }
  .gseg.nav .gseg-label svg { width: 22px; height: 22px; }
  .gseg.nav .gseg-lens { top: 5px; bottom: 5px; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) { .gseg-label { transition: none; } }

/* ---------- page shell ---------- */
main { display: block; min-height: 100vh; min-height: 100dvh; padding: calc(96px + var(--safe-t)) 20px 60px; outline: none; }
@media (max-width: 860px) { main { padding: calc(84px + var(--safe-t)) 14px calc(var(--nav-h) + 44px + var(--safe-b)); } }
.room { max-width: 1180px; margin: 0 auto; view-transition-name: room; }
.room-head { text-align: center; max-width: 760px; margin: 18px auto 30px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .28em; text-transform: uppercase; color: var(--c1); padding: 6px 12px; border-radius: 999px; background: rgba(111,247,255,.08); border: 1px solid rgba(111,247,255,.25); }
.room-head h1 { font-size: clamp(2.1rem, 6vw, 4.2rem); line-height: 1.02; margin: 14px 0 12px; letter-spacing: -.025em; font-weight: 850; }
.room-head p { color: var(--ink-2); font-size: clamp(1rem, 2.2vw, 1.15rem); margin: 0 auto; max-width: 620px; }
.hint { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: .85rem; margin-top: 14px; }
.hint .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c5); box-shadow: 0 0 10px var(--c5); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.6); opacity: .5; } }
.panel { padding: clamp(18px, 3vw, 28px); }
.panel h2, .panel h3 { margin: 0 0 6px; letter-spacing: -.01em; }
.panel p { color: var(--ink-2); margin: 0; }
.next-door { display: flex; justify-content: center; margin: 48px 0 10px; }

/* entrance animation for any element marked .rise */
.rise { opacity: 0; transform: scale(.96); transform-origin: 50% 50%; animation: rise .8s var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- view transitions between rooms ---------- */
/* Room changes: opacity + a gentle scale about the centre of the screen. No filter: blur here (WebKit/iOS Safari
   renders an accelerated filter+transform layer offset toward the bottom-right by the blur outset until it ends). */
::view-transition-old(room), ::view-transition-new(room) { transform-origin: 50% 40vh; }
::view-transition-old(room) { animation: roomOut .3s var(--ease-out) both; }
::view-transition-new(room) { animation: roomIn .5s var(--ease-out) both; }
@keyframes roomOut { to { opacity: 0; transform: scale(.97); } }
@keyframes roomIn { from { opacity: 0; transform: scale(1.03); } }
html.back ::view-transition-old(room) { animation-name: roomOutBack; }
html.back ::view-transition-new(room) { animation-name: roomInBack; }
@keyframes roomOutBack { to { opacity: 0; transform: scale(1.03); } }
@keyframes roomInBack { from { opacity: 0; transform: scale(.97); } }
.fallback-in { transform-origin: 50% 40vh; animation: roomIn .5s var(--ease-out) both; }

/* ==========================================================================
   ROOM 1 · The Atrium (home)
   ========================================================================== */
.atrium-hero { overflow-x: clip; position: relative; min-height: min(78vh, 760px); display: grid; place-items: center; text-align: center; perspective: 900px; }
.portal { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transform-style: preserve-3d; }
.ring { position: absolute; width: var(--s); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(255,255,255,.16);
  background: radial-gradient(closest-side, transparent 93%, rgba(185,140,255,.10) 97%, transparent);
  transform: translateZ(calc(var(--z) * 1px)) rotateX(calc(var(--tilt-y) * 10deg)) rotateY(calc(var(--tilt-x) * -10deg));
  animation: ringIn 2.2s var(--ease-out) both; animation-delay: calc(var(--d) * 1ms); }
.ring::before { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--c1); border-right-color: rgba(255,122,217,.6); /* plain borders + transform spin: no mask/conic repaint per frame */
  animation: spin calc(var(--sp) * 1s) linear infinite; will-change: transform; }
@keyframes ringIn { from { transform: scale(1.5); opacity: 0; } } /* scales about the ring's own centre (rings are grid-centred) */
.hero-core { position: relative; z-index: 2; padding: 0 8px; transform: translate3d(calc(var(--tilt-x) * 14px), calc(var(--tilt-y) * 10px), 0); }
.hero-core .eyebrow { animation: rise .8s var(--ease-out) .35s both; }
.hero-title { font-size: clamp(3rem, 12.5vw, 9rem); line-height: .9; margin: 18px 0 16px; letter-spacing: -.05em; font-weight: 900; }
.hero-title .ln { display: block; }
.hero-title .ch { display: inline-block; opacity: 0; transform: scale(.6); animation: chIn .9s var(--ease-spring) forwards; animation-delay: calc(500ms + var(--c) * 45ms); }
.hero-title .ln1 .ch { background: var(--iri); background-size: 700% 100%; background-position: calc(var(--c) * 16.6%) 0; -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .02em; }
.hero-title .ln2 { font-size: .42em; letter-spacing: .02em; font-weight: 750; margin-top: .25em; }
@keyframes chIn { to { opacity: 1; transform: none; } }
.hero-title .ch.wob { animation: chWob .8s var(--ease-spring); opacity: 1; }
@keyframes chWob { 30% { transform: translateY(-.25em) scale(1.25, .8) rotate(-6deg); } 60% { transform: translateY(.05em) scale(.9, 1.12); } }
.hero-sub { color: var(--ink-2); font-size: clamp(1.02rem, 2.4vw, 1.3rem); max-width: 560px; margin: 0 auto 26px; animation: rise .8s var(--ease-out) .8s both; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; animation: rise .8s var(--ease-out) .95s both; }
.scroll-cue { position: absolute; bottom: 8px; left: 50%; translate: -50% 0; color: var(--ink-3); font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: rise .8s var(--ease-out) 1.3s both; }
.scroll-cue::after { content: ''; width: 2px; height: 34px; border-radius: 2px; background: linear-gradient(var(--c1), transparent); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.doors-title { text-align: center; margin: 40px 0 22px; }
.doors-title h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 8px 0 0; letter-spacing: -.02em; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; perspective: 1200px; }
.door { --hue: 260; display: block; text-decoration: none; padding: 22px; min-height: 210px; transform-style: preserve-3d; transition: transform .5s var(--ease-out), box-shadow .5s; will-change: transform; }
.door:hover { box-shadow: var(--glass-shadow), 0 30px 70px -26px hsl(var(--hue) 90% 60% / .8); }
.door .art { position: relative; height: 92px; margin-bottom: 14px; transform: translateZ(40px); }
.door h3 { margin: 0 0 4px; font-size: 1.3rem; transform: translateZ(30px); }
.door p { margin: 0; color: var(--ink-2); font-size: .95rem; transform: translateZ(20px); }
.door .go { position: absolute; right: 18px; top: 18px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); transform: translateZ(50px); transition: transform .4s var(--ease-spring), background .3s; }
.door:hover .go { transform: translateZ(50px) rotate(-45deg); background: rgba(255,255,255,.22); }
.door .num { font-size: .7rem; letter-spacing: .3em; color: var(--ink-3); font-weight: 800; text-transform: uppercase; }
.glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.2), transparent 60%); opacity: 0; transition: opacity .4s; z-index: 2; }
.tilt:hover .glare, .tilt.touching .glare { opacity: 1; }

/* small door art */
.art-orbit { display: grid; place-items: center; }
.art-orbit span { position: absolute; width: 70px; height: 70px; border-radius: 50%; border: 2px solid hsl(var(--hue) 90% 70% / .8); animation: spin 6s linear infinite; }
.art-orbit span:nth-child(2) { width: 46px; height: 46px; transform: rotateX(65deg); animation-duration: 3s; border-color: var(--c3); }
.art-orbit span:nth-child(3) { width: 16px; height: 16px; background: #fff; box-shadow: 0 0 20px #fff; border: 0; }
.art-drops { display: flex; gap: 10px; align-items: center; height: 100%; }
.art-drops i { width: 54px; height: 54px; border-radius: 44% 56% 62% 38% / 42% 40% 60% 58%; background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.05)); border: 1px solid rgba(255,255,255,.45); box-shadow: inset 0 -8px 16px rgba(111,247,255,.35), 0 10px 20px -10px #000; animation: blobby 6s ease-in-out infinite; }
.art-drops i:nth-child(2) { width: 38px; height: 38px; animation-delay: -2s; }
.art-drops i:nth-child(3) { width: 26px; height: 26px; animation-delay: -4s; }
@keyframes blobby { 50% { border-radius: 60% 40% 38% 62% / 56% 62% 38% 44%; transform: translateY(-8px) rotate(20deg); } }
.art-stretch { display: flex; align-items: flex-end; gap: 6px; height: 100%; }
.art-stretch i { flex: 1; border-radius: 8px; background: linear-gradient(var(--c1), var(--c2)); opacity: .8; animation: stretchy 2.4s var(--ease-spring) infinite alternate; animation-delay: calc(var(--k) * -.3s); height: 30%; }
@keyframes stretchy { to { height: 100%; } }
.art-cards { position: relative; }
.art-cards i { position: absolute; left: 50%; top: 4px; width: 60px; height: 80px; border-radius: 12px; background: linear-gradient(135deg, var(--c3), var(--c2)); border: 1px solid rgba(255,255,255,.4); transform-origin: 50% 120%; animation: fan 4s var(--ease-spring) infinite alternate; }
.art-cards i:nth-child(1) { --r: -24deg; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.art-cards i:nth-child(2) { --r: 0deg; }
.art-cards i:nth-child(3) { --r: 24deg; background: linear-gradient(135deg, var(--c4), var(--c3)); }
@keyframes fan { from { transform: translateX(-50%) rotate(0); } to { transform: translateX(-50%) rotate(var(--r)); } }
.art-lantern { display: grid; place-items: center; }
.art-lantern i { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, rgba(255,211,110,.95), rgba(255,211,110,.2) 40%, transparent 70%); animation: pulse 2.6s ease-in-out infinite; }
.art-lantern b { position: absolute; font-size: 1.4rem; color: rgba(255,255,255,.2); letter-spacing: .5em; }
.art-blueprint { background-image: linear-gradient(rgba(111,247,255,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(111,247,255,.25) 1px, transparent 1px); background-size: 14px 14px; border-radius: 14px; border: 1px solid rgba(111,247,255,.35); overflow: hidden; }
.art-blueprint i { position: absolute; inset: 14px 30% 14px 14px; border: 2px dashed var(--c1); border-radius: 8px; animation: draw 3s ease-in-out infinite alternate; }
@keyframes draw { to { inset: 14px 14px 30px 40%; } }

.marquee { margin: 54px -20px 0; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: marq 32s linear infinite; font-size: clamp(1.6rem, 5vw, 3.2rem); font-weight: 900; letter-spacing: -.02em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.35); }
.marquee-track span:nth-child(even) { color: rgba(255,255,255,.9); -webkit-text-stroke: 0; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ==========================================================================
   Shared room bits (notes grid, glass range)  · Glass Garden room retired
   ========================================================================== */
.garden-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0 0; }
.garden-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; margin-top: 26px; }
.garden-notes .panel h3 { font-size: 1.05rem; }
.meter { display: flex; align-items: center; gap: 10px; }
input[type=range].glass-range { -webkit-appearance: none; appearance: none; width: 160px; height: 30px; background: transparent; touch-action: pan-y; }
input[type=range].glass-range::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3)); box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
input[type=range].glass-range::-moz-range-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3)); }
input[type=range].glass-range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, rgba(255,255,255,.35) 60%); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 6px 16px -4px #000, inset 0 -3px 6px rgba(111,247,255,.6); }
input[type=range].glass-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, rgba(255,255,255,.35) 60%); border: 1px solid #fff; }

/* ==========================================================================
   ROOM 3 · The Elastic Hall (responsive playground)
   ========================================================================== */
.elastic-wrap { display: grid; gap: 18px; }
.elastic-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; padding: 12px 14px; }
.elastic-bar .readout { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; display: flex; align-items: baseline; gap: 10px; }
.elastic-bar .readout small { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--c1); font-weight: 800; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.stretch-zone { position: relative; height: clamp(460px, 64vh, 620px); border-radius: 30px; padding: 18px; display: flex; justify-content: center; align-items: stretch;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 40px), repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 40px), rgba(8,6,24,.4);
  border: 1px dashed rgba(255,255,255,.15); overflow: hidden; }
.device { position: relative; width: var(--w, 360px); max-width: 100%; height: 100%; border-radius: 26px; transition: width .7s var(--ease-spring), border-radius .5s; container-type: inline-size; container-name: site;
  background: #fbf8ff; color: #1a1033; overflow: hidden; box-shadow: 0 0 0 8px rgba(255,255,255,.08), 0 0 0 9px rgba(255,255,255,.18), 0 40px 80px -30px #000; }
.device.dragging { transition: none; }
.handle { position: absolute; top: 50%; right: -34px; width: 30px; height: 84px; translate: 0 -50%; border-radius: 16px; cursor: ew-resize; touch-action: none; display: grid; place-items: center; z-index: 3;
  background: linear-gradient(160deg, rgba(255,255,255,.4), rgba(255,255,255,.1)); border: 1px solid rgba(255,255,255,.6); box-shadow: 0 10px 30px -8px rgba(111,247,255,.8), inset 0 1px 0 #fff; animation: nudge 2.4s ease-in-out infinite; }
.handle.left { right: auto; left: -34px; animation-direction: reverse; }
.handle::before { content: ''; width: 4px; height: 34px; border-radius: 4px; background: repeating-linear-gradient(#fff 0 3px, transparent 3px 6px); opacity: .8; }
@keyframes nudge { 50% { transform: translateX(5px); } }
.device-wrap { position: relative; height: 100%; display: flex; }
/* the mock site inside, which re-flows with container queries */
.mock { height: 100%; overflow: auto; overscroll-behavior: contain; font-size: 14px; scrollbar-width: none; }
.mock::-webkit-scrollbar { display: none; }
.mock-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; position: sticky; top: 0; background: rgba(251,248,255,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 2; border-bottom: 1px solid #eee6ff; }
.mock-logo { display: flex; align-items: center; gap: 8px; font-weight: 900; }
.mock-logo i { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(#6ff7ff, #b98cff, #ff7ad9, #ffd36e, #6ff7ff); }
.mock-links { display: none; gap: 18px; font-weight: 650; color: #5b4a8a; font-size: 13px; }
.mock-burger { width: 26px; height: 16px; background: linear-gradient(#1a1033 0 0) top/100% 2.5px no-repeat, linear-gradient(#1a1033 0 0) center/100% 2.5px no-repeat, linear-gradient(#1a1033 0 0) bottom/100% 2.5px no-repeat; border-radius: 2px; }
.mock-hero { padding: 22px 16px; display: grid; gap: 16px; }
.mock-hero h4 { font-size: 26px; line-height: 1.05; margin: 0; letter-spacing: -.03em; }
.mock-hero p { margin: 0; color: #5b4a8a; }
.mock-hero .mbtn { justify-self: start; background: #1a1033; color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 13px; }
.mock-art { aspect-ratio: 4/3; border-radius: 18px; background: radial-gradient(circle at 30% 35%, #ff7ad9 0 16%, transparent 17%), radial-gradient(circle at 70% 60%, #6ff7ff 0 22%, transparent 23%), linear-gradient(135deg, #7b4dff, #2c1670); position: relative; overflow: hidden; }
.mock-art::after { content: ''; position: absolute; inset: 22% 14%; border-radius: 16px; background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.mock-cards { display: grid; gap: 12px; padding: 4px 16px 20px; grid-template-columns: 1fr; }
.mock-card { border-radius: 16px; padding: 14px; background: #f0eaff; display: grid; gap: 6px; }
.mock-card i { width: 34px; height: 34px; border-radius: 10px; background: var(--g, linear-gradient(135deg,#6ff7ff,#b98cff)); }
.mock-card b { font-size: 15px; }
.mock-card span { color: #6b5a9a; font-size: 12.5px; }
.mock-foot { padding: 18px 16px 26px; color: #8a7bb5; font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; border-top: 1px solid #eee6ff; }
.mock-stamp { position: absolute; right: 12px; bottom: 12px; padding: 6px 10px; border-radius: 999px; background: #1a1033; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; z-index: 3; transition: transform .5s var(--ease-spring); }
.mock-stamp.bump { transform: scale(1.25) rotate(-4deg); }
@container site (min-width: 520px) {
  .mock-hero { grid-template-columns: 1.1fr 1fr; align-items: center; padding: 30px 22px; }
  .mock-hero h4 { font-size: 34px; }
  .mock-cards { grid-template-columns: repeat(2, 1fr); padding: 4px 22px 24px; }
}
@container site (min-width: 760px) {
  .mock-links { display: flex; } .mock-burger { display: none; }
  .mock-hero h4 { font-size: 46px; }
  .mock-cards { grid-template-columns: repeat(3, 1fr); }
  .mock-nav { padding: 16px 26px; }
}
@container site (min-width: 1000px) {
  .mock-hero { padding: 48px 40px; gap: 40px; }
  .mock-hero h4 { font-size: 60px; }
  .mock-cards { grid-template-columns: repeat(4, 1fr); padding: 4px 40px 30px; }
}
@container site (max-width: 300px) {
  .mock-hero h4 { font-size: 20px; }
  .mock-logo span { display: none; }
}
.elastic-lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.elastic-lessons .panel b { color: var(--c1); }
.squish-word { display: flex; justify-content: center; gap: .02em; font-weight: 900; font-size: clamp(2.4rem, 10vw, 6rem); letter-spacing: -.04em; margin: 30px 0 0; cursor: pointer; user-select: none; }
.squish-word span { display: inline-block; transition: transform .6s var(--ease-spring), color .3s; transform-origin: bottom; }
.squish-word span:hover { transform: scaleY(1.5) scaleX(.8); color: var(--c1); }

/* ==========================================================================
   ROOM 4 · The Kinetic Gallery
   ========================================================================== */
.gallery-tools { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: -10px 0 26px; }
.exhibits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; perspective: 1200px; }
.exhibit { min-height: 320px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; transform-style: preserve-3d; will-change: transform; transition: transform .6s var(--ease-out); }
.exhibit .stage { position: absolute; inset: 0; display: grid; place-items: center; transform: translateZ(30px); border-radius: inherit; overflow: hidden; }
.exhibit .caption { position: relative; z-index: 3; transform: translateZ(50px); }
.exhibit h3 { margin: 0 0 4px; font-size: 1.15rem; }
.exhibit p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.exhibit .tagline { font-size: .68rem; letter-spacing: .26em; text-transform: uppercase; font-weight: 800; color: var(--c4); }
/* holo foil */
.holo .stage { background: linear-gradient(calc(var(--hx, .5) * 180deg + 45deg), #6ff7ff33, #b98cff55, #ff7ad955, #ffd36e44, #8dffb033, #6ff7ff33); background-size: 300% 300%; background-position: calc(var(--hx, .5) * 100%) calc(var(--hy, .5) * 100%); mix-blend-mode: screen; }
.holo .stage::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(calc(var(--hx, .5) * 90deg + 60deg), rgba(255,255,255,.0) 0 6px, rgba(255,255,255,.16) 6px 7px); }
.holo .badge { width: 120px; height: 120px; border-radius: 30px; display: grid; place-items: center; font-size: 3rem; font-weight: 900; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.5); box-shadow: inset 0 1px 0 #fff; transform: translateZ(60px); margin-bottom: 70px; }
/* parallax layers */
.layers .stage { transform-style: preserve-3d; }
.layers .ly { position: absolute; border-radius: 50%; transform: translate3d(calc(var(--tilt-x-l, 0) * var(--depth) * 1px), calc(var(--tilt-y-l, 0) * var(--depth) * 1px), 0); transition: transform .3s var(--ease-out); }
.layers .ly.a { width: 220px; height: 220px; background: radial-gradient(circle at 30% 30%, #7b4dff, #2c1670); top: 10px; left: -40px; --depth: -10; }
.layers .ly.b { width: 120px; height: 120px; background: radial-gradient(circle at 30% 30%, #6ff7ff, #1f6c9e); top: 50px; right: 30px; --depth: 18; }
.layers .ly.c { width: 64px; height: 64px; background: radial-gradient(circle at 30% 30%, #fff, #ffd36e); top: 30px; left: 46%; --depth: 34; box-shadow: 0 0 40px #ffd36e; }
.layers .ly.d { width: 170px; height: 50px; border-radius: 30px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.5); top: 140px; left: 22%; --depth: 46; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
/* magnetic */
.magnet .stage { place-items: center; }
.magnet-btn { width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; cursor: pointer; border: 1px solid rgba(255,255,255,.5); color: #fff; margin-bottom: 60px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.5), rgba(255,122,217,.4) 40%, rgba(123,77,255,.5)); box-shadow: 0 20px 50px -10px rgba(255,122,217,.7), inset 0 2px 0 rgba(255,255,255,.7); transition: transform .5s var(--ease-spring); touch-action: none; }
.magnet-btn span { transition: transform .5s var(--ease-spring); pointer-events: none; }
/* morph blob */
.morph .stage { filter: url(#goo); }
.paused, .paused * { animation-play-state: paused !important; }
.morph .bl { position: absolute; width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(135deg, var(--c1), var(--c2)); animation: orbitBl 5s ease-in-out infinite; top: calc(50% - 80px); left: calc(50% - 45px); }
.morph .bl:nth-child(2) { background: linear-gradient(135deg, var(--c3), var(--c2)); animation-delay: -1.6s; width: 70px; height: 70px; }
.morph .bl:nth-child(3) { background: linear-gradient(135deg, var(--c4), var(--c3)); animation-delay: -3.2s; width: 56px; height: 56px; }
@keyframes orbitBl { 0%,100% { transform: translate(-50px, 0); } 33% { transform: translate(50px, -20px); } 66% { transform: translate(10px, 40px); } }
/* text scramble */
.scramble .stage { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; letter-spacing: .04em; color: var(--c5); text-shadow: 0 0 14px rgba(141,255,176,.6); padding: 0 20px 80px; text-align: center; }
/* spotlight grid */
.spot .stage { background-image: radial-gradient(rgba(255,255,255,.5) 1.2px, transparent 1.6px); background-size: 20px 20px; -webkit-mask: radial-gradient(160px circle at var(--mx, 50%) var(--my, 40%), #000, transparent 75%); mask: radial-gradient(160px circle at var(--mx, 50%) var(--my, 40%), #000, transparent 75%); }
.spot .stage::after { content: ''; position: absolute; inset: 0; background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 40%), rgba(111,247,255,.35), transparent 70%); }

/* scroll-driven reel */
.reel { margin-top: 56px; }
.reel h2 { text-align: center; font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 0 0 6px; letter-spacing: -.02em; }
.reel > p { text-align: center; color: var(--ink-2); margin: 0 0 24px; }
.reel-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.reel-item { padding: 22px; min-height: 160px; display: flex; flex-direction: column; justify-content: space-between; }
.reel-item .big { font-size: 2.6rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.reveal { opacity: 0; transform: translateY(60px) rotateX(30deg) scale(.9); transition: opacity .9s var(--ease-out), transform 1s var(--ease-spring); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }
@supports (animation-timeline: view()) {
  .reveal.sd { opacity: 1; transform: none; transition: none; animation: sdIn linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
  @keyframes sdIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
  .progress-orb { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
.progress-orb { position: fixed; left: 0; right: 0; top: 0; height: 3px; transform-origin: left; background: var(--iri); z-index: 60; transform: scaleX(var(--p, 0)); box-shadow: 0 0 12px var(--c2); }

/* ==========================================================================
   ROOM 5 · The Lantern Vault (hidden things)
   ========================================================================== */
.vault { position: relative; height: clamp(480px, 70vh, 660px); border-radius: 32px; overflow: hidden; cursor: none; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse at 50% 120%, #1a0f3a, #05040d 70%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 40px 80px -40px #000; }
.vault-lit { position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,122,217,.25), transparent 30%), radial-gradient(circle at 80% 70%, rgba(111,247,255,.25), transparent 30%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 22px), linear-gradient(#251651, #120a2c);
  -webkit-mask: radial-gradient(var(--lr, 120px) circle at var(--vx, 50%) var(--vy, 50%), #000 40%, transparent 100%); mask: radial-gradient(var(--lr, 120px) circle at var(--vx, 50%) var(--vy, 50%), #000 40%, transparent 100%); }
.vault-lit .scrawl { position: absolute; color: rgba(255,255,255,.55); font-weight: 800; font-size: clamp(.8rem, 1.8vw, 1rem); max-width: 22ch; line-height: 1.3; font-style: italic; }
.relic { position: absolute; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; border: 0; background: transparent; cursor: none; padding: 0; transition: transform .5s var(--ease-spring); }
.relic::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle, rgba(255,211,110,.4), transparent 70%); animation: pulse 2s ease-in-out infinite; }
.relic.found { transform: scale(0) rotate(180deg); pointer-events: none; }
.relic span { position: relative; filter: drop-shadow(0 0 8px rgba(255,211,110,.9)); }
.lantern { position: absolute; left: var(--vx, 50%); top: var(--vy, 50%); width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: #fff; box-shadow: 0 0 20px 6px rgba(255,211,110,.9), 0 0 80px 20px rgba(255,211,110,.35); pointer-events: none; z-index: 3; }
.vault-hud { position: absolute; left: 14px; right: 14px; top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 4; pointer-events: none; }
.vault-hud .glass { padding: 8px 14px; border-radius: 999px; font-weight: 750; font-size: .85rem; }
.relic-dots { display: flex; gap: 6px; }
.relic-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); transition: all .5s var(--ease-spring); }
.relic-dots i.on { background: var(--c4); box-shadow: 0 0 10px var(--c4); transform: scale(1.3); }
.vault-win { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; z-index: 5; opacity: 0; pointer-events: none; transition: opacity 1s; background: radial-gradient(circle, rgba(255,211,110,.18), rgba(5,4,13,.7)); }
.vault-win.show { opacity: 1; pointer-events: auto; cursor: auto; }
.vault-win .panel { max-width: 420px; }
.vault-win h2 { font-size: 1.8rem; }
.cabinet { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-top: 26px; }
.flip { perspective: 900px; min-height: 180px; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; }
.flip .faces { position: relative; width: 100%; height: 100%; min-height: 180px; transform-style: preserve-3d; transition: transform .9s var(--ease-spring); }
.flip.open .faces { transform: rotateY(180deg); }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; }
.flip .back { transform: rotateY(180deg); background: linear-gradient(160deg, rgba(111,247,255,.2), rgba(185,140,255,.1)) padding-box, linear-gradient(rgba(22,16,52,.6), rgba(22,16,52,.6)) padding-box, var(--glass-edge) border-box; }
.flip .face b { font-size: 1.15rem; }
.flip .face small { color: var(--ink-3); letter-spacing: .2em; text-transform: uppercase; font-size: .66rem; font-weight: 800; }
.flip .face p { color: var(--ink-2); margin: 0; font-size: .92rem; }
.flip .q { font-size: 2.4rem; }
.whisper { text-align: center; color: var(--ink-3); margin-top: 28px; font-size: .9rem; }
.whisper code { background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 6px; }

/* ==========================================================================
   ROOM 6 · The Blueprint Studio (build yours)
   ========================================================================== */
.studio { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } }
.config { display: grid; gap: 18px; }
.config fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.config legend { font-weight: 800; margin-bottom: 8px; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--c1); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts label { display: inline-flex; align-items: center; gap: 7px; padding: .6em 1em; border-radius: 999px; cursor: pointer; font-weight: 650; font-size: .92rem; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); transition: all .35s var(--ease-spring); user-select: none; }
.opts label:active { transform: scale(.94); }
.opts input:checked + label { background: linear-gradient(160deg, rgba(111,247,255,.3), rgba(185,140,255,.2)); border-color: rgba(111,247,255,.7); box-shadow: 0 0 0 3px rgba(111,247,255,.12), inset 0 1px 0 rgba(255,255,255,.4); }
.opts input:focus-visible + label { outline: 2px solid var(--c1); outline-offset: 2px; }
.preview-site { position: sticky; top: 100px; padding: 14px; }
.ps-frame { border-radius: 20px; overflow: hidden; min-height: 400px; transition: background .6s, color .6s; display: flex; flex-direction: column; }
.ps-bar { display: flex; gap: 6px; padding: 10px 12px; background: rgba(0,0,0,.25); align-items: center; }
.ps-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff6b8b; } .ps-bar i:nth-child(2) { background: #ffd36e; } .ps-bar i:nth-child(3) { background: #8dffb0; }
.ps-bar span { margin-left: 10px; font-size: .72rem; opacity: .7; font-family: ui-monospace, monospace; background: rgba(255,255,255,.1); padding: 3px 10px; border-radius: 999px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-body { padding: 22px; display: grid; gap: 14px; flex: 1; align-content: start; position: relative; overflow: hidden; }
.ps-body h3 { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.05; margin: 6px 0 0; letter-spacing: -.03em; }
.ps-pages { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-pages span { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); animation: rise .5s var(--ease-spring) both; }
.ps-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ps-feats div { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-size: .82rem; font-weight: 700; animation: rise .5s var(--ease-spring) both; }
.ps-feats div em { display: block; font-style: normal; font-size: 1.3rem; margin-bottom: 4px; }
.vibe-glass .ps-frame { background: linear-gradient(135deg, #2c1670, #0f2c5a); color: #fff; }
.vibe-glass .ps-body::before { content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%; right: -60px; top: -60px; background: radial-gradient(circle, #ff7ad9, transparent 65%); opacity: .6; }
.vibe-neon .ps-frame { background: #07060f; color: #8dffb0; }
.vibe-neon .ps-body h3 { text-shadow: 0 0 18px #8dffb0; }
.vibe-neon .ps-feats div { border-color: #8dffb0; box-shadow: 0 0 14px -4px #8dffb0; background: transparent; }
.vibe-calm .ps-frame { background: #f6f1e7; color: #2e2a22; }
.vibe-calm .ps-bar { background: #e9e0cf; }
.vibe-calm .ps-pages span, .vibe-calm .ps-feats div { background: #fff; border-color: #e2d7c3; }
.vibe-bold .ps-frame { background: #ffd36e; color: #1a1033; }
.vibe-bold .ps-body h3 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 900; }
.vibe-bold .ps-feats div { background: #1a1033; color: #ffd36e; border: 0; }
.udp { margin-top: 26px; text-align: center; padding: clamp(24px, 5vw, 48px); }
.udp h2 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); margin: 10px 0 10px; letter-spacing: -.02em; }
.udp p { max-width: 600px; margin: 0 auto 22px; color: var(--ink-2); }
.placeholder-note { display: inline-block; margin-top: 16px; font-size: .78rem; font-family: ui-monospace, monospace; color: #ffd36e; background: rgba(255,211,110,.1); border: 1px dashed rgba(255,211,110,.6); padding: 6px 12px; border-radius: 10px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-top: 22px; text-align: left; }
.steps .panel .n { font-size: 2rem; font-weight: 900; }

/* ---------- toast + bursts ---------- */
.toast { position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); z-index: 80; translate: -50% 0; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: .92rem; max-width: calc(100% - 32px); text-align: center;
  opacity: 0; transform: translateY(20px) scale(.9); transition: opacity .4s, transform .6s var(--ease-spring); pointer-events: none; }
@media (min-width: 861px) { .toast { bottom: 30px; } }
.toast.show { opacity: 1; transform: none; }
.burst-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.spark { position: absolute; width: 10px; height: 10px; border-radius: 3px; will-change: transform, opacity; }
.ripple { position: absolute; width: 20px; height: 20px; margin: -10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); animation: rip .9s var(--ease-out) forwards; }
@keyframes rip { to { transform: scale(9); opacity: 0; border-width: .5px; } }

/* global easter-egg modes */
html.mode-upside main { transform: rotate(180deg); transition: transform 1.4s var(--ease-spring); }
html.mode-prism main, html.mode-prism .sky { animation: prism 4s linear infinite; } /* not on body: a filter there would trap the fixed tab bar */
@keyframes prism { to { filter: hue-rotate(360deg); } }
html.mode-gravity .glass, html.mode-gravity .door { transition: transform 1.2s cubic-bezier(.5, 0, .75, 0) !important; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  ::view-transition-old(room), ::view-transition-new(room) { animation: none !important; }
  .rise, .hero-title .ch, .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
  .orb { animation: none !important; }
}

/* ==========================================================================
   "More" sheet (rooms beyond the main tabs)
   ========================================================================== */
.build-chip { border-color: rgba(255,211,110,.55); }
@media (max-width: 1100px) { .build-chip { display: none; } }
.sheet { position: fixed; inset: 0; z-index: 45; pointer-events: none; } /* under the header + tab bar (z 50), so the bar stays live while the menu is open */
.sheet .scrim { position: absolute; inset: 0; background: rgba(5,4,14,.45); opacity: 0; transition: opacity .4s; }
.sheet .sheet-card { position: absolute; right: max(12px, calc(50% - 590px)); top: calc(80px + var(--safe-t)); width: min(380px, calc(100% - 24px)); padding: 14px; display: grid; gap: 8px;
  transform-origin: top right; transform: scale(.85) translateY(-10px); opacity: 0; transition: transform .55s var(--ease-spring), opacity .3s; }
.sheet.open { pointer-events: auto; }
.sheet.open .scrim { opacity: 1; }
.sheet.open .sheet-card { transform: none; opacity: 1; }
@media (max-width: 860px) { .sheet .sheet-card { top: auto; bottom: calc(96px + var(--safe-b)); right: 12px; transform-origin: bottom right; transform: scale(.85) translateY(20px); } }
.sheet-card h4 { margin: 4px 6px 4px; font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-3); }
.sheet-link { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; text-decoration: none; transition: background .3s; }
.sheet-link:hover, .sheet-link.hot, .sheet-link[aria-current="page"] { background: rgba(255,255,255,.1); }
.sheet-link .ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(255,255,255,.2), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.22); flex: none; }
.sheet-link .ico svg { width: 22px; height: 22px; }
.sheet-link b { display: block; } .sheet-link small { color: var(--ink-3); }

/* ==========================================================================
   ROOM · Light Painting in Space
   ========================================================================== */
html[data-room="space"] #motes { opacity: 0; }
.space-stage { position: relative; height: clamp(480px, 72vh, 720px); border-radius: 32px; overflow: hidden; touch-action: none; background: #020109; cursor: crosshair;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 40px 80px -40px #000; }
.space-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.space-ui { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 10px; border-radius: 26px; z-index: 3; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); cursor: pointer; padding: 0; background: var(--sw); box-shadow: 0 0 14px -2px var(--sw); transition: transform .4s var(--ease-spring); touch-action: manipulation; }
.swatch.on { transform: scale(1.22); border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.15), 0 0 22px var(--sw); }
.swatch.rainbow { background: conic-gradient(#6ff7ff, #b98cff, #ff7ad9, #ffd36e, #8dffb0, #6ff7ff); }
.space-ui .sep { width: 1px; height: 26px; background: rgba(255,255,255,.18); }
.space-tip { position: absolute; top: 16px; left: 50%; translate: -50% 0; z-index: 3; pointer-events: none; color: rgba(255,255,255,.7); font-size: .85rem; font-weight: 650; text-align: center; transition: opacity .8s; padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.space-tip.gone { opacity: 0; }

/* ==========================================================================
   ROOM · The Terminal
   ========================================================================== */
.term-wrap { max-width: 900px; margin: 0 auto; }
.crt { position: relative; border-radius: 30px; padding: 16px; background: linear-gradient(160deg, #2a2440, #141024); box-shadow: inset 0 2px 0 rgba(255,255,255,.15), inset 0 -4px 10px rgba(0,0,0,.5), 0 50px 90px -40px #000, 0 0 0 1px rgba(255,255,255,.08); }
.crt-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 12px; color: rgba(255,255,255,.5); font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 800; }
.crt-led { width: 9px; height: 9px; border-radius: 50%; background: #8dffb0; box-shadow: 0 0 10px #8dffb0; display: inline-block; margin-right: 8px; animation: pulse 2.4s ease-in-out infinite; }
.screen { position: relative; height: clamp(380px, 58vh, 560px); border-radius: 22px; overflow: hidden; background: radial-gradient(ellipse at center, #0b2016 0%, #040a07 80%); box-shadow: inset 0 0 60px rgba(0,0,0,.9), inset 0 0 0 2px rgba(0,0,0,.6); cursor: text; }
.screen::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }
.screen::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at 50% 40%, rgba(141,255,176,.08), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.06), transparent 18%); animation: flick 5s steps(1) infinite; }
@keyframes flick { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .75; } 98% { opacity: .95; } }
.term-out { position: absolute; inset: 0; overflow-y: auto; padding: 18px 18px 22px; font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: clamp(13px, 1.7vw, 15.5px); line-height: 1.55; color: #9dffc0; text-shadow: 0 0 6px rgba(141,255,176,.65), 0 0 18px rgba(141,255,176,.25); scrollbar-width: thin; scrollbar-color: #2b5a3d transparent; white-space: pre-wrap; word-break: break-word; overscroll-behavior: contain; }
.term-out .sys { color: #6ff7ff; text-shadow: 0 0 6px rgba(111,247,255,.6); }
.term-out .warn { color: #ffd36e; text-shadow: 0 0 6px rgba(255,211,110,.6); }
.term-out .pink { color: #ff9be4; text-shadow: 0 0 6px rgba(255,122,217,.6); }
.term-out .dim { opacity: .6; }
.term-out .you { color: #fff; text-shadow: 0 0 6px rgba(255,255,255,.5); }
.term-line { display: flex; gap: .6ch; align-items: baseline; }
.term-line .ps1 { color: #ff9be4; text-shadow: 0 0 6px rgba(255,122,217,.6); flex: none; }
.term-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: #fff; font: inherit; text-shadow: inherit; caret-color: transparent; padding: 0; font-size: max(16px, 1em); }
.term-line .typed { color: #fff; }
.cursor { display: inline-block; width: .62em; height: 1.15em; background: #9dffc0; box-shadow: 0 0 10px #9dffc0; vertical-align: text-bottom; animation: blink 1s steps(1) infinite; margin-left: -2px; }
@keyframes blink { 50% { opacity: 0; } }
.term-entry { position: relative; flex: 1; min-width: 0; display: flex; }
.term-entry .mirror { pointer-events: none; color: #fff; white-space: pre; overflow: hidden; }
.term-entry .term-input { position: absolute; inset: 0; opacity: 0; }
.hints { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.hints .chip { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; font-weight: 600; padding: .5em .9em; }
.hints .chip::before { content: '>'; color: #ff9be4; }
.matrix-rain { position: absolute; inset: 0; z-index: 1; opacity: 0; pointer-events: none; transition: opacity .8s; }
.matrix-rain.on { opacity: .55; }

/* ==========================================================================
   ROOM · The Playground
   ========================================================================== */
.toys { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.toy { grid-column: span 6; position: relative; min-height: 340px; padding: 18px; display: flex; flex-direction: column; overflow: hidden; }
.toy.wide { grid-column: span 12; min-height: 420px; }
.toy.third { grid-column: span 4; }
@media (max-width: 960px) { .toy, .toy.third { grid-column: span 12; } }
.toy-head { position: relative; z-index: 3; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; pointer-events: none; }
.toy-head > * { pointer-events: auto; }
.toy-head h3 { margin: 0; font-size: 1.15rem; }
.toy-head p { margin: 2px 0 0; color: var(--ink-2); font-size: .88rem; }
.toy-head .tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.toy-head .chip { padding: .45em .8em; font-size: .8rem; }
.toy-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; border-radius: inherit; }
.toy-body { position: relative; flex: 1; display: grid; place-items: center; }
/* gooey metaballs */
.goo-field { position: absolute; inset: 0; filter: url(#goo); overflow: hidden; touch-action: none; border-radius: inherit; }
.goo-field i { position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); margin: calc(var(--s) / -2); border-radius: 50%; background: var(--bg); will-change: transform; }
/* magnetic text */
.mag-text { font-size: clamp(2.6rem, 9vw, 5.4rem); font-weight: 900; letter-spacing: -.03em; line-height: 1; text-align: center; user-select: none; touch-action: none; padding: 40px 0; }
.mag-text span { display: inline-block; transition: transform .5s var(--ease-spring), color .4s; will-change: transform; }
/* gradient mixer */
.mixer { position: absolute; inset: 0; border-radius: inherit; touch-action: none; cursor: pointer;
  background: radial-gradient(circle at var(--ax, 25%) var(--ay, 30%), var(--ca, #ff7ad9), transparent 55%), radial-gradient(circle at var(--bx, 75%) var(--by, 70%), var(--cb, #6ff7ff), transparent 55%), radial-gradient(circle at var(--cx, 60%) var(--cy, 25%), var(--cc, #ffd36e), transparent 50%), #2c1670; transition: background .2s; }
.mixer-knob { position: absolute; width: 44px; height: 44px; margin: -22px; border-radius: 50%; border: 2px solid #fff; background: rgba(255,255,255,.25); box-shadow: 0 6px 18px -4px #000, inset 0 1px 0 #fff; cursor: grab; touch-action: none; z-index: 2; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.hex-out { position: relative; z-index: 3; margin-top: auto; align-self: flex-start; font-family: ui-monospace, monospace; font-size: .8rem; padding: 6px 12px; }
/* jelly buttons */
.jellies { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; padding: 20px 0; }
.jelly { width: 82px; height: 82px; border-radius: 28px; border: 1px solid rgba(255,255,255,.45); cursor: pointer; font-size: 1.8rem; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(255,255,255,.5), rgba(255,255,255,.06)), var(--jc); box-shadow: inset 0 -8px 14px rgba(0,0,0,.2), inset 0 2px 0 rgba(255,255,255,.7), 0 16px 30px -12px var(--jc); touch-action: manipulation; }
.jelly.boing { animation: boing .8s var(--ease-spring); }
@keyframes boing { 0% { transform: scale(1); } 20% { transform: scale(1.3, .7); } 40% { transform: scale(.8, 1.25); } 60% { transform: scale(1.12, .9); } 80% { transform: scale(.96, 1.04); } 100% { transform: scale(1); } }
/* orbit toy (planet wobbler) */
.ripple-pool { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; touch-action: none; cursor: pointer;
  background: radial-gradient(circle at 50% 120%, #1f6c9e, #0b0820 70%); }
.ripple-pool .drop { position: absolute; width: 40px; height: 40px; margin: -20px; border-radius: 50%; border: 2px solid var(--rc, #6ff7ff); animation: poolRip 2.2s var(--ease-out) forwards; box-shadow: 0 0 20px var(--rc, #6ff7ff); }
@keyframes poolRip { to { transform: scale(12); opacity: 0; border-width: .3px; } }
@media (max-width: 600px) {
  .space-ui { gap: 6px; padding: 8px; left: 8px; right: 8px; bottom: 8px; border-radius: 22px; }
  .space-ui .sep { display: none; }
  .space-ui .chip { padding: .42em .72em; font-size: .76rem; }
  .swatch { width: 26px; height: 26px; }
  .space-tip { font-size: .78rem; top: 12px; }
}
@media (max-width: 600px) { .crt { padding: 10px; border-radius: 24px; } .crt-top span:last-child { display: none; } .screen { border-radius: 16px; } }
/* perf: the two largest portal rings stay still, and phones keep the rings still entirely (the intro zoom still plays) */
.ring:nth-child(-n+2)::before { animation: none; }
@media (hover: none) { .ring::before { animation: none; } }
