* { box-sizing: border-box; }
:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #07110f;
    color: #eefcf6;
}
html, body, main { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: radial-gradient(circle at 50% 40%, #153128 0, #07110f 68%); }
canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 52% 45%, rgba(51, 118, 92, .18), transparent 45%), linear-gradient(135deg, #07110f, #0a1815);
    cursor: crosshair;
    touch-action: manipulation;
}
.brainNode {
    border-radius: 50%;
    display: inline-block;
    height: 3vmin;
    width: 3vmin;
    text-align: center;
    transition: opacity .5s;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}
#nodeHolder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-height: 28vh;
    overflow: hidden;
    opacity: .7;
    transition: opacity .5s;
    line-height: 0;
    pointer-events: none;
    mask-image: linear-gradient(#000 45%, transparent 100%);
}
.intro {
    position: absolute;
    z-index: 3;
    top: max(18px, env(safe-area-inset-top));
    left: max(20px, env(safe-area-inset-left));
    width: min(390px, calc(100% - 40px));
    pointer-events: none;
    text-shadow: 0 2px 18px #000;
}
.eyebrow { margin: 0 0 7px; color: #65f5ac; font-size: 11px; letter-spacing: .24em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(25px, 5vw, 43px); line-height: 1; letter-spacing: -.04em; }
.intro p:not(.eyebrow) { margin: 10px 0 0; max-width: 355px; color: #c7dbd2; font-size: 14px; line-height: 1.45; }
.intro .hint { color: #ffe17c; font-weight: 700; }
.telemetry {
    position: absolute;
    z-index: 4;
    right: max(18px, env(safe-area-inset-right));
    top: max(18px, env(safe-area-inset-top));
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    max-width: 390px;
    pointer-events: none;
}
.telemetry span {
    padding: 7px 10px;
    border: 1px solid rgba(141, 239, 190, .24);
    border-radius: 999px;
    background: rgba(3, 17, 13, .7);
    color: #bcd5ca;
    font-size: 12px;
    backdrop-filter: blur(8px);
}
.telemetry strong { color: #fff; }
#statusText { color: #65f5ac; }
.controls {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(141, 239, 190, .2);
    border-radius: 16px;
    background: rgba(3, 15, 12, .86);
    box-shadow: 0 16px 50px rgba(0, 0, 0, .34);
    backdrop-filter: blur(12px);
}
button, .connectome-toggle, .speed-control {
    min-height: 40px;
    border: 1px solid rgba(141, 239, 190, .18);
    border-radius: 10px;
    color: #eefcf6;
    background: rgba(255, 255, 255, .055);
    font: inherit;
    font-size: 13px;
}
button { cursor: pointer; padding: 0 13px; }
button:hover { background: rgba(101, 245, 172, .13); border-color: rgba(101, 245, 172, .5); }
button:focus-visible, input:focus-visible { outline: 2px solid #ffe17c; outline-offset: 2px; }
button span { color: #65f5ac; font-size: 18px; vertical-align: -1px; }
.connectome-toggle, .speed-control { display: flex; align-items: center; gap: 8px; padding: 0 11px; }
.connectome-toggle input { accent-color: #65f5ac; }
.speed-control { min-width: 190px; }
.speed-control span { white-space: nowrap; color: #c7dbd2; }
.speed-control strong { color: #65f5ac; }
#speedSlider { width: 100px; accent-color: #65f5ac; }
@media (max-width: 720px) {
    .intro { top: 14px; left: 15px; width: calc(100% - 30px); }
    .intro p:not(.eyebrow) { max-width: 270px; font-size: 12px; }
    .telemetry { top: auto; bottom: 88px; left: 10px; right: 10px; justify-content: center; }
    .controls { width: calc(100% - 20px); justify-content: center; flex-wrap: wrap; bottom: 10px; padding: 7px; gap: 6px; }
    button, .connectome-toggle, .speed-control { min-height: 35px; font-size: 11px; }
    .speed-control { min-width: min(185px, 100%); }
    #nodeHolder { max-height: 20vh; }
}
@media (prefers-reduced-motion: reduce) {
    .brainNode, #nodeHolder { transition: none; }
}
