:root {
    --bg: #06070b;
    --fg: #eceef4;
    --muted: #8d92a8;
    --line: rgba(255, 255, 255, 0.09);
    --glass: rgba(10, 12, 20, 0.72);
    --accent: #5eead4;
    --pink: #ff5fb4;
    --display: "Space Grotesk", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --gutter: clamp(16px, 4vw, 48px);
    --panel-w: min(480px, 42vw);
    color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--display);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: radial-gradient(ellipse at 50% 40%, #171b30 0%, var(--bg) 70%);
    touch-action: none;
    cursor: grab;
}

body.dragging #scene { cursor: grabbing; }

body.hovering #scene { cursor: pointer; }

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* loader */
#loader {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--gutter);
    transition: opacity 0.8s, visibility 0.8s;
}

#loader.done { opacity: 0; visibility: hidden; }

.boot {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    min-height: 9em;
    white-space: pre-wrap;
}

.boot b { color: var(--accent); font-weight: 500; }

.boot-bar { width: min(320px, 100%); height: 2px; background: var(--line); margin-top: 16px; overflow: hidden; }

.boot-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }

/* nav */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px var(--gutter);
    pointer-events: none;
}

.nav > * { pointer-events: auto; }

.nav-logo { font-family: var(--mono); font-weight: 700; font-size: 18px; text-decoration: none; }

.nav-logo span { color: var(--pink); }

.nav nav { display: flex; gap: 6px; align-items: center; }

.nav nav a {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    transition: color 0.2s, background 0.2s;
}

.nav nav a:hover { color: var(--fg); }

.nav nav a.active { color: var(--bg); background: var(--accent); }

.nav nav .nav-cta { color: var(--fg); border: 1px solid var(--line); background: rgba(10, 12, 20, 0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.nav nav .nav-cta:hover { border-color: var(--accent); }

/* hero */
.hero {
    position: fixed;
    left: var(--gutter);
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
    z-index: 10;
    max-width: 520px;
    transition: opacity 0.6s, transform 0.6s;
}

body:not([data-route="home"]) .hero { opacity: 0; transform: translateY(20px); pointer-events: none; }

.eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.6); }
    70%, 100% { box-shadow: 0 0 0 10px rgba(94, 234, 212, 0); }
}

.hero h1 {
    font-size: clamp(48px, 7vw, 96px);
    line-height: 0.9;
    letter-spacing: -0.045em;
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6);
}

.hero-sub { color: #b7bbcc; margin-top: 16px; max-width: 42ch; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8); }

.hint-touch { display: none; }

@media (hover: none) {
    .hint-desktop { display: none; }
    .hint-touch { display: inline; }
}

.np-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(10, 12, 20, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: var(--mono);
    font-size: 12px;
    max-width: 100%;
}

.np-chip[hidden] { display: none; }

.np-chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; flex-shrink: 0; }

.bars i { width: 3px; height: 100%; background: #1db954; border-radius: 1px; transform-origin: bottom; animation: bar 1s ease-in-out infinite; }

.bars i:nth-child(2) { animation-delay: -0.4s; }

.bars i:nth-child(3) { animation-delay: -0.7s; }

.np-chip.paused .bars i { animation: none; transform: scaleY(0.3); background: var(--muted); }

@keyframes bar {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* hotspots projected from 3D */
#hotspots { position: fixed; inset: 0; pointer-events: none; z-index: 5; transition: opacity 0.4s; }

body:not([data-route="home"]) #hotspots { opacity: 0; }

body:not([data-route="home"]) #hotspots .hotspot { pointer-events: none; }

.hotspot {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg);
    white-space: nowrap;
    will-change: transform;
}

.hotspot .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.hotspot .txt {
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(6, 7, 11, 0.7);
    border: 1px solid var(--line);
    opacity: 0.85;
    transition: opacity 0.2s, border-color 0.2s;
}

.hotspot:hover .txt, .hotspot.hot .txt { opacity: 1; border-color: var(--accent); }

#cursor-label {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    pointer-events: none;
    font-family: var(--mono);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--bg);
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
}

#cursor-label.show { opacity: 1; }

/* content panel */
.panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--panel-w);
    z-index: 15;
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border-left: 1px solid var(--line);
    transform: translateX(105%);
    transition: transform 0.7s cubic-bezier(.7, 0, .2, 1);
    display: flex;
    flex-direction: column;
}

