:root {
    --pink: #e626a2;
    --pink-dark: #b9197e;
    --blue: #69b9d6;
    --blue-dark: #247994;
    --ink: #20252b;
    --muted: #5c6470;
    --line: #dbe3e8;
    --soft: #f5f9fb;
    --white: #ffffff;
    --shadow: 0 10px 28px rgba(25, 57, 71, 0.09);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--white);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

.directory-shell {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 72px;
}

.directory-header {
    max-width: 780px;
    margin: 0 auto 38px;
    text-align: center;
}

h1 {
    margin: 0;
    color: var(--pink);
    font-size: clamp(2.5rem, 6vw, 4.75rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.intro {
    max-width: 680px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--soft);
}

.field label {
    display: block;
    margin: 0 0 7px;
    font-size: 0.9rem;
    font-weight: 700;
}

.field select,
.field input {
    width: 100%;
    height: 52px;
    border: 1.5px solid #aab8c1;
    border-radius: 9px;
    outline: none;
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field select {
    padding: 0 42px 0 15px;
}

.field input {
    padding: 0 15px 0 45px;
}

.field select:focus,
.field input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(230, 38, 162, 0.13);
}

.search-wrap {
    position: relative;
}

.search-wrap > svg {
    position: absolute;
    z-index: 1;
    top: 15px;
    left: 15px;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-width: 1.8;
}

.clear-button {
    min-height: 52px;
    padding: 0 22px;
    border: 2px solid var(--pink);
    border-radius: 999px;
    background: var(--pink);
    color: var(--white);
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.clear-button:hover {
    border-color: var(--pink-dark);
    background: var(--pink-dark);
    transform: translateY(-1px);
}

.results-bar {
    display: flex;
    align-items: center;
    min-height: 62px;
    margin: 0;
}

.results-bar p {
    margin: 0;
    color: var(--muted);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.resource-card {
    display: flex;
    min-width: 0;
    min-height: 280px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid var(--line);
    border-top: 5px solid var(--blue);
    border-radius: 14px;
    background: var(--white);
    box-shadow: var(--shadow);
}

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

.card-content {
    padding: 25px 26px 18px;
}

.stage {
    display: inline-block;
    margin: 0 0 11px;
    color: var(--blue-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resource-card h2 {
    margin: 0 0 13px;
    font-size: clamp(1.25rem, 2.4vw, 1.55rem);
    line-height: 1.25;
}

.description {
    margin: 0;
    color: var(--muted);
}

.card-footer {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 17px 26px;
    border-top: 1px solid var(--line);
    background: #fbfdfe;
}

.category {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.card-footer a {
    display: inline-flex;
    min-width: 0;
    gap: 6px;
    align-items: center;
    color: var(--pink-dark);
    font-weight: 700;
    text-decoration: none;
}

.card-footer a:hover,
.card-footer a:focus-visible {
    text-decoration: underline;
}

.card-footer a svg {
    width: 18px;
    min-width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notice {
    padding: 48px 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--soft);
    text-align: center;
}

.notice h2,
.notice p {
    margin: 0;
}

.notice p {
    margin-top: 8px;
    color: var(--muted);
}

.notice .clear-button {
    margin-top: 22px;
}

@media (max-width: 820px) {
    .filter-panel {
        grid-template-columns: 1fr 1fr;
    }

    .clear-button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 650px) {
    .directory-shell {
        width: min(100% - 26px, 1160px);
        padding-top: 22px;
    }

    h1 {
        font-size: clamp(1.75rem, 10vw, 2.25rem);
        white-space: nowrap;
    }

    .directory-header {
        margin-bottom: 28px;
    }

    .filter-panel,
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        gap: 14px;
        padding: 17px;
    }

    .clear-button {
        justify-self: center;
        margin-top: 10px;
    }

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

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