:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #17212b;
    --muted: #66717c;
    --line: #e2e7ec;
    --accent: #245f8f;
    --accent-dark: #17486d;
    --tag: #eaf1f7;
    --shadow: 0 10px 30px rgba(20, 38, 55, .08);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.site-shell { max-width: 1220px; margin: 0 auto; padding: 0 28px; }
.site-header {
    min-height: 230px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    padding: 54px 0 44px;
    border-bottom: 1px solid var(--line);
}
.eyebrow, .section-label, .category {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .72rem;
    font-weight: 750;
}
.eyebrow, .section-label { color: var(--accent); }
h1 { margin: 7px 0 6px; font-size: clamp(2.2rem, 5vw, 3.7rem); line-height: 1.05; letter-spacing: -.035em; }
.subtitle { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 650px; }
.back-link { color: var(--accent); text-decoration: none; white-space: nowrap; font-weight: 650; }
.back-link:hover { text-decoration: underline; }

main { padding: 42px 0 70px; }
.featured {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 64px;
}
.featured-image { background: #edf1f4; }
.featured-image img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.featured-copy { padding: 42px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.featured-copy h2 { font-size: 2rem; margin: 10px 0 12px; letter-spacing: -.025em; }
.featured-copy p { color: var(--muted); margin: 0 0 25px; }
.button {
    background: var(--accent);
    color: white;
    text-decoration: none;
    padding: 11px 17px;
    border-radius: 9px;
    font-weight: 700;
}
.button:hover { background: var(--accent-dark); }

.collection-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.collection-heading h2 { margin: 4px 0 0; font-size: 1.9rem; letter-spacing: -.025em; }
.count { margin: 0; color: var(--muted); font-size: .9rem; }
.controls { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 28px; }
.search-box { flex: 1 1 310px; }
.search-box input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 9px;
    padding: 12px 14px;
    font: inherit;
    outline: none;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,95,143,.12); }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 8px 13px; font: inherit; cursor: pointer; }
.filter:hover, .filter.is-active { border-color: var(--accent); color: var(--accent); background: #f0f6fb; }

.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 5px 18px rgba(20,38,55,.045); transition: transform .18s ease, box-shadow .18s ease; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.app-card[hidden] { display: none; }
.card-image { display: block; aspect-ratio: 504 / 276; background: #edf1f4; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.app-card:hover .card-image img { transform: scale(1.025); }
.card-body { padding: 20px 21px 22px; }
.category { color: var(--accent); font-size: .66rem; }
.card-body h3 { margin: 6px 0 8px; font-size: 1.22rem; letter-spacing: -.015em; }
.card-body p { margin: 0 0 17px; color: var(--muted); font-size: .92rem; min-height: 4.4em; }
.card-link { color: var(--accent); text-decoration: none; font-weight: 750; font-size: .9rem; }
.card-link:hover { text-decoration: underline; }
.no-results { text-align: center; color: var(--muted); padding: 35px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 45px; color: var(--muted); font-size: .82rem; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
    .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .featured { grid-template-columns: 1fr; }
    .featured-image img { min-height: 0; }
}
@media (max-width: 620px) {
    .site-shell { padding: 0 17px; }
    .site-header { min-height: 0; padding: 34px 0 30px; align-items: flex-start; flex-direction: column; gap: 18px; }
    main { padding-top: 28px; }
    .featured-copy { padding: 28px; }
    .app-grid { grid-template-columns: 1fr; }
    .collection-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
    .controls { align-items: stretch; }
    .filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filter { white-space: nowrap; }
}
