:root { --ink: #e9e6f2; --dim: rgba(233, 230, 242, .62); --mag: #ff3d9a; --vio: #7a5cff; --cy: #35e0ff; --yel: #ffd23f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07070c; overflow: hidden; color: var(--ink);
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; touch-action: none; }

/* loading veil: alive from the first frame */
#veil { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 60%, #15101f 0%, #07070c 62%); transition: opacity 1.1s ease .1s, visibility 0s linear 1.3s; }
body.frozen #veil { transition: none; }
#veil.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.veil-inner { display: grid; justify-items: center; gap: 14px; }
.tri { position: relative; width: 74px; height: 64px; animation: tri-float 3.2s ease-in-out infinite; }
.tri i { position: absolute; left: 0; top: 0; width: 74px; height: 64px; clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(140deg, #ff8a3d, var(--mag) 45%, var(--vio) 80%); opacity: .9; animation: tri-pulse 1.8s ease-in-out infinite; }
.tri i:nth-child(2) { transform: translate(37px, 0) rotate(180deg) scale(.999); transform-origin: 50% 50%; background: linear-gradient(200deg, var(--mag), var(--vio) 60%, var(--cy)); animation-delay: .3s; }
.tri i:nth-child(3) { transform: translate(-37px, 0) rotate(180deg); background: linear-gradient(160deg, #ffb13d, #ff5a5a 60%, var(--mag)); animation-delay: .6s; }
@keyframes tri-pulse { 0%, 100% { opacity: .35; filter: brightness(.8); } 50% { opacity: 1; filter: brightness(1.25) drop-shadow(0 0 14px rgba(255, 61, 154, .55)); } }
@keyframes tri-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.veil-name { margin-top: 10px; font-weight: 600; letter-spacing: .02em; font-size: 20px; }
.veil-bar { width: 180px; height: 2px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
.veil-bar b { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, var(--mag), var(--cy)); transition: width .25s ease; }
.veil-note { font-size: 12.5px; color: var(--dim); letter-spacing: .02em; }

/* quiet title, one hint line */
#title { position: fixed; left: clamp(18px, 2.4vw, 40px); top: clamp(16px, 2.2vw, 34px); z-index: 10; pointer-events: none;
  text-shadow: 0 1px 18px rgba(0, 0, 0, .65); transition: opacity .6s ease, transform .6s ease; }
#title::before { content: ''; position: absolute; left: -60px; top: -50px; width: 560px; height: 260px; z-index: -1;
  background: radial-gradient(closest-side, rgba(5, 5, 10, .5), rgba(5, 5, 10, 0)); pointer-events: none; }
#title h1 { margin: 0; font-size: clamp(19px, 1.5vw, 26px); font-weight: 600; letter-spacing: .01em; }
#title .role { margin: 4px 0 0; font-size: clamp(12px, .86vw, 14.5px); color: var(--dim); max-width: 34em; }
#title .hint { margin: 12px 0 0; font-size: clamp(12px, .86vw, 14.5px); color: var(--ink); opacity: .9; display: inline-flex; align-items: center; gap: 9px; }
#title .hint::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mag); box-shadow: 0 0 10px var(--mag); animation: dot 1.6s ease-in-out infinite; }
@keyframes dot { 0%, 100% { transform: scale(.7); opacity: .55; } 50% { transform: scale(1.15); opacity: 1; } }
body.in-os #title, body.flying #title { opacity: 0; transform: translateY(-6px); }
body.frozen *, body.frozen *::before { animation-play-state: paused !important; }

#sound, #leave { position: fixed; z-index: 40; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 12px; border-radius: 999px;
  background: rgba(14, 12, 22, .55); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s, opacity .5s, transform .2s; }
#sound { right: clamp(18px, 2.4vw, 40px); top: clamp(16px, 2.2vw, 34px); }
#sound:hover, #leave:hover { background: rgba(40, 24, 60, .7); border-color: rgba(255, 61, 154, .7); }
#sound:active, #leave:active { transform: scale(.97); }
#sound .w1, #sound .w2 { display: none; }
#sound[aria-pressed="true"] .w1, #sound[aria-pressed="true"] .w2 { display: block; }
#sound[aria-pressed="true"] .x { display: none; }
#sound[aria-pressed="true"] { border-color: rgba(53, 224, 255, .55); }
body.in-os #sound { opacity: 0; pointer-events: none; }
#leave { left: 50%; bottom: 22px; transform: translateX(-50%); }
#leave[hidden] { display: none; }
kbd { font: 500 11px 'JetBrains Mono', ui-monospace, monospace; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, .12); }

#os { position: fixed; inset: 0; z-index: 20; opacity: 0; transform: scale(1.035); transition: opacity .3s ease, transform .45s cubic-bezier(.2, .7, .2, 1); }
#os.on { opacity: 1; transform: none; }
#os[hidden] { display: none; }
