:root {
    --black: #07090c;
    --ink: #14171b;
    --muted: #545b64;
    --paper: #fff;
    --line: #d8dde2;
    --control-line: #838b94;
    --focus: #26699a;
    --font: Aptos, "Segoe UI", Arial, sans-serif;
    --header-height: clamp(64px, 5.5vw, 80px);
    --header-gutter: clamp(18px, 3.3vw, 52px);
    --gutter: clamp(24px, 9vw, 144px);
    --mark-width: clamp(36px, 6vw, 100px);
    --mark-inset: clamp(4px, 1.8vw, 30px);
    --mark-clearance: calc(var(--mark-width) + var(--mark-inset) + 6px);
    --content-width: 1300px;
    --section-space: clamp(54px, 7.4vw, 116px);
}

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

[hidden] {
    display: none !important;
}

html {
    scroll-padding-top: var(--header-height);
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.55 var(--font);
}

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

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

button, input, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

:where(a, button, input, textarea, [role="tabpanel"]):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    z-index: 40;
    inset: 8px auto auto 16px;
    transform: translateY(-150%);
    padding: 10px 16px;
    background: var(--black);
    color: var(--paper);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    --header-shadow: #fffd;
    position: fixed;
    z-index: 20;
    inset: 0 0 auto;
    height: var(--header-height);
    background: transparent;
    pointer-events: none;
}

.site-header.on-dark, .flow-panel {
    --focus: #a8d8ff;
    color: var(--paper);
}

.site-header.on-dark {
    --header-shadow: #000c;
}

.site-header .brand, .site-header .contact-cta {
    filter: drop-shadow(0 0 2px var(--header-shadow));
    pointer-events: auto;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1520px, calc(100% - 2 * var(--header-gutter)));
    height: 100%;
    margin-inline: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    width: clamp(126px, 13vw, 195px);
    min-height: 44px;
}

.brand img {
    width: 100%;
    height: auto;
}

.on-dark .brand img {
    filter: invert(1);
}

.contact-cta, .form-submit, .consent-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 17px;
    border: 1px solid currentColor;
    border-radius: 0;
    background: transparent;
    text-align: center;
    font-weight: 550;
    line-height: 1.25;
}

.contact-cta:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.contact-cta {
    position: relative;
    min-height: 36px;
    padding: 5px 12px;
    font-size: .9rem;
    font-weight: 500;
}

@media (pointer: coarse) {
    .contact-cta::after {
        /* Extend the 36px button to a 44px touch target. */
        content: "";
        position: absolute;
        inset: -5px 0;
    }
}

.on-dark .contact-cta:hover {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
}

.panel {
    position: relative;
}

.panel-inner {
    width: min(var(--content-width), calc(100% - 2 * var(--gutter)));
    margin-inline: auto;
}

.flow-panel {
    isolation: isolate;
    display: grid;
    align-content: center;
    background: var(--black);
}

.flow-panel .panel-bg {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#home {
    min-height: 100vh;
    min-height: 100svh;
    padding-block: calc(var(--header-height) + clamp(48px, 10vh, 104px)) clamp(54px, 8vh, 84px);
}

#home::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, #05070b48, #05070b2e 48%, transparent 82%);
}

.hero-inner {
    width: min(1194px, 75.4%);
}

.hero-title {
    margin: 0 0 clamp(20px, 3vw, 40px);
    font-size: clamp(2.75rem, 4.65vw, 4.6rem);
    font-weight: 400;
    line-height: 1.09;
    letter-spacing: -.032em;
    text-shadow: 0 2px 20px #000a;
    text-wrap: balance;
}

.hero-copy {
    max-width: 67ch;
    margin: 0;
    color: #f6f8fa;
    font-size: clamp(1rem, 1.35vw, 1.25rem);
    line-height: 1.55;
    text-shadow: 0 1px 10px #000;
    text-wrap: pretty;
}

.hero-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(8px, 1vw, 14px);
    width: min(100%, 560px);
    margin-top: clamp(24px, 4.6vh, 46px);
}

.hero-logos img {
    width: auto;
    height: auto;
    max-width: min(100%, 104px);
}

.hero-logos img:nth-child(-n + 2) {
    max-width: 100%;
}

.hero-logos img:first-child {
    max-height: 76px;
}

.hero-logos img:nth-child(2) {
    max-height: 62px;
}

#mission {
    min-height: clamp(480px, 71vh, 710px);
    padding-block: clamp(64px, 10vh, 112px);
    border-top: 1px solid #ffffff28;
}

