/* hwakryul.com - Probability Theory as Spatial Poetry */
/* Color Palette */
:root {
    --void-black: #0a0c14;
    --deep-ink: #12151f;
    --night-panel: #1a1e2e;
    --muted-silver: #b8bcc8;
    --cool-white: #e2e4ec;
    --probability-blue: #4a6cf7;
    --entropy-violet: #7b5ea7;
    --soft-lavender: #9b8ec4;
    --tail-red: #c4475a;
    --nebula-wash: #1e2340;
}

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

html {
    background-color: var(--void-black);
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-black);
    color: var(--muted-silver);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.1vw, 19px);
    line-height: 1.72;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--deep-ink);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(74, 108, 247, 0.08);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: center;
}

.sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--night-panel);
    border: 1px solid rgba(74, 108, 247, 0.3);
    transition: all 0.5s ease;
}

.sidebar-item.active .sidebar-dot {
    background: var(--probability-blue);
    box-shadow: 0 0 12px rgba(74, 108, 247, 0.4);
}

.sidebar-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: rgba(184, 188, 200, 0.4);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: color 0.5s ease;
}

.sidebar-item.active .sidebar-label {
    color: var(--muted-silver);
}

/* Mobile Bar */
.mobile-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--deep-ink);
    z-index: 100;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(74, 108, 247, 0.08);
}

.mobile-dots {
    display: flex;
    gap: 24px;
    align-items: center;
}

.mobile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--night-panel);
    border: 1px solid rgba(74, 108, 247, 0.3);
    transition: all 0.5s ease;
    display: block;
}

.mobile-dot.active {
    background: var(--probability-blue);
    box-shadow: 0 0 12px rgba(74, 108, 247, 0.4);
}

/* Geometric Layer */
.geometric-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.geo-shape {
    position: fixed;
    will-change: transform;
}

.geo-circle-1 { top: 10%; left: 60%; }
.geo-triangle-1 { top: 35%; right: 8%; }
.geo-square-1 { top: 55%; left: 30%; }
.geo-circle-2 { top: 70%; right: 15%; }
.geo-triangle-2 { top: 20%; left: 45%; }
.geo-square-2 { top: 85%; left: 65%; }

/* Axis Lines */
.axis-lines {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.axis-line {
    position: absolute;
    background: rgba(184, 188, 200, 0.08);
}

.axis-h {
    height: 1px;
    left: 0;
    right: 0;
}

.axis-v {
    width: 1px;
    top: 0;
    bottom: 0;
}

.axis-h-1 { top: 25%; }
.axis-h-2 { top: 50%; }
.axis-h-3 { top: 75%; }
.axis-v-1 { left: 33%; }
.axis-v-2 { left: 66%; }

/* Main Content */
.main-content {
    margin-left: 240px;
    position: relative;
    z-index: 10;
}

/* Sections */
.section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 6vw, 120px);
    overflow: hidden;
}

.section-question {
    min-height: 100vh;
    flex-direction: column;
}

.section-distribution {
    min-height: 120vh;
}

.section-variables {
    min-height: 100vh;
}

.section-convergence {
    min-height: 80vh;
}

.section-remainder {
    min-height: 60vh;
}

/* Organic Blobs */
.blob {
    position: absolute;
    background: var(--nebula-wash);
    border: 1px solid rgba(74, 108, 247, 0.15);
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    animation: morph 20s ease-in-out infinite alternate;
    pointer-events: none;
}

.blob-1 {
    width: 500px;
    height: 500px;
    top: 10%;
    left: 15%;
    opacity: 0.6;
}

.blob-2 {
    width: 600px;
    height: 400px;
    top: 20%;
    right: -5%;
    opacity: 0.5;
    animation-delay: -5s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    bottom: 10%;
    left: 5%;
    opacity: 0.5;
    animation-delay: -10s;
}

.blob-4 {
    width: 350px;
    height: 350px;
    top: 15%;
    left: 20%;
    opacity: 0.4;
    animation-delay: -3s;
}

.blob-5 {
    width: 400px;
    height: 300px;
    bottom: 20%;
    right: 10%;
    opacity: 0.4;
    animation-delay: -8s;
}

@keyframes morph {
    0% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
    33% { border-radius: 55% 45% 38% 62% / 52% 60% 40% 48%; }
    66% { border-radius: 37% 63% 51% 49% / 58% 38% 62% 42%; }
    100% { border-radius: 48% 52% 45% 55% / 39% 57% 43% 61%; }
}

