@font-face {
    font-family: "Schibsted Grotesk";
    src: url("assets/schibsted-grotesk-var.woff2") format("woff2");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

/*
   One accent for the whole site, a cobalt blue, and one corner radius token
   used on every surface: cards, inputs, buttons, images. Light and dark are
   the same layout with swapped tokens, picked by the system.
*/

:root {
    --page: #f6f7f9;
    --surface: #ffffff;
    --sunk: #eceef2;
    --ink: #16181d;
    --muted: #5b606b;
    --hairline: #e0e2e8;
    --accent: #2647c9;
    --accent-soft: #e8ecfb;
    --accent-ink: #ffffff;
    --shadow: 0 1px 2px rgba(22, 24, 29, .05), 0 12px 28px rgba(22, 24, 29, .07);
    --radius: 12px;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --measure: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page: #101117;
        --surface: #181a22;
        --sunk: #22242e;
        --ink: #e9eaef;
        --muted: #9a9fac;
        --hairline: #282b35;
        --accent: #8ba4ff;
        --accent-soft: #1e2440;
        --accent-ink: #0a0f24;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .38);
    }
}

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

html {
    color-scheme: light dark;
    scroll-behavior: smooth;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--page);
    color: var(--ink);
    font-family: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent);
    text-underline-offset: 3px;
}

.shell {
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 1rem;
    top: 1rem;
    z-index: 10;
    background: var(--accent);
    color: var(--accent-ink);
    padding: .625rem 1rem;
    border-radius: var(--radius);
}

/* ---------- navigation ---------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--page) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
}

.nav__in {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav__mark {
    font-weight: 800;
    font-size: 1.0625rem;
    letter-spacing: .04em;
    color: var(--ink);
    text-decoration: none;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: .25rem;
    list-style: none;
}

.nav__links a {
    display: block;
    padding: .5rem .875rem;
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color .16s ease, background-color .16s ease;
}

.nav__links a:hover {
    color: var(--ink);
    background: var(--sunk);
}

.nav__links a[aria-current="page"] {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ---------- shared type ---------- */

main {
    flex: 1;
}

.display {
    font-size: clamp(2.25rem, 5.6vw, 4rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -.035em;
}

.initial {
    color: var(--accent);
}

.lede {
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    color: var(--muted);
    max-width: 46ch;
    margin-top: 1.25rem;
}

.section-head {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 700;
    letter-spacing: -.025em;
}

.eyebrow {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: .8125rem 1.5rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .16s ease, background-color .16s ease, transform .08s ease;
}

.btn:hover {
    border-color: var(--muted);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn--primary:hover {
    filter: brightness(1.08);
    border-color: var(--accent);
}

.btn[disabled] {
    opacity: .55;
    cursor: progress;
}

/* ---------- home: hero ---------- */

.hero {
    padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem);
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
}

@media (min-width: 900px) {
    .hero {
        grid-template-columns: 1.15fr .85fr;
    }
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* One real project photo, pulled live. It stays hidden if the API is down. */
.hero__shot {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--sunk);
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3;
}

.hero__shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__aside[hidden] {
    display: none;
}

.hero__caption {
    margin-top: .625rem;
    font-size: .8125rem;
    color: var(--muted);
}

/* ---------- home: how it works ---------- */

.flow {
    border-top: 1px solid var(--hairline);
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    display: grid;
    gap: 2rem;
}

@media (min-width: 760px) {
    .flow {
        grid-template-columns: 1.25fr 1fr 1fr;
        gap: clamp(2rem, 4vw, 3.5rem);
    }
}

.flow__step h3 {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -.015em;
    margin-bottom: .375rem;
}

.flow__step p {
    color: var(--muted);
    font-size: .9375rem;
}

/* ---------- live strip on the home page ---------- */

.live {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
    border-top: 1px solid var(--hairline);
}

.live__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

/* ---------- search form ---------- */

.tool {
    padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2rem);
}

.filters {
    margin-top: clamp(1.75rem, 3vw, 2.25rem);
    display: grid;
    gap: 1rem;
}

@media (min-width: 700px) {
    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 0;
}