#mission .panel-inner {
    width: min(1128px, 71%);
}

.belief-copy {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    font-weight: 350;
    letter-spacing: -.022em;
    line-height: 1.42;
}

.belief-copy span {
    display: block;
}

.belief-copy .large {
    font-weight: 650;
}

.seventeen-panel {
    padding-block: var(--section-space);
    border-top: 1px solid var(--line);
}

.seventeen-panel > .panel-inner {
    padding-inline-end: max(0px, calc(var(--mark-clearance) - var(--gutter)));
}

.page-title {
    margin: 0;
    font-size: clamp(2.5rem, 4.3vw, 4.2rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -.028em;
    text-wrap: balance;
}

.services-page {
    display: grid;
    grid-template-columns: minmax(0, .4fr) minmax(0, 1fr);
    grid-template-areas:
        "media title"
        "media content";
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 24px clamp(28px, 3.4vw, 54px);
}

.service-section-title {
    grid-area: title;
}

.service-media-wrap {
    grid-area: media;
    overflow: hidden;
    background: #f0f2f4;
}

.service-media-stage {
    display: grid;
    gap: 8px;
}

.service-media {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    filter: grayscale(1);
}

.service-content {
    grid-area: content;
    min-width: 0;
}

.service-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0 clamp(15px, 2.4vw, 38px);
    border-bottom: 1px solid var(--line);
}

.service-tab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 0 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: clamp(1rem, 1.9vw, 1.85rem);
    line-height: 1.2;
    text-align: left;
}

.service-tab:hover, .service-tab[aria-selected="true"] {
    color: var(--ink);
    border-bottom-color: currentColor;
}

.service-panes {
    margin-top: clamp(20px, 2.4vw, 38px);
}

.service-pane[role="region"] + .service-pane[role="region"] {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.service-pane .plain-copy {
    max-width: 76ch;
    font-size: clamp(1rem, 1.15vw, 1.1rem);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.plain-copy p {
    margin: 0 0 1em;
}

.plain-copy p:last-child {
    margin-bottom: 0;
}

.expertise-shell {
    max-width: 1060px;
    margin-inline: auto;
}

.expertise-heading {
    margin-bottom: clamp(28px, 4vw, 60px);
    text-align: center;
}

.expertise-cards {
    border-top: 1px solid var(--line);
}

.expertise-card {
    display: grid;
    grid-template-columns: clamp(84px, 16vw, 210px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 3vw, 48px);
    padding-block: clamp(12px, 1.16vw, 18px);
    border-bottom: 1px solid var(--line);
}

.expertise-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.expertise-card h3 {
    margin: 0;
    font-size: clamp(1.08rem, 2.12vw, 1.92rem);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: -.016em;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.partner-layout, .contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: center;
    gap: clamp(22px, 3.6vw, 56px);
}

#contact {
    padding-block: clamp(42px, 4.2vw, 64px);
    background: #fcfcfc;
}

.contact-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 4;
    object-fit: cover;
}

.contact-form-panel {
    min-width: 0;
    padding: clamp(20px, 2.1vw, 32px);
    border: 1px solid #bac0c7;
    background: var(--paper);
}

.contact-form-panel .page-title {
    margin-bottom: clamp(20px, 2.1vw, 30px);
    font-size: clamp(2.35rem, 3.5vw, 3.45rem);
}

.contact-form {
    display: grid;
    gap: 11px;
}

.form-row {
    display: grid;
    gap: 3px;
}

.form-row-hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.form-row label {
    font-size: .94rem;
    font-weight: 650;
}

.form-row input, .form-row textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 0;
    border-bottom: 1px solid var(--control-line);
    border-radius: 0;
    background: #f7f8fa;
}

.form-row input::placeholder, .form-row textarea::placeholder {
    color: var(--muted);
}

.form-row textarea {
    min-height: 88px;
    resize: vertical;
}

.form-submit {
    justify-self: center;
    margin-top: 4px;
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
    padding-inline: 24px;
}

.form-submit:hover {
    background: #333c46;
    border-color: #333c46;
}

.contact-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px 9px;
    margin: 18px 0 0;
    text-align: center;
    font-size: .94rem;
}

.contact-line a, .legal-link {
    text-decoration: underline;
    text-underline-offset: .2em;
    overflow-wrap: anywhere;
}

