:root {
    --ink: #0a0c0f;
    --ink-soft: #171b20;
    --paper: #f1f0eb;
    --surface: #fff;
    --line: #d7d7d2;
    --copy: #363b42;
    --muted: #686e75;
    --red: #a32c00;
    --red-dark: #7a2100;
    --orange: #e64a19;
    --blue: #0066cc;
    --blue-dark: #004a99;
    --white: #fff;
    --content-width: 1229px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html.calculators-page {
    scroll-padding-top: 96px;
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    color: var(--copy);
    background:
        linear-gradient(rgba(15, 26, 39, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 26, 39, 0.035) 1px, transparent 1px),
        var(--paper);
    background-size: 34px 34px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

main {
    flex: 1;
}

main :where(h1, h2, h3, h4, h5, h6, p, li, dt, dd) {
    min-inline-size: 0;
    overflow-wrap: anywhere;
}

a {
    color: inherit;
}

p {
    white-space: pre-line;
}

.restricted-width-wrapper {
    inline-size: min(100% - 40px, var(--content-width));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    inset-block-start: -100px;
    inset-inline-start: 8px;
    z-index: 10000;
    padding: 10px 14px;
    border: 2px solid var(--white);
    color: var(--white);
    background: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.skip-link:focus {
    inset-block-start: 6px;
    outline: var(--white) solid 3px;
    outline-offset: 2px;
}

.page-logo {
    position: fixed;
    top: 20px;
    left: 8px;
    z-index: 9000;
    width: 50px;
    height: 50px;
}

header nav {
    position: fixed;
    top: 20px;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    padding: 0 20px;
    background: rgba(0, 0, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

header nav ul {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 2.2vw, 36px);
    padding: 0;
    margin: 0;
    list-style: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

header nav ul li {
    margin: 0;
}

header nav ul li a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

header nav ul li a::after {
    position: absolute;
    right: 0;
    bottom: 5px;
    left: 0;
    height: 2px;
    background: var(--orange);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

header nav ul li a:hover,
header nav ul li a[aria-current="page"] {
    color: var(--orange);
}

header nav ul li a:hover::after,
header nav ul li a[aria-current="page"]::after {
    transform: scaleX(1);
}

header nav ul li a[aria-disabled="true"] {
    color: #969696;
    cursor: default;
}

header nav ul li a[aria-disabled="true"]::after {
    display: none;
}

header nav ul li a:focus-visible,
.footer-grid a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

header nav .hamburger {
    display: none;
    width: auto;
    padding: 0;
    border: 0;
    color: #fff;
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

header nav .hamburger:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.second-navigation {
    top: 0;
    height: 20px;
    background: var(--blue);
    border: 0;
}

.second-navigation ul {
    gap: 30px;
    height: 100%;
}

.second-navigation ul li {
    display: flex;
    align-items: center;
    height: 100%;
}

.second-navigation ul li a {
    height: 100%;
    min-height: 0;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
}

.second-navigation ul li a::after {
    bottom: 1px;
}

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-block-size: 620px;
    margin-block-start: 70px;
    overflow: hidden;
    color: var(--white);
    background: var(--ink);
}

.hero::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    background:
        linear-gradient(90deg, rgba(5, 7, 9, 0.99) 0%, rgba(5, 7, 9, 0.93) 44%, rgba(5, 7, 9, 0.46) 74%, rgba(5, 7, 9, 0.18) 100%),
        linear-gradient(0deg, rgba(5, 7, 9, 0.62), transparent 48%);
}

.hero::after {
    position: absolute;
    inset-block: 0;
    inset-inline-start: max(20px, calc(50% - 615px));
    z-index: -1;
    inline-size: 7px;
    content: "";
    background: linear-gradient(var(--red) 0 68%, var(--blue) 68% 100%);
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.015);
}

.hero .restricted-width-wrapper {
    padding-block: 72px;
}

.hero-content {
    max-inline-size: 800px;
    padding-inline-start: 32px;
    text-align: start;
}

.hero-kicker,
.section-kicker,
.selection-guide-label {
    margin: 0 0 14px;
    color: var(--orange);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    line-height: 1.25;
    text-transform: uppercase;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
}

.hero-kicker::before {
    inline-size: 42px;
    block-size: 4px;
    content: "";
    background: var(--red);
}

.hero h1 {
    max-inline-size: 770px;
    margin: 0;
    color: var(--white);
    font-family: Impact, "Arial Narrow", Arial, sans-serif;
    font-size: clamp(3.5rem, 6.1vw, 6.35rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 0.92;
    text-transform: uppercase;
    text-wrap: balance;
}

.hero-content > p:not(.hero-kicker) {
    max-inline-size: 720px;
    margin: 28px 0 32px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(1rem, 1.55vw, 1.2rem);
    line-height: 1.7;
}

.hero .cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 52px;
    padding: 12px 22px;
    border: 2px solid var(--red);
    color: var(--white);
    background: var(--red);
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 180ms ease, background-color 180ms ease;
}

.hero .cta-button::after {
    margin-inline-start: 16px;
    content: "\2193";
    font-size: 1.15rem;
}

.hero .cta-button:hover {
    background: var(--red-dark);
    transform: translateY(-3px);
}

.hero .cta-button:focus-visible {
    outline: var(--white) solid 3px;
    outline-offset: 4px;
}

#main-content {
    scroll-margin-top: 0;
}

.core-section {
    padding-block: clamp(68px, 8vw, 112px) 76px;
}

.catalog-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
    gap: clamp(36px, 6vw, 88px);
    align-items: end;
    margin-block-end: 64px;
}

.catalog-copy h2 {
    max-inline-size: 850px;
    margin: 0;
    color: var(--ink);
    font-family: "Arial Narrow", Arial, sans-serif;
    font-size: clamp(2.35rem, 4vw, 4.6rem);
    font-weight: 900;
    letter-spacing: -0.045em;
    line-height: 0.98;
    text-transform: uppercase;
    text-wrap: balance;
}

.catalog-copy > p:last-child {
    max-inline-size: 850px;
    margin: 28px 0 0;
    color: var(--copy);
    font-size: 1.02rem;
    line-height: 1.78;
}

.selection-guide {
    position: relative;
    padding: 30px 30px 26px;
    border-block-start: 5px solid var(--blue);
    color: var(--white);
    background: var(--ink-soft);
    box-shadow: 18px 18px 0 rgba(0, 102, 204, 0.12);
}

.selection-guide-label {
    color: #70b8ff;
}

.selection-guide h3 {
    margin: 0 0 20px;
    color: var(--white);
    font-family: "Arial Narrow", Arial, sans-serif;
    font-size: 1.55rem;
    line-height: 1.08;
    text-transform: uppercase;
}

.selection-guide ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.selection-guide li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 12px;
    align-items: center;
    min-block-size: 39px;
    border-block-start: 1px solid rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
    font-weight: 700;
}

.selection-guide li span {
    color: var(--orange);
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

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

.calculator-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
    padding: 30px 28px 32px;
    border: 1px solid #d9dde3;
    border-block-start: 5px solid var(--red);
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(9, 16, 29, 0.08);
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.calculator-card:nth-child(3n + 2) {
    border-block-start-color: var(--blue);
}

.calculator-card:hover {
    border-color: #b8c1cb;
    box-shadow: 0 18px 38px rgba(9, 16, 29, 0.13);
    transform: translateY(-5px);
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-block-end: 24px;
}

.card-number {
    color: var(--red);
    font-family: Impact, "Arial Narrow", Arial, sans-serif;
    font-size: 2.7rem;
    letter-spacing: 0.03em;
    line-height: 1;
}

.calculator-card:nth-child(3n + 2) .card-number {
    color: var(--blue);
}

.card-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-align: end;
    text-transform: uppercase;
}

.calculator-card h3 {
    margin: 0;
    color: var(--ink);
    font-family: "Arial Narrow", Arial, sans-serif;
    font-size: clamp(1.55rem, 2.25vw, 2.1rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.05;
    text-transform: uppercase;
}

.card-summary {
    margin: 18px 0 24px;
    color: var(--copy);
    font-size: 0.95rem;
    line-height: 1.65;
}

.calculator-details {
    margin: 0 0 28px;
}

.calculator-details > div {
    padding-block: 16px;
    border-block-start: 1px solid var(--line);
}

.calculator-details > div:last-child {
    border-block-end: 1px solid var(--line);
}

.calculator-details dt {
    margin: 0 0 5px;
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    line-height: 1.35;
    text-transform: uppercase;
}

.calculator-details dd {
    margin: 0;
    color: var(--copy);
    font-size: 0.88rem;
    line-height: 1.58;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    inline-size: 15.5rem;
    max-inline-size: 100%;
    min-block-size: 44px;
    align-self: center;
    margin-block-start: auto;
    padding: 9px 14px;
    border: 2px solid var(--blue);
    color: var(--white);
    background: var(--blue);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 180ms ease, background-color 180ms ease;
}

.card-cta::after {
    margin-inline-start: 11px;
    content: "\2192";
    font-size: 0.95rem;
}

.card-cta:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
}

.card-cta:focus-visible {
    outline: #333 solid 3px;
    outline-offset: 4px;
}

.calculator-note {
    position: relative;
    margin-block-start: 56px;
    padding: clamp(28px, 4vw, 44px);
    border-inline-start: 7px solid var(--red);
    color: var(--white);
    background: var(--ink-soft);
    overflow: hidden;
}

.calculator-note::after {
    position: absolute;
    right: -42px;
    bottom: -58px;
    inline-size: 180px;
    block-size: 180px;
    border: 28px solid rgba(0, 102, 204, 0.18);
    border-radius: 50%;
    content: "";
}

.calculator-note-kicker {
    margin: 0 0 10px;
    color: var(--orange);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    line-height: 1.25;
    text-transform: uppercase;
}

.calculator-note h3 {
    position: relative;
    z-index: 1;
    max-inline-size: 800px;
    margin: 0;
    color: var(--white);
    font-family: "Arial Narrow", Arial, sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.7rem);
    line-height: 1.05;
    text-transform: uppercase;
}

