.editorial-home {
    --home-bg: #0c0c0c;
    --home-surface: #161616;
    --home-ink: #f0f0f0;
    --home-accent: #ff5252;
    --home-card-width: min(34rem, 82vw);
    --home-shell-inset: max(2rem, calc((100vw - 72ch) / 2 + 2rem));
    color: var(--home-ink);
    background: var(--home-bg);
    overflow-x: clip;
    font-family: Outfit, system-ui, sans-serif;
}

.home-featured {
    padding-block: 2.5rem 3.5rem;
}

.home-featured__article {
    min-width: 0;
}

.home-featured__media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 20px;
    background: var(--home-surface);
    position: relative;
}

.home-featured__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 67%, rgba(12, 12, 12, 0.22));
    pointer-events: none;
}

.home-featured__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-featured__body {
    padding-top: 1.4rem;
}

.home-featured__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    color: rgba(240, 240, 240, 0.63);
    font-size: 0.82rem;
}

.home-featured__badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--home-accent);
    border-radius: 999px;
    color: var(--home-accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.045em;
}

.home-featured__title {
    margin: 0;
    font-family: Outfit, system-ui, sans-serif;
    font-size: clamp(2.05rem, 4.5vw, 3.15rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.09;
    text-wrap: balance;
}

.home-featured__title a {
    color: inherit;
    text-decoration: none;
}

.home-featured__title a:hover,
.home-featured__title a:focus-visible,
.home-featured__read:hover,
.home-featured__read:focus-visible {
    color: var(--home-accent);
}

.home-featured__excerpt {
    max-width: 67ch;
    margin: 1.1rem 0 0;
    color: rgba(240, 240, 240, 0.76);
    font-size: 1rem;
    line-height: 1.55;
}

.home-featured__read {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.35rem;
    color: var(--home-ink);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.home-category {
    padding-block: 2rem 2.75rem;
    border-top: 1px solid rgba(240, 240, 240, 0.1);
}

.home-category__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.home-category__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem 1rem;
}

.home-category__title {
    margin: 0;
    color: var(--home-ink);
    font-family: Outfit, system-ui, sans-serif;
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.14;
}

.home-category__all {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    color: rgba(240, 240, 240, 0.66);
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
}

.home-category__all:hover,
.home-category__all:focus-visible {
    color: var(--home-accent);
}

.home-category__controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.home-category__arrow {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.45rem;
    height: 2.45rem;
    min-width: 0;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 0;
    appearance: none;
    border: 1px solid rgba(240, 240, 240, 0.25);
    border-radius: 999px;
    background: var(--home-surface);
    color: var(--home-ink);
    cursor: pointer;
}

.home-category__arrow-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    flex: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1;
    transform: rotate(45deg);
    transform-origin: 50% 50%;
    pointer-events: none;
}

.home-category__arrow-glyph--left {
    transform: rotate(-135deg);
}

.home-category__arrow:hover:not(:disabled),
.home-category__arrow:focus-visible:not(:disabled) {
    border-color: var(--home-accent);
    color: var(--home-accent);
}

.home-category__arrow:disabled {
    opacity: 0.28;
    cursor: default;
}

.home-category__viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: var(--home-shell-inset);
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 var(--home-shell-inset),
        #000 calc(100% - clamp(3rem, 12vw, 9rem)),
        transparent 100%
    );
    mask-image: linear-gradient(
        90deg,
        transparent 0,
        #000 var(--home-shell-inset),
        #000 calc(100% - clamp(3rem, 12vw, 9rem)),
        transparent 100%
    );
}

.home-category__viewport::-webkit-scrollbar {
    display: none;
}

.home-category__viewport:focus-visible {
    outline: 2px solid var(--home-accent);
    outline-offset: -2px;
}

.home-category__track {
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
    position: relative;
    width: max-content;
    min-width: 100%;
    box-sizing: border-box;
    padding-inline: var(--home-shell-inset) max(1.15rem, calc(100vw - var(--home-shell-inset) - var(--home-card-width)));
    padding-bottom: 0.4rem;
}

.home-category__item {
    flex: 0 0 var(--home-card-width);
    width: var(--home-card-width);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    opacity: var(--home-slide-opacity, 0.08);
    transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-category__item:first-child {
    --home-slide-opacity: 1;
}

.home-category__item:nth-child(2) {
    --home-slide-opacity: 0.4;
}

.home-category__item:nth-child(3) {
    --home-slide-opacity: 0.16;
}

.home-category__item .post-card {
    animation: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 0;
    box-sizing: border-box;
    border: 1px solid rgba(240, 240, 240, 0.11);
    border-radius: 20px;
    background: var(--home-surface);
    overflow: hidden;
}

.home-category__item .post-card[data-reading-status="read"] {
    opacity: 1;
}

.home-category__item .post-card[data-reading-status="read"] .post-card__image {
    filter: none;
}

.home-category__item .post-card__main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    order: 1;
}

.home-category__item .post-card__media {
    display: block;
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: 1.25rem;
    overflow: hidden;
    background: var(--home-bg);
}

.home-category__item .post-card__image {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
    --home-image-shift-x: 0px;
    --home-image-shift-y: 0px;
}

.home-category__item .post-card__meta,
.home-category__item .post-card__title,
.home-category__item .post-card__excerpt,
.home-category__item .post-card__footer {
    margin-inline: 1.35rem;
}

.home-category__item .post-card__title {
    font-family: Outfit, system-ui, sans-serif;
    font-size: clamp(1.25rem, 2.3vw, 1.6rem);
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.home-category__item .post-card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.8rem;
    color: rgba(240, 240, 240, 0.7);
    font-size: 0.9rem;
    line-height: 1.5;
}