/* Watermarks */
.watermark {
    position: absolute;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(200px, 25vw, 400px);
    color: rgba(74, 108, 247, 0.04);
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

.watermark-1 { top: 10%; left: -5%; }
.watermark-2 { top: 5%; right: -10%; }
.watermark-3 { bottom: 5%; left: -5%; }
.watermark-4 { top: 10%; left: 10%; }

/* Dot Field */
.dot-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.dot-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--probability-blue);
    will-change: transform, opacity;
    transition-property: left, top, opacity;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hero Character */
.question-content {
    position: relative;
    z-index: 5;
    text-align: center;
}

.hero-character {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: clamp(72px, 15vw, 200px);
    color: var(--cool-white);
    letter-spacing: 0.05em;
    margin-bottom: 40px;
    line-height: 1.1;
}

.char-hwa, .char-ryul {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: charReveal 1.2s ease-out forwards;
}

.char-ryul {
    animation-delay: 0.3s;
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Probability Axis */
.probability-axis {
    width: 60%;
    max-width: 500px;
    height: 2px;
    background: rgba(184, 188, 200, 0.15);
    margin: 0 auto 40px;
    position: relative;
    overflow: hidden;
}

.axis-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--probability-blue), var(--entropy-violet));
    animation: axisFill 3s ease-out 0.8s forwards;
}

@keyframes axisFill {
    to { width: 100%; }
}

.question-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(18px, 2vw, 28px);
    color: var(--muted-silver);
    letter-spacing: -0.02em;
    opacity: 0;
    animation: fadeUp 1s ease-out 1.5s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Titles */
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 96px);
    color: var(--cool-white);
    letter-spacing: -0.02em;
    margin-bottom: 48px;
}

/* Distribution Section */
.distribution-content {
    max-width: 720px;
    width: 100%;
    position: relative;
    z-index: 5;
}

.bell-curve-container {
    width: 100%;
    margin-bottom: 48px;
}

.bell-curve {
    width: 100%;
    height: auto;
}

.bell-curve-line {
    transition: stroke-dashoffset 2s ease-out;
}

.bell-curve-line.animate {
    stroke-dashoffset: 0;
}

.distribution-text {
    max-width: 720px;
}

.distribution-text p {
    margin-bottom: 24px;
}

.mono-accent {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: var(--probability-blue);
    font-feature-settings: "liga" on;
}

/* Variable Cards */
.variables-content {
    max-width: 720px;
    width: 100%;
    position: relative;
    z-index: 5;
}

.variable-cards {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.variable-card {
    position: relative;
    background: var(--night-panel);
    border: 1px solid rgba(74, 108, 247, 0.1);
    border-radius: 8px;
    padding: 40px;
    overflow: hidden;
}

.card-1 { transform: rotate(1deg); }
.card-2 { transform: rotate(-0.5deg); }
.card-3 { transform: rotate(0.8deg); }

.card-blob {
    position: absolute;
    top: -30%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: var(--nebula-wash);
    border: 1px solid rgba(74, 108, 247, 0.1);
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    animation: morph 20s ease-in-out infinite alternate;
    pointer-events: none;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 32px);
    color: var(--cool-white);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.kr-accent {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    font-size: 0.7em;
    color: var(--soft-lavender);
    margin-left: 8px;
}

.variable-card p {
    margin-bottom: 20px;
    line-height: 1.72;
}

.card-formula {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: var(--probability-blue);
    font-feature-settings: "liga" on;
}

/* Convergence Section */
.convergence-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convergence-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.convergence-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--probability-blue);
    opacity: 0.3;
}

.convergence-curve {
    width: 60%;
    max-width: 600px;
    height: auto;
}

.convergence-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 720px;
}

.convergence-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(18px, 2.5vw, 28px);
    color: var(--cool-white);
    letter-spacing: -0.02em;
    line-height: 1.8;
}

/* Remainder Section */
.section-remainder {
    flex-direction: column;
    justify-content: center;
}

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

.remainder-domain {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--muted-silver);
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    opacity: 0.6;
}

.remainder-probability {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--probability-blue);
    letter-spacing: 0.05em;
}

/* Fade Reveal */
.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .mobile-bar {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: 48px;
    }

    .axis-lines {
        left: 0;
    }

    .section {
        padding: clamp(24px, 4vw, 60px);
    }

    .blob {
        transform: scale(0.6);
    }

    .variable-card {
        padding: 24px;
    }

    .card-1, .card-2, .card-3 {
        transform: rotate(0deg);
    }
}
