.cat-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 20rem;
    margin: 0 0 1.5rem;
    padding: 2.6rem 2.4rem 2.4rem;
    overflow: hidden;
    background-color: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.cat-hero.has-image {
    background-image: var(--cat-hero-image);
    background-repeat: no-repeat;
    background-position: center right;
    background-size: cover;
}

.cat-hero-overlay {
    display: none;
}

.cat-hero.has-image .cat-hero-overlay {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(
            90deg,
            var(--surface) 0%,
            var(--surface) 26%,
            color-mix(in srgb, var(--surface) 92%, transparent) 38%,
            color-mix(in srgb, var(--surface) 42%, transparent) 54%,
            color-mix(in srgb, var(--surface) 8%, transparent) 72%,
            transparent 84%
        ),
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--surface) 18%, transparent) 0%,
            transparent 28%,
            transparent 72%,
            color-mix(in srgb, var(--surface) 22%, transparent) 100%
        );
}

.cat-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 34rem;
    padding: 1.65rem 2rem 1.75rem;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(6px);
}

.cat-hero-kicker {
    margin: 0 0 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5b5c3b;
}

.cat-hero-title {
    margin: 0;
    font-size: clamp(2.1rem, 4.2vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.94;
    text-transform: uppercase;
}

.cat-hero-copy--wide {
    max-width: none;
}

.cat-hero-title--nowrap {
    white-space: nowrap;
}

.cat-hero-title-accent {
    position: relative;
    display: inline-block;
    max-width: 100%;
    color: #5b5c3b;
}

.cat-hero-title-accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.06em;
    height: 0.18em;
    background: color-mix(in srgb, #5b5c3b 22%, transparent);
    z-index: -1;
}

.cat-hero-desc {
    margin: 1.05rem 0 0;
    max-width: 23rem;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.cat-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1.15rem 0 0;
    padding: 0;
    list-style: none;
}

.cat-hero-tags li {
    padding: 0.35rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5b5c3b;
    background: color-mix(in srgb, #5b5c3b 8%, var(--surface));
    border: 1px solid color-mix(in srgb, #5b5c3b 28%, var(--border));
}

[data-theme='dark'] .cat-hero-kicker,
[data-theme='dark'] .cat-hero-title-accent,
[data-theme='dark'] .cat-hero-tags li {
    color: var(--accent);
}

[data-theme='dark'] .cat-hero-title-accent::after {
    background: color-mix(in srgb, var(--accent) 24%, transparent);
}

[data-theme='dark'] .cat-hero-tags li {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

[data-theme='dark'] .cat-hero-copy {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
}

@media (max-width: 900px) {
    .cat-hero {
        min-height: 0;
        padding: 1.5rem 1.15rem 1.5rem;
        align-items: flex-end;
    }

    .cat-hero.has-image {
        background-position: center top;
    }

    .cat-hero.has-image .cat-hero-overlay {
        background: linear-gradient(
            180deg,
            color-mix(in srgb, var(--surface) 8%, transparent) 0%,
            color-mix(in srgb, var(--surface) 55%, transparent) 42%,
            var(--surface) 78%
        );
    }

    .cat-hero-copy {
        max-width: none;
        width: 100%;
        padding: 1.25rem 1.15rem 1.3rem;
    }

    .cat-hero-title {
        font-size: 2rem;
    }

    .cat-hero-title--nowrap {
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .cat-hero {
        padding: 1.15rem 1.1rem 1.1rem;
    }

    .cat-hero-desc {
        font-size: 0.95rem;
    }
}

.cat-index {
    padding-bottom: 4rem;
}

.cat-index-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.cat-index-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.cat-index-head {
    display: flex;
    align-items: flex-start;
    gap: 1.05rem;
    padding: 1.25rem 1.3rem 1.15rem;
    color: inherit;
}

.cat-index-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    color: #5b5c3b;
    border: 1.5px solid color-mix(in srgb, #5b5c3b 45%, var(--border));
    border-radius: 50%;
}

.cat-index-copy {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.cat-index-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.25;
    text-transform: uppercase;
}

.cat-index-desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.cat-index-count {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #5b5c3b;
}

.cat-index-head:hover .cat-index-name {
    color: var(--accent-hover);
}

.cat-index-subs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    padding: 0 1.25rem 1.2rem;
    list-style: none;
}

.cat-index-subs a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    min-height: 2.55rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text);
    background: var(--bg);
}

.cat-index-sub-name {
    min-width: 0;
    font-weight: 500;
}

.cat-index-sub-count {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.cat-index-subs a:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}

.cat-index-subs a:hover .cat-index-sub-name {
    color: var(--accent-hover);
}

[data-theme='dark'] .cat-index-icon,
[data-theme='dark'] .cat-index-count {
    color: var(--accent);
}

[data-theme='dark'] .cat-index-icon {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

@media (max-width: 800px) {
    .cat-index-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .cat-index-head,
    .cat-index-subs {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }
}
