/* Page layouts */
.container {
    width: min(calc(100% - 3rem), var(--container-width));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 82px;
    display: flex;
    align-items: stretch;
    gap: 2.5rem;
    padding: 0 max(1.5rem, calc((100vw - var(--container-width)) / 2));
    border-bottom: 1px solid var(--color-border);
    background: rgb(247 246 241 / 78%);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    backdrop-filter: blur(18px) saturate(1.15);
}

.brand {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: -.025em;
    white-space: nowrap;
}

.brand-logo {
    display: block;
    height: 34px;
    width: auto;
}

.brand-symbol {
    display: none;
    height: 34px;
    width: auto;
}

.primary-nav {
    display: flex;
    align-items: stretch;
    gap: clamp(1rem, 2.2vw, 2.25rem);
    margin-inline: auto;
    font-size: .92rem;
}

.text-link {
    transition: color var(--duration-fast);
}

.text-link:hover {
    color: var(--color-sage);
}

/* Nav indicator: a 2px line that sits on the header's bottom stroke.
   Hover draws it in from the left; leaving wipes it out to the right. */
.primary-nav a {
    position: relative;
    display: flex;
    align-items: center;
}

.primary-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--color-ink);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform .45s cubic-bezier(.65, 0, .35, 1);
}

.primary-nav a:focus-visible::after,
.primary-nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left center;
}

@media (hover: hover) {
    .primary-nav a:hover::after {
        transform: scaleX(1);
        transform-origin: left center;
    }
}

.primary-nav a[aria-current="page"] {
    font-weight: 600;
}

/* Secondary actions: light grey fill, icon before the label. */
.header-link {
    align-self: center;
    margin-left: auto;
    min-height: 50px;
    align-items: center;
    padding: .5rem 1.4rem .5rem 1.2rem;
    border-radius: var(--radius-pill);
    background: rgb(23 23 23 / 7%);
    font-size: .92rem;
    white-space: nowrap;
    display: inline-flex;
    transition: background var(--duration-fast);
}

.header-link:hover {
    background: rgb(23 23 23 / 12%);
}

.header-link .btn-face,
.button-outline .btn-face,
.text-link .btn-face {
    flex-direction: row-reverse;
}

.menu-toggle {
    align-self: center;
    display: none;
}

.mobile-menu {
    display: none;
}

/* Lets the hero italics overhang their box without being cut off, without
   ever causing sideways scrolling. */
html,
body {
    overflow-x: clip;
}

.hero {
    position: relative;
    min-height: min(740px, calc(100svh - 82px));
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    column-gap: 2rem;
    padding-block: 5rem;
}

.hero-text {
    display: grid;
    justify-items: start;
}

.hero .eyebrow {
    margin-bottom: 2rem;
}

.hero h1 {
    margin-bottom: 2.5rem;
}

.hero-copy {
    margin-bottom: 2.5rem;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--color-muted);
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .13em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.hero h1,
.page-intro h1 {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
    font-size: var(--text-display);
    font-weight: 500;
    letter-spacing: var(--tracking-display);
    line-height: var(--line-tight);
}

.hero h1 {
    font-size: var(--heading-display);
}

