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

html, body {
    height: 100%;
    overflow: hidden;
    background: #110E1F;
    color: #C8C0D8;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
}

/* ===== HORIZONTAL RAIL ===== */
.rail {
    display: flex;
    height: 100vh;
    width: max-content;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ===== PANEL ===== */
.panel {
    position: relative;
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.panel-bg {
    position: absolute;
    inset: 0;
    background: #1E1833;
    z-index: 0;
}

/* Alternate panel backgrounds */
.panel:nth-child(even) .panel-bg {
    background: #110E1F;
}

.panel:nth-child(4n+3) .panel-bg {
    background: #2A2040;
}

/* ===== REFRACTION EDGE ===== */
.refraction-edge {
    position: absolute;
    right: 0;
    top: 0;
    width: 6px;
    height: 100%;
    z-index: 10;
    background: linear-gradient(
        180deg,
        #9B6DFF 0%,
        #00E5C8 25%,
        #FF7EB3 50%,
        #FFD86E 75%,
        #9B6DFF 100%
    );
    opacity: 0.6;
    filter: blur(2px);
}

.panel:last-child .refraction-edge {
    display: none;
}

/* ===== BUBBLE CONTAINER ===== */
.bubble-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bubbleFloat 8s ease-in-out infinite;
    pointer-events: auto;
    cursor: default;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.bubble::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(155, 109, 255, 0.05) 0%,
        rgba(155, 109, 255, 0.1) 40%,
        rgba(0, 229, 200, 0.15) 60%,
        rgba(255, 126, 179, 0.2) 80%,
        rgba(255, 216, 110, 0.1) 100%
    );
    border: 1px solid rgba(155, 109, 255, 0.25);
}

.bubble::after {
    content: '';
    position: absolute;
    top: 12%;
    left: 18%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: rotate(-30deg);
}

.bubble-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: #C8C0D8;
    z-index: 2;
    opacity: 0.8;
    text-shadow: 0 0 12px rgba(155, 109, 255, 0.5);
}

.bubble:hover {
    transform: scale(1.2);
    box-shadow: 0 0 30px rgba(155, 109, 255, 0.4), 0 0 60px rgba(0, 229, 200, 0.2);
}

.bubble:hover .bubble-symbol {
    opacity: 1;
    color: #FFD86E;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-18px) translateX(8px); }
    50% { transform: translateY(-8px) translateX(-12px); }
    75% { transform: translateY(-22px) translateX(5px); }
}

/* ===== PANEL CONTENT ===== */
.panel-content {
    position: relative;
    z-index: 5;
    max-width: 600px;
    padding: 2rem;
    text-align: center;
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 0.4rem;
    background: linear-gradient(
        135deg,
        #9B6DFF 0%,
        #00E5C8 30%,
        #FF7EB3 60%,
        #FFD86E 100%
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holoShift 6s ease-in-out infinite;
}

@keyframes holoShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.panel-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #9B6DFF;
    margin-bottom: 1.5rem;
    opacity: 0.85;
}

.panel-body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.7;
    color: #F2EEF8;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.panel.active .panel-body {
    opacity: 1;
    transform: translateY(0);
}

.proof-notation {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.proof-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: #00E5C8;
    padding: 0.3rem 1rem;
    border-left: 2px solid rgba(0, 229, 200, 0.3);
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}

.proof-line.deduced {
    color: #FFD86E;
    border-left-color: rgba(255, 216, 110, 0.3);
    transition-delay: 0.7s;
}

.panel.active .proof-line {
    opacity: 1;
    transform: translateX(0);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.progress-track {
    width: 200px;
    height: 3px;
    background: rgba(200, 192, 216, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #9B6DFF, #00E5C8, #FF7EB3);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(200, 192, 216, 0.25);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.progress-dot.active {
    background: #9B6DFF;
    transform: scale(1.4);
    box-shadow: 0 0 8px rgba(155, 109, 255, 0.5);
}

/* ===== SCROLL HINT ===== */
.scroll-hint {
    position: fixed;
    bottom: 5rem;
    right: 2rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(200, 192, 216, 0.5);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    animation: hintPulse 2s ease-in-out infinite;
    transition: opacity 0.5s ease;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-hint-arrow {
    color: rgba(200, 192, 216, 0.5);
}

@keyframes hintPulse {
    0%, 100% { transform: translateX(0); opacity: 0.6; }
    50% { transform: translateX(8px); opacity: 1; }
}

/* ===== HOLOGRAPHIC GLOW OVERLAYS ===== */
.panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        ellipse at 60% 40%,
        rgba(155, 109, 255, 0.06) 0%,
        transparent 50%
    );
    z-index: 0;
    pointer-events: none;
}

.panel:nth-child(3n+1)::before {
    background: radial-gradient(
        ellipse at 40% 60%,
        rgba(0, 229, 200, 0.05) 0%,
        transparent 50%
    );
}

.panel:nth-child(3n+2)::before {
    background: radial-gradient(
        ellipse at 70% 30%,
        rgba(255, 126, 179, 0.05) 0%,
        transparent 50%
    );
}

/* ===== SCROLLBAR HIDE ===== */
.rail::-webkit-scrollbar {
    display: none;
}
.rail {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
