/* ==========================================================================
   Soandaimes public site
   Design direction: "Trust & Authority" (navy + brand blue, accessible,
   high-contrast, subtle motion). Mobile-first; breakpoints 640 / 960 / 1200.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Brand */
    --navy-950: #030f27;          /* brand navy, from the logo/footer */
    --navy-900: #0a1a3a;
    --navy-800: #13284f;
    --brand-500: #1792cd;         /* brand blue: accents and text on navy only (3.5:1 on white) */
    --brand-400: #5cb8e6;         /* brand blue for small text on navy (8.6:1) */
    --brand-600: #0b6fa4;         /* buttons and links on light backgrounds (5.5:1) */
    --brand-700: #085a86;         /* hover */
    --brand-50: #e8f4fb;

    /* Neutrals */
    --ink: #0b1530;
    --text: #1e293b;
    --text-muted: #475569;
    --surface: #ffffff;
    --surface-muted: #f3f6fa;
    --border: #dfe5ee;
    --on-dark: #ffffff;
    --on-dark-muted: #b6c2d6;

    /* Typography */
    --font-heading: "Lexend", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* Spacing (spacious marketing scale) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --section-y: clamp(64px, 9vw, 112px);
    --gutter: 20px;
    --container: 1200px;

    /* Shape & depth */
    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(3, 15, 39, .06), 0 1px 3px rgba(3, 15, 39, .08);
    --shadow: 0 4px 12px rgba(3, 15, 39, .08), 0 2px 4px rgba(3, 15, 39, .05);
    --shadow-lg: 0 20px 40px -12px rgba(3, 15, 39, .25);

    /* Motion */
    --ease: cubic-bezier(.2, .7, .2, 1);
    --dur-fast: 150ms;
    --dur: 250ms;

    --header-h: 72px;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--ink);
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 var(--space-4);
    text-wrap: balance;
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-600); text-underline-offset: 3px; }
a:hover { color: var(--brand-700); }

ul[class], ol[class] { list-style: none; margin: 0; padding: 0; }

address { font-style: normal; }

main:focus { outline: none; }

:focus-visible {
    outline: 3px solid var(--brand-500);
    outline-offset: 3px;
    border-radius: 4px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 1000;
    padding: var(--space-3) var(--space-4);
    background: var(--navy-950);
    color: var(--on-dark);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: var(--on-dark); }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    vertical-align: -0.25em;
}
.icon-sm { width: .9em; height: .9em; vertical-align: -0.1em; }

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.narrow { max-width: calc(820px + var(--gutter) * 2); }

@media (min-width: 640px) {
    :root { --gutter: 32px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn .icon { transition: transform var(--dur) var(--ease); }
.btn:hover .icon-arrow-right { transform: translateX(3px); }

.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 1rem; }

.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; }

.btn-secondary { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    font-family: var(--font-heading);
    font-weight: 500;
    text-decoration: none;
    color: var(--brand-600);
}
.link-arrow .icon { transition: transform var(--dur) var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Top bar ---------- */
.topbar {
    display: none;
    background: var(--navy-950);
    color: var(--on-dark-muted);
    font-size: .875rem;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
}
.topbar-item, .topbar-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.topbar-links { display: flex; gap: var(--space-5); }
.topbar a { color: var(--on-dark-muted); text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar .icon { color: var(--brand-400); width: 1rem; height: 1rem; }

@media (min-width: 960px) {
    .topbar { display: block; }
}

/* ---------- Header & navigation ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--dur) var(--ease);
}
@supports (backdrop-filter: blur(8px)) {
    .site-header { background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(10px); }
}
.site-header.is-scrolled { box-shadow: var(--shadow); }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    min-height: var(--header-h);
}

.brand { display: inline-flex; padding: var(--space-2) 0; }
.brand img { width: 150px; height: auto; }

.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: -8px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.nav-toggle .icon { width: 26px; height: 26px; }
.nav-toggle:hover { background: var(--surface-muted); }
.nav-toggle-close { display: none; }
.site-header.is-open .nav-toggle-open { display: none; }
.site-header.is-open .nav-toggle-close { display: inline-flex; }

/* Mobile: the nav is a panel below the header. Visible without JS (no toggle needed then). */
.primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: var(--space-3) var(--gutter) var(--space-5);
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.site-header.is-open .primary-nav { display: block; animation: nav-in var(--dur) var(--ease); }
html:not(.js) .primary-nav { position: static; display: block; box-shadow: none; border: 0; padding-inline: 0; }
html:not(.js) .nav-toggle { display: none; }
html:not(.js) .header-inner { flex-wrap: wrap; }

@keyframes nav-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.nav-list a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--space-2);
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.nav-list a[aria-current="page"] { color: var(--brand-600); }
.nav-cta { width: 100%; margin-top: var(--space-5); }
.nav-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 48px;
    margin-top: var(--space-2);
    font-weight: 600;
    text-decoration: none;
}

