:root {
    color-scheme: dark;
    --navy-950: #071c2b;
    --navy-900: #0b253a;
    --navy-800: #102f49;
    --blue: #118fc8;
    --cyan: #39b7e8;
    --green: #43f59e;
    --text: #f5f9fc;
    --muted: #a9bfd0;
    --stroke: rgba(176, 212, 233, .16);
    --card: rgba(16, 47, 73, .76);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--navy-950);
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 14% -10%, rgba(17, 143, 200, .22), transparent 34rem),
        radial-gradient(circle at 88% 12%, rgba(67, 245, 158, .08), transparent 30rem),
        linear-gradient(160deg, var(--navy-900), var(--navy-950) 54%);
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.directory-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 12px clamp(18px, 5vw, 72px);
    border-bottom: 1px solid var(--stroke);
    background: rgba(7, 28, 43, .9);
    backdrop-filter: blur(18px);
}

.directory-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.directory-brand > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, var(--cyan), #087fb6);
    box-shadow: 0 10px 28px rgba(17, 143, 200, .28);
    font-size: 22px;
    font-weight: 900;
}

.directory-brand strong {
    display: grid;
    font-size: 18px;
    line-height: .92;
    letter-spacing: .03em;
}

.directory-brand small {
    color: #78a4bf;
    font-size: 9px;
    letter-spacing: .2em;
}

.directory-header nav,
.language-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.directory-header nav > a {
    color: #c4d6e2;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.directory-header nav > a:hover {
    color: #fff;
}

.language-links {
    padding: 4px;
    border: 1px solid var(--stroke);
    border-radius: 11px;
    background: rgba(255, 255, 255, .04);
}

.language-links a {
    padding: 7px 9px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.language-links a.is-active {
    color: #fff;
    background: #117fae;
}

main {
    width: min(1500px, calc(100% - 36px));
    margin: 0 auto;
    padding: clamp(42px, 7vw, 92px) 0 72px;
}

.directory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 42px;
    align-items: end;
    padding-bottom: clamp(34px, 5vw, 62px);
}

.directory-kicker {
    margin: 0 0 14px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .18em;
}

.directory-hero h1 {
    max-width: 900px;
    margin: 0;
    font-size: clamp(38px, 6vw, 78px);
    line-height: .98;
    letter-spacing: -.055em;
}

.directory-hero p:not(.directory-kicker) {
    max-width: 820px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.7;
}

.directory-count {
    display: grid;
    min-width: 180px;
    padding: 25px;
    border: 1px solid rgba(57, 183, 232, .3);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(17, 143, 200, .2), rgba(255, 255, 255, .04));
    box-shadow: 0 22px 60px rgba(0, 0, 0, .18);
}

.directory-count strong {
    color: #fff;
    font-size: 46px;
    line-height: 1;
}

.directory-count span {
    margin-top: 7px;
    color: #9ed4eb;
    font-size: 13px;
    font-weight: 750;
}

.directory-tools {
    position: sticky;
    top: 88px;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    background: rgba(7, 28, 43, .88);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .18);
    backdrop-filter: blur(18px);
}

.directory-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0 16px;
    border: 1px solid rgba(176, 212, 233, .18);
    border-radius: 13px;
    background: rgba(255, 255, 255, .055);
}

.directory-search:focus-within {
    border-color: rgba(57, 183, 232, .72);
    box-shadow: 0 0 0 3px rgba(57, 183, 232, .12);
}

.directory-search svg {
    width: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: #77bdda;
    stroke-width: 1.8;
}

.directory-search input {
    width: 100%;
    height: 48px;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
}

.directory-search input::placeholder {
    color: #7895a8;
}

.directory-filters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.directory-filters::-webkit-scrollbar {
    display: none;
}

