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

:root {
    --void-black: #0a0f1a;
    --midnight-steel: #0d1520;
    --deep-current: #142035;
    --lovebot-blue: #6ec6ff;
    --signal-cyan: #4e91dc;
    --ghost-lavender: #a8b8d8;
    --structural-slate: #1e2d4a;
    --pulse-glow: #253654;
    --static-pink: #ff6b9d;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-black);
    color: var(--ghost-lavender);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    display: flex;
}

/* Sidebar */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--void-black);
    border-right: 2px solid var(--structural-slate);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    opacity: 0;
    transform: translateX(-280px);
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

#sidebar.visible {
    opacity: 1;
    transform: translateX(0);
}

#sidebar-wave {
    margin-bottom: 40px;
}

#sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding: 0 16px;
}

.nav-node {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: border-color 150ms, background 200ms;
    text-decoration: none;
}

.nav-node:hover {
    background: var(--deep-current);
}

.nav-node.active {
    border-left-color: var(--lovebot-blue);
}

.nav-node.active svg {
    stroke: var(--lovebot-blue);
}

.nav-label {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ghost-lavender);
    opacity: 0;
    transition: opacity 400ms;
}

.nav-node:hover .nav-label {
    opacity: 1;
}

.nav-node.active .nav-label {
    opacity: 1;
    color: var(--lovebot-blue);
}

/* Main Content */
#main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
}

/* The Pulse */
.section-pulse {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--midnight-steel);
}

#bokeh-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(110,198,255,0.12), transparent 70%);
    opacity: 0;
    transition: opacity 1.2s ease;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

#hero-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 7vw, 9rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--lovebot-blue);
    line-height: 1.05;
    opacity: 0;
    transition: opacity 400ms;
}

#hero-headline.visible {
    opacity: 1;
}

#hero-cursor {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2rem, 5vw, 5rem);
    color: var(--lovebot-blue);
    opacity: 0;
    animation: blink 1s step-end infinite;
}

#hero-cursor.visible {
    opacity: 1;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--midnight-steel) 25%, var(--pulse-glow) 50%, var(--midnight-steel) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    border-radius: 0;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.hero-skeleton {
    width: clamp(300px, 60vw, 800px);
    height: clamp(60px, 10vw, 140px);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    transition: opacity 200ms;
}

.hero-skeleton.hidden {
    opacity: 0;
}

.cell-skeleton {
    position: absolute;
    inset: 0;
    z-index: 5;
    transition: opacity 200ms;
}

.cell-skeleton.hidden {
    opacity: 0;
}

/* Wave Dividers */
.wave-divider {
    padding: 20px 0;
    background: var(--midnight-steel);
}

.wave-divider svg {
    display: block;
}

.divider-wave {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.divider-wave.drawn {
    stroke-dashoffset: 0;
}

/* The Anatomy */
.section-anatomy {
    background: var(--midnight-steel);
    min-height: 100vh;
    padding: 60px 40px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 2px solid var(--structural-slate);
}

.grid-cell {
    position: relative;
    border: 1px solid var(--structural-slate);
    padding: 32px 24px;
    min-height: 200px;
    background: var(--midnight-steel);
    transition: background 200ms;
    overflow: hidden;
}

.grid-cell:hover {
    background: var(--deep-current);
}

.grid-cell:hover .cell-content h3 {
    color: var(--lovebot-blue);
}

.cell-content {
    opacity: 0;
    transition: opacity 400ms;
    position: relative;
    z-index: 2;
}

.cell-content.visible {
    opacity: 1;
}

.cell-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.1rem, 1.5vw, 1.4rem);
    font-weight: 500;
    color: var(--lovebot-blue);
    margin-bottom: 12px;
    transition: color 200ms;
}

.cell-content p {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--ghost-lavender);
}

/* The Signal */
.section-signal {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--midnight-steel);
    padding: 40px;
}

#signal-waves {
    max-width: 100%;
    height: 300px;
}

.signal-text {
    margin-top: 60px;
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 300;
    color: var(--ghost-lavender);
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.signal-text.visible {
    opacity: 1;
}

/* Protocol */
.section-protocol {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--void-black);
    padding: 80px 40px;
}

.protocol-content {
    max-width: 700px;
}

.protocol-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 500;
    color: var(--lovebot-blue);
    margin-bottom: 32px;
}

.protocol-block {
    background: var(--midnight-steel);
    border: 2px solid var(--structural-slate);
    padding: 24px;
    margin-bottom: 24px;
}

.protocol-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--signal-cyan);
}

.protocol-content p {
    line-height: 1.8;
}

/* Echo */
.section-echo {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--midnight-steel);
    padding: 80px 40px;
}

.echo-content {
    max-width: 700px;
}

.echo-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 500;
    color: var(--lovebot-blue);
    margin-bottom: 32px;
}

.echo-content p {
    margin-bottom: 32px;
    line-height: 1.8;
}

.echo-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--static-pink);
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--signal-cyan);
    letter-spacing: 0.1em;
}

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

/* Responsive */
@media (max-width: 1024px) {
    #sidebar {
        width: 60px;
        padding-top: 20px;
    }
    #sidebar.visible {
        transform: translateX(0);
    }
    #sidebar-wave svg {
        width: 40px;
        height: 20px;
    }
    .nav-label {
        display: none;
    }
    #main-content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-top: 2px solid var(--structural-slate);
        transform: translateX(0) translateY(56px);
    }
    #sidebar.visible {
        transform: translateX(0) translateY(0);
    }
    #sidebar-wave {
        display: none;
    }
    #sidebar-nav {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        height: 100%;
        padding: 0;
        gap: 0;
    }
    .nav-node {
        height: 56px;
        width: auto;
        padding: 0 12px;
        border-left: none;
        border-top: 3px solid transparent;
        justify-content: center;
    }
    .nav-node.active {
        border-left-color: transparent;
        border-top-color: var(--lovebot-blue);
    }
    .nav-label {
        display: none;
    }
    #main-content {
        margin-left: 0;
        width: 100%;
        padding-bottom: 56px;
    }
    .grid-container {
        grid-template-columns: 1fr;
    }
    .section-anatomy {
        padding: 40px 16px;
    }
}
