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

:root {
    --black: #000000;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray-mid: #e0e0e0;
    --gray-text: #666666;
    --nav-h: 58px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    color: var(--black);
    overflow: hidden;
    height: 100%;
}

/* ── Navbar ─────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid #222;
}

.nav-logo {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-plus {
    font-size: 18px;
    font-weight: 300;
    color: var(--white);
}

.nav-center {
    display: flex;
    gap: 28px;
}

.nav-link {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--white); }

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

.nav-social {
    color: #999;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.2s;
}
.nav-social:hover { color: var(--white); }


/* ── Page Grid ───────────────────────────────────── */
.page-grid {
    margin-top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow: hidden;
    display: grid;
    grid-template-columns: 58% 42%;
    grid-template-rows: 55% 45%;
    position: relative;
    /* subtle crosshatch grid background */
    background-color: var(--white);
    background-image:
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 48px 48px;
}

.panel {
    position: relative;
}

/* ── Headline panel (top-left) ───────────────────── */
.headline-panel {
    grid-column: 1;
    grid-row: 1;
    border-right: 1.5px solid var(--black);
    border-bottom: 1.5px solid var(--black);
    padding: 52px 52px 44px;
    display: flex;
    align-items: flex-start;
    overflow: hidden;
    position: relative;
}

.astronaut-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.moon-corner {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.moon-corner.loaded {
    opacity: 1;
}

.earth-corner {
    position: absolute;
    bottom: -180px;
    left: -180px;
    width: 300px;
    height: 300px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.earth-corner.loaded {
    opacity: 1;
}

.headline {
    position: relative;
    z-index: 2;
    font-size: clamp(2.8rem, 5vw, 6rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--black);
}

/* ── Stats panel (bottom-left after swap) ────────── */
.stats-panel {
    grid-column: 1;
    grid-row: 2;
    border-right: 1.5px solid var(--black);
    padding: 28px 36px 24px;
    background: var(--white);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 0;
    height: 100%;
}

.stat-header-row {
    display: flex;
    border: 1.5px solid var(--black);
    position: absolute;
    bottom: 28px;
    right: 52px;
    width: auto;
    background: var(--white);
    z-index: 3;
}

.stat-header-item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stat-header-divider {
    width: 1.5px;
    background: var(--black);
}

.stat-item-blank {
    border: none;
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.pubs-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 14px 18px 14px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-mid) transparent;
}

.pubs-section-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--black);
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.pubs-section-label:not(:first-child) {
    margin-top: 16px;
}

.pubs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pubs-list li {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    line-height: 1.55;
    color: var(--black);
}

.pubs-venue {
    color: var(--gray-text);
}

.pubs-link {
    color: var(--black);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.pubs-link:hover {
    opacity: 0.5;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--gray-text);
    text-transform: uppercase;
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--black);
    line-height: 1;
}

.stat-value.large {
    font-size: clamp(1.5rem, 2.2vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--black);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    animation: dot-pulse 2.8s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

.company-logo {
    height: 22px;
    width: auto;
    object-fit: contain;
    opacity: 0.75;
    flex-shrink: 0;
}

.stat-unit {
    font-size: 0.45em;
    font-weight: 500;
    color: var(--gray-text);
    margin-left: 2px;
    letter-spacing: 0.05em;
}

/* ── Description panel (top-right after swap) ────── */
.desc-panel {
    grid-column: 2;
    grid-row: 1;
    border-bottom: 1.5px solid var(--black);
    padding: 36px 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
}

.desc-inner {
    max-width: 100%;
}

.desc-inner p {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 28px;
}

.desc-inner p:last-of-type {
    margin-bottom: 36px;
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.project-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--black);
    text-decoration: none;
    transition: opacity 0.2s;
}

.project-link:hover {
    opacity: 0.5;
}

.reveal-btn {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--black);
    background: transparent;
    border: none;
    padding: 0;
    margin-top: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-align: left;
}

.reveal-btn:hover {
    opacity: 0.55;
}

.reveal-btn.revealed {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: default;
}

.reveal-btn.revealed:hover {
    opacity: 1;
}

.scroll-arrow {
    font-size: 18px;
    color: var(--black);
    opacity: 0.5;
    border: 1.5px solid currentColor;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* ── Orbital map panel (bottom-right) ───────────── */
.map-panel {
    grid-column: 2;
    grid-row: 2;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--white);
}

.map-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--gray-text);
}

.orbital-canvas {
    width: 100%;
    flex: 1;
    display: block;
    min-height: 0;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--white); }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #888; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .page-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        overflow: visible;
    }

    .headline-panel,
    .stats-panel,
    .desc-panel,
    .map-panel {
        grid-column: 1;
        border-right: none;
    }

    .headline-panel {
        grid-row: 1;
        border-bottom: 1.5px solid var(--black);
        padding: 36px 24px 100px;
        min-height: 72vh;
    }

    .desc-panel {
        grid-row: 2;
        border-bottom: 1.5px solid var(--black);
        padding: 32px 24px;
    }

    .stats-panel {
        grid-row: 3;
        border-bottom: 1.5px solid var(--black);
        padding: 20px 24px 24px;
    }

    .map-panel {
        grid-row: 4;
        min-height: 300px;
    }

    .headline { font-size: 2.4rem; }

    .stat-header-row {
        position: absolute;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }

    .moon-corner {
        width: 200px;
        height: 200px;
        top: -50px;
        right: -50px;
    }

    .earth-corner {
        width: 200px;
        height: 200px;
        bottom: -100px;
        left: -100px;
    }

    .stats-grid { height: auto; }

    .stat-item-blank { flex: none; }

    .pubs-scroll {
        height: auto;
        overflow-y: visible;
    }

    .nav-center { display: none; }

    .arrow-emoji { display: none; }
}

@media (max-width: 520px) {
    .nav-cta { display: none; }

    .headline { font-size: 1.8rem; }

    .headline-panel {
        padding: 28px 18px 90px;
        min-height: 68vh;
    }

    .desc-panel { padding: 24px 18px; }

    .stats-panel { padding: 16px 18px 20px; }

    .map-panel { min-height: 260px; }

    .navbar { padding: 0 16px; }

    .moon-corner {
        width: 150px;
        height: 150px;
        top: -40px;
        right: -40px;
    }

    .earth-corner {
        width: 150px;
        height: 150px;
        bottom: -75px;
        left: -75px;
    }

    .stat-value { font-size: 13px; }

    .desc-inner p { font-size: 0.9rem; }
}