.directory-filters button {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #9eb7c8;
    background: transparent;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.directory-filters button:hover,
.directory-filters button.is-active {
    color: #fff;
    border-color: rgba(57, 183, 232, .24);
    background: rgba(17, 143, 200, .17);
}

.directory-result-line {
    display: flex;
    gap: 6px;
    padding: 22px 4px 13px;
    color: #8da8ba;
    font-size: 13px;
}

.directory-result-line strong {
    color: #d9e8f1;
}

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

.race-directory-card {
    min-width: 0;
    border: 1px solid var(--stroke);
    border-radius: 20px;
    background: linear-gradient(150deg, var(--card), rgba(11, 37, 58, .72));
    box-shadow: 0 18px 46px rgba(0, 0, 0, .12);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.race-directory-card:hover {
    transform: translateY(-3px);
    border-color: rgba(57, 183, 232, .42);
    box-shadow: 0 26px 58px rgba(0, 0, 0, .22);
}

.race-directory-card.is-featured {
    border-color: rgba(67, 245, 158, .36);
    box-shadow: inset 0 3px 0 rgba(67, 245, 158, .68), 0 18px 46px rgba(0, 0, 0, .14);
}

.race-directory-card[hidden] {
    display: none;
}

.race-directory-card__link {
    display: flex;
    height: 100%;
    min-height: 330px;
    flex-direction: column;
    padding: 22px;
    color: inherit;
    text-decoration: none;
}

.race-directory-card__top {
    display: flex;
    min-height: 20px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #84a5b9;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.race-directory-card__top strong {
    color: var(--green);
    font-size: 9px;
    letter-spacing: .13em;
}

.race-directory-card h2 {
    margin: 17px 0 0;
    color: #fff;
    font-size: 21px;
    line-height: 1.24;
    letter-spacing: -.025em;
}

.race-directory-card p {
    display: -webkit-box;
    margin: 12px 0 20px;
    overflow: hidden;
    color: #9eb6c6;
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.race-directory-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: auto 0 0;
}

.race-directory-card dl div {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid rgba(176, 212, 233, .1);
    border-radius: 11px;
    background: rgba(255, 255, 255, .035);
}

.race-directory-card dt {
    color: #718fa3;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.race-directory-card dd {
    margin: 4px 0 0;
    overflow: hidden;
    color: #e9f2f7;
    font-size: 13px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-directory-card__action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(176, 212, 233, .12);
    color: #62c9ef;
    font-size: 12px;
    font-weight: 900;
}

.race-directory-card__action span {
    font-size: 18px;
}

.directory-empty {
    display: grid;
    min-height: 220px;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed rgba(176, 212, 233, .2);
    border-radius: 20px;
    color: var(--muted);
    text-align: center;
}

.directory-empty[hidden] {
    display: none;
}

.directory-empty strong {
    color: #fff;
}

footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px clamp(18px, 5vw, 72px);
    border-top: 1px solid var(--stroke);
    color: #7998ac;
    background: rgba(5, 22, 34, .7);
    font-size: 12px;
}

footer strong {
    color: #d9e8f1;
}

footer a {
    margin-left: auto;
    color: #68c9eb;
    font-weight: 850;
    text-decoration: none;
}

@media (max-width: 1080px) {
    .directory-tools {
        grid-template-columns: 1fr;
    }

    .directory-filters button {
        height: 40px;
    }

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

@media (max-width: 700px) {
    .directory-header {
        min-height: 66px;
        padding: 10px 14px;
    }

    .directory-brand > span {
        width: 38px;
        height: 38px;
    }

    .directory-header nav > a {
        display: none;
    }

    main {
        width: min(100% - 24px, 1500px);
        padding-top: 36px;
    }

    .directory-hero {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .directory-count {
        grid-template-columns: auto 1fr;
        min-width: 0;
        align-items: end;
        gap: 10px;
        padding: 17px 19px;
    }

    .directory-count strong {
        font-size: 34px;
    }

    .directory-tools {
        top: 76px;
        padding: 9px;
        border-radius: 16px;
    }

    .directory-search input {
        height: 44px;
        font-size: 13px;
    }

    .directory-filters {
        padding-bottom: 1px;
    }

    .race-directory-grid {
        grid-template-columns: 1fr;
    }

    .race-directory-card__link {
        min-height: 0;
    }

    footer {
        align-items: flex-start;
        flex-direction: column;
    }

    footer a {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