@media (min-width: 960px) {
    .brand img { width: 164px; }
    .nav-toggle { display: none; }
    .primary-nav,
    .site-header.is-open .primary-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: var(--space-5);
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
        animation: none;
    }
    .nav-list { display: flex; gap: var(--space-1); }
    .nav-list a {
        position: relative;
        min-height: 44px;
        padding: 0 var(--space-3);
        border: 0;
        font-size: .9375rem;
        color: var(--text);
        border-radius: var(--radius-sm);
        transition: color var(--dur-fast) var(--ease);
    }
    .nav-list a:hover { color: var(--brand-600); }
    .nav-list a::after {
        content: "";
        position: absolute;
        left: var(--space-3);
        right: var(--space-3);
        bottom: 4px;
        height: 2px;
        background: var(--brand-500);
        transform: scaleX(0);
        transition: transform var(--dur) var(--ease);
    }
    .nav-list a:hover::after,
    .nav-list a[aria-current="page"]::after { transform: scaleX(1); }
    .nav-cta { width: auto; margin: 0; }
    .nav-phone { display: none; }
}

/* ---------- Shared section scaffolding ---------- */
.section { padding-block: var(--section-y); }
.section--muted { background: var(--surface-muted); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-family: var(--font-heading);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-600);
}
.eyebrow::before {
    content: "";
    width: 24px;
    height: 2px;
    background: var(--brand-500);
}
.eyebrow--light { color: var(--brand-400); }

.section-title { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); letter-spacing: -.01em; }
.section-title--sm { font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); margin-bottom: var(--space-5); }

.lead { font-size: 1.1875rem; color: var(--text-muted); }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
}
.section-head .section-title { margin-bottom: 0; }
.section-head--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(560px, 82vh, 780px);
    padding-block: var(--space-8) calc(var(--space-8) + 48px);
    overflow: hidden;
    isolation: isolate;
    color: var(--on-dark);
    background: var(--navy-950);
}
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(3, 15, 39, .94) 0%, rgba(3, 15, 39, .78) 45%, rgba(3, 15, 39, .35) 100%),
        linear-gradient(0deg, rgba(3, 15, 39, .6) 0%, rgba(3, 15, 39, 0) 40%);
}
.hero-inner { max-width: calc(var(--container) + var(--gutter) * 2); }
.hero h1 {
    max-width: 16ch;
    font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}
.hero-lead {
    max-width: 56ch;
    margin-bottom: var(--space-6);
    font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
    color: rgba(255, 255, 255, .88);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Proof strip (overlaps hero) ---------- */
.proof { position: relative; z-index: 2; margin-top: -56px; }
.proof-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.proof-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-5);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.proof-item:nth-child(2n) { border-right: 0; }
.proof-value {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
}
.proof-label { font-size: .9375rem; color: var(--text-muted); }

@media (min-width: 960px) {
    .proof-grid { grid-template-columns: repeat(4, 1fr); }
    .proof-item { padding: var(--space-6); border-bottom: 0; }
    .proof-item:nth-child(2n) { border-right: 1px solid var(--border); }
    .proof-item:last-child { border-right: 0; }
}

/* ---------- Split (image + text) ---------- */
.split { display: grid; gap: var(--space-7); align-items: center; }
.split--top { align-items: start; }
.split-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
@media (min-width: 960px) {
    .split { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
    .split--top { grid-template-columns: 1.4fr 1fr; }
}

.feature-list { display: grid; gap: var(--space-5); margin: var(--space-6) 0; }
.feature-list li { display: flex; gap: var(--space-4); align-items: flex-start; }
.feature-list h3 { font-size: 1.0625rem; margin-bottom: var(--space-1); }
.feature-list p { color: var(--text-muted); font-size: 1rem; }

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--brand-50);
    color: var(--brand-600);
}
.feature-icon .icon { width: 24px; height: 24px; }

/* ---------- Service cards (home) ---------- */
.card-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.service-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.service-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.service-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.service-card-body { padding: var(--space-5); }
.service-card h3 { font-size: 1.125rem; margin-bottom: var(--space-2); }
.service-card p { font-size: 1rem; color: var(--text-muted); }

