:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #172033;
    --muted: #5d6b82;
    --border: #dce4f2;
    --primary: #1967d2;
    --primary-dark: #0f4ea6;
    --accent: #14a44d;
    --warning: #b42318;
    --shadow: 0 24px 60px rgba(23, 32, 51, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    background:
        radial-gradient(circle at top left, rgba(25, 103, 210, 0.22), transparent 34rem),
        linear-gradient(135deg, #f7fbff 0%, #eef4ff 55%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
}

.nav {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.nav-links a:hover,
.site-footer a:hover {
    color: var(--primary);
}

.hero {
    max-width: 1180px;
    margin: 0 auto;
    padding: 78px 24px 96px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    align-items: center;
    gap: 48px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 820px;
    margin-bottom: 22px;
    font-size: clamp(2.6rem, 6vw, 5.3rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.hero-text,
.section-heading p,
.table-heading p,
.content-grid p,
.formula-section p,
.faq p {
    color: var(--muted);
}

.hero-text {
    max-width: 690px;
    margin-bottom: 30px;
    font-size: 1.16rem;
}

.primary-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(25, 103, 210, 0.24);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-link:hover,
button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(25, 103, 210, 0.28);
}

.hero-card {
    padding: 30px;
    border: 1px solid rgba(25, 103, 210, 0.18);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.card-label {
    display: block;
    margin-bottom: 12px;
    color: var(--muted);
    font-weight: 700;
}

.hero-card strong {
    display: block;
    margin-bottom: 12px;
    color: var(--accent);
    font-size: 3.6rem;
    line-height: 1;
    letter-spacing: -0.06em;
}

.hero-card small {
    color: var(--muted);
}

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 64px 24px;
}

.calculator-section,
.content-grid,
.formula-section,
.faq {
    margin-bottom: 68px;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 28px;
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
    gap: 24px;
    align-items: start;
}

.calculator-card,
.results-card,
.table-card,
.content-grid article,
.formula-section,
.faq {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 44px rgba(23, 32, 51, 0.08);
}

.calculator-card,
.results-card,
.table-card,
.faq {
    padding: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 800;
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: #fbfdff;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(25, 103, 210, 0.12);
}

.calculator-card button {
    width: 100%;
    margin-top: 22px;
}

.form-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.error-message {
    min-height: 24px;
    margin: 10px 0 0;
    color: var(--warning);
    font-weight: 700;
}

.result-highlight {
    margin: 18px 0;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #e8f2ff, #ecfff4);
}

.result-highlight span,
.result-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.result-highlight strong {
    display: block;
    color: var(--accent);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.result-grid div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfdff;
}

.result-grid strong {
    font-size: 1.15rem;
}

.scenario-panel {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fbfdff;
}

.scenario-panel h3 {
    margin: 0 0 14px;
    font-size: 1.05rem;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.scenario-grid div {
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
}

.scenario-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.scenario-grid strong {
    font-size: 1rem;
}

.chart-wrap {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fbfdff;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
}

.table-card {
    margin-top: 24px;
}

.table-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.table-heading p {
    margin-bottom: 0;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
}

th:first-child,
td:first-child {
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #fbfdff;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.content-grid article {
    padding: 28px;
}

.content-grid h2 {
    font-size: 1.45rem;
}

.formula-section,
.assumptions-section {
    padding: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
    gap: 28px;
    align-items: center;
}

.formula-card {
    padding: 26px;
    border-radius: 18px;
    color: var(--primary-dark);
    background: var(--surface-soft);
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 900;
    text-align: center;
}

.assumptions-section {
    margin-bottom: 68px;
    grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
}

.assumption-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.assumption-list li {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--muted);
    background: #fbfdff;
}

.faq details {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.faq details:first-of-type {
    margin-top: 8px;
}

.faq summary {
    color: var(--text);
    font-weight: 900;
    cursor: pointer;
}

.faq details p {
    margin: 12px 0 0;
}

.learning-section,
.help-hero,
.article-list,
.article-page {
    margin-bottom: 68px;
}

.learning-grid,
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.learning-card,
.article-card,
.article-page article,
.article-toc,
.disclaimer-box,
.related-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 44px rgba(23, 32, 51, 0.08);
}

.learning-card,
.article-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
}

.learning-card h3,
.article-card h2 {
    margin-bottom: 0;
    font-size: 1.18rem;
    line-height: 1.25;
}

.learning-card p,
.article-card p,
.article-page p,
.article-page li,
.article-toc a,
.disclaimer-box,
.related-box {
    color: var(--muted);
}

.text-link {
    color: var(--primary);
    font-weight: 800;
}

.text-link:hover {
    color: var(--primary-dark);
}

.help-hero {
    padding: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at top right, rgba(20, 164, 77, 0.16), transparent 24rem),
        var(--surface);
    box-shadow: var(--shadow);
}

.help-hero p {
    max-width: 760px;
    color: var(--muted);
    font-size: 1.08rem;
}

.article-page {
    max-width: 920px;
}

.article-page article {
    padding: 38px;
}

.article-page h1 {
    max-width: none;
    font-size: clamp(2.1rem, 5vw, 3.8rem);
}

.article-page h2 {
    margin-top: 34px;
    font-size: clamp(1.4rem, 3vw, 2rem);
}

.article-page h3 {
    margin-top: 24px;
}

.article-page ul,
.article-page ol {
    padding-left: 22px;
}

.article-page li {
    margin-bottom: 10px;
}

.article-meta {
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 0.95rem;
}

.article-toc,
.disclaimer-box,
.related-box {
    margin: 24px 0;
    padding: 22px;
}

.article-toc h2,
.related-box h2 {
    font-size: 1.25rem;
}

.article-toc a,
.related-box a {
    display: block;
    margin-top: 8px;
}

.disclaimer-box {
    background: var(--surface-soft);
}

.site-footer {
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
}

.site-footer p {
    margin: 0;
}

.site-footer div {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.policy-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 56px 24px;
}

.policy-page article {
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 44px rgba(23, 32, 51, 0.08);
}

.policy-page li {
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .hero,
    .tool-layout,
    .formula-section,
    .assumptions-section {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 48px;
    }

    .nav {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    main {
        padding: 42px 16px;
    }

    .nav,
    .hero {
        padding-left: 16px;
        padding-right: 16px;
    }

    .form-grid,
    .result-grid,
    .content-grid,
    .scenario-grid,
    .learning-grid,
    .article-grid {
        grid-template-columns: 1fr;
    }

    .calculator-card,
    .results-card,
    .table-card,
    .content-grid article,
    .formula-section,
    .assumptions-section,
    .help-hero,
    .article-page article,
    .faq {
        padding: 22px;
    }

    .table-heading,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
