@font-face {
    font-family: "Caveat";
    src: url("fonts/caveat-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

.collection-page {
    --album-ink: #3d3024;
    --album-brass: #e4c181;
    --album-script: "Baskervville", "Iowan Old Style", Georgia, serif;
    max-width: 1160px;
    margin: clamp(2rem, 5vw, 4rem) auto;
    color: #f3eadd;
}
.collection-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.collection-page .collection-hero h1 {
    margin: 0;
    color: #fff1dc;
    font: 600 clamp(2.25rem, 5vw, 4.1rem)/1.07 var(--album-script);
    letter-spacing: -.045em;
    text-transform: none;
}
.collection-hero p { margin: .55rem 0 0; color: #c0b8ae; }
.collection-link, .collection-pagination a, .collection-pagination span[aria-disabled] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .58rem;
    min-height: 42px;
    padding: .5rem .95rem;
    border: 1px solid #79664a;
    border-radius: 5px;
    background: #27241f;
    color: #f1dcae;
    line-height: 1.35;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}
.collection-link:hover, .collection-pagination a:hover { border-color: #d4ad6f; background: #383025; color: #fff0d5; }
.collection-page :is(a, summary, button, select, input):focus-visible { outline: 3px solid #8dbceb; outline-offset: 3px; }
.collection-guest { display: flex; align-items: baseline; gap: .5rem; margin: .7rem 0 0; color: #d6c9b7; font-size: .82rem; }
.collection-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: space-between;
    gap: .7rem 1.25rem;
    margin: 1.2rem 0;
}
.collection-tabs { display: inline-flex; gap: .25rem; max-width: 100%; flex-wrap: wrap; }
.collection-tabs a, .collection-filters summary {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 40px;
    padding: .42rem .82rem;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #c8beb0;
    font-weight: 650;
    font-size: .87rem;
    text-decoration: none;
}
.collection-tabs a[aria-current], .collection-tabs a:hover, .collection-filters summary:hover {
    border-color: #655744;
    color: #ffe4b4;
    background: #2b2823;
}
.collection-filters { max-width: 100%; text-align: right; }
.collection-filters summary { cursor: pointer; }
.collection-filters summary::-webkit-details-marker { display: none; }
.collection-filters form { display: flex; flex-wrap: wrap; gap: .7rem; align-items: end; margin-top: .65rem; text-align: left; }
.collection-filters label { display: grid; gap: .25rem; min-width: 0; color: #d4c8b5; font-size: .8rem; }
.collection-filters :is(input, select) {
    width: 100%;
    max-width: 16rem;
    height: 42px;
    padding: .4rem .6rem;
    border: 1px solid #625849;
    border-radius: 4px;
    background: #201f1e;
    color: #fff4dc;
}
.collection-clear { align-self: end; padding: .6rem .2rem; color: #edcf94; font-size: .82rem; }

/* Desktop coordinates follow the 812 × 570 illustrated spread. */
.collection-album {
    --album-script: "Caveat", "Segoe Print", cursive;
    max-width: clamp(640px, calc((100svh - 145px) * 1.425), 1120px);
    margin: .7rem auto 1.3rem;
}
.collection-album [data-collection-fullscreen][hidden] { display: none; }
.collection-album .collection-hero {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    margin: 0 .35rem .45rem;
}
.collection-album .collection-hero h1 { font-size: clamp(1.65rem, 2.75vw, 2.35rem); letter-spacing: 0; }
.collection-hero-actions { display: flex; align-items: center; gap: .35rem; }
.collection-album .collection-hero .collection-link { min-height: 36px; padding: .32rem .65rem; font-size: .78rem; }
.collection-album .collection-hero .collection-expand { width: 36px; padding: 0; }
.collection-album .collection-tools { align-items: center; margin: .45rem .35rem; }
.collection-album .collection-guest { margin-inline: .45rem; }
.collection-atlas {
    --book-ink: #32271e;
    --book-gold: #dfa652;
    container-type: inline-size;
    position: relative;
    isolation: isolate;
    width: 100%;
    margin-inline: auto;
    font-family: var(--album-script);
}
.collection-book {
    --book-paper-image: url("/img/collection-open-book.webp");
    position: relative;
    width: 100%;
    aspect-ratio: 812 / 570;
    background: var(--book-paper-image) center / 100% 100% no-repeat;
    color: var(--book-ink);
}
.collection-leaf { position: absolute; inset: 0 50% 0 0; min-width: 0; }
.collection-leaf-right { inset: 0 0 0 50%; }
.collection-book-turn {
    --turn-duration: 430ms;
    --turn-angle: -180deg;
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.collection-book-stage {
    position: absolute;
    z-index: 3;
    inset: 0;
    overflow: clip;
    perspective: 145cqw;
}
.collection-book-turn[data-direction="prev"] { --turn-angle: 180deg; }
.collection-book-sheet {
    position: absolute;
    inset: 0 0 0 50%;
    transform-origin: left center;
    transform-style: preserve-3d;
    animation: collection-turn-sheet var(--turn-duration) cubic-bezier(.35, .05, .25, 1) both;
}
.collection-book-turn[data-direction="prev"] .collection-book-sheet {
    inset: 0 50% 0 0;
    transform-origin: right center;
}
.collection-book-underpage, .collection-book-face {
    background: var(--book-paper-image) left center / 200% 100% no-repeat;
}
.collection-book-underpage { z-index: 1; }
.collection-book-face {
    inset: 0;
    backface-visibility: hidden;
    clip-path: polygon(6% 3%, 100% 2%, 100% 97%, 7% 95%, 5% 92%, 5% 6%);
}
.collection-book-face-back { transform: rotateY(180deg); }
:is(.collection-book-underpage, .collection-book-face).collection-leaf-right { background-position: right center; }
.collection-book-face.collection-leaf-right {
    clip-path: polygon(0 2%, 94% 3%, 95% 6%, 95% 92%, 93% 95%, 0 97%);
}
.collection-book-face::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #44250b88, #44250b08 75%);
    animation: collection-turn-shade var(--turn-duration) ease both;
}
.collection-book-face.collection-leaf-right::after { background: linear-gradient(to left, #44250b88, #44250b08 75%); }
@keyframes collection-turn-sheet {
    from { transform: rotateY(0); }
    to { transform: rotateY(var(--turn-angle)); }
}
@keyframes collection-turn-shade {
    0%, 100% { opacity: 0; }
    45% { opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
    .collection-book-turn { display: none; }
}
.collection-slots { display: contents; margin: 0; padding: 0; list-style: none; }
.collection-entry {
    position: absolute;
    top: 10.4%;
    left: 59.25%;
    width: 48%;
    transform: translateX(-50%);
}
.collection-leaf-right .collection-entry { left: 50%; width: 51.72%; }
.collection-entry:nth-child(2) { top: 52.63%; }
.collection-entry-found, .collection-entry-caption {
    position: absolute;
    z-index: 1;
    inset: auto -22% 100%;
    display: block;
    padding: 0 .12rem .32cqw;
    border: 0;
    color: #35291e;
    background: transparent;
    font: 650 clamp(.96rem, 2.55cqw, 1.76rem)/1.02 var(--album-script);
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-align: center;
    text-wrap: balance;
}
.collection-entry-found::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 15.28%;
    width: 69.44%;
    aspect-ratio: 1;
}
.collection-leaf:not(.collection-leaf-right) :is(.collection-entry-caption, .collection-entry-found) { inset-inline: -3%; }
.collection-leaf:not(.collection-leaf-right) .collection-entry-found::after { left: 2.83%; width: 94.34%; }
.collection-mount {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    border: clamp(3px, .61cqw, 7px) solid #182134;
    border-radius: 2px 1px 3px 1px;
    outline: 1px solid #5e3e25;
    background-color: #af4829;
    background-image: radial-gradient(ellipse at 46% 40%, #f1b36822, transparent 72%), url("/img/collection-card-ground.webp");
    background-size: cover;
    box-shadow: inset 0 0 0 2px #dd9d45, inset 0 0 0 3px #814821, inset 0 0 13px 4px #8735119e, 0 1px 2px #533d1d67;
}
.collection-mount::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid #f2b66570;
    pointer-events: none;
}
.collection-mount > img {
    position: absolute;
    width: 91%;
    height: 91%;
    object-fit: contain;
    filter: drop-shadow(0 .22cqw .16cqw #54281188);
}
.collection-mount > i:not(.collection-loupe) { color: #57290e; font-size: 5cqw; }
.collection-entry:has(.collection-entry-found:hover) .collection-mount,
.collection-entry:focus-within .collection-mount { outline: 2px solid #8d5b2b; }
.collection-entry-missing .collection-mount {
    background-color: #9f6140;
    background-image: radial-gradient(ellipse at 50% 44%, #f0c18b8c 7%, #a6835947 61%, #49202c75 100%), url("/img/collection-card-ground.webp");
    box-shadow: inset 0 0 0 2px #bd985c, inset 0 0 0 3px #796244, 0 1px 2px #533d1d67;
}
.collection-entry-missing .collection-mount > img { filter: brightness(0); opacity: .76; }
.collection-entry-missing .collection-entry-caption { color: #65513a; }
.collection-question, .collection-loupe {
    position: absolute;
    bottom: 4%;
    right: 4%;
    display: grid;
    place-items: center;
    width: 1.5em;
    aspect-ratio: 1;
    border: 1px solid #89663b;
    border-radius: 50%;
    color: #5d4426;
    background: #efdcafe6;
    font: bold clamp(.66rem, 1.6cqw, 1rem)/1 var(--album-script);
}
.collection-loupe { opacity: 0; font: .78rem/1 system-ui, sans-serif; }
.collection-entry:focus-within .collection-loupe, .collection-entry:hover .collection-loupe { opacity: 1; }
.collection-progress {
    position: absolute;
    z-index: 2;
    inset: 5.6% auto auto 5.35%;
    display: grid;
    gap: .08em;
    width: max-content;
    max-width: 10.6%;
    color: #382a19;
    font: 600 clamp(.83rem, 1.78cqw, 1.24rem)/1.03 var(--album-script);
}
.collection-progress strong { font-weight: 700; white-space: nowrap; }
.collection-progress-percent { color: #614a32; white-space: nowrap; }
.collection-bookmarks {
    position: absolute;
    inset: 16% auto 13.6% 1.45%;
    z-index: 4;
    width: 5.8%;
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    gap: .18cqw;
    align-content: center;
}
.collection-bookmark {
    position: relative;
    display: flex;
    justify-self: start;
    align-items: center;
    justify-content: center;
    width: 81%;
    min-height: 0;
    padding: 1px 6% 1px 0;
    border: 1px solid #90754a;
    border-radius: 1px 28% 24% 1px / 1px 30% 25% 1px;
    background: linear-gradient(90deg, #b89961, #eee2bc 19%, #f6e6bf 73%, #cfb483);
    box-shadow: 1px 1px 1px #5b432d70, inset 0 0 0 1px #fff0cc8a;
    color: #38291b;
    text-decoration: none;
}
.collection-bookmark img { display: block; width: 88%; height: 93%; object-fit: contain; }
.collection-bookmark[aria-current] {
    width: 100%;
    border-color: #775022;
    background: linear-gradient(90deg, #a07438, #f1d493 20%, #ffebbd 75%, #c99446);
    box-shadow: 1px 1px 2px #6c422865, inset 0 0 0 1px #f9d897;
}
.collection-bookmark:hover, .collection-bookmark:focus-visible { z-index: 4; background-color: #faedc3; }
.collection-bookmark-label {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: .65em;
    width: max-content;
    padding: .4rem .6rem;
    border: 1px solid #b79b67;
    border-radius: 3px;
    background: #29261fee;
    color: #fff0c8;
    font: 650 .84rem/1.1 var(--album-script);
    clip-path: inset(50%);
    pointer-events: none;
}
.collection-bookmark-label small { color: #dfc792; font: 600 .68rem/1 system-ui, sans-serif; }
.collection-bookmark:is(:hover, :focus-visible) .collection-bookmark-label { clip-path: none; }
.collection-album .collection-pagination {
    position: absolute;
    z-index: 4;
    inset: auto 5.3% 5% 4.6%;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: .5rem;
    margin: 0;
    pointer-events: none;
}
.collection-turn { display: flex; align-items: end; gap: .65cqw; }
.collection-album .collection-pagination .collection-arrow {
    display: grid;
    place-items: center;
    width: clamp(25px, 4.15cqw, 44px);
    min-height: 0;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid #463b31;
    border-radius: 2px;
    background: linear-gradient(135deg, #344b59, #152032 74%);
    box-shadow: inset 0 0 0 1px #b89350, 0 1px 1px #48331f75;
    color: #e7a84e;
    font: 1.8cqw/1 system-ui, sans-serif;
    pointer-events: auto;
}
.collection-album .collection-pagination .collection-arrow:hover { color: #ffe0a3; }
.collection-album .collection-pagination span.collection-arrow[aria-disabled] { opacity: .62; }
.collection-folio { color: #493820; font: 600 clamp(.89rem, 2cqw, 1.33rem)/1 var(--album-script); }
.collection-colophon, .collection-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.collection-colophon { width: 24%; height: auto; opacity: .22; filter: sepia(.85); }
.collection-empty { display: grid; justify-items: center; gap: .65rem; width: 67%; text-align: center; }
.collection-empty img { width: 30%; height: auto; object-fit: contain; }
.collection-album .collection-empty h2 { margin: 0; color: #4b3720; font: 650 clamp(1rem, 2.45cqw, 1.8rem)/1.12 var(--album-script); text-transform: none; }
.collection-empty p, .collection-empty a { margin: 0; color: #52412a; font: clamp(.8rem, 1.55cqw, 1.07rem)/1.25 var(--album-script); }
.collection-empty a { text-decoration: underline; text-underline-offset: .18em; }
.collection-exit {
    position: absolute;
    z-index: 4;
    top: 2.3%;
    right: 2.5%;
    display: none;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #9a784b;
    border-radius: 3px;
    background: #442d1e;
    color: #f4dfb6;
}
:root:fullscreen .collection-exit:not([hidden]) { display: grid; }
:root:fullscreen:has(.collection-album) { background: #14100d; overflow: hidden; }
:root:fullscreen:has(.collection-album) :is(.storefront-header-wrap, .storefront-footer),
:root:fullscreen .collection-album > :is(.collection-hero, .collection-tools, .collection-guest) { display: none; }
:root:fullscreen:has(.collection-album) .storefront-main {
    display: grid;
    place-items: center;
    max-width: none;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    background: #14100d;
}
:root:fullscreen .collection-album { width: min(100vw, calc(100dvh * 1.42456)); max-width: none; margin: 0; }

.collection-detail-art {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: radial-gradient(ellipse at center, #967d5033, #b0997521 55%, transparent 72%);
}
.collection-detail-art > img { width: 79%; height: 79%; object-fit: contain; }
.collection-detail-art > i { color: #655238; font-size: 3.5rem; line-height: 1; }
.collection-pagination { display: flex; justify-content: center; align-items: center; gap: clamp(.5rem, 3vw, 2rem); margin-top: 1.3rem; }
.collection-pagination strong { color: #e4d6c0; font-size: .85rem; font-weight: 600; text-align: center; }
.collection-pagination span[aria-disabled] { opacity: .54; }
.collection-detail {
    width: min(440px, calc(100vw - 2rem));
    max-height: 86vh;
    max-height: 86dvh;
    overflow: auto;
    padding: 0;
    border: 2px solid #a68b61;
    border-radius: 9px;
    background: #e9d6b0 url("/img/album-parchment.webp") center / cover;
    color: var(--album-ink);
    box-shadow: 0 18px 65px #000a;
}
.collection-detail::backdrop { background: #120e0bd1; }
.collection-detail-close { position: sticky; z-index: 1; top: 0; height: 0; margin: 0; text-align: right; }
.collection-detail-close button {
    width: 40px;
    height: 40px;
    margin: .45rem;
    border: 1px solid #9b8059;
    border-radius: 50%;
    background: #f3e3c2;
    color: var(--album-ink);
}
.collection-detail-body { padding: 1.8rem clamp(1.15rem, 4vw, 2rem); text-align: center; }
.collection-detail-art { width: 128px; margin: 0 auto .65rem; }
.collection-page .collection-detail h2 { margin: 0; color: #473422; font: 650 1.85rem/1.1 var(--album-script); letter-spacing: -.025em; text-transform: none; }
.collection-detail-body > p { margin: .65rem 0; color: #685237; font: italic 1.04rem/1.4 var(--album-script); }
.collection-detail dl { display: grid; gap: .55rem; margin: 1rem 0 0; font-size: .85rem; }
.collection-detail dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-top: .5rem; border-top: 1px solid #a68b625c; }
.collection-detail dt { font-weight: 600; text-align: left; }
.collection-detail dd { margin: 0; text-align: right; }
.collection-detail figure { margin: 1rem 0 0; }
.collection-detail figure img { max-width: 100%; max-height: 240px; border-radius: 3px; }
.collection-detail figcaption { margin-top: .35rem; font-size: .78rem; }

@media (max-width: 700px) {
    .collection-hero { align-items: start; flex-direction: column; gap: .85rem; }
    .collection-tools { display: block; }
    .collection-filters { text-align: left; }
    .collection-filters summary { padding-left: 0; }
    .collection-filters form { margin-top: .25rem; }

}
@media (max-width: 400px) {
    .collection-pagination { flex-wrap: wrap; gap: .45rem; }
    .collection-pagination a, .collection-pagination span[aria-disabled] { padding-inline: .45rem; }
    .collection-tabs a { padding-inline: .58rem; }
}

@media (max-width: 900px) {
    .collection-album { max-width: none; }
    .storefront-main:has(.collection-album) { max-width: 100%; }
}
@media (max-width: 600px) {
    .collection-album { margin-block: .75rem 1.25rem; }
    .collection-album .collection-hero { margin-inline: 0; }
    .collection-album .collection-hero .collection-link { padding: .3rem .43rem; font-size: .67rem; }
    .collection-album .collection-hero .collection-expand { width: 31px; }
    .collection-album .collection-hero h1 { font-size: clamp(1.35rem, 6.1vw, 1.8rem); }
    .collection-bookmarks {
        position: relative;
        inset: auto;
        display: flex;
        justify-content: start;
        align-items: stretch;
        gap: .25rem;
        width: 100%;
        margin: 0 0 .15rem;
        padding: 2px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        scrollbar-color: #94774b #29231d;
    }
    .collection-bookmark, .collection-bookmark[aria-current] {
        flex: 0 0 auto;
        gap: .2rem;
        width: auto;
        min-height: 36px;
        padding: .12rem .42rem;
        border-radius: 4px 4px 1px 1px;
    }
    .collection-bookmark img { width: 26px; height: 28px; }
    .collection-bookmark-label {
        position: static;
        transform: none;
        gap: .3rem;
        padding: 0;
        border: 0;
        background: transparent;
        color: #46351f;
        clip-path: none;
        font-size: .77rem;
    }
    .collection-bookmark-label small { color: #605031; }
    .collection-book { --book-paper-image: url("/img/collection-open-book-mobile.webp"); aspect-ratio: .77; }
    .collection-progress {
        top: 4.2%;
        left: 6.5%;
        display: flex;
        max-width: 88%;
        gap: .45em;
        font-size: clamp(.89rem, 3.45cqw, 1.15rem);
    }
    .collection-entry { top: 19%; left: 55%; width: 72%; }
    .collection-leaf-right .collection-entry { left: 47%; width: 76%; }
    .collection-entry:nth-child(2) { top: 55%; }
    .collection-entry-caption, .collection-entry-found {
        inset-inline: -5%;
        padding-bottom: .2rem;
        font-size: clamp(.86rem, 3.8cqw, 1.25rem);
        line-height: 1.02;
    }
    .collection-entry-found::after { left: 4.55%; width: 90.9%; }
    .collection-mount { border-width: 3px; }
    .collection-album .collection-pagination { bottom: 4.5%; inset-inline: 5.5%; }
    .collection-album .collection-pagination .collection-arrow { width: 30px; font-size: .82rem; }
    .collection-empty { width: 77%; }
    .collection-empty p { font-size: .78rem; }
    .collection-exit { top: 50px; right: 5%; width: 27px; height: 27px; }
    :root:fullscreen .collection-album { width: min(100vw, calc((100dvh - 49px) * .77)); }
}
@media (max-width: 375px) {
    .collection-progress { top: 3.6%; display: grid; grid-template-columns: auto auto; gap: 0 .4em; }
    .collection-progress #album-progress-label { grid-column: 1 / -1; }
    .collection-entry:first-child { top: 21%; }
}
