/* hwaklyul.com - Probability Design Language */
/* Colors: #C3B1D4 (Lavender), #F7F2E9 (Parchment), #1A1815 (Deep Ink), 
   #2C2A26 (Charcoal), #C9A96E (Antique Gold), #E8C4B8 (Bernoulli Rose), 
   #8B7E6A (Stone), #B5C4B1 (Sage) */

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #F7F2E9;
    background-color: #1A1815;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Marble Texture Overlay ===== */
#marble-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    background-image: 
        radial-gradient(ellipse at 20% 50%, #E8C4B8 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, #F7F2E9 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, #C3B1D4 0%, transparent 45%),
        radial-gradient(circle at 60% 30%, #C9A96E 0%, transparent 35%);
}

/* ===== Probability Canvas ===== */
#probability-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== Navigation ===== */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: linear-gradient(to bottom, rgba(26, 24, 21, 0.9) 0%, rgba(26, 24, 21, 0) 100%);
    transition: background 0.4s ease, padding 0.4s ease;
}

#main-nav.scrolled {
    background: rgba(26, 24, 21, 0.95);
    padding: 1rem 3rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    color: #C9A96E;
    line-height: 1;
}

.nav-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: #F7F2E9;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8B7E6A;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #C9A96E;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #C9A96E;
}

.nav-link:hover::after {
    width: 100%;
}

/* ===== Diagonal Sections ===== */
.diagonal-section {
    position: relative;
    min-height: 100vh;
    z-index: 2;
    overflow: hidden;
}

.section-hero {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8vh), 0 100%);
    background: linear-gradient(165deg, #1A1815 0%, #2C2A26 40%, #1A1815 100%);
    padding-bottom: 8vh;
}

.section-distributions {
    clip-path: polygon(0 8vh, 100% 0, 100% calc(100% - 8vh), 0 100%);
    margin-top: -8vh;
    background: linear-gradient(195deg, #2C2A26 0%, #1A1815 50%, #2C2A26 100%);
    padding-top: 12vh;
    padding-bottom: 8vh;
}

.section-convergence {
    clip-path: polygon(0 0, 100% 8vh, 100% 100%, 0 calc(100% - 8vh));
    margin-top: -8vh;
    background: linear-gradient(165deg, #1A1815 0%, #2C2A26 60%, #1A1815 100%);
    padding-top: 12vh;
    padding-bottom: 8vh;
}

.section-axioms {
    clip-path: polygon(0 8vh, 100% 0, 100% calc(100% - 8vh), 0 100%);
    margin-top: -8vh;
    background: linear-gradient(195deg, #2C2A26 0%, #1A1815 50%, #2C2A26 100%);
    padding-top: 12vh;
    padding-bottom: 8vh;
}

.section-closing {
    clip-path: polygon(0 0, 100% 8vh, 100% 100%, 0 100%);
    margin-top: -8vh;
    background: linear-gradient(165deg, #1A1815 0%, #2C2A26 100%);
    padding-top: 12vh;
    min-height: 60vh;
}

/* ===== Section Content ===== */
.section-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* ===== Hero Section ===== */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 100vh;
    padding-top: 6rem;
}

.hero-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #C9A96E;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
}

.title-line {
    display: block;
    font-size: clamp(3rem, 6vw, 5.5rem);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.title-line:nth-child(1) {
    animation-delay: 0.5s;
}

.title-line:nth-child(2) {
    animation-delay: 0.7s;
}

.title-line em {
    font-style: italic;
    color: #C9A96E;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.8;
    color: #8B7E6A;
    max-width: 480px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.9s;
}

/* ===== Hero Visual ===== */
.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 1.2s ease forwards 0.6s;
}

.bell-curve-container {
    width: 100%;
    max-width: 400px;
    position: relative;
}

#hero-bell-curve {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(201, 169, 110, 0.15));
}

.column-fragments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.column-fragment {
    position: absolute;
    background: linear-gradient(to bottom, rgba(247, 242, 233, 0.06), transparent);
    border: 1px solid rgba(247, 242, 233, 0.04);
}

.frag-1 {
    width: 3px;
    height: 60%;
    top: 10%;
    left: 15%;
    transform: rotate(-12deg);
    animation: floatFragment 8s ease-in-out infinite;
}

.frag-2 {
    width: 2px;
    height: 45%;
    top: 25%;
    right: 20%;
    transform: rotate(8deg);
    animation: floatFragment 10s ease-in-out infinite 2s;
}

.frag-3 {
    width: 4px;
    height: 35%;
    bottom: 15%;
    left: 40%;
    transform: rotate(-5deg);
    animation: floatFragment 12s ease-in-out infinite 4s;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards 1.5s;
}

.scroll-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8B7E6A;
}

