/* hwagryul.com - McBling Probability */
/* Colors: #F5ECD7, #E8E8E8, #1A0E14, #E84393, #A0A0A0, #D4A843, #6B1D3A, #C0C0C0, #8E7B8B */

:root {
    --cream: #F5ECD7;
    --light-gray: #E8E8E8;
    --near-black: #1A0E14;
    --hot-pink: #E84393;
    --gray: #A0A0A0;
    --gold: #D4A843;
    --burgundy: #6B1D3A;
    --silver: #C0C0C0;
    --mauve: #8E7B8B;
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--near-black);
    color: var(--cream);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--near-black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loading-dice {
    animation: diceRotate 2s ease-in-out infinite;
}

@keyframes diceRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
}

.loading-text {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.1em;
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Particle Canvas */
#particle-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;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(26, 14, 20, 0.95), transparent);
    backdrop-filter: blur(8px);
    transition: transform 0.4s ease;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -0.02em;
}

.nav-domain {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--silver);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--hot-pink);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--hot-pink);
}

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

.nav-probability {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-size: 12px;
}

.prob-label {
    color: var(--mauve);
    letter-spacing: 0.05em;
}

.prob-value {
    color: var(--hot-pink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Sections */
.section {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: 100px 60px;
}

.section-grid {
    display: grid;
    grid-template-columns: 62fr 38fr;
    gap: 60px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
}

.section-grid.reverse {
    grid-template-columns: 38fr 62fr;
}

.col-left, .col-right {
    position: relative;
}

/* Hero Section */
#hero {
    background: radial-gradient(ellipse at 30% 50%, rgba(107, 29, 58, 0.15), transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(212, 168, 67, 0.08), transparent 50%);
}

.hero-pretitle {
    font-family: var(--font-ui);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--gold);
    display: block;
    margin-bottom: 16px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 88px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--cream);
}

.title-line {
    display: inline;
}

.title-accent {
    color: var(--hot-pink);
    font-style: italic;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--mauve);
    margin-top: 16px;
    letter-spacing: 0.05em;
    font-style: italic;
}

.hero-description {
    margin-top: 40px;
    max-width: 520px;
}

.hero-description p {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--light-gray);
    font-weight: 300;
}

.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 56px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
}

.stat-number.special {
    color: var(--hot-pink);
}

.stat-label {
    font-family: var(--font-ui);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray);
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

/* Die floating animations */
.die-float {
    animation: dieFloat 6s ease-in-out infinite;
}

.die-float-delayed {
    animation: dieFloat 6s ease-in-out infinite 1.5s;
}

@keyframes dieFloat {
    0%, 100% { transform: translate(80px, 60px) rotate(0deg); }
    33% { transform: translate(85px, 45px) rotate(2deg); }
    66% { transform: translate(75px, 55px) rotate(-1deg); }
}

@keyframes dieFloatDelayed {
    0%, 100% { transform: translate(220px, 280px) rotate(0deg); }
    33% { transform: translate(215px, 270px) rotate(-2deg); }
    66% { transform: translate(225px, 285px) rotate(1deg); }
}

.suit-float { animation: suitBob 4s ease-in-out infinite; }
.suit-float-2 { animation: suitBob 4s ease-in-out infinite 1s; }
.suit-float-3 { animation: suitBob 4s ease-in-out infinite 2s; }
.suit-float-4 { animation: suitBob 4s ease-in-out infinite 3s; }

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

.section-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    overflow: hidden;
}

.section-divider svg {
    width: 100%;
    height: 100%;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-number {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--gold);
    font-weight: 700;
    border: 1px solid var(--gold);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.section-tag {
    font-family: var(--font-ui);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--mauve);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 64px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--cream);
    margin-bottom: 28px;
}

.accent-text {
    color: var(--hot-pink);
    font-style: italic;
}

