:is(.site-header, .site-footer) {
    --blue: #1488bd;
    --blue-dark: #075276;
    --blue-deep: #082f46;
    --ink-soft: #50616a;
    --line: rgb(20 35 44 / 14%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: normal;
}

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 2px solid rgb(20 35 44 / 10%);
    background: rgb(0 44 75 / 90%);
    backdrop-filter: blur(18px);
}

@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: scroll(root block)) {
        .site-header::before {
            position: absolute;
            z-index: 1;
            inset: 0 0 auto;
            height: 3px;
            background: linear-gradient(90deg, #f3c748, #56cfdd);
            transform-origin: left;
            animation: reading-progress linear both;
            animation-timeline: scroll(root block);
            pointer-events: none;
            content: "";
        }
    }
}

@keyframes reading-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.nav-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(0.8rem, 2vw, 2.25rem);
    width: 100%;
    min-height: 5.15rem;
    margin-inline: auto;
    padding-inline: clamp(2rem, 5vw, 5.5rem);
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.8rem;
    color: inherit;
    text-decoration: none;
}

.brand img {
    width: clamp(11rem, 15vw, 15rem);
    height: auto;
}

.header-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-width: 0;
}

.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.66rem 2.35rem;
    color: var(--paper);
    border: 1px solid var(--paper);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    max-width: 100%;
    white-space: normal;
    text-align: center;
}

.header-button--primary {
    border-color: var(--paper);
    color: var(--blue-dark);
    background: var(--paper);
}

.header-button--primary:hover {
    border-color: var(--paper);
    background: var(--paper);
    color: var(--blue);
}

.header-button--quiet:hover {
    border-color: var(--paper);
    background: var(--blue-dark);
    color: var(--paper);
}

.site-footer { color: var(--ink); background: var(--paper); }

.site-footer > .section-shell {
    width: min(100% - 2rem, 94rem);
    margin-inline: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(10rem, 0.85fr) minmax(0, 4.15fr);
    gap: clamp(2rem, 3vw, 3rem);
    padding-block: clamp(4rem, 7vw, 7rem);
}

.footer-brand .brand img { width: min(14rem, 100%); }

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: 2rem;
}

.footer-grid > *,
.footer-links > * { min-width: 0; }
.footer-links > div { display: flex; flex-direction: column; align-items: flex-start; }
.footer-links strong { margin-bottom: 1.1rem; color: var(--blue-deep); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.footer-links a { padding-block: 0.35rem; color: var(--ink-soft); font-size: 0.8rem; text-decoration: none; }
.footer-links a:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 0.2rem; }
.footer-info address,
.footer-info p { margin: 0; color: var(--ink-soft); font-size: 0.8rem; font-style: normal; line-height: 1.85; }
.footer-info address a { padding: 0; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.66rem;
}

@media (max-width: 74rem) {
    .nav-shell { padding-inline: 3rem; }
}

@media (max-width: 64rem) {
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 60rem) {
    .nav-shell {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem 1rem;
        padding-inline: 3rem;
        padding-block: 0.65rem;
    }

    .header-actions { grid-column: 2; }
}

@media (max-width: 47.99rem) {
    .nav-shell { padding-inline: clamp(12px, 4vw, 20px); }
    .brand img { width: clamp(128px, 34vw, 156px); }
    .header-actions { gap: 0.3rem; }

    .header-button {
        min-height: 2.4rem;
        padding: 0.58rem 0.82rem;
        font-size: 0.7rem;
    }

    .site-footer > .section-shell { width: min(100% - 1rem, 94rem); }
    .footer-grid { gap: 3rem; }
    .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.3rem 1.5rem; }
    .footer-info { grid-column: 1 / -1; }
    .footer-bottom { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 22rem) {
    .brand img { width: 115.2px; }
    .header-button { padding-inline: 0.55rem; font-size: 0.65rem; }
}
