:root {
    --bg: #f7f2ea;
    --paper: #fffdf9;
    --paper-soft: #f8f3eb;
    --paper-muted: #f3ece1;
    --text: #1d2a3c;
    --muted: #5f6d7f;
    --line: #e4d8c8;
    --line-strong: #d8c8b2;
    --accent: #16A34A;
    --accent-dark: #166534;
    --accent-soft: #DCFCE7;
    --accent-wash: #F0FDF4;
    --accent-line: #86EFAC;
    --accent-line-strong: #4ADE80;
    --accent-rgb: 22, 163, 74;
    --navy: #2f3c52;
    --shadow: 0 22px 48px rgba(115, 79, 37, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --container: 1180px;
    --content: 760px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top center, rgba(74, 222, 128, 0.22), transparent 34%),
        linear-gradient(180deg, #f8f3eb 0%, #faf7f1 18%, #f8f3eb 100%);
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    line-height: 1.6;
}

body::before {
    content: "";
    display: block;
    height: 11px;
    background: var(--navy);
}

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-shell {
    width: min(calc(100% - 1.5rem), var(--container));
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.95rem;
    padding: 0.35rem 0.1rem 0.9rem;
}

.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(var(--accent-rgb), 0.14) 0%,
        rgba(228, 216, 200, 0.92) 18%,
        rgba(228, 216, 200, 0.92) 82%,
        rgba(var(--accent-rgb), 0.14) 100%
    );
}

.brand,
h1,
h2,
h3,
.widget-title,
.section-lead {
    font-family: "Bitter", Georgia, serif;
}

.brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    max-width: min(100%, 420px);
}

.brand-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-height: auto;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: min(100%, 420px);
    height: 72px;
    object-fit: contain;
    transform: none;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
    gap: 1.1rem;
}

.topbar nav a {
    display: inline-flex;
    align-items: center;
    position: relative;
    color: var(--navy);
    font-size: 1.08rem;
    font-weight: 800;
    padding: 0.35rem 0;
    transition: color 0.18s ease;
}

.topbar nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -0.08rem;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.65);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.18s ease;
}

.topbar nav a:hover,
.topbar nav a:focus-visible {
    color: var(--accent-dark);
}

.topbar nav a:hover::after,
.topbar nav a:focus-visible::after {
    transform: scaleX(1);
}

.page-frame {
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 253, 249, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid rgba(228, 216, 200, 0.95);
    border-radius: 36px;
    box-shadow: 0 28px 70px rgba(57, 44, 31, 0.08);
    overflow: hidden;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 2.1rem;
    border: 1px solid rgba(228, 216, 200, 0.85);
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(247, 243, 235, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: 0 10px 28px rgba(57, 44, 31, 0.04);
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.hero::before {
    top: -90px;
    right: -30px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.16) 0%, rgba(var(--accent-rgb), 0) 70%);
}

.hero::after {
    bottom: -120px;
    left: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(47, 60, 82, 0.08) 0%, rgba(47, 60, 82, 0) 72%);
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero.is-plain {
    background: transparent;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin: 0 0 0.9rem;
    padding: 0 0.95rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 0.9rem;
    color: var(--navy);
    font-size: clamp(2.55rem, 5.6vw, 4.5rem);
    line-height: 1.08;
    letter-spacing: -0.05em;
}

h2 {
    margin: 0 0 0.85rem;
    color: var(--navy);
    font-size: clamp(1.95rem, 4vw, 3rem);
    line-height: 1.14;
    letter-spacing: -0.03em;
}

h3 {
    margin: 0 0 0.55rem;
    color: var(--navy);
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    line-height: 1.25;
}

p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 1.08rem;
}

p:last-child {
    margin-bottom: 0;
}

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

.hero-copy {
    max-width: 68ch;
    font-size: 1.18rem;
}

.hero-copy strong {
    color: var(--accent-dark);
}

