/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #e8f4f6;
    background: #0d3b4a;
}

body {
    overflow: hidden;
    height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 72px;
    z-index: 100;
    background: rgba(13, 59, 74, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(91, 168, 181, 0.3);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.2);
    transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.sidebar:hover {
    width: 280px;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 0 24px;
    gap: 48px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    color: #5ba8b5;
    position: relative;
    padding-left: 0;
    transition: color 300ms ease;
    white-space: nowrap;
}

.nav-item.active {
    color: #e8967a;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e8967a;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 300ms ease 100ms;
}

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

/* === CANVAS === */
#flare-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
}

/* === SCROLL CONTAINER === */
.scroll-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
    margin-left: 72px;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* === SCENES === */
.scene {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scene-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 0 48px;
}

/* Diagonal slice */
.diagonal-slice {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e8967a;
    transform: skewY(-3deg);
    opacity: 0.5;
    z-index: 3;
}

/* === SCENE 1: HERO === */
.scene-1 {
    background: radial-gradient(ellipse at 30% 40%, #1a5c6b 0%, #0d3b4a 70%);
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #b8d8dc;
    text-align: center;
    margin-bottom: 32px;
}

.hero-rule {
    width: 200px;
    height: 2px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, #7ec8cf, transparent);
}

/* === INFLATED 3D TEXT === */
.inflated {
    text-shadow:
        1px 1px 0 #1a5c6b,
        2px 2px 0 #17536a,
        3px 3px 0 #144b62,
        4px 4px 0 #11435a,
        5px 5px 0 #0e3b52,
        6px 6px 12px rgba(13, 59, 74, 0.6);
    background: linear-gradient(135deg, #e8f4f6 0%, #7ec8cf 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === SCENE 2: ANATOMY === */
.scene-2 {
    background: radial-gradient(ellipse at 60% 50%, #1a5c6b 0%, #0d3b4a 80%);
}

.scene-2-layout {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.anatomy-left {
    flex: 0 0 55%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inflated-arc {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(5rem, 12vw, 14rem);
    letter-spacing: 0.08em;
}

.anatomy-divider {
    position: absolute;
    left: 55%;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: #e8967a;
    transform: skewY(-3deg);
    opacity: 0.6;
}

.anatomy-right {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-left: 48px;
}

.text-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.text-block .bracket {
    flex-shrink: 0;
    margin-top: 4px;
}

.text-block p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1.05rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #b8d8dc;
}

/* === SCENE 3: CONSTELLATION === */
.scene-3 {
    background: radial-gradient(ellipse at 50% 50%, #1a5c6b 0%, #0d3b4a 85%);
}

.constellation-container {
    position: relative;
    height: 70vh;
    max-width: none;
    width: calc(100vw - 72px);
}

.constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.conn-line {
    fill: none;
    stroke: #5ba8b5;
    stroke-width: 1.5;
    stroke-dasharray: 4 2;
    stroke-dashoffset: 100;
    opacity: 0.5;
}

.conn-line.animate {
    animation: dashFlow 3s linear infinite;
}

@keyframes dashFlow {
    to {
        stroke-dashoffset: 0;
    }
}

.node {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #7ec8cf, #0d3b4a);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.node.visible {
    transform: translate(-50%, -50%) scale(1);
}

.node-label {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: #b8d8dc;
    text-transform: uppercase;
    white-space: nowrap;
}

/* === SCENE 4: SIGNAL === */
.scene-4 {
    background: radial-gradient(ellipse at 50% 50%, #1a5c6b 0%, #0d3b4a 75%);
}

.signal-content {
    text-align: center;
}

.inflated-begin {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 8vw, 9rem);
    letter-spacing: 0.1em;
    margin-bottom: 48px;
}

.pulse-text {
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.signal-input-wrap {
    display: flex;
    justify-content: center;
}

.signal-input {
    background: none;
    border: none;
    border-bottom: 1px solid #5ba8b5;
    color: #e8f4f6;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    padding: 8px 4px;
    width: 240px;
    outline: none;
    transition: border-color 300ms ease;
}

.signal-input::placeholder {
    color: #5ba8b5;
    font-style: italic;
    opacity: 0.7;
}

.signal-input:focus {
    border-bottom-color: #e8967a;
}

.signal-input:active {
    color: #c4725a;
}

/* === SCROLL ANIMATIONS === */
.scene-content > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scene.in-view .scene-content > * {
    opacity: 1;
    transform: translateY(0);
}

.scene.in-view .scene-content > *:nth-child(1) { transition-delay: 0ms; }
.scene.in-view .scene-content > *:nth-child(2) { transition-delay: 150ms; }
.scene.in-view .scene-content > *:nth-child(3) { transition-delay: 300ms; }
.scene.in-view .scene-content > *:nth-child(4) { transition-delay: 450ms; }

/* pulse-text should always be visible when in view, override opacity animation */
.scene.in-view .pulse-text {
    animation: pulse 4s ease-in-out infinite;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100% !important;
        height: 56px;
        border-right: none;
        border-top: 1px solid rgba(91, 168, 181, 0.3);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar:hover {
        width: 100% !important;
    }

    .sidebar-inner {
        flex-direction: row;
        justify-content: space-around;
        padding: 0 16px;
        gap: 0;
    }

    .nav-label {
        display: none;
    }

    .nav-item.active::before {
        left: 0;
        right: 0;
        top: -1px;
        bottom: auto;
        width: auto;
        height: 3px;
    }

    .scroll-container {
        margin-left: 0;
        margin-bottom: 56px;
        height: calc(100vh - 56px);
    }

    #flare-canvas {
        display: none;
    }

    .scene-content {
        padding: 0 24px;
    }

    .scene-2-layout {
        flex-direction: column;
        gap: 32px;
    }

    .anatomy-left {
        flex: none;
    }

    .anatomy-divider {
        position: relative;
        left: auto;
        top: auto;
        bottom: auto;
        width: 60%;
        height: 2px;
        transform: skewX(-3deg);
        margin: 0 auto;
    }

    .anatomy-right {
        flex: none;
        padding-left: 0;
    }

    .inflated {
        text-shadow:
            1px 1px 0 #1a5c6b,
            2px 2px 0 #17536a,
            3px 3px 6px rgba(13, 59, 74, 0.6);
    }

    .diagonal-slice {
        height: 1px;
        transform: skewY(-2deg);
    }
}
