/* ============================================
   hwaklyul.com - Probability as Architecture
   Blobitecture + Diagonal Sections
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --navy-deep: #1A2A3A;
    --navy-mid: #2A3A5A;
    --navy-light: #3A5A7A;
    --metallic-silver: #8AA0B0;
    --bio-green: #60C0A0;
    --marble-cream: #E0D8D0;
    --text-light: #C0D0E0;
    --blob-highlight: #4A7A9A;
    --darkest: #0A1A2A;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    font-size: clamp(15px, 1.05vw, 17px);
    color: var(--text-light);
    background: var(--darkest);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    line-height: 1.3;
}

.data-num {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: var(--bio-green);
}

/* ============================================
   HERO SECTION
   ============================================ */
.section-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
    overflow: hidden;
}

/* Background Blobs */
.hero-bg-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.bg-blob {
    position: absolute;
    background: var(--navy-light);
    opacity: 0.2;
    border-radius: 40% 60% 50% 40% / 60% 40% 50% 60%;
    animation: blobMorph 10s ease-in-out infinite alternate;
}

.bg-blob-1 {
    width: 300px;
    height: 280px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.bg-blob-2 {
    width: 200px;
    height: 220px;
    top: 60%;
    left: 15%;
    border-radius: 50% 40% 60% 45% / 45% 55% 40% 60%;
    animation-delay: -2s;
}

.bg-blob-3 {
    width: 350px;
    height: 320px;
    top: 5%;
    right: 10%;
    border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
    animation-delay: -4s;
}

.bg-blob-4 {
    width: 180px;
    height: 200px;
    top: 70%;
    right: 20%;
    border-radius: 60% 40% 55% 45% / 40% 60% 45% 55%;
    animation-delay: -6s;
}

.bg-blob-5 {
    width: 250px;
    height: 230px;
    bottom: 5%;
    left: 40%;
    border-radius: 55% 45% 50% 50% / 50% 50% 45% 55%;
    animation-delay: -8s;
}

@keyframes blobMorph {
    0% {
        border-radius: 40% 60% 50% 40% / 60% 40% 50% 60%;
    }
    25% {
        border-radius: 50% 50% 40% 60% / 40% 60% 55% 45%;
    }
    50% {
        border-radius: 60% 40% 55% 45% / 50% 50% 40% 60%;
    }
    75% {
        border-radius: 45% 55% 60% 40% / 55% 45% 60% 40%;
    }
    100% {
        border-radius: 55% 45% 45% 55% / 45% 55% 50% 50%;
    }
}

/* Hero Content Layout */
.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 1400px;
    gap: 60px;
    padding: 40px 0;
}

.hero-left {
    flex: 0 1 500px;
    opacity: 0;
    animation: fadeInUp 800ms ease-out 300ms forwards;
}

.logotype {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    color: var(--text-light);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.logotype-dot {
    color: var(--bio-green);
}

.hero-subtitle {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    color: var(--bio-green);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.hero-tagline {
    font-size: clamp(16px, 1.3vw, 20px);
    font-weight: 400;
    color: var(--metallic-silver);
    line-height: 1.7;
}

/* Probability Blobs (Hero Right) */
.hero-right {
    flex: 0 1 600px;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prob-blob {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(145deg, rgba(42, 58, 90, 0.7), rgba(58, 90, 122, 0.4));
    border: 1px solid rgba(138, 160, 176, 0.3);
    cursor: pointer;
    transition: border-radius 200ms ease, transform 400ms ease, background 300ms ease;
    opacity: 0;
    transform: scale(0.3);
    padding: 15px;
}

.prob-blob.assembled {
    opacity: 1;
    transform: scale(1);
}

.prob-blob-normal {
    width: 180px;
    height: 170px;
    border-radius: 50% 50% 40% 40% / 60% 60% 30% 30%;
    top: 30px;
    left: 50%;
    transform-origin: center;
    animation-delay: 0s;
}

.prob-blob-poisson {
    width: 140px;
    height: 150px;
    border-radius: 35% 65% 50% 50% / 50% 50% 60% 40%;
    top: 10px;
    left: 10%;
    animation-delay: 200ms;
}

.prob-blob-exponential {
    width: 160px;
    height: 130px;
    border-radius: 30% 70% 60% 40% / 60% 40% 50% 50%;
    bottom: 30px;
    left: 5%;
    animation-delay: 400ms;
}

.prob-blob-uniform {
    width: 150px;
    height: 120px;
    border-radius: 20% 20% 20% 20% / 30% 30% 30% 30%;
    bottom: 50px;
    right: 5%;
    animation-delay: 600ms;
}

.prob-blob-binomial {
    width: 130px;
    height: 140px;
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
    top: 50%;
    right: 15%;
    transform: translateY(-50%) scale(0.3);
    animation-delay: 800ms;
}

.prob-blob-binomial.assembled {
    transform: translateY(-50%) scale(1);
}

.prob-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.prob-value {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--metallic-silver);
}

.prob-blob:hover {
    background: linear-gradient(145deg, rgba(74, 122, 154, 0.6), rgba(58, 90, 122, 0.5));
    border-color: rgba(96, 192, 160, 0.5);
}

/* Ripple Effect */
.blob-ripple {
    position: absolute;
    border: 2px solid var(--bio-green);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
    animation: rippleExpand 400ms ease-out forwards;
}

@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
        margin-left: -50px;
        margin-top: -50px;
    }
}

