:root {
    --ink: #13231f;
    --ink-soft: #51615c;
    --paper: #f5f3ec;
    --surface: #fffefa;
    --line: #d9ded8;
    --green: #0f6b4e;
    --green-dark: #084936;
    --green-pale: #dceee6;
    --amber: #e3a83b;
    --danger: #a32929;
    --danger-pale: #fff0ed;
    --shadow: 0 22px 55px rgba(25, 45, 38, 0.09);
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 90% 4%, rgba(227, 168, 59, 0.14), transparent 28rem),
        var(--paper);
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.site-header {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-weight: 750;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: white;
    background: var(--green-dark);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.header-link,
.text-button {
    color: var(--green-dark);
    font-weight: 700;
}

.header-link {
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.hero {
    width: min(900px, calc(100% - 40px));
    margin: 72px auto 58px;
    text-align: center;
}

.eyebrow,
.step-label {
    margin: 0 0 12px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 20px;
    font-size: clamp(2.45rem, 6vw, 5.35rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero-copy {
    max-width: 660px;
    margin: 0 auto;
    color: var(--ink-soft);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.55;
}

.hero-facts {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-facts span,
.method-badge {
    padding: 8px 12px;
    border: 1px solid rgba(15, 107, 78, 0.22);
    border-radius: 999px;
    color: var(--green-dark);
    background: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    font-weight: 700;
}

.app-layout {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(350px, 0.88fr);
    gap: 22px;
    align-items: start;
}

.projections {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 100px;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid rgba(19, 35, 31, 0.10);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.projections-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 34px;
}

.projections-heading h2 {
    margin-bottom: 0;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    letter-spacing: -0.035em;
}

.projections-heading > p {
    max-width: 410px;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

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

.chart-panel {
    min-width: 0;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcf8;
}

.chart-panel figcaption {
    min-height: 104px;
}

.chart-panel h3 {
    margin-bottom: 6px;
    font-size: 1.18rem;
}

.chart-panel figcaption p {
    margin-bottom: 15px;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.chart-legend button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 3px 0;
    border: 0;
    color: var(--ink-soft);
    background: transparent;
    font-size: 0.78rem;
}

.chart-legend button[aria-pressed="false"] {
    opacity: 0.45;
    text-decoration: line-through;
}

.legend-swatch {
    width: 18px;
    height: 3px;
    border-radius: 99px;
}

.series-one {
    background: var(--green);
}

.series-two {
    background: var(--amber);
}

.chart-wrap {
    position: relative;
    min-width: 0;
}

.projection-chart {
    display: block;
    width: 100%;
    min-height: 300px;
    overflow: visible;
    touch-action: pan-y;
}

.chart-frame {
    fill: white;
    stroke: var(--line);
}

.chart-grid-line {
    stroke: #e8ece7;
    stroke-width: 1;
}

.chart-axis-label,
.chart-axis-title {
    fill: var(--ink-soft);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
}

.chart-axis-title {
    font-weight: 700;
}

.chart-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.chart-line-series-one,
.chart-hover-marker-series-one {
    stroke: var(--green);
}

.chart-line-series-two,
.chart-hover-marker-series-two {
    stroke: var(--amber);
}

.chart-hover-guide {
    stroke: var(--ink-soft);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    pointer-events: none;
}

.chart-hover-marker {
    fill: white;
    stroke-width: 2.5;
    pointer-events: none;
}

.chart-hit-area {
    fill: transparent;
    cursor: crosshair;
}

.chart-tooltip {
    position: absolute;
    z-index: 4;
    width: max-content;
    max-width: min(240px, calc(100% - 16px));
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: white;
    background: var(--green-dark);
    box-shadow: 0 10px 30px rgba(19, 35, 31, 0.18);
    font-size: 0.76rem;
    line-height: 1.45;
    pointer-events: none;
}

.chart-tooltip strong {
    display: block;
    margin-bottom: 4px;
}

.chart-tooltip span {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.chart-tooltip i {
    width: 7px;
    height: 7px;
    margin: 5px 6px 0 0;
    border-radius: 50%;
    flex: 0 0 auto;
}

.chart-tooltip b {
    margin-left: auto;
}

.panel {
    border: 1px solid rgba(19, 35, 31, 0.10);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-panel,
.results-panel {
    padding: clamp(24px, 4vw, 42px);
}

.results-panel {
    position: sticky;
    top: 18px;
    min-height: 610px;
    color: white;
    background:
        radial-gradient(circle at 100% 0, rgba(227, 168, 59, 0.20), transparent 20rem),
        var(--green-dark);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: start;
    margin-bottom: 30px;
}

.section-heading h2,
.explanation h2,
.disclaimer h2 {
    margin-bottom: 0;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    letter-spacing: -0.035em;
}

.text-button {
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    white-space: nowrap;
}

fieldset {
    margin: 0;
    padding: 26px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

legend {
    padding: 0 0 18px;
    font-size: 1.02rem;
    font-weight: 800;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
}

.field-wide {
    grid-column: 1 / -1;
}

.field small {
    color: var(--ink-soft);
    font-size: 0.76rem;
    font-weight: 400;
    line-height: 1.35;
}

input,
select,
.input-prefix,
.input-suffix {
    width: 100%;
}

input,
select {
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #c9d1cb;
    border-radius: 10px;
    color: var(--ink);
    background: white;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(15, 107, 78, 0.14);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(163, 41, 41, 0.10);
}

.input-prefix,
.input-suffix {
    display: grid;
    align-items: center;
    border: 1px solid #c9d1cb;
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

.input-prefix {
    grid-template-columns: auto 1fr;
}

.input-suffix {
    grid-template-columns: 1fr auto;
}

.input-prefix > span,
.input-suffix > span {
    padding: 0 13px;
    color: var(--ink-soft);
    font-weight: 700;
}

.input-prefix input,
.input-suffix input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.input-prefix:focus-within,
.input-suffix:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(15, 107, 78, 0.14);
}

.primary-button,
.secondary-button {
    width: 100%;
    min-height: 54px;
    border-radius: 12px;
    font-weight: 800;
}

.primary-button {
    margin-top: 10px;
    border: 0;
    color: white;
    background: var(--green);
    box-shadow: 0 12px 24px rgba(15, 107, 78, 0.20);
}

.primary-button:hover {
    background: var(--green-dark);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.75;
}

.button-loader {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 9px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: white;
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 0.75s linear infinite;
}

.is-loading .button-loader {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(163, 41, 41, 0.24);
    border-radius: 12px;
    color: var(--danger);
    background: var(--danger-pale);
    line-height: 1.45;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.results-placeholder {
    min-height: 510px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.results-placeholder h2 {
    margin: 18px 0 8px;
}

.results-placeholder p {
    max-width: 330px;
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.5;
}

.placeholder-number {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: var(--amber);
    font-weight: 800;
}

.results-panel .step-label {
    color: #7ee0ba;
}

.results-heading {
    align-items: center;
}

.results-heading h2 {
    color: white;
}

.method-badge {
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.result-hero {
    padding: 24px 0 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.result-hero p,
.result-card p {
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.86rem;
}

.result-hero strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.result-hero span,
.result-card span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
}

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

.result-card {
    min-height: 134px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
}

.accent-card {
    border-color: rgba(126, 224, 186, 0.35);
    background: rgba(126, 224, 186, 0.11);
}

.result-card strong {
    display: block;
    margin-bottom: 7px;
    color: white;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.result-list {
    margin: 0;
}

.result-list div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.result-list dt {
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.82rem;
}

.result-list dd {
    margin: 0;
    color: white;
    font-size: 0.88rem;
    font-weight: 750;
    text-align: right;
}

.result-note {
    margin: 20px 0;
    padding: 13px 14px;
    border-radius: 10px;
    color: #e3f8ef;
    background: rgba(126, 224, 186, 0.10);
    font-size: 0.82rem;
    line-height: 1.45;
}

.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: white;
    background: transparent;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.explanation,
.disclaimer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto 100px;
}

.explanation > h2 {
    max-width: 680px;
}

.explanation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 34px;
}

.explanation article {
    padding: 26px;
    border-top: 2px solid var(--green);
    background: rgba(255, 255, 255, 0.48);
}

.explanation article > span {
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
}

.explanation h3 {
    margin: 28px 0 10px;
    font-size: 1.14rem;
}

.explanation article p,
.disclaimer p {
    margin-bottom: 0;
    color: var(--ink-soft);
    line-height: 1.55;
}

.disclaimer {
    padding: clamp(24px, 5vw, 46px);
    border-radius: 22px;
    background: var(--green-pale);
}

.disclaimer h2 {
    margin-bottom: 12px;
}

footer {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 36px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(19, 35, 31, 0.14);
    color: var(--ink-soft);
    font-size: 0.82rem;
}

@media (max-width: 920px) {
    .hero {
        margin-top: 48px;
    }

    .app-layout {
        grid-template-columns: 1fr;
    }

    .results-panel {
        position: static;
        min-height: 0;
    }

    .results-placeholder {
        min-height: 320px;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .chart-panel figcaption {
        min-height: 0;
    }
}

@media (max-width: 620px) {
    .site-header,
    .hero,
    .app-layout,
    .projections,
    .explanation,
    .disclaimer,
    footer {
        width: min(100% - 24px, 1180px);
    }

    .header-link {
        display: none;
    }

    .hero {
        margin-bottom: 38px;
        text-align: left;
    }

    .hero-facts {
        justify-content: flex-start;
    }

    .panel {
        border-radius: 18px;
    }

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

    .projections {
        padding: 20px 12px;
        border-radius: 18px;
    }

    .projections-heading {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .chart-panel {
        padding: 16px 8px 12px;
    }

    .chart-panel figcaption {
        padding: 0 8px;
    }

    .field-grid,
    .primary-results,
    .explanation-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .result-list div {
        align-items: flex-end;
    }

    footer {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
