/* 확률.com — Probability Education Platform */
/* Palette: #0B0F19 Stats Dark, #141B2D Panel, #1E293B Raised, #E2E8F0 Bright, #94A3B8 Muted, #6366F1 Indigo, #34D399 Green, #F472B6 Pink, #FB923C Orange */

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

body {
    background: #0B0F19;
    color: #E2E8F0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.025) 39px, rgba(255,255,255,0.025) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.025) 39px, rgba(255,255,255,0.025) 40px);
    overflow-x: hidden;
}

/* ====== HERO ====== */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.hero-inner {
    max-width: 660px;
    width: 100%;
}

.hero-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 56px;
    color: #E2E8F0;
    margin-bottom: 0.15rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0 40px rgba(99,102,241,0.3);
}

.hero-sub {
    font-size: 18px;
    color: #94A3B8;
    margin-bottom: 2rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
}

.hero-curve {
    margin-bottom: 1.5rem;
}

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

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

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

.hero-stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #94A3B8;
    text-transform: lowercase;
}

.hero-stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 20px;
    font-weight: 500;
    color: #6366F1;
    font-variant-numeric: tabular-nums;
}

.quick-tools {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tool-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #6366F1;
    text-decoration: none;
    border: 1px solid rgba(99,102,241,0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
}

.tool-link:hover {
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.6);
}

/* ====== SECTIONS ====== */
.section-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-heading {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #E2E8F0;
    margin-bottom: 2rem;
    text-align: center;
}

/* ====== CONCEPT PANELS ====== */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.panel {
    background: #141B2D;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.panel:hover {
    background: #1E293B;
    border-color: rgba(99,102,241,0.2);
    transform: translateY(-2px);
}

.panel-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #E2E8F0;
    margin-bottom: 0.75rem;
}

.panel-viz {
    margin-bottom: 0.75rem;
}

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

.panel-controls {
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.slider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #94A3B8;
}

.slider-label span {
    white-space: nowrap;
    min-width: 80px;
    font-variant-numeric: tabular-nums;
}

.param-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6366F1;
    cursor: pointer;
    border: 2px solid #0B0F19;
    box-shadow: 0 0 6px rgba(99,102,241,0.4);
}

.param-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6366F1;
    cursor: pointer;
    border: 2px solid #0B0F19;
    box-shadow: 0 0 6px rgba(99,102,241,0.4);
}