@media (min-width: 1200px) {
    /* Five services: 3 + 2 reads better than 4 + 1. */
    .card-grid { grid-template-columns: repeat(6, 1fr); }
    .card-grid > .service-card { grid-column: span 2; }
    .card-grid > .service-card:nth-child(4) { grid-column: 2 / span 2; }
}

/* ---------- Project grid & tiles ---------- */
.project-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.project-tile[hidden] { display: none; }
.project-tile a {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--navy-900);
    color: #fff;
    text-decoration: none;
}
.project-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--ease);
}
.project-tile a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(3, 15, 39, .9) 0%, rgba(3, 15, 39, .35) 45%, rgba(3, 15, 39, 0) 70%);
    transition: opacity var(--dur) var(--ease);
}
.project-tile a:hover img,
.project-tile a:focus-visible img { transform: scale(1.04); }
.project-tile a:focus-visible { outline-offset: 4px; }

.project-tile-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-5);
}
.project-tile-cat {
    font-family: var(--font-heading);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-400);
}
.project-tile-title {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
}
.project-tile-detail { font-size: .9375rem; color: rgba(255, 255, 255, .82); }

.project-tile-zoom {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    opacity: 0;
    transform: scale(.9);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.project-tile-zoom .icon { width: 18px; height: 18px; }
a:hover > .project-tile-zoom,
a:focus-visible > .project-tile-zoom { opacity: 1; transform: none; }
@media (hover: none) {
    .project-tile-zoom { opacity: 1; transform: none; }
}

/* ---------- Filter chips ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    font-family: var(--font-heading);
    font-size: .9375rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy-950); border-color: var(--navy-950); color: #fff; }
.chip-count {
    min-width: 24px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: .8125rem;
    color: var(--text-muted);
    text-align: center;
}
.chip[aria-pressed="true"] .chip-count { background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------- Certifications ---------- */
.cert-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.cert-card {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.cert-card img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
}
.cert-card h3 { font-size: 1.0625rem; margin-bottom: var(--space-1); }
.cert-card p { font-size: .9375rem; color: var(--text-muted); }

/* ---------- CTA band ---------- */
.cta-band {
    position: relative;
    padding-block: clamp(48px, 7vw, 80px);
    background:
        radial-gradient(1200px 400px at 100% 0%, rgba(23, 146, 205, .28), transparent 60%),
        var(--navy-950);
    color: var(--on-dark-muted);
    overflow: hidden;
}
.cta-inner {
    display: grid;
    gap: var(--space-6);
    align-items: center;
}
.cta-band h2 { color: #fff; font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.25rem); }
.cta-band p { max-width: 56ch; font-size: 1.0625rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (min-width: 960px) {
    .cta-inner { grid-template-columns: 1fr auto; gap: var(--space-8); }
}

/* ---------- Page header (inner pages) ---------- */
.page-header {
    position: relative;
    padding-block: clamp(48px, 7vw, 96px);
    background: var(--navy-950);
    color: var(--on-dark-muted);
    isolation: isolate;
    overflow: hidden;
}
.page-header--image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: var(--page-header-image) center 40% / cover no-repeat;
}
.page-header--image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(3, 15, 39, .95) 0%, rgba(3, 15, 39, .82) 55%, rgba(3, 15, 39, .55) 100%);
}
.page-header h1 {
    max-width: 22ch;
    margin-bottom: var(--space-4);
    font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -.015em;
    color: #fff;
}
.page-header .eyebrow { color: var(--brand-400); }
.page-header-lead {
    max-width: 62ch;
    font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
    color: rgba(255, 255, 255, .85);
}

.breadcrumb { margin-bottom: var(--space-5); font-size: .875rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.breadcrumb li { display: inline-flex; align-items: center; gap: var(--space-2); }
.breadcrumb li + li::before { content: "/"; color: rgba(255, 255, 255, .4); }
.breadcrumb a { color: var(--on-dark-muted); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb [aria-current] { color: #fff; }

/* ---------- Long-form text ---------- */
.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--text); }
.prose h2 { margin-top: var(--space-7); font-size: 1.375rem; }
.prose h2:first-child { margin-top: 0; }
.prose .section-title { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2rem); }
.prose ul { padding-left: 1.25em; margin: 0 0 var(--space-4); }
.prose li { margin-bottom: var(--space-2); }