.section-body {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.7;
    color: var(--light-gray);
    font-weight: 300;
    max-width: 520px;
    margin-bottom: 32px;
}

/* Classical Section */
#classical {
    background: radial-gradient(ellipse at 60% 40%, rgba(212, 168, 67, 0.08), transparent 60%);
}

.probability-card {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.1), rgba(232, 67, 147, 0.05));
    border: 1px solid rgba(212, 168, 67, 0.25);
    border-radius: 12px;
    padding: 28px;
    max-width: 440px;
}

.prob-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.prob-card-icon {
    font-size: 28px;
    color: var(--gold);
}

.prob-card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--cream);
}

.formula {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--cream);
    display: flex;
    align-items: center;
    gap: 8px;
}

.formula-frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
}

.frac-num {
    font-size: 14px;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 4px;
    color: var(--hot-pink);
    font-family: var(--font-ui);
}

.frac-den {
    font-size: 14px;
    padding-top: 4px;
    color: var(--silver);
    font-family: var(--font-ui);
}

.section-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.classical-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.coin-group {
    animation: coinShine 4s ease-in-out infinite;
}

@keyframes coinShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}

.side-quote {
    max-width: 360px;
    margin-left: auto;
    padding: 24px;
    border-left: 2px solid var(--gold);
}

.side-quote blockquote {
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--cream);
    line-height: 1.5;
    margin-bottom: 12px;
}

.side-quote cite {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--mauve);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Distributions Section */
#distributions {
    background: radial-gradient(ellipse at 40% 60%, rgba(232, 67, 147, 0.08), transparent 60%);
}

.distribution-visual {
    position: relative;
    width: 100%;
}

#bell-curve-canvas {
    width: 100%;
    height: auto;
    max-height: 400px;
}

.distribution-labels {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 8px;
}

.dist-label {
    position: absolute;
    transform: translateX(-50%);
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--gray);
}

.dist-label.mu {
    color: var(--hot-pink);
    font-size: 16px;
    font-weight: 600;
}

.distribution-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
}

.dist-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dist-stat-value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--gold);
}

.dist-stat-label {
    font-family: var(--font-ui);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mauve);
}

.interactive-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid rgba(232, 67, 147, 0.2);
    border-radius: 8px;
    max-width: 340px;
}

.hint-icon {
    color: var(--hot-pink);
    font-size: 18px;
}

.hint-text {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--gray);
    letter-spacing: 0.02em;
}

/* Bayesian Section */
#bayesian {
    background: radial-gradient(ellipse at 30% 50%, rgba(142, 123, 139, 0.1), transparent 60%),
                radial-gradient(ellipse at 70% 70%, rgba(107, 29, 58, 0.1), transparent 50%);
}

.bayes-theorem {
    background: linear-gradient(135deg, rgba(26, 14, 20, 0.8), rgba(107, 29, 58, 0.15));
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 16px;
    padding: 36px;
    max-width: 480px;
}

.bayes-formula {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    justify-content: center;
}

.bayes-part {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--hot-pink);
}

.bayes-equals {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--gold);
}

.bayes-fraction {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bayes-num {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--cream);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 6px;
}

.bayes-den {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--silver);
    padding-top: 6px;
}

.bayes-labels {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.bayes-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bl-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.bl-text {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bayes-visual {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

#bayes-canvas {
    width: 100%;
    height: auto;
    max-height: 350px;
    border-radius: 8px;
}

.bayes-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    background: rgba(26, 14, 20, 0.6);
    border: 1px solid rgba(212, 168, 67, 0.15);
    border-radius: 12px;
}

.bayes-slider {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bayes-slider label {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--mauve);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 120px;
}

.bayes-slider input[type='range'] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: linear-gradient(to right, var(--burgundy), var(--hot-pink));
    border-radius: 2px;
    outline: none;
}

.bayes-slider input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid var(--near-black);
}