.field__label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--ink);
}

.field select,
.field input {
    font: inherit;
    font-size: .9375rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: .75rem .875rem;
    width: 100%;
    min-width: 0;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.field select:disabled {
    color: var(--muted);
    background: var(--sunk);
    cursor: not-allowed;
}

.field input::placeholder {
    color: var(--muted);
}

.field select:focus,
.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.field__hint {
    font-size: .8125rem;
    color: var(--muted);
}

.tool__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-top: 1.5rem;
}

/* ---------- results ---------- */

.results {
    padding-bottom: clamp(3rem, 6vw, 5rem);
}

.results__count {
    font-size: .9375rem;
    color: var(--muted);
    min-height: 1.6em;
    padding: 1.25rem 0;
}

.cards {
    display: grid;
    gap: clamp(1.25rem, 2.4vw, 1.75rem);
    grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card__shot {
    flex: none;
    aspect-ratio: 16 / 10;
    background: var(--sunk);
    position: relative;
    overflow: hidden;
}

.card__shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__theme {
    position: absolute;
    left: .75rem;
    bottom: .75rem;
    background: var(--surface);
    color: var(--ink);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .3125rem .5625rem;
    border-radius: calc(var(--radius) / 2);
}

.card__body {
    padding: 1.125rem 1.25rem 1.375rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: .375rem;
}

.card__where {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--accent);
}

.card__title {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.015em;
}

.card__title a {
    color: var(--ink);
    text-decoration: none;
}

.card__title a:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent);
}

.card__org {
    font-size: .8125rem;
    color: var(--muted);
}

.card__summary {
    font-size: .9375rem;
    color: var(--muted);
    margin-top: .25rem;
}

.card__fund {
    margin-top: auto;
    padding-top: 1.125rem;
}

.card__bar {
    height: 4px;
    background: var(--sunk);
    border-radius: 999px;
    overflow: hidden;
}

.card__bar span {
    display: block;
    height: 100%;
    background: var(--accent);
}

.card__figures {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .8125rem;
    color: var(--muted);
    margin-top: .5rem;
}

.card__figures b {
    color: var(--ink);
    font-weight: 700;
}

.card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding-top: 1rem;
    font-size: .875rem;
    font-weight: 600;
}

/* ---------- loading, empty, error ---------- */

.skeleton {
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.skeleton__shot {
    aspect-ratio: 16 / 10;
}

.skeleton__body {
    padding: 1.125rem 1.25rem 1.5rem;
    display: grid;
    gap: .625rem;
}

.skeleton__line {
    height: .7rem;
    border-radius: 999px;
}

.skeleton__line--short {
    width: 50%;
}

.skeleton__shot,
.skeleton__line {
    background: var(--sunk);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

.load-more {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding-top: clamp(.5rem, 2vw, 1.25rem);
}

.note {
    grid-column: 1 / -1;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    padding: clamp(1.75rem, 4vw, 2.75rem);
    max-width: 40rem;
}

.note__head {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin-bottom: .375rem;
}

.note__body {
    color: var(--muted);
}

.note--error {
    border-color: var(--accent);
}

.note--error .note__head {
    color: var(--accent);
}

/* ---------- prose page ---------- */

.prose {
    padding: clamp(3rem, 6vw, 5rem) 0;
    max-width: 62ch;
}

.prose h1 {
    margin-bottom: 1.5rem;
}

.prose p {
    margin-bottom: 1.125rem;
    color: var(--muted);
    font-size: 1.0625rem;
}

.prose strong {
    color: var(--ink);
    font-weight: 600;
}

.prose h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink);
    margin: 2.5rem 0 .75rem;
}

/* ---------- footer ---------- */

.footer {
    border-top: 1px solid var(--hairline);
    padding: 2rem 0;
    font-size: .875rem;
    color: var(--muted);
}

.footer__in {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2rem;
    justify-content: space-between;
    align-items: center;
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

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

    .card,
    .btn,
    .nav__links a {
        transition: none;
    }

    .card:hover {
        transform: none;
    }

    .skeleton__shot,
    .skeleton__line {
        animation: none;
    }
}
