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

:root {
    --bg:        #0a0a12;
    --bg-alt:    #0f0f1c;
    --surface:   #14141f;
    --border:    #1e1e30;
    --text:      #ddddf0;
    --muted:     #7777a0;
    --accent:    #6366f1;
    --accent-lo: rgba(99, 102, 241, 0.15);
    --accent-glow: rgba(99, 102, 241, 0.4);
    --font:      'Inter', system-ui, sans-serif;
    --mono:      'JetBrains Mono', 'Fira Code', monospace;
    --radius:    12px;
    --max-w:     820px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ─── Utilities ─────────────────────────────────────────────────────── */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.mono { font-family: var(--mono); font-size: 0.92em; color: #a5b4fc; }

/* ─── Hero ──────────────────────────────────────────────────────────── */
.hero {
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%), var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 80px 0 72px;
    text-align: center;
}

.hero-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-lo);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 999px;
    padding: 4px 14px;
    margin-bottom: 28px;
}

.hero-title {
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #e0e0ff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 520px;
    margin: 0 auto 48px;
}

.hero-answer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.hero-number-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-number-wrap::before {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.hero-number {
    position: relative;
    font-size: clamp(4rem, 14vw, 7rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #fff;
    text-shadow: 0 0 60px var(--accent-glow);
}

.hero-answer-text {
    font-size: 1.1rem;
    color: var(--text);
    text-align: left;
    line-height: 1.5;
}

.hero-answer-text strong {
    color: #fff;
}

/* ─── Sections ──────────────────────────────────────────────────────── */
.section {
    padding: 72px 0;
}

.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    color: #fff;
}

.section-text {
    color: #b0b0cc;
    margin-bottom: 20px;
    max-width: 640px;
}

.section-text strong { color: var(--text); }
.section-text em { color: #c4c4e0; font-style: italic; }

/* ─── Callout ───────────────────────────────────────────────────────── */
.callout {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.callout-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.callout-formula {
    font-family: var(--mono);
    font-size: 1.3rem;
    color: #a5b4fc;
    font-weight: 500;
}

.callout-label {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.callout-arrow {
    font-size: 1.5rem;
    color: var(--muted);
}

/* ─── Calculator ────────────────────────────────────────────────────── */
.calculator {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin-top: 28px;
}

/* Slider */
.slider-block { display: flex; flex-direction: column; gap: 14px; }

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.slider-label {
    font-size: 0.9rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.slider-value {
    font-family: var(--mono);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--accent);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
    transition: background 0.05s;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.25), 0 2px 8px rgba(0,0,0,0.4);
    transition: box-shadow 0.15s;
}

.slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 7px rgba(99,102,241,0.3), 0 2px 12px rgba(0,0,0,0.5);
}

.slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.25);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
    font-family: var(--mono);
}

/* Result */
.result-block { display: flex; flex-direction: column; gap: 20px; }

.result-main {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.result-number {
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    transition: color 0.2s;
}

.result-description {
    font-size: 0.95rem;
    color: var(--muted);
    max-width: 260px;
    line-height: 1.4;
}

.progress-track {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.15s ease, background-color 0.2s ease;
}

.result-details {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-value {
    font-size: 1.05rem;
    color: var(--text);
}

/* ─── Chart ─────────────────────────────────────────────────────────── */
.chart-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px 20px;
    margin-top: 28px;
}

/* ─── Formula ───────────────────────────────────────────────────────── */
.formula-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 28px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.formula-line {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: #b0b0cc;
}

.formula-label {
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.formula-main {
    font-size: 1.05rem;
}

.formula-main .mono {
    color: #c4b5fd;
    font-size: 1em;
}

.formula-divider {
    height: 1px;
    background: var(--border);
}

/* ─── Milestones ────────────────────────────────────────────────────── */
.milestones {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 28px;
}

.milestone {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.milestone-highlight {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.04);
}

.milestone-n {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--text);
    font-size: 1rem;
}

.milestone-bar-wrap {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.milestone-bar {
    height: 100%;
    border-radius: 4px;
}

.milestone-prob {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Applications ──────────────────────────────────────────────────── */
.applications {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.app-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
}

.app-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.app-text {
    font-size: 0.9rem;
    color: #9090b8;
    line-height: 1.7;
}

.app-text strong { color: var(--text); }

/* ─── Footer ────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

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

.footer a:hover {
    text-decoration: underline;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .hero { padding: 56px 0 52px; }
    .section { padding: 52px 0; }
    .calculator { padding: 24px 20px; }
    .callout { padding: 20px 24px; gap: 20px; }
    .hero-answer { flex-direction: column; gap: 16px; text-align: center; }
    .hero-answer-text { text-align: center; }
    .formula-line { flex-direction: column; gap: 6px; }
}