.hero h1 em,
.page-intro h1 em {
    font-family: var(--font-editorial);
    font-weight: 400;
    font-size: calc(1em * var(--serif-optical));
    letter-spacing: var(--tracking-serif);
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 390px;
    color: var(--color-muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.button {
    min-height: var(--button-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: .65rem 1.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: .92rem;
    font-weight: 500;
    transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}

.button-dark {
    background: var(--color-ink);
    color: var(--color-white);
}

.button-dark:hover {
    background: var(--color-sage);
}

.button-outline {
    background: rgb(23 23 23 / 7%);
}

.button-outline:hover {
    background: rgb(23 23 23 / 12%);
}

/* Lucide icons (inline SVG, stroke follows the text colour). */
.icon {
    width: 1.15em;
    height: 1.15em;
    flex: none;
    stroke-width: 1.75px;
}

/* Keep the stroke at 1.75px whatever the icon size. */
.icon :is(path, circle, rect) {
    vector-effect: non-scaling-stroke;
}

/* Hover roll: the visible label and icon slide up and out while an identical
   copy slides in from below. Markup is built by js/main.js from data-icon. */
.btn-roll {
    position: relative;
    display: inline-flex;
    overflow: hidden;
    padding-block: .14em;
    margin-block: -.14em;
}

.btn-face {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
    transition: transform .5s cubic-bezier(.65, 0, .35, 1);
}

.btn-face+.btn-face {
    position: absolute;
    inset: .14em 0;
    justify-content: center;
    transform: translateY(calc(100% + .4em));
}

.text-link .btn-face,
.header-link .btn-face {
    gap: .45rem;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {

    .button:hover .btn-face:first-child,
    .header-link:hover .btn-face:first-child,
    .text-link:hover .btn-face:first-child,
    .button:focus-visible .btn-face:first-child,
    .header-link:focus-visible .btn-face:first-child,
    .text-link:focus-visible .btn-face:first-child {
        transform: translateY(calc(-100% - .4em));
    }

    .button:hover .btn-face+.btn-face,
    .header-link:hover .btn-face+.btn-face,
    .text-link:hover .btn-face+.btn-face,
    .button:focus-visible .btn-face+.btn-face,
    .header-link:focus-visible .btn-face+.btn-face,
    .text-link:focus-visible .btn-face+.btn-face {
        transform: translateY(0);
    }
}

.hero-art,
.cta-art {
    position: relative;
    width: 100%;
    height: clamp(380px, 40vw, 540px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.art-card {
    position: absolute;
    width: 41%;
    aspect-ratio: .68;
    display: grid;
    place-items: center;
    padding: 1rem;
    box-shadow: var(--shadow-soft);
    font-family: var(--font-editorial);
    font-size: clamp(.95rem, 2.2vw, 1.75rem);
    line-height: 1.1;
    text-align: center;
}

.art-card-one,
.art-card-three {
    font-size: clamp(.75rem, 1.5vw, 1.2rem);
}

/* Only the outer ~56% of a side card stays visible, so the text sits there. */
.art-card-text {
    max-width: 48%;
}

.art-card-one .art-card-text {
    text-align: left;
}

.art-card-three .art-card-text {
    text-align: right;
}

/* The middle card overlaps the inner ~40% of each side card, so the side
   cards keep their text inside the part that stays visible. */
.art-card-one {
    z-index: 2;
    place-items: center start;
    --rest-transform: rotate(-11deg) translate(-56%, 2%);
    --lift-transform: rotate(-5deg) translate(-56%, -4%) scale(1.07);
    background: var(--color-sage);
    color: var(--color-white);
}

.art-card-two {
    z-index: 3;
    --rest-transform: rotate(7deg) translate(2%, 5%);
    --lift-transform: rotate(3deg) translate(2%, -1%) scale(1.07);
    background: var(--color-gold);
}

.art-card-three {
    z-index: 1;
    place-items: center end;
    --rest-transform: rotate(17deg) translate(60%, -3%);
    --lift-transform: rotate(8deg) translate(60%, -9%) scale(1.07);
    background: var(--color-red);
}

.art-card {
    transform: var(--rest-transform);
    transition: transform var(--duration-normal) ease, box-shadow var(--duration-normal) ease;
}

/* Desktop with a mouse: the hovered cover comes to the front and straightens. */
@media (hover: hover) and (min-width: 851px) {
    .art-card:hover {
        z-index: 4;
        transform: var(--lift-transform);
        box-shadow: 0 24px 48px rgba(23, 23, 23, .18);
    }
}

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

/* The same cover stack, smaller, above the closing call to action. The middle
   cover is paper coloured so it stays visible on the gold background. */
.cta-art {
    width: min(100%, 440px);
    height: clamp(250px, 26vw, 330px);
    margin-bottom: 2rem;
}

.cta-art .art-card {
    font-size: clamp(.8rem, 1.5vw, 1.25rem);
}

.cta-art .art-card-one,
.cta-art .art-card-three {
    font-size: clamp(.65rem, 1.1vw, .95rem);
}

.cta-art .art-card-two {
    background: var(--color-paper);
}

.section {
    padding-block: var(--section-space);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}

.section-heading h2,
.discovery-banner h2,
.final-cta h2 {
    margin-bottom: 0;
    font-size: var(--heading-section);
    font-weight: 500;
    letter-spacing: var(--tracking-display);
    line-height: 1.02;
}

.section-aside {
    margin: 0;
    color: var(--color-muted);
    font-family: var(--font-editorial);
    font-size: 1.05rem;
    font-style: italic;
}

.text-link {
    font-size: .92rem;
    white-space: nowrap;
    display: inline-flex;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--grid-gap-wide);
}

.book-card {
    min-width: 0;
}

/* Soft panel: cover lifted off it, badge top left, title and details below. */
.book-card-link {
    display: flex;
    height: 100%;
    flex-direction: column;
    gap: .75rem;
    padding: .75rem .75rem 1.15rem;
    border-radius: var(--radius-md);
    background: var(--color-panel);
    transition: background var(--duration-fast);
}

.book-card-link:hover {
    background: var(--color-panel-hover);
}

.book-cover-wrap {
    position: relative;
    flex: none;
    aspect-ratio: .9;
    display: grid;
    place-items: center;
}

/* Cover size comes from the card width only, so every card lines up. */
.book-cover {
    width: 56%;
    aspect-ratio: .68;
    object-fit: cover;
    box-shadow: 0 1px 2px rgb(23 23 23 / 10%), 6px 12px 22px rgb(23 23 23 / 22%);
}

.cover-placeholder {
    width: 56%;
    aspect-ratio: .68;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: .7rem;
    padding: 1rem;
    border: 1px solid rgb(23 23 23 / 15%);
    box-shadow: 0 1px 2px rgb(23 23 23 / 10%), 6px 12px 22px rgb(23 23 23 / 22%);
    background: var(--cover-color, var(--color-sage));
    color: var(--cover-ink, var(--color-white));
    text-align: center;
}

.cover-placeholder span {
    font-size: .62rem;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.cover-placeholder strong {
    font-family: var(--font-editorial);
    font-size: clamp(.9rem, 1.6vw, 1.35rem);
    font-weight: 400;
    line-height: 1.05;
}

/* Flip: front and back faces of the cover. */
.book-flip {
    width: 56%;
    aspect-ratio: .68;
    perspective: 900px;
}

.book-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.4, .1, .2, 1);
}

.book-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 1px 2px rgb(23 23 23 / 10%), 6px 12px 22px rgb(23 23 23 / 22%);
}

.book-face-back {
    transform: rotateY(180deg);
}

.book-face .book-cover,
.book-face .cover-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    box-shadow: none;
}

.book-back-generated {
    width: 100%;
    height: 100%;
    display: grid;
    align-content: space-between;
    gap: .75rem;
    padding: 1.1rem 1rem;
    background: var(--cover-color, var(--color-ink));
    color: var(--cover-ink, var(--color-white));
}

.book-back-brand,
.book-back-meta {
    font-size: .62rem;
    letter-spacing: .13em;
    text-transform: uppercase;
    opacity: .85;
}

.book-back-blurb {
    margin: 0;
    font-family: var(--font-editorial);
    font-size: .85rem;
    font-style: italic;
    line-height: 1.45;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {

    .book-card-link:hover .book-flip-inner,
    .book-card-link:focus-visible .book-flip-inner {
        transform: rotateY(180deg);
    }
}

.book-card-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: .3rem;
}

.book-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
}

.book-card-detail {
    margin: 0;
    color: var(--color-muted);
    font-size: .88rem;
    white-space: nowrap;
}

.book-tag {
    position: absolute;
    top: .25rem;
    left: .25rem;
    padding: .28rem .8rem;
    border-radius: var(--radius-pill);
    background: var(--color-red);
    color: var(--color-ink);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.35;
}

.category-section {
    padding-block: var(--section-space);
    background: #F0EFE9;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
}

.category-tile {
    position: relative;
    min-height: 245px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: var(--radius-sm);
}

.category-tile>span:first-child {
    font-size: .7rem;
    letter-spacing: .12em;
}

.category-tile strong {
    font-family: var(--font-editorial);
    font-size: clamp(1.45rem, 2.5vw, 2.4rem);
    font-weight: 400;
    line-height: 1.05;
}

.category-sage {
    background: #D3E6E1;
}

.category-yellow {
    background: #FCE6B5;
}

.category-lilac {
    background: var(--color-lilac);
}

.category-peach {
    background: var(--color-peach);
}

.tile-arrow {
    align-self: flex-end;
    display: grid;
}

.tile-arrow .icon {
    width: 1.6rem;
    height: 1.6rem;
}

.discovery-banner {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(2rem, 6vw, 5rem);
    border-radius: var(--radius-sm);
    background: var(--color-sage-soft);
}

.discovery-banner h2 {
    margin-bottom: 1.75rem;
}

.banner-ornament {
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border: 1px solid rgb(23 23 23 / 20%);
    border-radius: 50%;
    transform: rotate(-12deg);
    font-family: var(--font-editorial);
    font-size: 1.2rem;
}

.brand-statement {
    padding-block: var(--section-space);
    background: var(--color-sage-soft);
    text-align: center;
}

.statement {
    max-width: 900px;
    margin: 0 auto 1.5rem;
    font-family: var(--font-editorial);
    font-size: var(--heading-title);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.14;
    text-wrap: balance;
}

.statement em {
    font-style: italic;
}

.final-cta {
    display: grid;
    justify-items: center;
    gap: 1.2rem;
    padding: var(--section-space) 1rem;
    background: var(--color-gold);
    text-align: center;
}

.final-cta .eyebrow {
    color: rgb(23 23 23 / 65%);
    margin-bottom: 0;
}

/* Footer */
.site-footer {
    overflow: hidden;
    padding-top: clamp(3.5rem, 7vw, 5rem);
    background: var(--color-ink);
    color: #A3A3A3;
}

.footer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3rem;
}

