.swa-hero-carousel {
    --hero-panel: var(--swa-home-surface);
    --hero-tile: var(--swa-home-raised);
    --hero-text: var(--swa-home-text);
    --hero-muted: var(--swa-home-muted);
    --hero-accent: #baa7f7;
    width: min(100%, 22.4rem);
    min-width: 0;
    align-self: center;
    container-type: inline-size;
    color: var(--hero-text);
}

.swa-hero-carousel [hidden] { display: none; }

.swa-hero-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-rows: minmax(0, 1fr);
    block-size: clamp(21.5rem, 123cqi, 28.8rem);
    overflow: auto hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.swa-hero-carousel:has([data-hero-controls]:not([hidden])) .swa-hero-track { scrollbar-width: none; }

.swa-hero-slide {
    min-width: 0;
    min-height: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.swa-hero-controls {
    display: flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: .75rem auto 0;
    border: 1px solid var(--swa-home-border);
    border-radius: .75rem;
    background: var(--hero-panel);
}

.swa-hero-arrow {
    display: grid;
    flex: none;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: .625rem;
}

.swa-hero-arrow[aria-disabled="true"] {
    color: var(--hero-muted);
    cursor: default;
    opacity: .5;
}

.swa-hero-arrow:not([aria-disabled="true"]):hover { background: var(--hero-tile); }

.swa-hero-selectors {
    display: flex;
    align-items: center;
    border-inline: 1px solid var(--swa-home-border);
}

.swa-hero-selectors button {
    position: relative;
    min-width: 44px;
}

.swa-hero-selectors button[aria-pressed="true"] { color: var(--hero-accent); }

.swa-hero-selectors button[aria-pressed="true"]::after {
    position: absolute;
    inset-inline: .625rem;
    inset-block-end: .3125rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
}

.swa-hero-showcase-options {
    display: flex;
    justify-content: center;
    gap: .125rem;
    padding: .1875rem;
    border-radius: .75rem;
    background: var(--swa-home-surface);
}

.swa-hero-selectors button,
.swa-hero-showcase-options button {
    min-height: 44px;
    padding-block: .375rem;
    padding-inline: clamp(.5rem, 2.4cqi, .875rem);
    border-radius: .625rem;
    color: var(--hero-muted);
    font-size: .8125rem;
    font-weight: 600;
}

.swa-hero-selectors button:hover,
.swa-hero-showcase-options button:hover { color: var(--hero-text); }

.swa-hero-showcase-options button[aria-pressed="true"] {
    background: var(--hero-tile);
    color: var(--hero-accent);
}

.swa-hero-carousel :where(a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--hero-accent);
    outline-offset: -2px;
}

.swa-hero-gallery {
    --hero-cover-gap: .75rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: var(--hero-cover-gap);
    height: 100%;
}

.swa-hero-gallery-pinned,
.swa-hero-gallery-reel {
    display: grid;
    grid-auto-rows: calc((100% - var(--hero-cover-gap)) / 2);
    gap: var(--hero-cover-gap);
    min-height: 0;
}

.swa-hero-gallery img {
    display: block;
    width: 100%;
    min-height: 0;
    height: 100%;
    border-radius: 1rem;
    object-fit: cover;
}

.swa-hero-gallery-reel {
    overflow-y: auto;
    scrollbar-width: thin;
}

.swa-hero-showcase {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: clamp(.875rem, 4cqi, 1.25rem);
    overflow-y: auto;
    border: 1px solid var(--swa-home-border);
    border-radius: 1rem;
    background: var(--hero-panel);
    scrollbar-width: thin;
}

.swa-hero-showcase-header,
.swa-hero-showcase-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .375rem .75rem;
}

.swa-hero-showcase-header > span,
.swa-hero-showcase-header code {
    color: var(--hero-muted);
    font-size: .8125rem;
    font-weight: 600;
}

.swa-hero-showcase-title,
.swa-hero-showcase-header h2 {
    font-size: clamp(1.05rem, 4.5cqi, 1.375rem);
    font-weight: 700;
    line-height: 1.2;
}

.swa-hero-showcase-description,
.swa-hero-showcase-info caption {
    color: var(--hero-muted);
    font-size: .8125rem;
    line-height: 1.45;
}

.swa-hero-showcase-description { margin-top: .25rem; }

.swa-hero-showcase-link,
.swa-hero-showcase-header a {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 32px;
    color: var(--hero-accent);
    font-size: .8125rem;
    font-weight: 600;
}

.swa-hero-showcase :is(.swa-hero-showcase-link, .swa-hero-showcase-header a):hover {
    text-decoration: underline;
    text-underline-offset: .2em;
}

.swa-hero-showcase-image {
    position: relative;
    flex: 1 1 0;
    min-height: 6rem;
    overflow: hidden;
    border-radius: .75rem;
    background: var(--swa-home-panel);
}

.swa-hero-showcase-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.swa-hero-showcase--cs2 .swa-hero-showcase-image img { object-fit: contain; }

.swa-hero-showcase--rust .swa-hero-showcase-image {
    min-height: 7rem;
    background: var(--swa-home-panel);
}

.swa-hero-showcase--rust td { font-variant-numeric: tabular-nums; }

.swa-hero-showcase-options button { flex: 1; }

.swa-hero-carousel:not(:has([data-hero-controls]:not([hidden]))) .swa-hero-showcase-options { display: none; }

@media (min-width: 1024px) {
    .swa-hero-carousel {
        flex: none;
        width: clamp(20rem, 28.8vw, 25.6rem);
    }
}