.scroll-arrow {
    animation: bounceDown 2s ease-in-out infinite;
}

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-number {
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    color: #C9A96E;
    border: 1px solid rgba(201, 169, 110, 0.3);
    padding: 0.4rem 1rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: #F7F2E9;
    margin-bottom: 1rem;
}

.section-epigraph {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    font-style: italic;
    color: #8B7E6A;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===== Distribution Cards ===== */
.distribution-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.distribution-card {
    background: rgba(44, 42, 38, 0.6);
    border: 1px solid rgba(201, 169, 110, 0.1);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.distribution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #C9A96E, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.distribution-card:hover {
    transform: translateY(-4px);
    border-color: rgba(201, 169, 110, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.distribution-card:hover::before {
    opacity: 1;
}

.card-visual {
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.dist-svg {
    width: 100%;
    height: auto;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #F7F2E9;
    margin-bottom: 0.5rem;
}

.card-formula {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #C9A96E;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.card-formula sup {
    font-size: 0.65em;
}

.card-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #8B7E6A;
    line-height: 1.7;
}

/* ===== Convergence Section ===== */
.convergence-display {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.convergence-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: #F7F2E9;
    margin-bottom: 1.5rem;
}

.convergence-body {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #8B7E6A;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.convergence-counter {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.counter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.counter-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8B7E6A;
}

.counter-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #C9A96E;
    letter-spacing: -0.03em;
}

.counter-mean {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #C3B1D4;
    letter-spacing: -0.03em;
}

.simulate-button {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1A1815;
    background: #C9A96E;
    border: none;
    padding: 0.9rem 2.5rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.simulate-button:hover {
    background: #d4b87e;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201, 169, 110, 0.3);
}

.simulate-button:active {
    transform: translateY(0);
}

.simulate-button.running {
    background: #8B7E6A;
    pointer-events: none;
}

.convergence-visual {
    background: rgba(44, 42, 38, 0.4);
    border: 1px solid rgba(201, 169, 110, 0.1);
    padding: 1.5rem;
    aspect-ratio: 4/3;
}

#convergence-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== Axioms Section ===== */
.axioms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.axiom-item {
    text-align: center;
    padding: 2.5rem 1.5rem;
    position: relative;
}

.axiom-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background: rgba(201, 169, 110, 0.3);
}

.axiom-number-display {
    margin-bottom: 1.5rem;
}

.axiom-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(201, 169, 110, 0.4);
    border-radius: 50%;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #C9A96E;
}

.axiom-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #F7F2E9;
    margin-bottom: 0.75rem;
}

.axiom-formula {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #C9A96E;
    margin-bottom: 1.25rem;
    opacity: 0.8;
}

.axiom-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #8B7E6A;
    line-height: 1.7;
}

/* ===== Closing Section ===== */
.closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 50vh;
    padding: 4rem 0;
}

.closing-symbol {
    margin-bottom: 2rem;
    opacity: 0.8;
}

.closing-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 300;
    font-style: italic;
    color: #8B7E6A;
    max-width: 500px;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.closing-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, #C9A96E, transparent);
    margin-bottom: 2rem;
}

.closing-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #F7F2E9;
    margin-bottom: 0.5rem;
}

.closing-copyright {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: #8B7E6A;
    opacity: 0.6;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes floatFragment {
    0%, 100% { transform: translateY(0) rotate(-12deg); opacity: 0.3; }
    50% { transform: translateY(-15px) rotate(-10deg); opacity: 0.6; }
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-subtitle {
        margin: 0 auto;
    }

    .distribution-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .convergence-display {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .axioms-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .section-content {
        padding: 0 1.5rem;
    }

    #main-nav {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .title-line {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .convergence-counter {
        flex-direction: column;
        gap: 1rem;
    }
}