.footer-logo {
    display: inline-block;
}

.footer-logo img {
    display: block;
    height: 36px;
    width: auto;
}

.footer-tagline {
    max-width: 36ch;
    margin: 1.25rem 0 0;
    font-size: 1.05rem;
    line-height: 1.6;
}

.footer-links {
    display: grid;
    min-width: 200px;
    gap: 1rem;
}

.footer-heading {
    margin: 0 0 .75rem;
    color: var(--color-white);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.footer-links a {
    width: fit-content;
    font-size: 1rem;
    transition: color var(--duration-fast);
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--color-white);
}

.footer-copy {
    margin: clamp(2.5rem, 6vw, 4.5rem) 0 1.75rem;
    font-size: .95rem;
}

.footer-rule {
    height: 1px;
    background: rgb(255 255 255 / 14%);
}

/* Wordmark placeholder: sized to the container width and cropped at the bottom. */
.footer-art {
    height: calc(min(100vw - 3rem, var(--container-width)) * .2008);
    margin-top: clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
}

.footer-wordmark {
    display: block;
    width: 100%;
    height: auto;
    opacity: .34;
}

/* Catalogue */
.catalogue-page {
    padding-block: 5rem var(--section-space);
}

.page-intro {
    max-width: 650px;
    margin-bottom: 4rem;
}

