@font-face { font-family: 'VT323'; src: url(/fonts/vt323.woff2) format('woff2'); font-display: block; }
@font-face { font-family: 'Plex Mono'; src: url(/fonts/plex-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root { --amber: #ffb340; --amber-dim: #8a5a1c; --ink: #07050a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--amber); overflow: hidden; }
body { font-family: 'Plex Mono', ui-monospace, monospace; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }

/* loading veil */
#veil { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--ink); z-index: 5; transition: opacity 1.4s ease; font-family: 'VT323', monospace; font-size: 22px; letter-spacing: .08em; }
#veil p { margin: 0; opacity: .7; }
.sigil-spin { width: 64px; height: 64px; background: url(/favicon.svg) center/contain no-repeat; animation: spin 6s linear infinite; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
body.ready #veil { opacity: 0; pointer-events: none; }

/* hint */
#hint { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); font-family: 'VT323', monospace; font-size: 20px; letter-spacing: .14em; color: #e9d7b0; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; text-shadow: 0 0 8px rgba(255,170,60,.45); z-index: 3; white-space: nowrap; }
#hint.on { opacity: .75; }
#hint .k::before { content: '› '; color: var(--amber); }

/* dive-through-the-screen overlay */
#dive { position: fixed; inset: 0; background: radial-gradient(circle at 50% 50%, #fff2cf 0%, #ffb340 35%, #2a1406 100%); opacity: 0; pointer-events: none; z-index: 6; transition: opacity .55s ease-in; }
#dive.on { opacity: 1; }

#sound { position: fixed; right: 16px; bottom: 14px; z-index: 4; background: none; border: 1px solid rgba(255,179,64,.25); color: #e9d7b0; font-family: 'VT323', monospace; font-size: 18px; padding: 2px 10px 0; border-radius: 3px; cursor: pointer; opacity: .55; transition: opacity .3s; }
#sound:hover, #sound:focus-visible { opacity: 1; }
body.loading #sound { display: none; }

/* plain fallback: visible without WebGL, kept for screen readers otherwise */
#fallback { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 48px 24px; height: 100%; overflow: auto; }
#fallback h1 { font-family: 'VT323', monospace; font-weight: 400; font-size: 56px; margin: 0; letter-spacing: .08em; }
#fallback h2 { font-family: 'VT323', monospace; font-weight: 400; letter-spacing: .1em; opacity: .7; }
#fallback .works { list-style: none; padding: 0; }
#fallback .works li { margin: 0 0 14px; }
#fallback a { color: var(--amber); text-decoration: none; }
#fallback .num { display: inline-block; width: 3.2em; opacity: .6; }
#fallback .ty { opacity: .6; font-size: .8em; }
#fallback small { color: #c9a57a; margin-left: 3.2em; }
#fallback .note { opacity: .5; font-size: 13px; }
body.webgl #fallback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; padding: 0; }
body.nogl #veil, body.nogl #hint { display: none; }
body.nogl { overflow: auto; }

body.pointer #stage canvas { cursor: pointer; }
body.card #veil, body.card #hint, body.card #sound { display: none; }