.panel.open { transform: none; }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 76px 32px 0;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.panel-close { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }

.panel-close:hover { color: var(--fg); border-color: var(--accent); }

.panel-body { overflow-y: auto; padding: 24px 32px 48px; overscroll-behavior: contain; }

.panel-body > * { animation: rise 0.6s both; }

.panel-body > *:nth-child(2) { animation-delay: 0.05s; }
.panel-body > *:nth-child(3) { animation-delay: 0.1s; }
.panel-body > *:nth-child(4) { animation-delay: 0.15s; }
.panel-body > *:nth-child(n+5) { animation-delay: 0.2s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.panel .kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 12px; }

.panel h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; letter-spacing: -0.025em; margin-bottom: 16px; }

.panel h3 { font-size: 17px; letter-spacing: -0.01em; margin: 32px 0 12px; }

.panel p { color: #b4b8c9; margin-bottom: 14px; }

.panel .muted, .muted { color: var(--muted); font-size: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 24px 0 8px; }

.stats div { background: rgba(6, 7, 11, 0.6); padding: 16px; }

.stats b { display: block; font-size: 26px; letter-spacing: -0.03em; color: var(--accent); }

.stats span { font-size: 12px; color: var(--muted); }

.skills { display: grid; grid-template-columns: 90px 1fr; gap: 10px 16px; font-size: 14px; margin-bottom: 24px; }

.skills dt { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 2px; }

.skills dd { color: var(--fg); }

.jobs { list-style: none; }

.jobs li { position: relative; padding: 0 0 28px 22px; border-left: 1px solid var(--line); scroll-margin-top: 24px; transition: background 0.3s; }

.jobs li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }

.jobs li.flash::before { background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.jobs h3 { margin: 4px 0 8px; font-size: 18px; }

.jobs h3 a, .jobs h3 .at { color: var(--accent); text-decoration: none; font-weight: 500; }

.when { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }

.tags li { font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }

.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 20px 0; font-family: var(--mono); font-size: 11px; }

.pipeline span { padding: 5px 9px; border-radius: 6px; border: 1px solid rgba(94, 234, 212, 0.35); color: var(--accent); background: rgba(94, 234, 212, 0.06); }

.pipeline i { width: 14px; height: 1px; background: var(--accent); opacity: 0.6; }

.mini-cards { display: grid; gap: 10px; }

.mini-cards div { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }

.mini-cards b { font-size: 15px; }

.mini-cards p { font-size: 14px; margin: 4px 0 0; }

.award { padding: 18px 0; border-top: 1px solid var(--line); }

.award h3 { margin: 4px 0 8px; }

.big-mail { display: inline-block; font-size: clamp(20px, 2.2vw, 26px); color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(94, 234, 212, 0.4); margin: 12px 0 24px; word-break: break-all; }

.socials { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 24px; }

.socials a { font-family: var(--mono); font-size: 13px; color: var(--fg); text-decoration: none; }

.socials a:hover { color: var(--accent); }

/* no-WebGL fallback: the panel becomes a normal page */
body.no-webgl #hotspots { display: none; }

body.no-webgl .hero { position: static; padding: 120px var(--gutter) 40px; }

body.no-webgl { overflow: auto; }

body.no-webgl .mobile-nav { display: flex; }

.mobile-nav {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* phones: bottom sheet */
@media (max-width: 760px) {
    :root { --sheet-h: 58vh; }
    .nav { padding: 14px var(--gutter); }
    .nav nav a:not(.nav-cta) { display: none; }
    .panel {
        top: auto;
        left: 0;
        width: auto;
        height: var(--sheet-h);
        border-left: 0;
        border-top: 1px solid var(--line);
        border-radius: 20px 20px 0 0;
        transform: translateY(105%);
    }
    .panel-head { padding: 18px 20px 0; }
    .panel-body { padding: 16px 20px calc(40px + env(safe-area-inset-bottom)); }
    .hero h1 { font-size: 52px; }
    .mobile-nav { display: flex; }
}


.mobile-nav a { font-family: var(--mono); font-size: 12px; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 12, 20, 0.6); }

@media (prefers-reduced-motion: reduce) {
    .panel, .hero, .panel-body > * { transition: none; animation: none; }
    .pulse, .bars i, .hotspot .dot { animation: none; }
}