.page-intro h1 {
    font-size: var(--heading-display);
}

.page-intro>p:last-child {
    color: var(--color-muted);
}

.catalogue-controls {
    padding-block: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.search-field {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--color-ink);
}

.search-field>span:not(.sr-only) {
    font-size: 1.4rem;
}

.search-field input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 1rem;
}

.search-field input:focus-visible {
    outline: 0;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.1rem;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.category-chip {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 0 1rem 0 .85rem;
    line-height: 1;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-white);
    font-size: .88rem;
    transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}

.category-chip .icon {
    width: 1rem;
    height: 1rem;
}

/* Centre the label on its cap height so the padding looks equal top and bottom. */
.category-chip span {
    line-height: 1;
    text-box: trim-both cap alphabetic;
}

.category-chip:hover {
    border-color: var(--color-ink);
}

.category-chip[aria-pressed="true"] {
    border-color: var(--color-ink);
    background: var(--color-ink);
    color: var(--color-white);
}

.sort-control {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--color-muted);
    font-size: .84rem;
    white-space: nowrap;
}

.sort-control select {
    padding: .35rem 1.5rem .35rem .4rem;
    border: 0;
    background: transparent;
    color: var(--color-ink);
    font-size: .84rem;
}

.results-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block: 1.5rem;
    color: var(--color-muted);
    font-size: .84rem;
}