.highlight-panel {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(23, 146, 205, .3), transparent 60%),
        var(--navy-950);
    color: var(--on-dark-muted);
}
.highlight-quote {
    font-family: var(--font-heading);
    font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}
@media (min-width: 960px) {
    .highlight-panel { position: sticky; top: calc(var(--header-h) + 24px); padding: var(--space-7); }
}

/* ---------- About: pillars ---------- */
.pillar-grid {
    display: grid;
    gap: var(--space-5);
}
@media (min-width: 960px) {
    .pillar-grid { grid-template-columns: repeat(3, 1fr); }
}
.pillar {
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.pillar .feature-icon { margin-bottom: var(--space-5); }
.pillar h3 { font-size: 1.25rem; }
.pillar p { font-size: 1rem; color: var(--text-muted); }
.pillar-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    margin-top: auto;
    padding-top: var(--space-5);
}
.pillar-footer img { height: 72px; width: auto; }

/* ---------- Services page ---------- */
.service-list { display: grid; gap: var(--space-7); }
.service-row { display: grid; gap: var(--space-5); align-items: center; }
.service-row-media {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.service-row-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 500ms var(--ease);
}
.service-row-media:hover img { transform: scale(1.03); }
.service-row-num {
    display: block;
    margin-bottom: var(--space-2);
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--brand-500);
    opacity: .35;
}
.service-row h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
.service-row p { font-size: 1.125rem; color: var(--text-muted); max-width: 48ch; }

@media (min-width: 860px) {
    .service-list { gap: var(--space-8); }
    .service-row { grid-template-columns: 1.15fr 1fr; gap: var(--space-8); }
    .service-row:nth-child(even) .service-row-media { order: 2; }
}

.trust-grid {
    display: grid;
    gap: var(--space-5);
}
@media (min-width: 760px) {
    .trust-grid { grid-template-columns: repeat(2, 1fr); }
}
.trust-item {
    padding: var(--space-6);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.trust-item .feature-icon { margin-bottom: var(--space-4); }
.trust-item h3 { font-size: 1.1875rem; }
.trust-item p { font-size: 1rem; color: var(--text-muted); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: var(--space-7); }
@media (min-width: 960px) {
    .contact-grid { grid-template-columns: 1fr 1.1fr; align-items: stretch; }
}
.contact-cards {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    align-content: start;
}
.contact-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 80px;
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.contact-card:hover { border-color: var(--brand-600); box-shadow: var(--shadow); color: var(--text); }
.contact-card-label { display: block; font-size: .875rem; color: var(--text-muted); }
.contact-card-value {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--ink);
    overflow-wrap: anywhere;
}
/* Email addresses don't fit a half-width card; give them the whole row. */
.contact-card--wide { grid-column: 1 / -1; }
.contact-card--primary { background: var(--navy-950); border-color: var(--navy-950); }
.contact-card--primary:hover { border-color: var(--brand-500); }
.contact-card--primary .feature-icon { background: rgba(255, 255, 255, .1); color: var(--brand-400); }
.contact-card--primary .contact-card-label { color: var(--on-dark-muted); }
.contact-card--primary .contact-card-value { color: #fff; font-size: 1.125rem; }

.contact-subtitle { grid-column: 1 / -1; margin: var(--space-5) 0 var(--space-1); font-size: 1.25rem; }
.location-grid {
    grid-column: 1 / -1;
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.location {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius);
    background: var(--surface-muted);
    line-height: 1.5;
}
.location strong { font-family: var(--font-heading); color: var(--ink); }

.map-frame {
    min-height: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-muted);
}
.map-frame iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: 0; }

/* ---------- Documents & notices ---------- */
/* ul.doc-list, not .doc-list: the ul[class] reset would otherwise zero the margin. */
ul.doc-list { display: grid; gap: var(--space-3); margin-bottom: var(--space-7); }
.doc-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease);
}
.doc-item:hover { border-color: var(--brand-600); box-shadow: var(--shadow); color: var(--text); }
.doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #fdecea;
    color: #b42318;
}
.doc-body { flex: 1; min-width: 0; }
.doc-title { display: block; font-family: var(--font-heading); font-weight: 500; color: var(--ink); line-height: 1.35; }
.doc-meta { display: block; font-size: .875rem; color: var(--text-muted); }
.doc-arrow { color: var(--brand-600); transition: transform var(--dur) var(--ease); }
.doc-item:hover .doc-arrow { transform: translateX(3px); }

