/* ──────────────────────────────
   DESIGN TOKENS
────────────────────────────── */
:root {
    --bg-900: #080c14;
    --bg-800: #0d1220;
    --bg-700: #12192e;
    --bg-600: #1a2340;
    --bg-500: #1e2a4a;
    --surface: #1a2340;
    --surface-up: #1f2c4f;

    --accent: #5b8dee;
    --accent-2: #7c5ce4;
    --accent-3: #00d4aa;
    --accent-4: #f0a500;

    --signal-color: #5b8dee;
    --filter-color: #a855f7;
    --output-color: #00d4aa;

    --text-100: #f0f4ff;
    --text-200: #c8d4f0;
    --text-400: #7a8ab4;
    --text-600: #4a5880;

    --border: rgba(91, 141, 238, 0.18);
    --glow: rgba(91, 141, 238, 0.15);
    --glow-2: rgba(124, 92, 228, 0.12);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --font-body: 'Noto Sans KR', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ──────────────────────────────
   RESET & BASE
────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-900);
    color: var(--text-200);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

h1,
h2,
h3 {
    color: var(--text-100);
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* ──────────────────────────────
   HERO
────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91, 141, 238, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(124, 92, 228, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 20% 70%, rgba(0, 212, 170, 0.08) 0%, transparent 60%),
        var(--bg-900);
    animation: heroPulse 8s ease-in-out infinite alternate;
}

@keyframes heroPulse {
    from {
        opacity: 0.8;
    }

    to {
        opacity: 1;
    }
}

/* animated grid lines */
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(91, 141, 238, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 141, 238, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(60px);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
    padding: 40px 24px;
}

.badge {
    display: inline-block;
    background: rgba(91, 141, 238, 0.15);
    border: 1px solid rgba(91, 141, 238, 0.35);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 6px 18px;
    border-radius: 100px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f0f4ff 0%, #5b8dee 60%, #7c5ce4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-400);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-formula {
    background: var(--bg-700);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 32px;
    margin: 0 auto 36px;
    max-width: 460px;
    font-size: 1.25rem;
    box-shadow: 0 0 40px var(--glow);
}

.cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 40px;
    border-radius: 100px;
    box-shadow: 0 8px 32px rgba(91, 141, 238, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(91, 141, 238, 0.5);
}

/* ──────────────────────────────
   SECTIONS
────────────────────────────── */
.section {
    padding: 96px 0;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.section-sub {
    text-align: center;
    color: var(--text-400);
    margin-bottom: 48px;
    font-size: 1rem;
}

/* ──────────────────────────────
   CONCEPT CARDS
────────────────────────────── */
.concept-section {
    background: var(--bg-800);
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 56px;
}

.concept-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.concept-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.3s;
}

.concept-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent) inset;
    border-color: rgba(91, 141, 238, 0.4);
}

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

.card-icon {
    font-size: 2.4rem;
    margin-bottom: 16px;
}

.concept-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-100);
}

.concept-card p {
    font-size: 0.9rem;
    color: var(--text-400);
    margin-bottom: 16px;
}

.formula-box {
    background: var(--bg-700);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.95rem;
    text-align: center;
    overflow-x: auto;
}

.concept-list {
    list-style: none;
    font-size: 0.88rem;
    color: var(--text-400);
}

.concept-list li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.concept-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ──────────────────────────────
   PLAYGROUND
────────────────────────────── */
.playground-section {
    background: var(--bg-900);
}

.tab-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.tab-btn {
    background: var(--bg-700);
    border: 1px solid var(--border);
    color: var(--text-400);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 22px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-100);
    border-color: var(--accent);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(91, 141, 238, 0.35);
}

.playground-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .playground-layout {
        grid-template-columns: 1fr;
    }
}

/* Controls */
.controls-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: sticky;
    top: 24px;
}

.controls-panel h3 {
    font-size: 1rem;
    margin-bottom: 24px;
    color: var(--text-100);
}

.control-group {
    margin-bottom: 24px;
}

.control-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-400);
    margin-bottom: 10px;
    font-weight: 500;
}

.ctrl-val {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.ctrl-hint {
    font-size: 0.78rem;
    color: var(--text-600);
    margin-top: 6px;
}

/* 기본 초기화 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    outline: none;
}

/* 트랙 스타일 (크롬/사파리) */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: var(--bg-600);
    border-radius: 3px;
}

/* 트랙 스타일 (파이어폭스) */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    background: var(--bg-600);
    border-radius: 3px;
}

/* 슬롯(Thumb) 스타일 (크롬/사파리) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    /* 트랙 중앙 정렬 (18px-6px)/2 */
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(91, 141, 238, 0.5);
    transition: transform 0.15s;
}

/* 슬롯(Thumb) 스타일 (파이어폭스) */
input[type="range"]::-moz-range-thumb {
    border: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(91, 141, 238, 0.5);
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-400);
    cursor: pointer;
    transition: color 0.2s;
}

.radio-label:hover {
    color: var(--text-100);
}

.radio-label input[type="radio"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
}

.filter-display {
    background: var(--bg-700);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 8px;
}

.filter-title {
    font-size: 0.78rem;
    color: var(--text-600);
    margin-bottom: 8px;
    font-weight: 500;
}

.formula-display {
    background: linear-gradient(135deg, rgba(91, 141, 238, 0.08), rgba(124, 92, 228, 0.08));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 16px;
    font-size: 0.85rem;
    text-align: center;
}

.formula-title {
    font-size: 0.75rem;
    color: var(--text-600);
    margin-bottom: 8px;
}

/* Charts */
.charts-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px 12px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}