.results-line p {
    margin: 0;
}

.clear-filters {
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.empty-state {
    padding: 5rem 1rem;
    text-align: center;
}

.empty-state>span {
    font-size: 2rem;
}

.empty-state h2 {
    margin: .75rem 0;
    font-size: 1.6rem;
    font-weight: 500;
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--color-muted);
}

/* Details */
.detail-page {
    padding-block: 2rem var(--section-space);
}

.breadcrumbs {
    display: flex;
    gap: .55rem;
    margin-bottom: 3rem;
    color: var(--color-muted);
    font-size: .84rem;
}

.breadcrumbs a:hover {
    color: var(--color-ink);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 8vw, 8rem);
    align-items: start;
}

.detail-cover {
    min-height: 560px;
    display: grid;
    place-items: center;
    border: 1px solid var(--color-border);
    background: #EEEDE8;
}

.detail-cover .book-cover,
.detail-cover .cover-placeholder {
    width: 54%;
    height: auto;
    aspect-ratio: .68;
}

.detail-cover {
    position: relative;
}

.detail-flip {
    width: 54%;
    aspect-ratio: .68;
    padding: 0;
    border: 0;
    background: none;
    perspective: 1200px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.detail-flip .book-flip-inner {
    display: block;
}

.detail-flip.is-flipped .book-flip-inner {
    transform: rotateY(180deg);
}

.detail-flip:focus-visible {
    outline: 2px solid var(--color-ink);
    outline-offset: 6px;
}

.detail-cover .book-face .book-cover,
.detail-cover .book-face .cover-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.flip-hint {
    position: absolute;
    bottom: 1.25rem;
    left: 0;
    right: 0;
    margin: 0;
    color: var(--color-muted);
    font-size: .82rem;
    text-align: center;
}

.detail-copy {
    padding-block: 2rem;
}

.detail-facts {
    margin-top: 2.5rem;
    max-width: 560px;
}

.detail-facts-title {
    margin-bottom: .5rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.detail-facts dl {
    margin: 0;
}

.detail-facts dl>div {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: .8rem 0;
    border-top: 1px solid var(--color-border);
    font-size: .95rem;
}

.detail-facts dl>div:last-child {
    border-bottom: 1px solid var(--color-border);
}

.detail-facts dt {
    color: var(--color-muted);
}

.detail-facts dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.detail-copy h1 {
    margin-bottom: .4rem;
    font-size: var(--heading-title);
    font-weight: 500;
    letter-spacing: var(--tracking-display);
    line-height: 1;
}

.detail-author {
    margin-bottom: 2rem;
    color: var(--color-muted);
    font-family: var(--font-editorial);
    font-size: 1.25rem;
    font-style: italic;
}

.detail-description {
    max-width: 560px;
    margin-bottom: 1.75rem;
    color: #454545;
    line-height: 1.75;
    font-size: 1.1rem;
}

.detail-description p+p {
    margin-top: 1rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
}

.detail-meta span {
    padding: .4rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: .82rem;
}

.purchase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

.more-stores {
    position: relative;
}

.more-btn {
    width: var(--button-height);
    padding: 0;
    cursor: pointer;
}

.more-btn .icon {
    width: 1.5em;
    height: 1.5em;
}

.more-menu {
    position: absolute;
    z-index: 5;
    top: calc(100% + .5rem);
    right: 0;
    min-width: 13.5rem;
    padding: .4rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-white);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    transition: opacity var(--duration-fast) ease, transform var(--duration-normal) cubic-bezier(.16, 1, .3, 1), visibility 0s linear var(--duration-normal);
}

.more-stores.is-open .more-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}

.more-menu a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-md);
    font-size: .92rem;
    font-weight: 500;
}

.more-menu a:hover,
.more-menu a:focus-visible {
    background: var(--color-panel);
}

.purchase-actions:empty {
    display: none;
}

.related-section {
    padding-top: var(--section-space);
}

.detail-not-found {
    min-height: 50vh;
}