.home-category__item .post-card__footer {
    margin-top: auto;
    padding-block: 1.3rem 1rem;
}

.home-category__item .post-card__main .post-tag-links--card {
    margin: 0.85rem 1.35rem 0;
    padding: 0;
}

.home-category__item .reactions {
    position: relative;
    flex: 0 0 auto;
    order: 2;
    flex-flow: row wrap;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 0.4rem;
    margin: 0;
    padding: 0.85rem 1.35rem 1.1rem;
    border: 0;
}

.home-category__item .reactions::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 1px;
    background: rgba(240, 240, 240, 0.11);
    pointer-events: none;
}

.home-category__item .reaction {
    min-width: 0;
}

@media (min-width: 48rem) {
    .home-featured {
        padding-block: 3.75rem 5rem;
    }

    .home-category {
        padding-block: 2.6rem 3.7rem;
    }
}

@media (min-width: 40rem) and (max-width: 47.99rem) {
    .editorial-home {
        --home-shell-inset: 1.5rem;
    }
}

@media (max-width: 39.99rem) {
    .editorial-home {
        --home-card-width: 84vw;
        --home-shell-inset: max(1.15rem, env(safe-area-inset-left));
    }

    .home-featured {
        padding-block: 1.7rem 2.7rem;
    }

    .home-featured__media,
    .home-category__item .post-card {
        border-radius: 12px;
    }

    .home-category__header {
        align-items: center;
    }

    .home-category__arrow {
        width: 2.25rem;
        height: 2.25rem;
    }

    .home-category__item .post-card__meta,
    .home-category__item .post-card__title,
    .home-category__item .post-card__excerpt,
    .home-category__item .post-card__footer {
        margin-inline: 1rem;
    }

    .home-category__item .reactions {
        padding-inline: 1rem;
    }

    .home-category__item .post-card__main .post-tag-links--card {
        margin-inline: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-category__item {
        transition: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .home-featured__image {
        transition: transform 0.25s ease;
    }

    .home-featured__media:hover .home-featured__image {
        transform: scale(1.025);
    }

    .home-category__item .post-card__image {
        transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .home-category__item .post-card__media:is(:hover, :focus-visible) .post-card__image {
        transform: translate3d(
            var(--home-image-shift-x),
            var(--home-image-shift-y),
            0
        ) scale(1.045);
    }
}


/* Final card in every category leads to the full archive. */
.home-category__item--explore {
    display: flex;
    align-items: stretch;
}

.home-category__explore {

    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    min-height: 100%;
    box-sizing: border-box;
    padding: clamp(1.4rem, 3vw, 2.15rem);
    overflow: hidden;
    border: 1px solid rgba(240, 240, 240, 0.17);
    border-radius: 20px;
    color: var(--home-ink);
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 82, 82, 0.11), transparent 54%),
        linear-gradient(145deg, var(--home-surface), var(--home-bg));
    text-decoration: none;
    isolation: isolate;
}

.home-category__explore::before {
    content: "↗";
    position: absolute;
    top: 12%;
    right: -0.13em;
    z-index: 0;
    color: rgba(240, 240, 240, 0.035);
    font-family: Outfit, system-ui, sans-serif;
    font-size: clamp(12rem, 26vw, 22rem);
    font-weight: 400;
    line-height: 1;
    transform: rotate(-6deg);
    pointer-events: none;
}

.home-category__explore::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 100% 0%, rgba(255, 82, 82, 0.13), transparent 58%);
    opacity: 0;
    pointer-events: none;
}

.home-category__explore-top {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.95rem;
}

.home-category__explore-kicker {
    display: inline-block;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(255, 82, 82, 0.35);
    border-radius: 999px;
    color: var(--home-accent);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.home-category__explore-heading {
    max-width: 14ch;
    font-family: Outfit, system-ui, sans-serif;
    font-size: clamp(1.7rem, 3.25vw, 2.65rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.045em;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.home-category__explore-description {
    max-width: 32ch;
    color: rgba(240, 240, 240, 0.62);
    font-size: 0.9rem;
    line-height: 1.55;
}

.home-category__explore-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(240, 240, 240, 0.13);
}

.home-category__explore-label {
    max-width: 21ch;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.home-category__explore-arrow {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 3.1rem;
    height: 3.1rem;
    border: 1px solid rgba(240, 240, 240, 0.23);
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1;
}

.home-category__explore:hover,
.home-category__explore:focus-visible {
    border-color: rgba(255, 82, 82, 0.58);
}

.home-category__explore:hover::after,
.home-category__explore:focus-visible::after {
    opacity: 1;
}

.home-category__explore:hover .home-category__explore-arrow,
.home-category__explore:focus-visible .home-category__explore-arrow {
    border-color: var(--home-accent);
    background: var(--home-accent);
    color: var(--home-bg);
    transform: translate(2px, -2px);
}

.home-category__explore:focus-visible {
    outline: 2px solid var(--home-accent);
    outline-offset: -4px;
}

@media (max-width: 39.99rem) {
    .home-category__explore {
        border-radius: 12px;
        padding: 1.35rem;
    }

    .home-category__explore-heading {
        font-size: clamp(1.65rem, 7vw, 2.2rem);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .home-category__explore {
        transition: border-color 0.4s ease;
    }

    .home-category__explore::after {
        transition: opacity 0.46s ease;
    }

    .home-category__explore-arrow {
        transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
    }
}
