.gallery-toolbar {
    position: sticky;
    z-index: 20;
    top: var(--header-height);
    width: min(100%, var(--content-width));
    min-height: 76px;
    margin-inline: auto;
    padding-inline: var(--page-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(14px);
}
.gallery-views { display: flex; align-items: stretch; align-self: stretch; }
.gallery-views a { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 clamp(12px, 1.7vw, 26px); color: var(--muted); border-right: 1px solid var(--line); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.gallery-views a:first-child { border-left: 1px solid var(--line); }
.gallery-views a:hover, .gallery-views a[aria-current="page"] { color: var(--text-strong); background: var(--surface); }
.gallery-views a[aria-current="page"] { box-shadow: inset 0 -3px var(--accent); }
.gallery-views a b { min-width: 22px; height: 22px; padding-inline: 5px; display: grid; place-items: center; background: var(--surface-strong); color: var(--accent); font-size: .62rem; letter-spacing: 0; }

.gallery-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.gallery-filters label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .62rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.gallery-filters select { min-width: 150px; height: 42px; padding: 0 36px 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.gallery-filter--series select { min-width: 190px; }

.category-grid, .project-section {
    width: min(100%, var(--content-width));
    margin-inline: auto;
    padding: clamp(54px, 7vw, 110px) var(--page-gutter) clamp(90px, 11vw, 170px);
}
.category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-left: 1px solid var(--line); }
.category-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 116px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.category-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; display: grid; place-items: center; background: var(--bg-alt); }
.category-card img { width: 100%; height: 100%; object-fit: contain; filter: saturate(.8) brightness(.82); transition: transform .7s var(--ease-out), filter .4s ease; }
.category-card:hover img { transform: scale(1.05); filter: saturate(1) brightness(.85); }
.category-card__index { position: absolute; top: 16px; left: 16px; padding: 3px 5px; background: color-mix(in srgb, var(--bg) 84%, transparent); color: var(--accent); font-size: .64rem; font-weight: 900; }
.category-card__body { min-width: 0; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px; border-top: 1px solid var(--line); }
.category-card__title { min-width: 0; display: grid; }
.category-card__title strong { display: -webkit-box; overflow: hidden; color: var(--text-strong); font-family: var(--font-display); font-size: clamp(1.2rem, 1.45vw, 1.55rem); line-height: 1.05; letter-spacing: -.025em; text-transform: uppercase; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.category-card__title small { margin-top: 8px; color: var(--muted); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; }
.category-card__arrow { color: var(--text-strong); font-size: 1.2rem; transition: transform .3s var(--ease-out), color .2s ease; }
.category-card:hover .category-card__arrow { color: var(--accent); transform: translate(4px, -4px); }

.project-section__head { min-height: 160px; display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 34px; }
.project-section__head h2 { margin-top: 14px; font-size: clamp(2.3rem, 3vw, 3.4rem); line-height: 1; }
.project-section__head > a { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.project-section__head > a:hover { color: var(--accent); }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.project-card-shell { position: relative; min-width: 0; display: grid; }
.project-card-shell .project-card { height: 100%; }
.project-like-form { position: absolute; z-index: 3; top: 12px; right: 12px; }
.project-card { min-width: 0; padding: 0; display: grid; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.project-card__image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); }
.project-card__image::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 0 var(--accent); transition: box-shadow .25s ease; }
.project-card__image img { width: 100%; height: 100%; object-fit: contain; transition: transform .65s var(--ease-out), filter .35s ease; }
.project-card:hover .project-card__image::after { box-shadow: inset 0 0 0 4px var(--accent); }
.project-card:hover .project-card__image img { transform: scale(1.045); }
.project-card__meta { height: 108px; min-width: 0; padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: end; overflow: hidden; }
.project-card__meta small { grid-column: 1 / -1; color: var(--muted); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.project-card__meta strong { margin-top: 7px; display: -webkit-box; overflow: hidden; font-family: var(--font-display); font-size: clamp(1.05rem, 1.15vw, 1.3rem); line-height: 1.08; text-transform: uppercase; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-card__meta i { align-self: end; color: var(--accent); font-style: normal; font-size: .58rem; font-weight: 850; letter-spacing: .1em; }

.pagination { display: flex; justify-content: center; margin-top: 50px; }
.pagination a, .pagination span { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-right: 0; color: var(--muted); font-size: .72rem; font-weight: 800; }
.pagination > :last-child { border-right: 1px solid var(--line); }
.pagination a:hover, .pagination a[aria-current="page"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.pagination[hidden], .project-grid[hidden], .empty-state[hidden] { display: none; }
.project-section > .empty-state a { width: fit-content; margin-top: 24px; display: inline-flex; border-bottom: 1px solid var(--line-strong); color: var(--text-strong); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.project-section > .empty-state a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 1100px) {
    .category-grid, .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-toolbar { align-items: stretch; flex-direction: column; padding-block: 12px; }
    .gallery-views { min-height: 48px; }
    .gallery-filters { padding-bottom: 4px; }
}
@media (max-width: 700px) {
    .gallery-toolbar { position: relative; top: auto; }
    .gallery-views { width: 100%; }
    .gallery-views a { flex: 1; gap: 5px; padding-inline: 4px; font-size: .62rem; letter-spacing: .06em; white-space: nowrap; }
    .gallery-views a b { min-width: 19px; height: 19px; font-size: .55rem; }
    .gallery-filters { display: grid; grid-template-columns: 1fr 1fr; }
    .gallery-filter--series { grid-column: 1 / -1; }
    .gallery-filters label { display: grid; }
    .gallery-filters select { min-width: 0; width: 100%; }
    .category-grid, .project-section { padding-top: 38px; padding-bottom: 80px; }
    .category-grid, .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-card { grid-template-rows: auto 92px; }
    .category-card__media { aspect-ratio: 16 / 10; }
    .category-card__index { top: 10px; left: 10px; font-size: .55rem; }
    .category-card__body { padding: 12px; gap: 8px; }
    .category-card__title strong { font-size: clamp(.98rem, 4.8vw, 1.2rem); line-height: 1; }
    .category-card__title small { margin-top: 6px; font-size: .5rem; letter-spacing: .08em; }
    .category-card__arrow { font-size: 1rem; }
    .project-card__meta { height: 104px; padding: 14px; }
    .project-card__meta i { display: none; }
    .project-card__meta strong { font-size: clamp(1rem, 5vw, 1.25rem); }
    .project-section__head { min-height: 118px; align-items: flex-start; flex-direction: column; padding-bottom: 24px; }
    .project-section__head h2 { font-size: clamp(2rem, 8vw, 2.5rem); }
}
@media (max-width: 460px) {
    .project-card__image { aspect-ratio: 16 / 10; }
    .project-card__meta { height: 96px; padding: 11px; }
    .project-card__meta small { font-size: .5rem; letter-spacing: .08em; }
}
