.shop-app {
    padding-top: 20px;
}

.shop-app:has(.home-hero) {
    padding-top: 0;
}

/* Keep the footer below the viewport until Vue adds the catalogue. */
#root:has(#initial-home-hero) {
    min-height: 100vh;
}

.home-hero {
    --hero-ink: #101c4b;
    --hero-blue: #164bbc;
    margin-bottom: 1rem;
    color: var(--hero-ink);
}

.home-hero__slides {
    --hero-slide-direction: 1;
    display: grid;
    grid-template-rows: auto auto;
    overflow: clip;
}

.home-hero__slides.is-reversing {
    --hero-slide-direction: -1;
}

/* Stack the slides so their shared rows reserve space before rotation. */
.home-hero__slide {
    display: grid;
    grid-area: 1 / 1 / 3 / 2;
    grid-template-rows: subgrid;
    visibility: hidden;
    pointer-events: none;
}

.home-hero__slide.is-active {
    visibility: visible;
    pointer-events: auto;
}

.home-hero__slide.is-leaving {
    visibility: visible;
}

.home-hero__slides.is-transitioning .home-hero__slide.is-active {
    animation: hero-slide-in 500ms cubic-bezier(.22, .61, .36, 1) both;
}

.home-hero__slide.is-leaving {
    animation: hero-slide-out 500ms cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes hero-slide-in {
    from { transform: translateX(calc(100% * var(--hero-slide-direction))); }
    to { transform: translateX(0); }
}

@keyframes hero-slide-out {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-100% * var(--hero-slide-direction))); }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero__slides.is-transitioning .home-hero__slide {
        animation: none;
    }
}

.home-hero__scene {
    position: relative;
    min-height: 430px;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    background: linear-gradient(to bottom, transparent 55%, #fff),
        linear-gradient(100deg, #bcdffc, #aedcfd 50%, #abd9fb);
}

.home-hero__copy {
    position: relative;
    z-index: 1;
    padding: 1rem 1.25rem 8rem;
    text-align: center;
}

.home-hero__slide--character .home-hero__scene {
    background: linear-gradient(to bottom, #eee9fd, #fff);
}

.home-hero__slide--space .home-hero__scene {
    background: linear-gradient(to bottom, #badbfc, #fff);
}

.home-hero h1 {
    margin: 0 0 .35rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.home-hero__copy p {
    margin: 0 0 .65rem;
    font-size: clamp(1rem, 1.7vw, 1.15rem);
    line-height: 1.5;
    text-wrap: balance;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
}

.home-hero__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 44px;
    padding: .5rem 1rem;
    border: 1px solid var(--hero-ink);
    border-radius: 5px;
    color: #fff;
    background: var(--hero-ink);
    font: inherit;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
}

.home-hero__action:hover {
    color: #fff;
    background: #243c75;
    text-decoration: none;
}

.home-hero__action--secondary {
    color: var(--hero-ink);
    background: rgba(255, 255, 255, .92);
}

.home-hero__action--secondary:hover {
    color: var(--hero-ink);
    background: #edf5fc;
}

.home-hero__art {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    margin-inline: auto;
    display: block;
    width: 100%;
    max-width: 1140px;
    height: auto;
    /* Prepare the masked artwork's layer before its first paint. */
    will-change: transform;
    mask-image: linear-gradient(to bottom, transparent, #000 24px),
        linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
    mask-composite: intersect;
}

/* The character scene has taller foreground subjects than the landscapes. */
.home-hero__slide--character .home-hero__art {
    max-width: 860px;
}

.home-hero__categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    padding: 0;
    margin-top: .75rem;
}

.home-hero__category {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    padding: .5rem;
    border: 1px solid #dfe5ee;
    border-radius: 6px;
    background: #fff;
}

.home-hero__category > img {
    width: 42%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    flex-shrink: 0;
}

.home-hero__category-copy {
    min-width: 0;
}

.home-hero__category h2 {
    margin: 0 0 .35rem;
    font-family: inherit;
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.4;
}

.home-hero__category ul {
    display: flex;
    flex-wrap: wrap;
    column-gap: .7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-hero__category a {
    display: inline-block;
    padding: .35rem 0;
    color: var(--hero-ink);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    text-underline-offset: 4px;
}

.home-hero__category a:hover,
.home-hero__category a:focus-visible {
    color: var(--hero-blue);
    text-decoration: underline;
}

.home-hero a:focus-visible,
.home-hero button:focus-visible {
    outline: 3px solid var(--hero-blue);
    outline-offset: 4px;
}

.home-hero__controls,
.home-hero__pages {
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-hero__controls {
    grid-area: 1 / 1 / 2 / 2;
    align-self: end;
    justify-self: center;
    z-index: 2;
    max-width: calc(100% - 1rem);
    margin-bottom: .35rem;
    pointer-events: none;
}

.home-hero__controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: .5rem;
    border: 0;
    border-radius: 50%;
    color: var(--hero-ink);
    background: transparent;
    cursor: pointer;
}

.home-hero__pages button {
    min-width: 32px;
    padding: .5rem .35rem;
    pointer-events: auto;
}

.home-hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(16, 28, 75, .3);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .65);
}

.home-hero__pages [aria-current="true"] .home-hero__dot {
    background: rgba(16, 28, 75, .7);
}

.home-hero__pages button:hover .home-hero__dot,
.home-hero__pages button:focus-visible .home-hero__dot {
    background: var(--hero-ink);
}

.home-hero__arrow {
    opacity: 0;
    pointer-events: none;
    font-size: 1.25rem;
}

@media (hover: hover) and (pointer: fine) {
    .home-hero__slides:has(.home-hero__scene:hover) .home-hero__arrow,
    .home-hero__controls:hover .home-hero__arrow {
        opacity: .7;
        pointer-events: auto;
    }
}

/* Keep the hover-only controls available to keyboard users. */
.home-hero__arrow:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 991px) {
    .home-hero__scene {
        min-height: 350px;
    }

    .home-hero__slide--character .home-hero__art {
        width: 72%;
    }

    .home-hero__category {
        flex-direction: column;
        text-align: center;
    }

    .home-hero__category > img {
        width: 100%;
        max-width: 110px;
    }

    .home-hero__category ul {
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .home-hero__scene {
        min-height: 300px;
    }

    .home-hero__copy {
        padding: .75rem 1rem 8rem;
    }

    .home-hero__copy p {
        font-size: .9375rem;
    }

    .home-hero__slide--character .home-hero__art {
        width: 100%;
    }

    .home-hero__art {
        mask-image: linear-gradient(to bottom, transparent, #000 16px);
    }

    .home-hero__actions {
        gap: .5rem;
    }

    .home-hero__action {
        gap: .5rem;
        padding: .5rem .8rem;
    }

    .home-hero__categories {
        grid-template-columns: 1fr;
        gap: .5rem;
        padding: 0 15px;
    }

    .home-hero__category {
        flex-direction: row;
        gap: 1rem;
        text-align: left;
    }

    .home-hero__category > img {
        width: 32%;
        max-width: 95px;
    }

    .home-hero__category ul {
        justify-content: flex-start;
    }

    .home-hero__category a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}