@media (max-width: 850px) {
    .site-header {
        gap: 1rem;
    }

    .primary-nav {
        gap: 1rem;
    }

    .hero {
        min-height: 0;
        grid-template-columns: 1fr;
        align-content: start;
        padding-block: 3.5rem 2rem;
    }

    .hero-art {
        justify-self: center;
        width: min(100%, 460px);
        height: 380px;
        margin-block: 2.5rem 1rem;
    }

    .book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: 1fr;
    }

    .category-tile {
        min-height: 170px;
    }

    .detail-layout {
        gap: 2rem;
    }

    .detail-cover {
        min-height: 430px;
    }
}

@media (max-width: 600px) {
    .container {
        width: min(calc(100% - 2rem), var(--container-width));
    }

    .header-link {
        min-height: 40px;
        padding: .35rem 1rem .35rem .85rem;
        font-size: .82rem;
    }

    .site-header {
        min-height: 68px;
        justify-content: space-between;
        padding-inline: 1rem;
    }

    .site-header .header-link {
        display: none;
    }

    /* Hamburger: bare lines, 48px touch target, morphs into a cross. */
    .menu-toggle {
        position: relative;
        width: 48px;
        height: 48px;
        margin-right: -12px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--color-ink);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-toggle-lines {
        position: relative;
        display: block;
        width: 24px;
        height: 16px;
    }

    .menu-toggle-lines>span {
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform .45s cubic-bezier(.7, 0, .2, 1), opacity .2s ease;
    }

    .menu-toggle-lines>span:nth-child(1) {
        top: 0;
    }

    .menu-toggle-lines>span:nth-child(2) {
        top: 7px;
    }

    .menu-toggle-lines>span:nth-child(3) {
        top: 14px;
    }

    .menu-open .menu-toggle-lines>span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-open .menu-toggle-lines>span:nth-child(2) {
        opacity: 0;
    }

    .menu-open .menu-toggle-lines>span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Full-bleed menu: the page colour at ~80% with a blur behind it. */
    .mobile-menu {
        display: grid;
        position: fixed;
        z-index: 45;
        inset: 0;
        place-items: center;
        padding: 5.5rem 1.5rem 3rem;
        background: rgb(247 246 241 / 80%);
        -webkit-backdrop-filter: blur(22px) saturate(1.15);
        backdrop-filter: blur(22px) saturate(1.15);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        /* Closing: wait for the items to leave, then fade the panel. */
        transition: opacity .35s ease .3s, visibility 0s linear .65s;
    }

    .menu-open .mobile-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .35s ease, visibility 0s;
    }

    .menu-open .site-header {
        background: transparent;
        border-bottom-color: transparent;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        transition-delay: 0s;
    }

    .site-header {
        transition: background .3s ease .4s, border-color .3s ease .4s;
    }

    .menu-open {
        overflow: hidden;
    }

    /* The root has overflow-x: clip, so the body's overflow no longer reaches
       the viewport. Lock the root too, or the page scrolls behind the menu. */
    html.menu-lock {
        overflow: hidden;
    }

    .mobile-menu {
        overscroll-behavior: contain;
        touch-action: none;
    }

    .mobile-nav {
        display: grid;
        justify-items: center;
        gap: 1.6rem;
        text-align: center;
    }

    .mobile-nav>a {
        font-size: clamp(1.9rem, 8.5vw, 2.6rem);
        font-weight: 500;
        letter-spacing: -.045em;
        line-height: 1.1;
        opacity: 0;
        transform: translateY(46px);
        /* Closing: last item leaves first, sliding back down. */
        transition: opacity .3s ease calc((4 - var(--i)) * 55ms), transform .45s cubic-bezier(.6, 0, .8, .4) calc((4 - var(--i)) * 55ms);
    }

    .menu-open .mobile-nav>a {
        opacity: 1;
        transform: none;
        /* Opening: top item first, each one rising from below. */
        transition: opacity .5s ease calc(.12s + var(--i) * 80ms), transform .7s cubic-bezier(.16, 1, .3, 1) calc(.12s + var(--i) * 80ms);
    }

    .mobile-nav>a[aria-current="page"] {
        color: var(--color-sage);
    }

    .mobile-nav>.menu-cta {
        margin: 1rem 0 0;
        min-height: var(--button-height);
        padding: .5rem 1.7rem .5rem 1.5rem;
        font-size: 1rem;
        font-weight: 400;
        letter-spacing: 0;
        line-height: normal;
    }

    .cta-art {
        width: min(100%, 300px);
        height: 230px;
    }

    .hero {
        min-height: 0;
        align-content: start;
        padding-block: 3.5rem 2rem;
    }

    .hero h1 {
        font-size: clamp(3.2rem, 15vw, 4.5rem);
    }

    /* In normal flow so it can never sit on top of the copy or button. */
    .art-card-text {
        max-width: 62%;
    }

    .hero-art {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        justify-self: center;
        width: min(100%, 340px);
        height: 270px;
        margin-block: 2.5rem 1rem;
        opacity: 1;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
        gap: .75rem;
    }

    .section-aside {
        display: none;
    }

    .book-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }


    .category-tile {
        min-height: 175px;
        padding: .9rem;
    }

    .category-tile strong {
        font-size: 1.45rem;
    }

    .discovery-banner {
        min-height: 320px;
        padding: 1.5rem;
    }

    .banner-ornament {
        width: 115px;
        height: 115px;
        font-size: .68rem;
    }

    .footer-top {
        flex-direction: column;
        gap: 3.25rem;
    }

    .footer-links {
        gap: .7rem;
    }

    .footer-heading {
        margin-bottom: 1rem;
    }

    .footer-art {
        height: calc((100vw - 2rem) * .2008);
    }

    .catalogue-page {
        padding-top: 3rem;
    }

    .page-intro {
        margin-bottom: 2.5rem;
    }

    .filter-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .sort-control {
        align-self: flex-end;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-cover {
        min-height: 430px;
    }

    .detail-copy {
        padding-top: 0;
    }

    .detail-copy h1 {
        font-size: var(--heading-title);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
/* Scroll reveal (js/reveal.js). Each kind of element enters in its own way. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
    [data-reveal] {
        --ease-out: cubic-bezier(.16, 1, .3, 1);
        opacity: 0;
        transform: translateY(28px);
        transition: opacity .8s ease, transform 1s var(--ease-out), filter 1s ease;
    }

    [data-reveal].is-in {
        opacity: 1;
        transform: none;
        filter: none;
    }

    /* Small labels slide in from the left. */
    [data-reveal="slide"] {
        transform: translateX(-36px);
    }

    [data-reveal="slide-right"] {
        transform: translateX(36px);
    }

    /* Headings rise out of a blur. */
    [data-reveal="heading"] {
        transform: translateY(56px);
        filter: blur(10px);
    }

    /* The big statement settles in slowly from slightly larger. */
    [data-reveal="statement"] {
        transform: scale(1.05);
        filter: blur(14px);
        transition-duration: 1.2s, 1.4s, 1.2s, 1s;
    }

    /* Buttons pop with a small overshoot. */
    [data-reveal="pop"] {
        transform: translateY(14px) scale(.82);
        transition: opacity .6s ease, transform .8s cubic-bezier(.34, 1.56, .64, 1);
    }

    /* Book cards rise and settle. */
    [data-reveal="card"] {
        transform: translateY(64px) scale(.94);
    }

    /* Mood tiles swing up from their bottom corner. */
    [data-reveal="tilt"] {
        transform: translateY(44px) rotate(-5deg);
        transform-origin: 0 100%;
    }

    /* Cover stacks: the wrapper stays put, each cover flies in on its own beat. */
    [data-reveal="stack"] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    [data-reveal="stack"] .art-card {
        opacity: 0;
        translate: var(--from, 0) 90px;
        transition: opacity .7s ease, translate 1.2s var(--ease-out);
        transition-delay: calc(var(--rd, 0ms) + var(--beat, 0ms));
    }

    [data-reveal="stack"] .art-card-one {
        --from: -70px;
        --beat: 0ms;
    }

    [data-reveal="stack"] .art-card-two {
        --from: 0px;
        --beat: 220ms;
    }

    [data-reveal="stack"] .art-card-three {
        --from: 70px;
        --beat: 440ms;
    }

    [data-reveal="stack"].is-in .art-card {
        opacity: 1;
        translate: 0 0;
    }

    /* The header drops in from the top of the screen on load. */
    .site-header {
        animation: header-drop .9s cubic-bezier(.16, 1, .3, 1) backwards;
    }

    @keyframes header-drop {
        from {
            transform: translateY(-100%);
        }
    }
}
