.catalog-intro.category-hero {
    container-type: inline-size;
    display: block;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 0;
    --hero-gutter: max(4cqi, 18px);
    --hero-heading: clamp(43px, 4.55cqi, 78px);
    --hero-fade-start: calc(var(--hero-gutter) + 5.8 * var(--hero-heading));
}

.category-hero .category-hero-content {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    min-block-size: clamp(308px, 22cqi, 382px);
    padding: clamp(32px, 3.1cqi, 52px) var(--hero-gutter);
}

.category-hero h1 {
    max-inline-size: 72%;
    font-size: var(--hero-heading);
    line-height: 1.08;
    letter-spacing: -.035em;
    margin-block: 10px clamp(18px, 1.6cqi, 29px);
}
.category-hero p {
    max-inline-size: min(68ch, 76%);
    font-size: clamp(15px, 1.18cqi, 20px);
    line-height: 1.55;
}

.category-hero-shelf {
    position: absolute;
    inset: 0;
    container-type: size;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, 1fr);
    overflow: hidden;
    pointer-events: none;
    mask-image: linear-gradient(71deg, transparent var(--hero-fade-start),
        rgb(0 0 0 / 12%) calc(var(--hero-fade-start) + 5cqi),
        rgb(0 0 0 / 48%) 70%, rgb(0 0 0 / 88%) 89%, #000);
}

