:root {
    --bg: #ffffff;
    --fg: #000000;
    --glow: rgba(0, 0, 0, 0.12);
    --line: rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow-x: hidden;
    background: var(--bg);
    color: var(--fg);
    font-family: Georgia, "Times New Roman", serif;
}

#stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.top-nav-shell {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: min(calc(100% - 32px), 980px);
    pointer-events: none;
}

.neural-nav {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    filter: blur(10px);
    transition:
        opacity 1.1s ease,
        transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1),
        filter 1.1s ease;
}

.neural-nav.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.top-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 18px 20px;
    padding: 0;
    pointer-events: auto;
}

.neural-button {
    --line: rgba(12, 12, 12, 0.42);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 0 24px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 20px;
    color: #111111;
    text-decoration: none;
    letter-spacing: 0.16em;
    font-size: 0.94rem;
    background:
        radial-gradient(circle at 18% 24%, rgba(0, 0, 0, 0.06), transparent 26%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.04), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(242, 242, 242, 0.84));
    box-shadow:
        inset 0 0 24px rgba(0, 0, 0, 0.04),
        0 12px 28px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    isolation: isolate;
    backdrop-filter: blur(10px);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease,
        color 0.35s ease;
}

.neural-button::before,
.neural-button::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.neural-button::before {
    background:
        linear-gradient(117deg, transparent 15%, var(--line) 16%, transparent 17%) 16% 18% / 34% 2px no-repeat,
        linear-gradient(26deg, transparent 15%, var(--line) 16%, transparent 17%) 66% 26% / 28% 2px no-repeat,
        linear-gradient(-29deg, transparent 15%, var(--line) 16%, transparent 17%) 58% 70% / 34% 2px no-repeat,
        linear-gradient(24deg, transparent 15%, var(--line) 16%, transparent 17%) 18% 72% / 34% 2px no-repeat;
    opacity: 0.9;
}

.neural-button::after {
    inset: 9px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background:
        linear-gradient(rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.04)) 0 50% / 100% 1px no-repeat,
        linear-gradient(90deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.04)) 50% 0 / 1px 100% no-repeat,
        radial-gradient(circle at center, transparent 38%, rgba(0, 0, 0, 0.05) 100%);
}

.neural-button:hover,
.neural-button:focus-visible {
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(0, 0, 0, 0.34);
    color: #000000;
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.05),
        0 16px 32px rgba(0, 0, 0, 0.12);
    outline: none;
}

.neural-button:active {
    transform: translateY(-2px) scale(0.99);
}

.ghost {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: transparent;
    opacity: 0;
    white-space: pre-line;
    pointer-events: none;
    user-select: none;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-shadow: none;
}

.ticker-shell {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    overflow: hidden;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 248, 248, 0.86));
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.ticker-track {
    display: flex;
    width: max-content;
    min-width: 100%;
    animation: ticker-scroll 46s linear infinite;
}

.ticker-track span {
    flex: 0 0 auto;
    padding: 11px 24px;
    color: #111111;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

@keyframes ticker-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

@media (max-width: 720px) {
    .top-nav-shell {
        top: 16px;
        width: min(calc(100% - 24px), 300px);
    }

    .top-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        justify-items: center;
    }

    .neural-button {
        min-height: 60px;
        width: 100%;
        max-width: 132px;
        padding: 0 10px;
        letter-spacing: 0.08em;
        font-size: 0.84rem;
    }

    .ticker-track span {
        padding: 10px 18px;
        font-size: 0.7rem;
        letter-spacing: 0.02em;
    }
}