.section,
.content-grid,
.metrics-grid,
.info-grid,
.links-grid,
.faq-list,
.article-list,
.article-content,
.sidebar-list,
.footer-grid {
    display: grid;
    gap: 1rem;
}

.page-body {
    padding: 1.4rem 0 0;
}

.page-shell {
    width: min(100%, 1020px);
    margin: 0 auto;
    display: grid;
    gap: 1.25rem;
}

.content-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 1.4rem;
}

.main-column,
.sidebar-column {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

.panel-grid,
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-top: 1rem;
}

.links-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.article-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.article-content {
    grid-template-columns: minmax(0, 1fr);
}

.panel,
.metric,
.link-card,
.faq-card,
.article-card,
.sidebar-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 12px 28px rgba(57, 44, 31, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.panel,
.sidebar-card {
    background: linear-gradient(180deg, #fffdfb 0%, #fff 100%);
}

.article-card:hover,
.sidebar-card:hover,
.metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(57, 44, 31, 0.08);
    border-color: var(--line-strong);
}

.section-title,
.widget-title {
    margin: 0 0 0.85rem;
    color: var(--navy);
    font-size: 1.2rem;
    line-height: 1.2;
}

.section-lead {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.calculator-shell {
    margin-top: 1.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: linear-gradient(180deg, #f7efe5 0%, #fdfaf6 100%);
    overflow: hidden;
}

.calculator-top,
.calculator-bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.calculator-bottom {
    padding-top: 0;
}

.calc-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.calc-panel-title {
    margin: 0 0 0.85rem;
    color: var(--navy);
    font-family: "Bitter", Georgia, serif;
    font-size: 1.2rem;
}

.field-stack,
.field-grid {
    display: grid;
    gap: 0.85rem;
}

.field-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.field {
    display: grid;
    gap: 0.35rem;
}

label,
.field-label {
    color: var(--text);
    font-weight: 700;
    font-size: 1rem;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    min-height: 54px;
    padding: 0.9rem 1rem;
    border: 1px solid #d7ccbc;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
}

input[readonly] {
    background: #f7f3ed;
    color: var(--navy);
}

input:focus,
select:focus {
    outline: 2px solid rgba(var(--accent-rgb), 0.16);
    outline-offset: 1px;
    border-color: rgba(var(--accent-rgb), 0.52);
}

.toggle-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
}

.toggle-option {
    position: relative;
    display: block;
}

.toggle-option input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.toggle-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0.95rem 1rem;
    border: 1px solid #d6cab9;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--navy);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.toggle-option input:checked + span {
    border-color: var(--accent-line-strong);
    background: linear-gradient(180deg, var(--accent-soft) 0%, #c7f9d7 100%);
    color: var(--accent-dark);
}

.calculator-actions,
.cta-row,
.hero-actions,
.inline-links,
.tag-list,
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-actions {
    margin-top: 1rem;
}

.calculator-actions {
    padding: 0 1rem 1rem;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(180deg, #16A34A 0%, #15803D 100%);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(var(--accent-rgb), 0.18);
}

.button:hover,
button.button:hover {
    filter: brightness(1.03);
}

.button.is-secondary {
    border-color: var(--accent-line);
    background: var(--accent-wash);
    color: var(--accent-dark);
    box-shadow: none;
}

.metric small,
.link-card strong,
.mini-post time,
.article-meta,
.muted,
.hint,
.table-caption {
    color: var(--muted);
}

.metric strong {
    display: block;
    margin: 0.35rem 0 0.2rem;
    color: var(--navy);
    font-size: 1.8rem;
    line-height: 1.15;
    font-family: "Bitter", Georgia, serif;
}

.metric.is-primary {
    border-color: var(--accent-line);
    background: linear-gradient(180deg, var(--accent-wash) 0%, #fff 100%);
}

.link-card {
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.link-card:hover,
.link-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent-line-strong);
}

.link-card strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--navy);
    font-size: 1.1rem;
    font-family: "Bitter", Georgia, serif;
}

.article-card {
    display: grid;
    gap: 0.9rem;
}

.article-card h2,
.article-card h3 {
    margin-bottom: 0;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.article-card .button {
    width: 100%;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-size: 0.98rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 0.8rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.96rem;
}

.sidebar-card .widget-title {
    margin-bottom: 0.95rem;
    font-size: 1.15rem;
}

.sidebar-list {
    gap: 0.85rem;
}

.mini-post {
    display: grid;
    gap: 0.18rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.mini-post:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.mini-post strong {
    color: var(--navy);
    font-size: 1.08rem;
    line-height: 1.28;
}

.mini-post p {
    font-size: 0.98rem;
    margin: 0;
}

.breadcrumbs {
    margin-bottom: 0.85rem;
    font-size: 0.98rem;
}

.breadcrumbs a {
    color: var(--accent-dark);
    font-weight: 700;
}

.article-content .article-section {
    border-radius: var(--radius-lg);
}

.faq-card h3 {
    font-size: 1.55rem;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

th,
td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 1rem;
}

th {
    color: var(--navy);
    background: #f8f1e8;
    font-family: "Bitter", Georgia, serif;
    font-weight: 700;
}

tr:last-child td {
    border-bottom: 0;
}

ul,
ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--muted);
}

li + li {
    margin-top: 0.45rem;
}

.site-footer {
    margin-top: 1rem;
    padding: 1.1rem 0 0;
    color: var(--muted);
}

.footer-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--line);
}