.calculator-note > p:last-child {
    position: relative;
    z-index: 1;
    max-inline-size: 920px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.site-footer {
    padding: 42px 20px;
    margin-top: 0;
    color: #fff;
    background: #000;
    text-align: center;
}

.site-footer p {
    margin: 0 0 20px;
    color: #fff;
    font-size: 16px;
}

.site-footer nav {
    display: flex;
    justify-content: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 10px 20px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer-grid li {
    margin: 0;
}

.footer-grid a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 6px;
    color: #fff;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.footer-grid a:hover {
    color: var(--orange);
}

.scrollToTopBtn {
    position: fixed;
    right: 15px;
    bottom: 15px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 10px 15px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    font: inherit;
    line-height: normal;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
}

.scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.scrollToTopBtn:hover {
    background: var(--blue-dark);
}

.scrollToTopBtn:focus-visible {
    outline: 3px solid #111;
    outline-offset: 3px;
}

.arrow {
    display: block;
    margin-bottom: 3px;
    font-size: 16px;
}

.top-text {
    font-size: 14px;
}

@media (min-width: 886px) {
    .navigation-list li:nth-child(6),
    .navigation-list li:nth-child(7),
    .navigation-list li:nth-child(8),
    .navigation-list li:nth-child(9) {
        display: none;
    }
}

@media (max-width: 1024px) {
    .catalog-intro {
        grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
        gap: 38px;
    }

    .calculator-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 886px) {
    .page-logo {
        right: 8px;
        left: auto;
    }

    header nav ul {
        position: absolute;
        top: 50px;
        left: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        max-height: 0;
        padding: 0;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.98);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
    }

    header nav ul.open {
        max-height: 560px;
        padding-block: 12px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    header nav .hamburger {
        display: block;
    }

    header nav ul li {
        width: 100%;
        padding-inline: 20px;
    }

    header nav ul li a {
        width: 100%;
    }

    header nav ul li a::after {
        right: auto;
        width: 44px;
    }

    .navigation-list li:nth-child(6),
    .navigation-list li:nth-child(7),
    .navigation-list li:nth-child(8),
    .navigation-list li:nth-child(9) {
        display: block;
    }

    .second-navigation ul {
        display: none;
    }

    .hero {
        min-block-size: 590px;
    }

    .hero::after {
        inset-inline-start: 20px;
    }

    .hero-content {
        padding-inline: 28px 10px;
    }

    .catalog-intro {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .selection-guide {
        max-inline-size: 620px;
    }
}

@media (max-width: 768px) {
    .restricted-width-wrapper {
        inline-size: min(100% - 28px, var(--content-width));
    }

    .hero {
        min-block-size: 560px;
    }

    .hero::before {
        background: linear-gradient(90deg, rgba(5, 7, 9, 0.95), rgba(5, 7, 9, 0.65));
    }

    .hero-background {
        object-position: 67% center;
    }

    .hero .restricted-width-wrapper {
        padding-block: 54px;
    }

    .hero h1 {
        font-size: clamp(3rem, 13vw, 5.4rem);
    }

    .hero-content > p:not(.hero-kicker) {
        line-height: 1.58;
    }

    .core-section {
        padding-block: 62px 58px;
    }

    .catalog-intro {
        margin-block-end: 48px;
    }

    .catalog-copy h2 {
        font-size: clamp(2.25rem, 11vw, 4rem);
    }

    .selection-guide {
        margin-inline-end: 12px;
        padding: 26px 22px 22px;
        box-shadow: 12px 12px 0 rgba(0, 102, 204, 0.12);
    }

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

    .calculator-card {
        padding: 26px 22px 28px;
    }

    .calculator-note {
        margin-block-start: 44px;
        padding: 28px 22px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, auto);
        row-gap: 0;
    }

    .scrollToTopBtn .arrow {
        display: none;
    }
}

@media (max-width: 420px) {
    .hero-content {
        padding-inline-start: 22px;
    }

    .hero h1 {
        font-size: 2.75rem;
    }

    .hero .cta-button {
        inline-size: 100%;
    }

    .card-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .card-heading p {
        text-align: start;
    }
}

@media (max-width: 359px) {
    .hero .cta-button,
    .card-cta {
        min-inline-size: 0;
        white-space: normal;
    }

    .footer-grid {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 10px;
    }

    .footer-grid a {
        padding-inline: 4px;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .hero .cta-button:hover,
    .card-cta:hover,
    .calculator-card:hover,
    .scrollToTopBtn,
    .scrollToTopBtn.show {
        transform: none;
    }
}