.notice {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-6);
    border-radius: var(--radius);
    background: var(--surface-muted);
    border-left: 4px solid var(--brand-500);
}
.notice h2 { font-size: 1.25rem; }
.notice .btn { margin-top: var(--space-2); }
@media (min-width: 640px) {
    .notice { flex-direction: row; }
}

/* ---------- Funded projects ---------- */
.funded-list { display: grid; gap: var(--space-6); }
.funded-card {
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.funded-head h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.5rem); }
.funded-label {
    margin: var(--space-5) 0 var(--space-3);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.funded-logo { width: 100%; max-width: 420px; margin-bottom: var(--space-5); }
.facts {
    display: grid;
    margin: 0 0 var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.facts > div {
    display: grid;
    gap: 2px var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}
.facts > div:nth-child(odd) { background: var(--surface-muted); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: .875rem; font-weight: 600; color: var(--text-muted); }
.facts dd { margin: 0; color: var(--ink); }
@media (min-width: 640px) {
    .facts > div { grid-template-columns: 240px 1fr; align-items: baseline; }
}

/* ---------- Error page ---------- */
.error-page { min-height: 50vh; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--navy-950);
    color: var(--on-dark-muted);
    font-size: .9375rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.site-footer a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-grid {
    display: grid;
    gap: var(--space-7);
    padding-block: var(--space-8) var(--space-7);
}
@media (min-width: 640px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.3fr; }
}
.footer-logo { width: 150px; margin-bottom: var(--space-4); filter: brightness(0) invert(1); }
.footer-brand p { max-width: 36ch; }
.footer-social { display: flex; gap: var(--space-2); margin-top: var(--space-5); }
.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.footer-social a:hover { background: var(--brand-600); border-color: var(--brand-600); text-decoration: none; }
.footer-social .icon { width: 18px; height: 18px; }

.site-footer ul { list-style: none; margin: 0; padding: 0; }

.footer-title {
    margin-bottom: var(--space-4);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
}
.footer-col li { margin-bottom: var(--space-1); }
.footer-col li a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.footer-contact li { display: flex; gap: var(--space-3); margin-bottom: var(--space-3); line-height: 1.5; }
.footer-contact .icon { color: var(--brand-400); margin-top: 2px; width: 18px; height: 18px; }
.footer-contact li a { display: inline; min-height: 0; }

.footer-funding {
    padding-block: var(--space-5);
    background: #fff;
}
.footer-funding a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4) var(--space-7);
}
.footer-funding img { height: 40px; width: auto; max-width: 100%; object-fit: contain; }
/* The Pessoas 2030 artwork carries extra whitespace, so it needs more height to read at the same size. */
.footer-funding img:first-child { height: 60px; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-5);
    padding-block: var(--space-5);
    font-size: .875rem;
}

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-600);
    color: #fff;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.back-to-top:hover { background: var(--brand-700); color: #fff; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- Gallery dialog ---------- */
.gallery {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(3, 10, 24, .96);
    color: #fff;
}
.gallery::backdrop { background: rgba(3, 10, 24, .96); }
.gallery[open] { display: grid; grid-template-rows: auto 1fr auto; animation: gallery-in var(--dur) var(--ease); }
@keyframes gallery-in { from { opacity: 0; } to { opacity: 1; } }

.gallery-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
}
.gallery-counter { font-size: .9375rem; color: var(--on-dark-muted); font-variant-numeric: tabular-nums; }
.gallery-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 var(--space-4);
}
.gallery-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: opacity var(--dur) var(--ease);
}
.gallery-stage img.is-loading { opacity: .3; }
.gallery-caption {
    padding: var(--space-4) var(--space-5) var(--space-5);
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
}
.gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease);
}
.gallery-btn:hover { background: rgba(255, 255, 255, .24); }
.gallery-btn .icon { width: 24px; height: 24px; }
.gallery-prev, .gallery-next { position: absolute; top: 50%; transform: translateY(-50%); }
.gallery-prev { left: var(--space-4); }
.gallery-next { right: var(--space-4); }
@media (max-width: 639px) {
    .gallery-prev, .gallery-next { top: auto; bottom: var(--space-2); transform: none; }
}

/* ---------- Reveal on scroll (only when JS can reveal it) ---------- */
.js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms var(--ease), transform 400ms var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
    .project-tile a:hover img,
    .service-row-media:hover img { transform: none; }
}

/* ---------- Print ---------- */
@media print {
    .topbar, .site-header, .back-to-top, .cta-band, .footer-funding, .map-frame { display: none !important; }
    .page-header, .site-footer { background: none; color: #000; }
    .page-header h1 { color: #000; }
}