.category-hero-row { display: flex; justify-content: flex-end; min-block-size: 0; }
.category-hero-row + .category-hero-row { transform: translateX(25cqh); }
.category-hero-cubby {
    --cubby-back: #e6edf1;
    --cubby-floor: #9bafbf;
    position: relative;
    box-sizing: border-box;
    flex: 0 0 50cqh;
    overflow: hidden;
    border: clamp(4px, 1.5cqh, 7px) solid #9db4c7;
    border-block-start-color: #adc1cf;
    border-block-end-color: #849eb3;
    background: radial-gradient(ellipse at 50% 0, #fff6db 1%, transparent 57%),
        linear-gradient(var(--cubby-back) 70%, var(--cubby-floor));
    box-shadow: inset 0 0 15px #2b435a64, inset 0 -8px 12px #3f506246;
}
.category-hero-cubby:nth-child(4n + 2) { --cubby-back: #ece1cc; --cubby-floor: #c8ad88; }
.category-hero-cubby:nth-child(4n + 3) { --cubby-back: #e2e7d8; --cubby-floor: #a5b297; }
.category-hero-cubby:nth-child(4n + 4) { --cubby-back: #cfdee9; --cubby-floor: #8ea6bc; }
.category-hero-cubby::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 2% 9% auto;
    block-size: max(1px, 1.1%);
    border-radius: 50%;
    background: #fff6dd;
    box-shadow: 0 1px 5px 1px #fff1c7;
}
.category-hero-cubby::after {
    content: "";
    position: absolute;
    inset: auto 18% 8% 18%;
    block-size: 12%;
    background: radial-gradient(ellipse, #2437485c, transparent 67%);
}
.category-hero-cubby img {
    position: absolute;
    z-index: 1;
    max-inline-size: none;
    block-size: auto;
}
.category-hero-photo img {
    inset: 15% 10% 10%;
    inline-size: 80%;
    block-size: 75%;
    object-fit: contain;
    mix-blend-mode: multiply;
    border-radius: 4%;
}

.category-hero-face {
    --source-ratio: 1;
    --crop-width: calc(var(--right) - var(--left));
    --crop-height: calc(var(--bottom) - var(--top));
    --face-ratio: calc(var(--source-ratio) * var(--crop-width) / var(--crop-height));
    position: absolute;
    z-index: 1;
    inset-inline-start: 50%;
    inset-block-end: 9%;
    inline-size: min(88%, calc(37cqh * var(--face-ratio)));
    aspect-ratio: var(--face-ratio);
    overflow: hidden;
    transform: translateX(-50%);
    mix-blend-mode: multiply;
}
.category-hero-face img {
    inline-size: calc(10000% / var(--crop-width));
    inset-inline-start: calc(-100% * var(--left) / var(--crop-width));
    inset-block-start: calc(-100% * var(--top) / var(--crop-height));
}

/* Bounds are percentages of the reviewed gallery image. */
.face-zodiac { --top: 34.5; --bottom: 67.4; }
.face-zodiac.face-front { --left: 12.2; --right: 46.7; }
.face-zodiac.face-back { --left: 53; --right: 88; }
.face-astro { --top: 50.4; --bottom: 84; }
.face-astro.face-front { --left: 12.2; --right: 47.6; }
.face-astro.face-back { --left: 52.6; --right: 88.3; }
.face-city { --top: 50.4; --bottom: 84; }
.face-city.face-front { --left: 12.3; --right: 49; }
.face-city.face-back { --left: 52.7; --right: 88; }
.face-stars { --source-ratio: 1.452; --top: 34; --bottom: 86.5; }
.face-stars.face-front { --left: 4.5; --right: 46; }
.face-stars.face-back { --left: 51; --right: 93; }

.face-graph { --top: 43; --bottom: 77; mix-blend-mode: normal; }
.face-graph.face-front { --left: 6; --right: 44.6; }
.face-graph.face-back { --left: 51.6; --right: 90.4; }
.face-graph.face-front img {
    clip-path: polygon(17.6% 48.8%, 17.6% 45.8%, 18.2% 45.2%, 25.5% 44.7%, 35% 44.7%, 42% 45.1%, 42.5% 45.6%, 42.3% 53%, 41.8% 65%, 41.3% 74.7%, 40% 75.2%, 30% 75.6%, 20% 75.4%, 18.8% 75%, 18.3% 69.4%, 15.6% 70.1%, 13.1% 70.1%, 11.2% 69%, 9.7% 66.6%, 8.6% 63.4%, 8.2% 58.3%, 8.6% 54.7%, 9.7% 51.6%, 11.7% 49.6%, 14.1% 48.8%, 17.6% 48.8%, 17.6% 50.8%, 14.2% 50.8%, 12.5% 51.6%, 11.1% 53.4%, 10.4% 56.6%, 10.4% 60.3%, 11% 64.1%, 12.1% 66.9%, 13.7% 68.3%, 15.6% 68.3%, 18% 67.1%, 17.9% 55%);
}
.face-graph.face-back img {
    clip-path: polygon(53.9% 45.7%, 54.7% 45.1%, 62% 44.7%, 71.3% 44.7%, 78% 45.1%, 78.7% 45.8%, 78.7% 49%, 81.6% 48.6%, 83.8% 49%, 85.7% 50.1%, 87.2% 52%, 88.3% 55.5%, 88.7% 60.2%, 88.2% 64.1%, 87.2% 67%, 85.6% 69.4%, 83.2% 70.3%, 80.5% 70.1%, 78.1% 69.3%, 78.3% 67.3%, 80.5% 68.4%, 82.8% 68.6%, 84.2% 67.9%, 85.5% 65.7%, 86.3% 63%, 86.6% 59.4%, 86.1% 55.3%, 85.1% 52.6%, 83.7% 51.1%, 82% 50.7%, 80.2% 50.9%, 78.6% 52.1%, 78.3% 65%, 77.6% 75.1%, 73.1% 75.5%, 64% 75.6%, 56% 75.2%, 55% 74.7%, 54.6% 64%);
}

/* These four crops show a single, unflipped face from each real gallery image. */
.category-hero-corgi-front img,
.category-hero-corgi-back img { inline-size: 209%; inset-block-start: -91%; }
.category-hero-corgi-front img {
    inset-inline-start: 0;
    clip-path: polygon(16% 53.8%, 16.7% 51.5%, 23% 50.6%, 35% 50.7%, 41.4% 51.4%, 43% 52.5%, 42.2% 73%, 41.8% 85.5%, 39% 86.3%, 24% 86.5%, 16.3% 85.7%, 16.1% 79.5%, 11% 80.1%, 8% 79.2%, 5.8% 76.2%, 4.3% 71%, 4% 64%, 5% 60%, 7.5% 57%, 10.4% 55.7%, 16% 55.2%, 16% 57.6%, 12% 57.6%, 9.4% 59%, 7.6% 61.8%, 6.9% 65.5%, 7% 70.9%, 8.3% 75%, 10.5% 77.5%, 13% 78%, 15.8% 77%, 15.8% 61%);
}
.category-hero-corgi-back img {
    inset-inline-start: -109%;
    clip-path: polygon(57% 52.7%, 59% 51.2%, 69% 50.5%, 80% 50.7%, 84% 51.5%, 85% 53%, 84.9% 55.2%, 90% 55.6%, 93% 57.8%, 94.9% 61.5%, 95.8% 67%, 95.2% 72.8%, 93.1% 77.3%, 90% 79.6%, 87% 80.2%, 83.6% 79.7%, 84% 77.1%, 87% 78%, 89.5% 77.4%, 91.4% 75.3%, 92.7% 71%, 92.9% 66.3%, 92.2% 62.4%, 90.6% 59.7%, 88.5% 58.2%, 84.7% 57.7%, 83.6% 85.3%, 82% 86.1%, 72% 86.4%, 60% 86.1%, 57.7% 85%);
}
.category-hero-husky-front img,
.category-hero-husky-back img { inline-size: 231%; inset-block-start: -107%; }
.category-hero-husky-front img {
    inset-inline-start: -124%;
    clip-path: polygon(56.5% 54%, 58% 53.3%, 64% 52.7%, 76% 52.6%, 81% 53.6%, 81.3% 56.8%, 85.7% 56.6%, 89.3% 57.8%, 91% 60.7%, 92% 65%, 91.5% 69.8%, 90.2% 74.5%, 87.8% 77.8%, 84% 79.6%, 81% 79.4%, 80.8% 77%, 83.9% 77.2%, 86.3% 76%, 88.3% 73.3%, 89.5% 69%, 89.8% 65.2%, 88.9% 61.8%, 87.2% 59.8%, 84.4% 59.1%, 81.2% 59.4%, 80.9% 70%, 80.5% 83.8%, 78.9% 84.7%, 65% 84.8%, 57.5% 84.4%, 57.1% 82.6%);
}
.category-hero-husky-back img {
    inset-inline-start: -11%;
    clip-path: polygon(19.4% 54%, 20.6% 53.2%, 31% 52.6%, 42% 52.9%, 44% 53.8%, 43.3% 70%, 43% 83.6%, 41% 84.5%, 32% 84.8%, 20% 84.4%, 19.6% 82.9%, 19.6% 79.1%, 16% 79.2%, 13% 78%, 10.9% 75.4%, 9.6% 71.6%, 9% 67%, 9.4% 63.5%, 10.6% 60.3%, 13% 57.7%, 16% 56.8%, 19.3% 56.9%, 19.3% 59.3%, 16.4% 59.1%, 14% 60%, 12.5% 62%, 11.5% 64.8%, 11.4% 67.8%, 12% 72.1%, 13.1% 74.8%, 14.9% 76.6%, 17% 77.2%, 19.4% 76.8%);
}

@container (max-width: 760px) {
    .category-hero .category-hero-content { min-block-size: 0; padding: 23px var(--hero-gutter) 174px; }
    .category-hero h1 { max-inline-size: 100%; font-size: clamp(32px, 7.15cqi, 49px); }
    .category-hero p { max-inline-size: min(100%, 42ch); }
    .category-hero-shelf {
        inset-block-start: auto;
        block-size: 158px;
        mask-image: linear-gradient(153deg, transparent 9%, rgb(0 0 0 / 50%) 44%, #000 90%);
    }
}