.slider-value {
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--hot-pink);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Modern Section */
#modern {
    background: radial-gradient(ellipse at 50% 50%, rgba(232, 67, 147, 0.06), transparent 60%);
}

.modern-visual {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    opacity: 0.15;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--hot-pink);
    writing-mode: vertical-rl;
    animation: matrixFall linear infinite;
    line-height: 1;
    letter-spacing: 4px;
}

@keyframes matrixFall {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.modern-center-graphic {
    position: relative;
    z-index: 2;
}

.neural-svg {
    width: 300px;
    height: 300px;
}

.neuron {
    animation: neuronPulse 3s ease-in-out infinite;
}

.neuron:nth-child(2n) {
    animation-delay: 0.5s;
}

.neuron:nth-child(3n) {
    animation-delay: 1s;
}

@keyframes neuronPulse {
    0%, 100% { opacity: 0.6; r: 12; }
    50% { opacity: 1; r: 14; }
}

.synapse {
    animation: synapseFire 2s ease-in-out infinite;
}

.synapse:nth-child(2n) {
    animation-delay: 0.3s;
}

.synapse:nth-child(3n) {
    animation-delay: 0.7s;
}

@keyframes synapseFire {
    0%, 100% { opacity: 0.2; stroke-width: 0.5; }
    50% { opacity: 0.8; stroke-width: 1.5; }
}

.modern-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
}

.modern-list-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(232, 67, 147, 0.05), rgba(212, 168, 67, 0.03));
    border: 1px solid rgba(232, 67, 147, 0.12);
    border-radius: 10px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.modern-list-item:hover {
    border-color: rgba(232, 67, 147, 0.35);
    transform: translateX(4px);
}

.mli-icon {
    color: var(--hot-pink);
    font-size: 20px;
    margin-top: 2px;
}

.mli-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mli-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--cream);
}

.mli-desc {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--gray);
    letter-spacing: 0.02em;
}

/* Footer */
#footer {
    position: relative;
    z-index: 2;
    padding: 80px 60px;
    border-top: 1px solid rgba(212, 168, 67, 0.15);
    background: linear-gradient(to top, rgba(26, 14, 20, 1), rgba(26, 14, 20, 0.95));
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 700;
    color: var(--gold);
    display: block;
}

.footer-tagline {
    font-family: var(--font-display);
    font-size: 18px;
    font-style: italic;
    color: var(--mauve);
    display: block;
    margin-top: 8px;
}

.footer-formula {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--silver);
}

.footer-prob {
    color: var(--hot-pink);
    font-weight: 700;
}

.footer-suits {
    display: flex;
    gap: 24px;
    font-size: 24px;
}

.footer-suit:nth-child(1) { color: var(--silver); }
.footer-suit:nth-child(2) { color: var(--hot-pink); }
.footer-suit:nth-child(3) { color: var(--gold); }
.footer-suit:nth-child(4) { color: var(--mauve); }

.footer-copy {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* Scroll-reveal animations */
.section .col-left,
.section .col-right {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible .col-left {
    opacity: 1;
    transform: translateY(0);
}

.section.visible .col-right {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

/* Responsive */
@media (max-width: 1024px) {
    .section-grid,
    .section-grid.reverse {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero-title { font-size: 60px; }
    .section-title { font-size: 48px; }
    .section { padding: 80px 32px; }
    #main-nav { padding: 16px 24px; }
    .nav-links { display: none; }
    .hero-stats { gap: 32px; }
}

@media (max-width: 640px) {
    .hero-title { font-size: 44px; }
    .section-title { font-size: 36px; }
    .section { padding: 60px 20px; }
    .hero-stats { flex-direction: column; gap: 24px; }
    .distribution-stats { flex-direction: column; gap: 20px; }
    .bayes-formula { flex-direction: column; gap: 8px; }
    .bayes-slider { flex-direction: column; align-items: flex-start; gap: 8px; }
    #footer { padding: 60px 20px; }
}
