/* ============================================
   hwaglyul.com -- Probability Cloud Chamber
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0A0A14;
    color: #B0B0CC;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    font-weight: 400;
    overflow-x: hidden;
}

/* --- Noise Texture Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.03;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
}

/* --- Bell Curve SVG --- */
#bell-curve {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 400px;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#bell-curve.visible {
    opacity: 1;
}

/* --- Grid System --- */
.distribution-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 32px;
    padding: 0 32px;
}

/* ============================================
   SECTION 1: The Void
   ============================================ */
.section-void {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.void-content {
    position: relative;
    z-index: 10;
}

.title-main {
    font-family: 'JetBrains Mono', monospace;
    font-size: 56px;
    font-weight: 800;
    line-height: 1.15;
    color: #E8E8FF;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.title-main.visible {
    opacity: 1;
}

.title-sub {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #B0B0CC;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.5s ease 0.5s;
}

.title-sub.visible {
    opacity: 1;
}

/* ============================================
   SECTION 2: The Distribution
   ============================================ */
.section-distribution {
    position: relative;
    z-index: 10;
    padding: 80px 0;
    min-height: 200vh;
}

/* --- Content Panels --- */
.content-panel {
    grid-column: span 4;
    position: relative;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-radius: 4px;
    padding: 40px;
    padding-left: 56px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, border-color 0.3s ease;
}

.content-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-panel:hover {
    border-color: rgba(74, 158, 255, 0.6);
}

/* Full-width panels for specific items */
.content-panel[data-panel="lln"],
.content-panel[data-panel="monte-carlo"] {
    grid-column: span 4;
}

/* --- Confidence Interval Border --- */
.panel-ci-border {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 20px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding-left: 4px;
    gap: 4px;
}

.ci-line {
    display: block;
    width: 2px;
    height: 0;
    transition: height 0.5s ease;
}

.ci-mean {
    background: rgba(74, 158, 255, 0.4);
    transition-delay: 0.3s;
}

.ci-68 {
    background: rgba(74, 158, 255, 0.2);
    transition-delay: 0.5s;
}

.ci-95 {
    background: rgba(74, 158, 255, 0.1);
    transition-delay: 0.7s;
}

.content-panel.visible .ci-line {
    height: 100%;
}

/* --- Panel Content --- */
.panel-body {
    position: relative;
    z-index: 1;
}

.panel-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: #E8E8FF;
    margin-bottom: 16px;
}

.panel-text {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    color: #B0B0CC;
    margin-bottom: 20px;
}

.panel-expression {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #4A9EFF;
    display: block;
    padding: 12px 16px;
    background: rgba(74, 158, 255, 0.05);
    border-left: 2px solid rgba(74, 158, 255, 0.3);
    border-radius: 0 4px 4px 0;
}

/* --- Dice Markers --- */
.dice-marker {
    grid-column: span 8;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    opacity: 0.3;
}

/* ============================================
   SECTION 3: The Experiment
   ============================================ */
.section-experiment {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 32px;
}

.experiment-content {
    max-width: 600px;
    text-align: center;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-radius: 4px;
    padding: 60px 40px;
}

.experiment-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    color: #E8E8FF;
    margin-bottom: 16px;
}

.experiment-text {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
    color: #B0B0CC;
    margin-bottom: 32px;
}

.experiment-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #B0B0CC;
    opacity: 0.7;
    margin-bottom: 4px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 800;
    color: #4A9EFF;
}

/* ============================================
   SECTION 4: The Convergence
   ============================================ */
.section-convergence {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 32px;
}

.convergence-content {
    position: relative;
    z-index: 10;
}

.convergence-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    color: #E8E8FF;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.convergence-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.convergence-text {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    color: #B0B0CC;
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 0.8s ease 0.3s;
}

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

.convergence-sub {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #7A7AFF;
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.convergence-sub.visible {
    opacity: 1;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .distribution-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 0 16px;
    }

    .content-panel {
        grid-column: span 1;
    }

    .content-panel[data-panel="lln"],
    .content-panel[data-panel="monte-carlo"] {
        grid-column: span 1;
    }

    .dice-marker {
        grid-column: span 1;
    }

    .title-main {
        font-size: 36px;
    }

    .experiment-title,
    .convergence-title {
        font-size: 28px;
    }

    .experiment-stats {
        flex-direction: column;
        gap: 20px;
    }
}
