:root {
 --theme-bg:#f6b32d;
 --theme-foreground:#512c31;
 --theme-panel:#462f36;
 --theme-bar:#684049;
 --theme-text:#fff0cd;
 --theme-link:#ffcf80;
 --theme-accent:#ffc442;
 --theme-edge:#ffe296;
 --theme-ink:#49303b;
 font:14px/1.6 "Trebuchet MS", sans-serif;
}
*{box-sizing:border-box}
body{margin:0;min-height:100dvh;overflow:hidden;background:var(--theme-bg);color:var(--theme-foreground)}
[hidden]{display:none!important}
a{color:inherit;text-underline-offset:4px}
button,select{font:inherit;cursor:pointer}
:focus-visible{outline:3px solid #fffaf0;outline-offset:3px}
.sr-only,.wordmark:has(canvas) span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

header{position:fixed;inset:0 0 auto;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:24px 28px;z-index:5;pointer-events:none}
header a,header button,header select{pointer-events:auto}
.wordmark{display:block;color:#fffaf0;font-size:24px;font-weight:900;text-decoration:none;text-shadow:0 2px 12px #49303b55}
.wordmark canvas,#title canvas{display:block;image-rendering:pixelated;filter:drop-shadow(2px 3px 0 var(--theme-ink))}
.wordmark canvas{width:clamp(168px,27vw,340px);height:auto}
#title{min-width:0;color:#fffaf0;text-align:right;text-shadow:0 2px 12px #49303b55}
#title canvas{width:auto;height:auto;max-width:100%;margin-left:auto}
.header-right{text-align:right}
h1{margin:0 0 5px;font-size:clamp(17px,2.1vw,26px);line-height:1.1}
.utilities{display:flex;align-items:center;justify-content:flex-end;gap:5px}
#palette,.icon-button,#details,#close-details{background:var(--theme-panel);border:1px solid var(--theme-ink);color:var(--theme-text)}
#palette{height:36px;max-width:100%;padding:0 6px}
.icon-button,#close-details{display:grid;place-items:center;width:44px;height:44px;padding:8px}
.icon-button svg{width:24px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.sound-off,.icon-button[aria-pressed="false"] .sound-waves{display:none}
.icon-button[aria-pressed="false"] .sound-off{display:initial}
.stage{position:fixed;inset:0;width:100vw;height:100dvh;touch-action:none;cursor:grab}
.stage:active{cursor:grabbing}
.stage>canvas{display:block;width:100%;height:100%;image-rendering:auto}
#fallback{display:none;position:fixed;inset:34% 16px auto;text-align:center}
.failed #fallback{display:block}
.failed .stage{display:none}

#info{position:fixed;left:28px;top:50%;transform:translateY(-50%);width:clamp(300px,29vw,420px);max-height:calc(100dvh - 160px);margin:0;border:2px solid var(--theme-ink);border-radius:7px;background:var(--theme-panel);color:var(--theme-text);box-shadow:7px 8px color-mix(in srgb,var(--theme-ink) 25%,transparent);overflow:auto;z-index:4;overscroll-behavior:contain}
.terminal-bar{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:center;min-height:42px;padding:8px;background:var(--theme-bar);border-bottom:1px solid var(--theme-ink);font-size:12px}
.window-dots{position:absolute;left:14px;display:flex;gap:7px;align-items:center}
.window-dots i{width:11px;height:11px;border-radius:50%;background:#ff5f57;box-shadow:inset 0 0 0 1px #0003}
.window-dots i:nth-child(2){background:#febc2e}
.window-dots i:nth-child(3){background:#28c840}
.terminal-content{padding:20px 22px 24px;font-size:13px;line-height:1.75;overflow-wrap:anywhere}
#info h2{font-size:15px;color:var(--theme-edge);margin:12px 0}
#info p{margin:12px 0 22px}
#info .prompt{font-size:12px;margin:0 0 12px;line-height:1.9}
.prompt>span:first-child,.cursor{color:var(--theme-accent)}
.prompt .path,.projects a{color:var(--theme-link)}
.prompt .command{color:var(--theme-edge)}
.projects{display:grid;margin:0 0 24px;gap:15px}
.projects a{line-height:1.6;text-decoration:none}
.projects a:hover{text-decoration:underline}
.projects span{display:block;color:var(--theme-text);font-size:12px}
#info .terminal-idle{margin:24px 0 0}
#details,#close-details{display:none}

.part-callouts,.console-ui{position:absolute;inset:0;pointer-events:none;z-index:2}
.part-callouts{overflow:hidden}
.console-ui{z-index:3}
.part-callouts svg,.console-ui svg{position:absolute;inset:0;width:100%;height:100%}
.part-callouts polyline,.console-ui polyline{fill:none;stroke:var(--theme-edge);stroke-width:2;filter:drop-shadow(0 1px 0 var(--theme-ink))}
.part-callouts circle{fill:var(--theme-accent);stroke:var(--theme-ink);stroke-width:1.5}
.part-balloon{position:absolute;pointer-events:auto;font-size:11px;line-height:1.35;min-height:40px;padding:6px 8px;background:var(--theme-panel);color:var(--theme-text);border:1px solid var(--theme-link);border-radius:4px;box-shadow:2px 3px var(--theme-ink);text-align:left;touch-action:manipulation}
.part-balloon[aria-pressed="true"]{border-color:var(--theme-edge);background:var(--theme-bar)}
.console-balloon{min-height:32px;white-space:nowrap}
.console-hit{position:absolute;width:32px;height:32px;transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;border:0;background:transparent;border-radius:50%;padding:0}
.console-hit[role="slider"]{cursor:ns-resize}
#note{position:fixed;left:50%;bottom:8px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);margin:0;z-index:3;pointer-events:none;font-size:12px}
#note.has-note{padding:6px 10px;background:var(--theme-panel);color:var(--theme-text);border:1px solid var(--theme-link)}

@media(max-width:900px){
 header{padding:14px 12px}
 #details{position:fixed;right:0;top:45%;z-index:4;display:block;min-height:44px;padding:7px 8px;writing-mode:vertical-rl;box-shadow:-2px 2px var(--theme-ink)}
 #info{left:auto;right:0;top:0;bottom:0;width:min(360px,calc(100vw - 22px));max-height:none;transform:translateX(103%);visibility:hidden;border-radius:0;z-index:6;transition:transform .24s ease,visibility 0s linear .24s}
 .drawer-open #info{transform:translateX(0);visibility:visible;transition-delay:0s}
 .drawer-open #details{visibility:hidden}
 #close-details{display:grid;position:absolute;right:4px;top:2px;font-size:22px}
 .terminal-bar{min-height:49px}
 .terminal-content{padding:18px 16px}
 .part-balloon{font-size:10px}
 #palette{font-size:11px}
}
@media(prefers-reduced-motion:reduce){#info{transition:none}}

.reassemble-action{
 min-height:44px;
 padding:8px 14px;
 background:#ffe08a;
 color:#392536;
 border:2px solid #392536;
 box-shadow:3px 3px #392536;
 font-size:13px;
 font-weight:800;
}
.reassemble-action:active{box-shadow:1px 1px #392536}

.utilities{
 position:fixed;
 right:max(14px,env(safe-area-inset-right));
 bottom:max(14px,env(safe-area-inset-bottom));
 z-index:5;
 flex-direction:column;
 gap:8px;
}
.utilities .icon-button{box-shadow:2px 2px var(--theme-ink)}
#palette-menu{
 position:fixed;
 inset:auto max(66px,calc(env(safe-area-inset-right) + 52px)) max(66px,calc(env(safe-area-inset-bottom) + 52px)) auto;
 margin:0;
 padding:4px;
 background:var(--theme-panel);
 border:1px solid var(--theme-link);
}
.console-hit.volume-hit{width:44px;height:48px}

.wordmark,#title{font-size:clamp(20px,2.4vw,30px);letter-spacing:-.04em}
#info{border:0;border-radius:18px;box-shadow:0 18px 50px #241a2538}
.terminal-bar{border-bottom:0}.icon-button,#palette,#details,#close-details{border:0;border-radius:12px}.utilities .icon-button{box-shadow:0 4px 14px #241a2530}.part-balloon,.reassemble-action{border-radius:10px;box-shadow:0 4px 14px #241a2530}

/* The portfolio shares the original scene without the standalone page chrome. */
html.embedded,html.embedded body{background:transparent!important}
.embedded header,.embedded .utilities,.embedded #details,.embedded #info,.embedded #note{display:none!important}
.embedded .stage{background:transparent}
.embedded .console-balloon{font-size:10px}