.legal-page {
    width: min(980px, calc(100% - 2 * var(--gutter)));
    margin-inline: auto;
    padding-block: calc(var(--header-height) + 22px) clamp(48px, 7vw, 96px);
}

.legal-page h1 {
    margin: 0 0 24px;
    font-size: clamp(1.7rem, 3.1vw, 2.65rem);
    line-height: 1.18;
}

.legal-flow {
    max-width: 820px;
    font-size: 1.03rem;
    line-height: 1.68;
}

.legal-flow p {
    margin: 0 0 1.05em;
    overflow-wrap: anywhere;
}

.site-footer {
    padding-block: clamp(30px, 3vw, 48px);
    border-top: 1px solid var(--line);
    font-size: .95rem;
}

.footer-grid {
    --footer-gutter: var(--header-gutter);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(24px, 3.3vw, 46px);
    width: min(1500px, calc(100% - 2 * var(--footer-gutter)));
    margin-inline: auto;
}

.site-pages .footer-grid {
    padding-inline-end: max(0px, calc(var(--mark-clearance) - var(--footer-gutter)));
}

.footer-logo-img {
    width: clamp(132px, 14vw, 220px);
    height: auto;
}

.footer-navigation {
    justify-self: end;
    text-align: right;
}

.footer-link-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: baseline;
    gap: 0 14px;
    margin: 0;
}

.footer-link, .footer-action, .footer-current {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    font-weight: 400;
}

.footer-link:hover, .footer-action:hover {
    color: var(--muted);
}

.footer-current {
    font-weight: 600;
}

.footer-separator {
    display: none;
}

.footer-main {
    --footer-column-gap: clamp(16px, 2.8vw, 44px);
    --footer-logo-width: clamp(108px, calc(90px + 5.5vw), 166px);
    --footer-ministry-width: calc(var(--footer-logo-width) * .86);
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, var(--footer-ministry-width)) minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "funding-title funding-title partner-title beneficiary-title"
        "bmwk esf ibykus tmk"
        "note note note note"
        "copy copy copy copy";
    align-items: start;
    gap: 16px var(--footer-column-gap);
}

.footer-funding, .footer-funding-logos, .footer-partner-block, .footer-beneficiary {
    display: contents;
}

.footer-funding .footer-block-title { grid-area: funding-title; }
.footer-partner-block .footer-block-title { grid-area: partner-title; }
.footer-beneficiary .footer-block-title { grid-area: beneficiary-title; }
.footer-note { grid-area: note; }
.footer-copy { grid-area: copy; }

.footer-block-title {
    overflow-wrap: anywhere;
}

.footer-main .partner-logo {
    display: block;
    width: min(100%, var(--logo-width, var(--footer-logo-width)));
}

.footer-main .partner-logo img {
    width: auto;
    height: auto;
    max-height: calc(var(--footer-logo-width) * .56);
    /* Align the artwork inside the original files' white margins. */
    transform: translate(var(--logo-offset, 0, 0));
}

.footer-main .bmwk {
    grid-area: bmwk;
    --logo-width: var(--footer-ministry-width);
    --logo-offset: -2.1%, -6.6%;
}

.footer-main .esf {
    grid-area: esf;
    --logo-width: calc(var(--footer-logo-width) * 1.38);
    --logo-offset: -1.2%, -5.5%;
}

.footer-main .ibykus { grid-area: ibykus; }

.footer-main .tmk {
    grid-area: tmk;
    --logo-offset: -.6%, -3.8%;
}

.footer-note, .footer-copy {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.footer-note {
    padding-top: 14px;
}

.panel-seventeen-mark {
    position: fixed;
    z-index: 2;
    inset: auto var(--mark-inset) clamp(14px, 2.4vw, 34px) auto;
    width: var(--mark-width);
    height: auto;
    opacity: 0;
    pointer-events: none;
}

.mark-visible .panel-seventeen-mark {
    opacity: 1;
}

.consent-banner {
    --focus: #a8d8ff;
    position: fixed;
    z-index: 30;
    inset: auto 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 24px;
    width: min(1160px, calc(100% - 32px));
    max-height: calc(100dvh - var(--header-height) - 20px);
    margin-inline: auto;
    padding: 17px 20px;
    overflow: auto;
    border: 1px solid #fff4;
    background: var(--black);
    color: var(--paper);
    box-shadow: 0 8px 32px #0003;
    font-size: .94rem;
}

.consent-banner p, .consent-category-desc {
    margin: 3px 0 0;
}

.consent-actions, .consent-modal-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.consent-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 8px;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.consent-button {
    padding-inline: 13px;
    font-size: .9rem;
}

.consent-button:hover {
    background: #fff2;
}

.consent-button.primary {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--black);
}