/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 600ms ease-out 2000ms forwards;
}

.scroll-hint-text {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--metallic-silver);
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.scroll-hint-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--bio-green);
    border-bottom: 2px solid var(--bio-green);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   DIAGONAL BOUNDARIES
   ============================================ */
.diagonal-boundary {
    position: relative;
    z-index: 3;
    margin-top: -1px;
    line-height: 0;
}

.diagonal-boundary svg {
    display: block;
    width: 100%;
    height: 120px;
}

.boundary-1 .boundary-path {
    fill: var(--navy-mid);
}

.boundary-1 {
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy-mid) 100%);
}

.boundary-2 .boundary-path {
    fill: var(--navy-light);
}

.boundary-2 {
    background: var(--navy-mid);
}

/* ============================================
   CONCEPTS SECTION
   ============================================ */
.section-concepts {
    position: relative;
    background: linear-gradient(180deg, var(--navy-mid) 0%, var(--navy-light) 100%);
    padding: 100px 5% 120px;
    overflow: hidden;
}

.section-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 3.5vw, 44px);
    color: var(--text-light);
    text-align: center;
    margin-bottom: 16px;
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
    color: var(--metallic-silver);
    font-size: clamp(15px, 1.1vw, 18px);
}

.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.concept-blob {
    position: relative;
    background: linear-gradient(145deg, rgba(42, 58, 90, 0.8), rgba(26, 42, 58, 0.6));
    border: 1px solid rgba(138, 160, 176, 0.3);
    padding: 40px 30px 35px;
    transition: border-radius 200ms ease, border-color 300ms ease, transform 300ms ease;
    opacity: 0;
    transform: translateY(30px);
}

.concept-blob.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms ease, transform 600ms ease, border-radius 200ms ease, border-color 300ms ease;
}

.concept-blob-1 {
    border-radius: 40% 60% 50% 40% / 60% 40% 50% 60%;
}

.concept-blob-2 {
    border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%;
}

.concept-blob-3 {
    border-radius: 45% 55% 60% 40% / 55% 45% 40% 60%;
}

.concept-blob-4 {
    border-radius: 60% 40% 45% 55% / 40% 60% 55% 45%;
}

.concept-blob:hover {
    border-color: rgba(96, 192, 160, 0.5);
    transform: translateY(-4px);
}

/* Marble Edge */
.marble-edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(224, 216, 208, 0.7) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(192, 208, 224, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(224, 216, 208, 0.6) 0%, transparent 55%),
        linear-gradient(180deg, var(--marble-cream), rgba(192, 184, 176, 0.8), var(--marble-cream));
    border-radius: 2px;
    opacity: 0.8;
}

.concept-title {
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 12px;
}

.concept-desc {
    color: var(--metallic-silver);
    margin-bottom: 16px;
    font-size: clamp(14px, 0.95vw, 16px);
    line-height: 1.7;
}

.concept-formula {
    padding-top: 12px;
    border-top: 1px solid rgba(138, 160, 176, 0.15);
}

.concept-formula .data-num {
    font-size: 13px;
}

/* ============================================
   SIMULATIONS SECTION
   ============================================ */
.section-simulations {
    position: relative;
    background: linear-gradient(180deg, var(--navy-light) 0%, var(--navy-mid) 50%, var(--navy-deep) 100%);
    padding: 100px 5% 120px;
    overflow: hidden;
}

.simulations-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1300px;
    margin: 0 auto;
}

.sim-panel {
    opacity: 0;
    transform: translateY(30px);
}