.param-slider-pink::-webkit-slider-thumb { background: #F472B6; box-shadow: 0 0 6px rgba(244,114,182,0.4); }
.param-slider-pink::-moz-range-thumb { background: #F472B6; box-shadow: 0 0 6px rgba(244,114,182,0.4); }

.panel-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    background: rgba(99,102,241,0.15);
    color: #6366F1;
    border: 1px solid rgba(99,102,241,0.3);
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.panel-btn:hover {
    background: rgba(99,102,241,0.25);
    border-color: rgba(99,102,241,0.6);
}

.panel-btn-secondary {
    background: rgba(255,255,255,0.04);
    color: #94A3B8;
    border-color: rgba(255,255,255,0.1);
}

.panel-btn-secondary:hover {
    background: rgba(255,255,255,0.08);
    color: #E2E8F0;
}

.panel-desc {
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.panel-formula {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #6366F1;
}

.panel-formula code {
    font-variant-numeric: tabular-nums;
}

/* ====== INTERACTIVE TOOLS ====== */
.tool-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.tool-panel {
    background: #141B2D;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.25s;
}

.tool-panel:hover {
    border-color: rgba(99,102,241,0.15);
}

.tool-panel-wide {
    grid-column: 1 / -1;
}

.tool-name {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #E2E8F0;
    margin-bottom: 1rem;
}

.tool-display {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    margin-bottom: 1rem;
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

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

.stat-label {
    font-size: 11px;
    color: #94A3B8;
    font-family: 'IBM Plex Mono', monospace;
    margin-right: 0.25rem;
}

.stat-value {
    font-family: 'IBM Plex Mono', monospace;
    color: #E2E8F0;
    font-size: 16px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.result-green { color: #34D399; }
.result-pink { color: #F472B6; }
.result-orange { color: #FB923C; font-family: 'IBM Plex Mono', monospace; font-weight: 500; }
.result-indigo { color: #6366F1; }

.tool-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tool-desc {
    font-size: 13px;
    color: #94A3B8;
    line-height: 1.6;
}

/* Coin */
.coin-viz {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    perspective: 400px;
    height: 64px;
}

.coin {
    width: 56px;
    height: 56px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.coin.flipping {
    animation: coinFlipAnim 0.5s ease;
}

@keyframes coinFlipAnim {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(720deg); }
}

.coin.show-tails {
    transform: rotateY(180deg);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 22px;
    backface-visibility: hidden;
}

.coin-heads {
    background: linear-gradient(135deg, #34D399, #059669);
    color: #0B0F19;
}

.coin-tails {
    background: linear-gradient(135deg, #F472B6, #DB2777);
    color: #0B0F19;
    transform: rotateY(180deg);
}

.convergence-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.convergence-fill {
    height: 100%;
    background: linear-gradient(90deg, #F472B6, #6366F1, #34D399);
    border-radius: 3px;
    width: 50%;
    transition: width 0.3s ease;
}

.convergence-mid {
    position: absolute;
    left: 50%;
    top: -2px;
    width: 1px;
    height: 10px;
    background: #E2E8F0;
    opacity: 0.5;
}

/* Dice */
.dice-viz {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.dice-display {
    flex-shrink: 0;
}

.dice-svg {
    width: 56px;
    height: 56px;
}

.dice-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    flex: 1;
    height: 80px;
}

.dice-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.dice-bar-wrap {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: flex-end;
}

.dice-bar {
    width: 100%;
    background: linear-gradient(180deg, #6366F1, rgba(99,102,241,0.5));
    border-radius: 3px 3px 0 0;
    height: 0;
    transition: height 0.3s ease;
}

.dice-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #94A3B8;
    margin-top: 4px;
}

.dice-count {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: #6366F1;
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}

/* Distribution Comparison */
.dist-compare-viz {
    margin-bottom: 1rem;
}

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

.dist-compare-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.dist-ctrl-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dist-ctrl-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* ====== SCENARIOS ====== */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.scenario-card {
    background: #141B2D;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.25s, border-color 0.25s;
}

.scenario-card:hover {
    background: #1E293B;
    border-color: rgba(251,146,60,0.2);
}

.scenario-icon {
    margin-bottom: 0.75rem;
}

.scenario-name {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #E2E8F0;
    margin-bottom: 0.5rem;
}

.scenario-desc {
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.scenario-calc {
    margin-top: 0.75rem;
}

.scenario-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.scenario-result-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(251,146,60,0.06);
    border: 1px solid rgba(251,146,60,0.15);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.scenario-result-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #94A3B8;
}

.scenario-result-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Monty Hall */
.monty-game {
    margin-top: 0.75rem;
}

.monty-doors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.monty-door {
    background: #1E293B;
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    text-align: center;
    font-family: 'IBM Plex Mono', monospace;
    color: #E2E8F0;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.monty-door:hover:not(.monty-opened):not(.monty-revealed) {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.5);
    transform: translateY(-2px);
}

.monty-door-num {
    font-size: 18px;
    font-weight: 500;
}

.monty-door-content {
    font-size: 22px;
    min-height: 28px;
}

.monty-door.monty-opened {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.05);
    opacity: 0.5;
    cursor: default;
}

.monty-door.monty-selected {
    border-color: #6366F1;
    box-shadow: 0 0 12px rgba(99,102,241,0.3);
}

.monty-door.monty-revealed.monty-winner {
    border-color: #34D399;
    background: rgba(52,211,153,0.1);
}

.monty-door.monty-revealed.monty-loser {
    border-color: #F472B6;
    background: rgba(244,114,182,0.05);
}

.monty-msg {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 0.75rem;
    text-align: center;
}

.monty-stats {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    font-variant-numeric: tabular-nums;
}

/* ====== REFERENCE ====== */
.ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.ref-card {
    background: #141B2D;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.2s;
}

.ref-card:hover {
    border-color: rgba(99,102,241,0.2);
}

.ref-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #E2E8F0;
    margin-bottom: 0.5rem;
}

.ref-formula {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #6366F1;
}

.ref-formula code {
    font-variant-numeric: tabular-nums;
}

/* ====== FOOTER ====== */
.footer {
    padding: 2.5rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.flink {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #94A3B8;
    text-decoration: none;
    transition: color 0.2s;
}

.flink:hover {
    color: #6366F1;
}

.footer-copy {
    font-size: 13px;
    color: #94A3B8;
}

/* ====== FADE IN ====== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .panel-grid { grid-template-columns: 1fr; }
    .tool-panels { grid-template-columns: 1fr; }
    .scenario-grid { grid-template-columns: 1fr; }
    .ref-grid { grid-template-columns: 1fr 1fr; }
    .dist-compare-controls { grid-template-columns: 1fr; }
    .hero-title { font-size: 40px; }
    .hero { min-height: 70vh; }
}

@media (max-width: 480px) {
    .ref-grid { grid-template-columns: 1fr; }
    .quick-tools { flex-direction: column; align-items: center; }
    .hero-stats { gap: 1.5rem; }
    .hero-title { font-size: 34px; }
    .dice-viz { flex-direction: column; align-items: center; }
}