.chart-card:hover {
    border-color: rgba(91, 141, 238, 0.35);
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.chart-label {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.08em;
}

.input-label {
    background: rgba(91, 141, 238, 0.2);
    color: var(--signal-color);
}

.filter-label {
    background: rgba(168, 85, 247, 0.2);
    color: var(--filter-color);
}

.output-label {
    background: rgba(0, 212, 170, 0.2);
    color: var(--output-color);
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-100);
}

.chart-desc {
    font-size: 0.78rem;
    color: var(--text-600);
    margin-left: auto;
}

canvas {
    display: block;
    width: 100%;
    max-width: 100%;
}

.cursor-line {
    position: absolute;
    top: 40px;
    bottom: 12px;
    width: 2px;
    background: rgba(240, 165, 0, 0.6);
    box-shadow: 0 0 8px rgba(240, 165, 0, 0.4);
    pointer-events: none;
    transition: left 0.05s linear;
    display: none;
}

/* Animation Controls */
.anim-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.anim-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.anim-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.anim-btn.secondary {
    background: var(--bg-600);
    border: 1px solid var(--border);
    color: var(--text-200);
}

.anim-info {
    font-size: 0.85rem;
    color: var(--text-400);
    margin-left: auto;
    font-family: var(--font-mono);
}

/* ──────────────────────────────
   INTUITION
────────────────────────────── */
.intuition-section {
    background: var(--bg-800);
}

.intuition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 56px;
}

.intuition-step {
    display: flex;
    gap: 20px;
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

.intuition-step:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.step-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(91, 141, 238, 0.4);
}

.step-content h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.step-content p {
    font-size: 0.875rem;
    color: var(--text-400);
    line-height: 1.7;
}

/* ──────────────────────────────
   COMPARE TABLE
────────────────────────────── */
.compare-section {
    background: var(--bg-900);
}

.table-wrapper {
    margin-top: 48px;
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.compare-table th {
    background: var(--surface);
    color: var(--text-400);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.compare-table tr:hover td {
    background: var(--surface-up);
}

.compare-table td {
    color: var(--text-200);
}

.tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
}

.tag-box {
    background: rgba(91, 141, 238, 0.15);
    color: var(--signal-color);
}

.tag-exp {
    background: rgba(168, 85, 247, 0.15);
    color: var(--filter-color);
}

.tag-gauss {
    background: rgba(0, 212, 170, 0.15);
    color: var(--output-color);
}

/* ──────────────────────────────
   QUIZ
────────────────────────────── */
.quiz-section {
    background: var(--bg-800);
}

.quiz-container {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 28px 24px;
    transition: border-color 0.3s;
}

.quiz-q {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-100);
    margin-bottom: 18px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.quiz-num {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
    flex-shrink: 0;
    margin-top: 2px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    background: var(--bg-700);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 0.9rem;
    color: var(--text-200);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: var(--font-body);
}

.quiz-option:hover {
    background: var(--surface-up);
    border-color: var(--accent);
}

.quiz-option.correct {
    background: rgba(0, 212, 170, 0.15);
    border-color: var(--output-color);
    color: var(--output-color);
}

.quiz-option.wrong {
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.5);
    color: rgba(255, 120, 120, 0.9);
}

.quiz-feedback {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.ok {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: #00d4aa;
}

.quiz-feedback.fail {
    background: rgba(255, 80, 80, 0.08);
    border: 1px solid rgba(255, 80, 80, 0.25);
    color: rgb(255, 120, 120);
}

/* ──────────────────────────────
   FOOTER
────────────────────────────── */
.footer {
    background: var(--bg-900);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-600);
}

.footer-sub {
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--text-400);
}

/* ──────────────────────────────
   SCROLL REVEAL
────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ──────────────────────────────
   REVERSE CORRELATION / STA
────────────────────────────── */
.reverse-section {
    background: var(--bg-800);
}

.content-wrapper {
    margin-top: 56px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.text-block h3 {
    margin-bottom: 16px;
    font-size: 1.4rem;
    color: var(--text-100);
}

.text-block p {
    color: var(--text-200);
    margin-bottom: 16px;
    font-size: 1rem;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(91, 141, 238, 0.1), rgba(124, 92, 228, 0.1));
    border-left: 4px solid var(--accent);
    padding: 20px 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-100);
    margin: 24px 0;
}

/* STA Playground Layout */
.sta-playground {
    background: var(--bg-900);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.sta-playground::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-3));
}

.sta-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    margin-top: 32px;
}

@media (max-width: 800px) {
    .sta-layout {
        grid-template-columns: 1fr;
    }
}

.sta-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.safe-run-btn {
    width: 100%;
    text-align: center;
    cursor: pointer;
    border: none;
}

.safe-run-btn.running {
    background: var(--bg-600);
    border: 1px solid var(--border);
    color: var(--text-200);
    box-shadow: none;
}

.sta-stats {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sta-charts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-card.extra-small {
    padding: 12px 16px;
    background: var(--bg-800);
}

.chart-card.small-h {
    padding: 12px 16px;
}

/* Limitations Grid */
.limit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.limit-card {
    background: rgba(255, 80, 80, 0.05);
    border: 1px solid rgba(255, 80, 80, 0.2);
    border-radius: var(--radius-md);
    padding: 20px;
}

.limit-card h4 {
    color: #ff7878;
    margin-bottom: 10px;
    font-size: 1rem;
}

.limit-card p {
    font-size: 0.9rem;
    color: var(--text-400);
    margin-bottom: 0;
}

.summary-box {
    background: var(--surface-up);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 32px;
    text-align: center;
}