.sim-panel.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms ease, transform 600ms ease;
}

.sim-blob-frame {
    background: linear-gradient(145deg, rgba(42, 58, 90, 0.7), rgba(26, 42, 58, 0.5));
    border: 1px solid rgba(138, 160, 176, 0.25);
    padding: 30px 25px;
    transition: border-radius 200ms ease, border-color 300ms ease;
}

.sim-panel-1 .sim-blob-frame {
    border-radius: 50% 50% 40% 40% / 20% 20% 15% 15%;
}

.sim-panel-2 .sim-blob-frame {
    border-radius: 40% 60% 55% 45% / 15% 18% 20% 15%;
}

.sim-panel-3 .sim-blob-frame {
    border-radius: 55% 45% 45% 55% / 18% 15% 18% 20%;
}

.sim-title {
    font-size: clamp(18px, 1.5vw, 22px);
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 8px;
}

.sim-desc {
    color: var(--metallic-silver);
    font-size: clamp(13px, 0.9vw, 15px);
    margin-bottom: 20px;
    line-height: 1.6;
}

.sim-canvas {
    background: rgba(10, 26, 42, 0.5);
    border-radius: 12px;
    min-height: 200px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 15px;
    overflow: hidden;
    position: relative;
}

#walk-canvas {
    width: 100%;
    height: 200px;
    display: block;
}

.sim-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 170px;
}

.sim-bar {
    flex: 1;
    max-width: 30px;
    min-width: 8px;
    background: linear-gradient(180deg, var(--bio-green), var(--blob-highlight));
    border-radius: 4px 4px 0 0;
    transition: height 300ms ease;
    position: relative;
}

.sim-bar-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--metallic-silver);
    white-space: nowrap;
}

.sim-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.sim-btn {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 13px;
    padding: 8px 18px;
    background: rgba(74, 122, 154, 0.3);
    border: 1px solid rgba(138, 160, 176, 0.3);
    color: var(--text-light);
    border-radius: 30px;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease;
}

.sim-btn:hover {
    background: rgba(96, 192, 160, 0.25);
    border-color: var(--bio-green);
}

.sim-btn:active {
    transform: scale(0.97);
}

.sim-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--metallic-silver);
}

.sim-stats .data-num {
    font-size: 13px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    position: relative;
    background: var(--darkest);
    padding: 80px 5% 60px;
    text-align: center;
    overflow: hidden;
}

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

.footer-blob {
    position: absolute;
    background: var(--navy-light);
    opacity: 0.08;
    animation: blobMorph 12s ease-in-out infinite alternate;
}

.footer-blob-1 {
    width: 120px;
    height: 110px;
    border-radius: 40% 60% 50% 40% / 60% 40% 50% 60%;
    top: 20px;
    left: 10%;
}

.footer-blob-2 {
    width: 90px;
    height: 100px;
    border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%;
    bottom: 20px;
    right: 15%;
    animation-delay: -3s;
}

.footer-blob-3 {
    width: 150px;
    height: 130px;
    border-radius: 45% 55% 60% 40% / 55% 45% 40% 60%;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: -6s;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-logo {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 30px);
    color: var(--text-light);
    display: block;
    margin-bottom: 12px;
}

.footer-text {
    color: var(--metallic-silver);
    font-size: 15px;
    margin-bottom: 8px;
}

.footer-sub {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--navy-light);
    letter-spacing: 0.05em;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .hero-left {
        flex: none;
    }

    .hero-right {
        flex: none;
        width: 100%;
        min-height: 320px;
    }

    .prob-blob-normal {
        left: 35%;
    }

    .prob-blob-poisson {
        left: 5%;
    }

    .prob-blob-exponential {
        left: 0;
    }

    .concepts-grid {
        grid-template-columns: 1fr;
    }

    .simulations-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero-right {
        min-height: 280px;
    }

    .prob-blob {
        padding: 10px;
    }

    .prob-blob-normal {
        width: 140px;
        height: 130px;
    }

    .prob-blob-poisson {
        width: 110px;
        height: 120px;
    }

    .prob-blob-exponential {
        width: 120px;
        height: 100px;
    }

    .prob-blob-uniform {
        width: 110px;
        height: 90px;
    }

    .prob-blob-binomial {
        width: 100px;
        height: 110px;
    }

    .sim-blob-frame {
        padding: 20px 15px;
    }

    .sim-controls {
        gap: 6px;
    }

    .sim-btn {
        padding: 6px 14px;
        font-size: 12px;
    }
}