.consent-modal {
    width: min(640px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: clamp(18px, 4vw, 32px);
    overflow: auto;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--paper);
    box-shadow: 0 12px 52px #0003;
}

.consent-modal::backdrop {
    background: #07090caa;
}

.consent-modal h2 {
    margin: 0;
    font-size: clamp(1.45rem, 4vw, 1.85rem);
    font-weight: 550;
    line-height: 1.2;
}

.consent-modal p {
    color: var(--muted);
}

.consent-category {
    padding-block: 13px;
    border-top: 1px solid var(--line);
}

.consent-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.consent-category-title {
    font-weight: 650;
}

.consent-category-desc {
    font-size: .92rem;
}

.consent-toggle {
    display: grid;
    flex: 0 0 44px;
    min-height: 44px;
    place-items: center;
}

.consent-toggle input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--ink);
}

.consent-modal-actions {
    justify-content: flex-end;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.consent-button.light:hover {
    background: #eef1f4;
}

.consent-button.light.primary {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.consent-button.light.primary:hover {
    background: #333c46;
}

@media (min-width: 1280px) {
    .site-pages .footer-grid {
        padding-inline-end: 100px;
    }
}

@media (max-width: 1000px) {
    :root {
        --gutter: clamp(22px, 5.2vw, 54px);
    }

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

@media (max-width: 820px) {
    .services-page {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "title" "tabs" "media" "panes";
        grid-template-rows: auto;
        row-gap: 16px;
    }

    .service-content { display: contents; }
    .service-tabs { grid-area: tabs; }
    .service-panes {
        grid-area: panes;
        margin-top: 2px;
    }
    .service-media {
        aspect-ratio: 2 / 1;
        max-height: 300px;
    }

    .partner-layout, .contact-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-photo {
        aspect-ratio: 16 / 9;
        max-height: 340px;
        object-fit: cover;
        object-position: center 56%;
    }

    .footer-main {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "funding-title funding-title"
            "bmwk esf"
            "partner-title beneficiary-title"
            "ibykus tmk"
            "note note"
            "copy copy";
        row-gap: 12px;
    }

    .footer-partner-block .footer-block-title,
    .footer-beneficiary .footer-block-title {
        margin-top: 6px;
    }

    .footer-note {
        margin-top: 6px;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: clamp(18px, 5.2vw, 26px);
    }

    #home {
        padding-block: calc(var(--header-height) + 42px) 54px;
    }

    #home::before {
        background: linear-gradient(180deg, transparent 14%, #05070b34 38%, #05070b98 83%);
    }

    .hero-inner {
        width: calc(100% - 2 * var(--gutter));
        text-align: center;
    }

    .hero-title {
        font-size: clamp(2.05rem, 9.6vw, 3.35rem);
    }

    .hero-copy {
        max-width: 43ch;
        margin-inline: auto;
    }

    .hero-logos {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: center;
        width: min(100%, 306px);
        margin-inline: auto;
        gap: 22px 20px;
    }

    .hero-logos img:nth-child(n + 3) {
        max-width: min(100%, 130px);
    }

    .hero-logos img:first-child {
        max-height: 72px;
    }

    .hero-logos img:nth-child(2) {
        max-height: 70px;
    }

    #mission {
        min-height: 440px;
    }

    #mission .panel-inner {
        width: calc(100% - 2 * var(--gutter));
    }

    .belief-copy {
        font-size: clamp(1.45rem, 6.45vw, 2.35rem);
        line-height: 1.36;
    }

    .belief-copy span + span {
        margin-top: .1em;
    }

    .contact-line [aria-hidden="true"] { display: none; }

    .footer-grid {
        --footer-gutter: var(--gutter);
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-navigation {
        justify-self: start;
        text-align: left;
    }

    .footer-link-row { justify-content: flex-start; }
    .footer-link, .footer-action, .footer-current { min-height: 40px; }

    .consent-banner {
        bottom: 8px;
        width: calc(100% - 16px);
        padding: 14px;
    }

    .consent-actions > *, .consent-modal-actions > * {
        flex: 1 1 130px;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    .contact-cta, .form-submit, .consent-button, .panel-seventeen-mark {
        transition: color .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease;
    }
}