.footer-copy {
    max-width: 52ch;
}

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

.footer-column {
    display: grid;
    gap: 0.7rem;
}

.footer-title {
    margin: 0;
    color: var(--navy);
    font-family: "Bitter", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.footer-links {
    display: grid;
    gap: 0.45rem;
}

.footer-links a {
    color: var(--navy);
    font-weight: 600;
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.footer-bottom {
    margin-top: 0.9rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.96rem;
}

.page-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
}

.page-summary-card {
    padding: 1.1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf9 0%, #fff6ec 100%);
    box-shadow: 0 10px 22px rgba(57, 44, 31, 0.04);
}

.page-summary-card span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

.page-summary-card strong {
    display: block;
    color: var(--navy);
    font-family: "Bitter", Georgia, serif;
    font-size: 1.18rem;
    line-height: 1.2;
}

.page-closing-panel {
    padding: 1.35rem;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.12), transparent 32%),
        linear-gradient(180deg, #fffaf5 0%, #fff 100%);
    box-shadow: 0 18px 38px rgba(57, 44, 31, 0.06);
}

.page-closing-panel h2 {
    margin-bottom: 0.55rem;
}

.page-closing-panel p {
    max-width: 60ch;
}

@media (max-width: 980px) {
    .content-grid,
    .calculator-top,
    .calculator-bottom,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .site-shell {
        width: min(calc(100% - 1rem), var(--container));
        padding-top: 0.8rem;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 0.9rem;
        padding: 0.15rem 0 0.8rem;
    }

    .topbar nav {
        justify-content: flex-start;
        gap: 1rem;
        margin-left: 0;
    }

    .brand-logo-wrap {
        width: auto;
        min-height: auto;
    }

    .brand-logo {
        width: auto;
        max-width: min(100%, 320px);
        height: 58px;
    }

    .page-body,
    .site-footer {
        padding-left: 0;
        padding-right: 0;
    }

    .page-frame {
        padding: 0.9rem;
        border-radius: 26px;
    }

    h1 {
        font-size: clamp(2.2rem, 10vw, 3.4rem);
    }

    h2 {
        font-size: clamp(1.65rem, 8vw, 2.4rem);
    }

    .hero-copy,
    p {
        font-size: 1rem;
    }

    .calculator-actions,
    .cta-row,
    .hero-actions,
    .inline-links {
        flex-direction: column;
    }

    .button,
    button.button {
        width: 100%;
    }

    .metrics-grid,
    .links-grid,
    .article-list,
    .toggle-group,
    .footer-columns {
        grid-template-columns: 1fr;
    }
}
