/* ==========================================================================
   Maneesh Book Shop — "The Reading Room"
   Design system + page styles for the coffee table book vertical.

   Palette is derived from the shop logo (#26568e blue, #f4f1eb ivory) and the
   painted storefront signboard (ochre). Type pairing: Fraunces (display) with
   Archivo (text/UI), both with sturdy system fallbacks.

   Structure of this file:
     1. Tokens
     2. Reset + base
     3. Typography primitives
     4. Buttons, links, form controls
     5. Site header + navigation
     6. Home: hero
     7. Home: legacy strip
     8. Home: curated by purpose
     9. Home: curated by genre
    10. Home: editorial spotlight
    11. Catalogue (toolbar, grid, cards)
    12. Curation / enquiry band
    13. Footer
    14. Selection drawer (cart)
    15. Book detail page
    16. About page
    17. Motion + reveal
    18. Responsive refinements
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Brand */
  --blue: #26568e;
  --blue-deep: #1c4271;
  --blue-soft: #6d8cb4;
  --ink: #0f2138;          /* deepest navy, near-black with a blue cast */
  --ink-2: #1a2f4a;

  /* Paper */
  --ivory: #f4f1eb;
  --paper: #fbf9f5;
  --parchment: #ebe5d9;
  --rule: #d6cfc0;
  --rule-soft: #e4ded1;

  /* Text */
  --text: #35383c;
  --text-muted: #6b6a64;
  --text-faint: #8a867d;
  --on-ink: #ece7dd;
  --on-ink-muted: #a9b4c3;

  /* Accent — lifted from the shop's painted signboard */
  --ochre: #96670f;
  --ochre-bright: #d9a531;

  /* Type */
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* Scale */
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0: clamp(0.97rem, 0.94rem + 0.14vw, 1.06rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.7vw, 1.95rem);
  --step-3: clamp(1.9rem, 1.6rem + 1.4vw, 2.9rem);
  --step-4: clamp(2.4rem, 1.8rem + 2.9vw, 4.6rem);

  /* Layout */
  --shell: 1320px;
  --shell-narrow: 940px;
  --gutter: clamp(1.15rem, 4vw, 4rem);
  --section-y: clamp(3.75rem, 8vw, 8.5rem);
  --header-h: 74px;
  --drawer-pad: 1.5rem;

  /* Effects */
  --lift-1: 0 1px 2px rgba(15, 33, 56, 0.06), 0 6px 18px rgba(15, 33, 56, 0.07);
  --lift-2: 0 2px 4px rgba(15, 33, 56, 0.07), 0 18px 40px rgba(15, 33, 56, 0.14);
  --lift-3: 0 4px 8px rgba(15, 33, 56, 0.1), 0 34px 70px rgba(15, 33, 56, 0.22);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --page-turn: cubic-bezier(0.4, 0, 0.15, 1);
}

/* 2. Reset + base ---------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.62;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

.hero-book img,
.genre-tile img,
.book-cover img,
.detail-stage img,
.gallery-thumb img {
  background: transparent;
  mix-blend-mode: multiply;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

.section--ink :focus-visible,
.site-footer :focus-visible,
.selection-panel :focus-visible {
  outline-color: var(--ochre-bright);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell-narrow {
  max-width: var(--shell-narrow);
}

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

.section--ink {
  background: var(--ink);
  color: var(--on-ink);
}

.section--parchment {
  background: var(--parchment);
}

/* 3. Typography primitives -------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
  font-variation-settings: "SOFT" 12, "WONK" 0;
}

.section--ink h1,
.section--ink h2,
.section--ink h3,
.site-footer h2,
.site-footer h3 {
  color: var(--paper);
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

/* Small tracked label — the connective tissue of the whole layout */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 1.25rem;
}

.eyebrow::before {
  content: "";
  width: 1.9rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  flex: none;
}

.section--ink .eyebrow {
  color: var(--ochre-bright);
}

.section-title {
  font-size: var(--step-3);
  max-width: 20ch;
  text-wrap: balance;
}

.section-lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 52ch;
  margin-top: 1.4rem;
}

.section--ink .section-lede {
  color: var(--on-ink-muted);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  margin-bottom: clamp(2.25rem, 4vw, 3.75rem);
}

.section-head > div {
  min-width: 0;
}

/* 4. Buttons, links, controls ---------------------------------------------- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  padding: 0.92em 1.7em;
  min-height: 46px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: 2px;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  transition:
    background 0.35s var(--ease),
    color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary:hover {
  --btn-bg: var(--blue);
  --btn-bd: var(--blue);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--rule);
}

.btn--ghost:hover {
  --btn-bd: var(--ink);
  --btn-bg: rgba(15, 33, 56, 0.04);
}

.btn--on-ink {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  --btn-bd: rgba(236, 231, 221, 0.38);
}

.btn--on-ink:hover {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  --btn-bd: var(--paper);
}

.btn--whatsapp {
  --btn-bg: #12734a;
  --btn-fg: #fff;
  --btn-bd: #12734a;
}

.btn--whatsapp:hover {
  --btn-bg: #0d5b3a;
  --btn-bd: #0d5b3a;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
  transform: none;
}

/* Understated text link with an animated rule */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--blue);
  text-decoration: none;
  padding-bottom: 0.3em;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}

.link-arrow:hover {
  gap: 0.95em;
  color: var(--ink);
}

.section--ink .link-arrow {
  color: var(--ochre-bright);
}

.section--ink .link-arrow:hover {
  color: var(--paper);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.field > span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.field input,
.field select {
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.7em 0.85em;
  min-height: 44px;
  width: 100%;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.field select {
  appearance: none;
  padding-right: 2.4em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2326568e' stroke-width='1.4' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9em center;
  background-size: 11px;
  cursor: pointer;
}

.field input:hover,
.field select:hover {
  border-color: var(--blue-soft);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(38, 86, 142, 0.16);
}

.field input::placeholder {
  color: var(--text-faint);
}

/* 5. Site header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  /* Deliberately opaque rather than blurred: cheaper to composite over a long
     image-heavy page, and closer to printed paper than to frosted glass. */
  background: var(--ivory);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 12px rgba(15, 33, 56, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
  min-width: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  transition: transform 0.5s var(--ease);
}

.brand:hover .brand-logo {
  transform: rotate(-6deg) scale(1.04);
}

.brand-name {
  display: block;
  font-family: var(--display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}

.brand-tag {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 0.24em;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.2rem);
}

.nav-link {
  position: relative;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-block: 0.4rem;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.selection-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.62rem 1rem;
  min-height: 44px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.selection-toggle:hover {
  border-color: var(--ink);
  background: rgba(15, 33, 56, 0.04);
}

.selection-count {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding-inline: 0.35em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: background 0.3s var(--ease);
}

.selection-toggle.has-items .selection-count {
  background: var(--ochre);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.nav-toggle span {
  position: relative;
  width: 17px;
  height: 1.5px;
  background: var(--ink);
  transition: background 0.2s var(--ease);
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 17px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease);
}

.nav-toggle span::before {
  top: -5px;
}

.nav-toggle span::after {
  top: 5px;
}

body.nav-open .nav-toggle span {
  background: transparent;
}

body.nav-open .nav-toggle span::before {
  transform: translateY(5px) rotate(45deg);
}

body.nav-open .nav-toggle span::after {
  transform: translateY(-5px) rotate(-45deg);
}

/* 6. Home — hero ----------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-copy {
  max-width: 34rem;
}

.hero-title {
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  color: var(--blue);
}

.hero-lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-muted);
  margin-top: 1.6rem;
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.4rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.6rem;
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.hero-meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* Stacked covers: real books, arranged like a table display */
.hero-stack {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, minmax(0, 1fr));
  aspect-ratio: 5 / 4.2;
  min-height: 300px;
}

.hero-stack::after {
  /* the surface the books rest on */
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 2%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--rule) 16%,
    var(--rule) 84%,
    transparent
  );
}

.hero-book {
  position: relative;
  display: block;
  align-self: end;
  min-width: 0;
  text-decoration: none;
  transition: transform 0.6s var(--page-turn);
}

.hero-book img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 18px 26px rgba(15, 33, 56, 0.26))
    drop-shadow(0 3px 5px rgba(15, 33, 56, 0.14));
}

.hero-book:hover,
.hero-book:focus-visible {
  transform: translateY(-10px) rotate(0deg);
  z-index: 6;
}

/* A deliberate, hand-placed composition rather than an even row */
.hero-book--1 {
  grid-area: 2 / 1 / 7 / 4;
  transform: rotate(-4deg);
  z-index: 3;
}

.hero-book--2 {
  grid-area: 1 / 3 / 7 / 6;
  z-index: 4;
}

.hero-book--3 {
  grid-area: 2 / 5 / 6 / 7;
  transform: rotate(5deg);
  z-index: 2;
}

/* laid flatter and lower, so it reads as a book resting under the stack */
.hero-book--4 {
  grid-area: 5 / 1 / 7 / 3;
  transform: rotate(10deg) translate(-16%, 6%);
  z-index: 1;
}

/* Running strip beneath the hero */
.hero-strip {
  border-block: 1px solid var(--rule);
  background: rgba(235, 229, 217, 0.55);
}

.hero-strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem clamp(1.5rem, 4vw, 3.5rem);
  padding-block: 1.15rem;
  margin: 0;
  list-style: none;
  font-size: var(--step--1);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-strip-inner li {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}

.hero-strip-inner li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ochre);
  flex: none;
}

/* 7. Legacy strip ----------------------------------------------------------- */

.legacy-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  align-items: center;
}

.legacy-figure {
  position: relative;
  margin: 0;
}

.legacy-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 600px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 2px;
  box-shadow: var(--lift-3);
}

.legacy-figure figcaption {
  margin-top: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
}

.legacy-quote {
  font-family: var(--display);
  font-size: var(--step-2);
  line-height: 1.25;
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  color: var(--paper);
  margin: 0 0 1.75rem;
  text-wrap: balance;
}

.legacy-body {
  color: var(--on-ink-muted);
  line-height: 1.75;
  max-width: 52ch;
}

.legacy-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1.5rem;
  margin: 2.75rem 0 0;
  padding-top: 2.25rem;
  border-top: 1px solid rgba(236, 231, 221, 0.18);
}

.legacy-fact dt {
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--ochre-bright);
  line-height: 1;
}

.legacy-fact dd {
  margin: 0.6rem 0 0;
  font-size: var(--step--1);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
  line-height: 1.5;
}

/* 8. Curated by purpose ----------------------------------------------------- */

.purpose-list {
  border-top: 1px solid var(--rule);
}

.purpose-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.15fr) auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.5rem, 3vw, 2.35rem);
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.4s var(--ease), padding-inline 0.4s var(--ease);
}

.purpose-row:hover,
.purpose-row:focus-visible {
  background: var(--paper);
  padding-inline: clamp(0.5rem, 2vw, 1.5rem);
}

.purpose-index {
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--ochre);
  font-variant-numeric: tabular-nums;
}

.purpose-name {
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--ink);
  line-height: 1.12;
  margin: 0;
  transition: color 0.3s var(--ease);
}

.purpose-row:hover .purpose-name {
  color: var(--blue);
}

.purpose-copy {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 46ch;
}

.purpose-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--blue);
  flex: none;
  transition:
    background 0.35s var(--ease),
    border-color 0.35s var(--ease),
    color 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.purpose-row:hover .purpose-cue {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--paper);
  transform: translateX(4px);
}

/* 9. Curated by genre ------------------------------------------------------- */

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(1rem, 2vw, 1.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The representative cover is shown whole, standing on the tile, rather than
   cropped as wallpaper — book covers are artwork and should not be trimmed. */
.genre-tile {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
  aspect-ratio: 3 / 4;
  padding: 1.4rem 1.25rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--ivory);
  text-decoration: none;
  transition:
    background 0.45s var(--ease),
    border-color 0.45s var(--ease),
    transform 0.45s var(--ease);
}

.genre-tile:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-4px);
}

.genre-tile img {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  margin: 0 auto;
  object-fit: contain;
  mix-blend-mode: normal;
  align-self: center;
  filter: drop-shadow(0 12px 18px rgba(15, 33, 56, 0.24))
    drop-shadow(0 2px 4px rgba(15, 33, 56, 0.14));
  transition: transform 0.55s var(--page-turn);
}

.genre-tile:hover img {
  transform: translateY(-5px) scale(1.03);
}

.genre-tile-name {
  display: block;
  font-family: var(--display);
  font-size: var(--step-1);
  color: var(--ink);
  line-height: 1.15;
  transition: color 0.45s var(--ease);
}

.genre-tile-count {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.45s var(--ease);
}

.genre-tile:hover .genre-tile-name {
  color: var(--paper);
}

.genre-tile:hover .genre-tile-count {
  color: var(--ochre-bright);
}

/* 10. Editorial spotlight --------------------------------------------------- */

.spotlight-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.spotlight-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  min-height: 300px;
}

.spotlight-stage::before {
  content: "";
  position: absolute;
  inset: 6% 4%;
  background: rgba(236, 231, 221, 0.04);
  border: 1px solid rgba(236, 231, 221, 0.14);
}

.spotlight-stage img {
  position: relative;
  max-height: 480px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: normal;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.5));
  transition: opacity 0.4s var(--ease), transform 0.6s var(--page-turn);
}

.spotlight-stage.is-swapping img {
  opacity: 0;
  transform: translateY(10px);
}

.spotlight-title {
  font-size: var(--step-3);
  text-wrap: balance;
  margin-bottom: 0;
}

.spotlight-publisher {
  display: block;
  font-size: var(--step--1);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-ink-muted);
  margin-bottom: 0.9rem;
}

.spotlight-blurb {
  color: var(--on-ink-muted);
  margin-top: 1.4rem;
  max-width: 48ch;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-price {
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--ochre-bright);
  margin-top: 1.5rem;
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.spotlight-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(236, 231, 221, 0.18);
}

.spotlight-dot {
  width: 34px;
  height: 20px;
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.spotlight-dot::before {
  content: "";
  display: block;
  height: 3px;
  background: rgba(236, 231, 221, 0.25);
  transition: background 0.3s var(--ease);
}

.spotlight-dot[aria-selected="true"]::before {
  background: var(--ochre-bright);
}

.spotlight-dot:hover::before {
  background: rgba(236, 231, 221, 0.6);
}

/* 11. Catalogue ------------------------------------------------------------- */

.catalogue {
  padding-top: clamp(3rem, 6vw, 5.5rem);
  padding-bottom: var(--section-y);
  scroll-margin-top: var(--header-h);
}

.catalogue-toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: var(--ivory);
  border-block: 1px solid var(--rule);
  margin-bottom: 2.25rem;
}

.toolbar-primary {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1rem;
  align-items: end;
}

.genre-strip {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.genre-strip::-webkit-scrollbar {
  height: 3px;
}

.genre-strip::-webkit-scrollbar-thumb {
  background: var(--rule);
}

.genre-chip {
  flex: none;
  scroll-snap-align: start;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  min-height: 38px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
  transition:
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.genre-chip:hover {
  border-color: var(--blue-soft);
  color: var(--ink);
}

.genre-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.genre-chip small {
  opacity: 0.62;
  margin-left: 0.35em;
  font-size: 0.95em;
}

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.75rem;
}

.results-summary {
  margin: 0;
  font-size: var(--step--1);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.results-summary strong {
  color: var(--ink);
  font-weight: 700;
}

.clear-filters {
  background: none;
  border: 0;
  padding: 0.3rem 0;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid currentColor;
}

.clear-filters:hover {
  color: var(--ink);
}

.clear-filters[hidden] {
  display: none;
}

/* --- Book cards: the cover is the object; the card is only a shelf --- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: clamp(1.75rem, 3vw, 3rem) clamp(1.1rem, 2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.book-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.book-cover {
  position: relative;
  display: grid;
  /* minmax(0,1fr) stops the auto row from being sized by the image's intrinsic
     height, which would defeat max-height:100% and break row alignment. */
  grid-template-rows: minmax(0, 1fr);
  place-items: end center;
  aspect-ratio: 1 / 1;
  /* flex/grid items default to min-height:auto, which would let a tall cover
     stretch the square and knock rows of cards out of alignment */
  min-height: 0;
  padding: 0.5rem 0.5rem 0;
  text-decoration: none;
}

/* the shelf line the cover stands on */
.book-cover::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 1px;
  background: var(--rule);
  transition: background 0.4s var(--ease);
}

.book-card:hover .book-cover::after {
  background: var(--blue-soft);
}

.book-cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(15, 33, 56, 0.16))
    drop-shadow(0 2px 3px rgba(15, 33, 56, 0.1));
  transition: transform 0.55s var(--page-turn), filter 0.55s var(--ease);
  transform-origin: bottom center;
}

.book-card:hover .book-cover img,
.book-cover:focus-visible img {
  transform: translateY(-8px) scale(1.035);
  filter: drop-shadow(0 20px 26px rgba(15, 33, 56, 0.24))
    drop-shadow(0 3px 5px rgba(15, 33, 56, 0.12));
}

.cover-fallback {
  display: grid;
  place-items: center;
  width: 74%;
  aspect-ratio: 3 / 4;
  padding: 1rem;
  background: var(--parchment);
  border: 1px solid var(--rule);
  font-family: var(--display);
  font-size: 0.86rem;
  line-height: 1.3;
  text-align: center;
  color: var(--text-muted);
  box-shadow: var(--lift-1);
  overflow: hidden;
}

.book-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 1rem;
  min-width: 0;
}

.book-publisher {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 0.5rem;
}

.book-title {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.005em;
  margin: 0 0 0.55rem;
  /* keep the grid tidy without breaking long titles awkwardly */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.book-title a {
  color: var(--ink);
  text-decoration: none;
}

.book-title a:hover {
  color: var(--blue);
}

.book-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.65rem;
}

.book-price {
  font-family: var(--display);
  font-size: 1.02rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.add-button {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.5rem 0.85rem;
  min-height: 38px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
  transition:
    background 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.add-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.add-button.in-selection {
  border-color: var(--ochre);
  color: var(--ochre);
  background: rgba(150, 103, 15, 0.07);
}

.add-button.in-selection:hover {
  background: var(--ochre);
  color: #fff;
}

.catalogue-empty {
  padding: clamp(3rem, 8vw, 6rem) 0;
  text-align: center;
  border-block: 1px solid var(--rule);
}

.catalogue-empty h3 {
  font-size: var(--step-2);
  margin-bottom: 0.75rem;
}

.catalogue-empty p {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.load-more-wrap {
  display: grid;
  place-items: center;
  gap: 0.9rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rule);
}

.load-more-wrap[hidden] {
  display: none;
}

.load-more-note {
  font-size: var(--step--1);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0;
}

/* 12. Curation / enquiry band ---------------------------------------------- */

.curation-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.curation-prompts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.curation-prompts li {
  padding: 1.05rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--display);
  font-size: 1.06rem;
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  color: var(--ink-2);
  line-height: 1.4;
}

.curation-prompts li::before {
  content: "\201C";
  color: var(--ochre);
}

.curation-prompts li::after {
  content: "\201D";
  color: var(--ochre);
}

.curation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.curation-fineprint {
  margin-top: 1.5rem;
  font-size: var(--step--1);
  color: var(--text-faint);
  max-width: 44ch;
  line-height: 1.6;
}

/* 13. Footer ---------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: var(--on-ink);
  padding-top: clamp(3.5rem, 7vw, 6rem);
  padding-bottom: 2rem;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid rgba(236, 231, 221, 0.16);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  margin-bottom: 1.25rem;
}

.footer-brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: none;
}

.footer-brand span {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--paper);
}

.footer-blurb {
  color: var(--on-ink-muted);
  max-width: 40ch;
  line-height: 1.65;
}

.footer-motto {
  margin-top: 1.5rem;
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: 1.15rem;
  color: var(--ochre-bright);
}

.footer-heading {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  margin: 0 0 1.15rem;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.footer-list a {
  color: var(--on-ink-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.3s var(--ease);
}

.footer-list a:hover {
  color: var(--paper);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.75rem;
  font-size: 0.78rem;
  color: rgba(169, 180, 195, 0.8);
}

.footer-bottom p {
  margin: 0;
}

/* 14. Selection drawer ------------------------------------------------------ */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 33, 56, 0.5);
  border: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  cursor: pointer;
}

body.selection-open .scrim {
  opacity: 1;
  visibility: visible;
}

.selection-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(430px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ivory);
  border-left: 1px solid var(--rule);
  box-shadow: -30px 0 60px rgba(15, 33, 56, 0.18);
  transform: translateX(101%);
  visibility: hidden;
  transition: transform 0.48s var(--page-turn), visibility 0.48s;
}

body.selection-open .selection-panel {
  transform: translateX(0);
  visibility: visible;
}

.selection-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--drawer-pad) 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.selection-head h2 {
  font-size: var(--step-2);
  margin: 0;
}

.selection-subhead {
  margin: 0.4rem 0 0;
  font-size: var(--step--1);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.icon-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.selection-items {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--drawer-pad);
}

.selection-line {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
}

.selection-line:last-child {
  border-bottom: 0;
}

.selection-line img {
  width: 62px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(15, 33, 56, 0.18));
}

.selection-thumb-fallback {
  display: grid;
  place-items: center;
  width: 62px;
  height: 78px;
  background: var(--parchment);
  border: 1px solid var(--rule);
  font-family: var(--display);
  color: var(--text-faint);
}

.selection-line h3 {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.3rem;
  overflow-wrap: anywhere;
}

.selection-line h3 a {
  color: var(--ink);
  text-decoration: none;
}

.selection-line h3 a:hover {
  color: var(--blue);
}

.selection-line-meta {
  margin: 0 0 0.7rem;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.selection-line-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
}

.qty button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s var(--ease);
}

.qty button:hover {
  background: var(--parchment);
}

.qty span {
  min-width: 2ch;
  text-align: center;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.line-total {
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.remove-line {
  background: none;
  border: 0;
  padding: 0.2rem 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid transparent;
}

.remove-line:hover {
  color: #9c3b33;
  border-bottom-color: currentColor;
}

.selection-empty {
  display: grid;
  gap: 0.7rem;
  padding: clamp(2.5rem, 8vh, 4.5rem) 0;
  text-align: center;
}

.selection-empty h3 {
  font-size: var(--step-1);
}

.selection-empty p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0;
}

.selection-foot {
  padding: 1.35rem var(--drawer-pad)
    calc(1.35rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.selection-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.selection-total span {
  font-size: var(--step--1);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.selection-total strong {
  font-family: var(--display);
  font-size: var(--step-2);
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.selection-note {
  margin: 0 0 1.1rem;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-faint);
}

.selection-foot .btn {
  width: 100%;
}

/* 15. Book detail ----------------------------------------------------------- */

.detail-main {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: var(--section-y);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--step--1);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.breadcrumb-sep {
  opacity: 0.5;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.detail-gallery {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.detail-stage {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(170deg, var(--paper), var(--parchment));
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.detail-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 34px rgba(15, 33, 56, 0.24))
    drop-shadow(0 4px 6px rgba(15, 33, 56, 0.12));
  transition: opacity 0.3s var(--ease), transform 0.45s var(--page-turn);
}

.detail-stage.is-swapping img {
  opacity: 0;
  transform: translateX(-12px);
}

.stage-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 2rem;
  text-align: center;
  font-family: var(--display);
  color: var(--text-faint);
}

.detail-stage.has-no-image img {
  display: none;
}

.detail-stage.has-no-image .stage-fallback {
  display: grid;
}

.gallery-thumbs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumbs::-webkit-scrollbar {
  height: 3px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
  background: var(--rule);
}

.gallery-thumb {
  flex: none;
  scroll-snap-align: start;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  padding: 0.35rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.gallery-thumb:hover {
  border-color: var(--blue-soft);
  transform: translateY(-2px);
}

.gallery-thumb[aria-selected="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 1.1rem 1.5rem;
  margin: 0.75rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}

.glance dt {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.glance dd {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.detail-copy {
  min-width: 0;
}

.detail-publisher {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 1rem;
}

.detail-title {
  font-size: var(--step-3);
  line-height: 1.05;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.detail-genre {
  padding: 0.32rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.detail-genre:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.detail-buy {
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.detail-price {
  font-family: var(--display);
  font-size: var(--step-3);
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.detail-price-note {
  margin: 0.6rem 0 0;
  font-size: var(--step--1);
  color: var(--text-faint);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.detail-actions .btn {
  flex: 1 1 12rem;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-soft);
}

.detail-links a {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.detail-links a:hover {
  color: var(--blue);
}

.detail-section {
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
}

.detail-section > h2 {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 0.85rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.description-copy {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
  max-width: 62ch;
}

.description-copy p {
  margin-bottom: 1.1em;
}

.description-copy p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-size: 3.25em;
  line-height: 0.82;
  padding: 0.05em 0.1em 0 0;
  color: var(--blue);
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(9rem, 0.55fr) minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}

.spec-row span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.spec-row strong {
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.issuu-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow: hidden;
  background: var(--parchment);
}

.issuu-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.related {
  margin-top: clamp(3.5rem, 7vw, 6rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--rule);
}

.detail-missing {
  padding: clamp(4rem, 12vw, 8rem) 0;
  text-align: center;
}

.detail-missing h1 {
  font-size: var(--step-3);
  margin-bottom: 1rem;
}

.detail-missing p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* 16. About ----------------------------------------------------------------- */

.about-hero {
  padding-top: clamp(2.5rem, 5vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.about-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.about-title {
  font-size: var(--step-4);
  line-height: 1;
  text-wrap: balance;
}

.about-lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--text-muted);
  margin-top: 1.5rem;
  max-width: 42ch;
}

.about-figure {
  margin: 0;
}

.about-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 560px;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 2px;
  box-shadow: var(--lift-3);
}

.about-carousel {
  position: relative;
}

.about-carousel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 560px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--lift-3);
  background: var(--parchment);
}

.about-shop-carousel .about-carousel-frame {
  max-height: 520px;
}

.about-carousel--nostalgic .about-carousel-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(217, 165, 49, 0.12), transparent 38%),
    radial-gradient(circle at 50% 42%, transparent 54%, rgba(86, 54, 20, 0.2));
  mix-blend-mode: soft-light;
}

.about-carousel--nostalgic .about-carousel-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(244, 241, 235, 0.08);
}

.about-carousel-frame img {
  box-shadow: none;
}

.about-carousel-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.025);
  transition:
    opacity 0.55s var(--ease),
    transform 0.9s var(--page-turn);
}

.about-carousel-image.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.about-carousel--nostalgic .about-carousel-image {
  filter: sepia(0.28) saturate(0.78) contrast(0.92) brightness(1.02);
}

.about-carousel-controls {
  position: absolute;
  z-index: 4;
  right: 0.9rem;
  bottom: 0.9rem;
  display: flex;
  gap: 0.45rem;
}

.about-carousel-button {
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(251, 249, 245, 0.4);
  border-radius: 999px;
  background: rgba(15, 33, 56, 0.74);
  color: var(--paper);
  box-shadow: 0 8px 18px rgba(15, 33, 56, 0.18);
  transition:
    transform 0.25s var(--ease),
    background 0.25s var(--ease);
}

.about-carousel-button:hover {
  transform: translateY(-2px);
  background: rgba(15, 33, 56, 0.9);
}

.about-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.about-carousel-dots {
  display: inline-flex;
  gap: 0.42rem;
  flex: none;
}

.about-carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--rule);
}

.about-carousel-dot[aria-selected="true"] {
  background: var(--blue);
}

.about-chapters {
  display: grid;
  gap: clamp(3rem, 7vw, 6rem);
}

.about-chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: start;
}

.about-chapter--flip .about-chapter-media {
  order: 2;
}

.about-chapter-media {
  margin: 0;
}

.about-chapter-media img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 520px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: var(--lift-2);
}

.about-painting-frame {
  --painting-height: min(74vh, 620px);
  display: grid;
  place-items: center;
  width: min(100%, calc(var(--painting-height) * 1019 / 1543));
  max-width: 100%;
  margin-inline: auto;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.about-painting-frame img {
  aspect-ratio: 1019 / 1543;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center top;
  box-shadow: var(--lift-2);
}

.about-chapter-media .about-carousel-frame img {
  aspect-ratio: auto;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

.about-chapter-media figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.about-chapter h2 {
  font-size: var(--step-2);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.about-chapter p {
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 56ch;
}

.about-pullquote {
  font-family: var(--display);
  font-size: var(--step-3);
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  line-height: 1.2;
  color: var(--ink);
  text-align: center;
  max-width: 24ch;
  margin: 0 auto;
  text-wrap: balance;
}

.about-attrib {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* The first chapter reuses the storefront photograph, cropped lower so it
   reads as the window display rather than a repeat of the hero. */
.about-chapter--window img {
  object-position: center 62%;
}

.about-signoff {
  text-align: center;
}

.about-signoff .eyebrow {
  justify-content: center;
}

.about-signoff .curation-actions {
  justify-content: center;
  margin-top: 2.5rem;
}

.about-signoff-name {
  font-family: var(--display);
  font-size: var(--step-3);
  line-height: 1.12;
  color: var(--paper);
  margin-bottom: 0.9rem;
}

.about-signoff-motto {
  font-family: var(--display);
  font-style: italic;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  font-size: var(--step-1);
  color: var(--ochre-bright);
  margin: 0;
}

.about-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.about-value h3 {
  font-size: var(--step-1);
  margin-bottom: 0.7rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.about-value p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* 17. Motion + reveal ------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal[data-reveal-delay="1"] { transition-delay: 0.08s; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.16s; }
.reveal[data-reveal-delay="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* 18. Responsive ------------------------------------------------------------ */

@media (max-width: 1080px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-gallery {
    position: static;
    max-width: 560px;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 940px) {
  .hero-inner,
  .legacy-inner,
  .spotlight-inner,
  .curation-inner,
  .about-hero-inner,
  .about-chapter {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-inner {
    gap: 2.5rem;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-stack {
    order: -1;
    aspect-ratio: 5 / 3.6;
    min-height: 240px;
  }

  /* The under-stack book is dropped on narrow screens: at this width it only
     clips against the left gutter instead of adding depth. */
  .hero-book--4 {
    display: none;
  }

  .hero-book--1 {
    grid-area: 2 / 1 / 7 / 4;
  }

  .legacy-figure,
  .about-figure,
  .about-chapter-media {
    max-width: 460px;
  }

  .legacy-figure img,
  .about-figure img,
  .about-chapter-media img {
    aspect-ratio: 16 / 11;
  }

  .about-painting-frame {
    --painting-height: min(70vh, 620px);
  }

  .about-painting-frame img {
    aspect-ratio: 1019 / 1543;
    width: 100%;
    height: auto;
  }

  .about-chapter--flip .about-chapter-media {
    order: 0;
  }

  .spotlight-stage img {
    max-height: 42vh;
  }

  .toolbar-primary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar-search {
    grid-column: 1 / -1;
  }

  .purpose-row {
    grid-template-columns: 2.5rem minmax(0, 1fr) 42px;
    align-items: start;
    column-gap: 1rem;
    row-gap: 0.65rem;
  }

  .purpose-index {
    grid-column: 1;
    grid-row: 1;
  }

  .purpose-name {
    grid-column: 2;
    grid-row: 1;
  }

  .purpose-copy {
    grid-column: 2 / 4;
    grid-row: 2;
    max-width: none;
    margin-top: 0;
  }

  .purpose-cue {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: end;
  }
}

@media (max-width: 780px) {
  .nav-toggle {
    display: inline-flex;
    order: 3;
  }

  .primary-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
    box-shadow: 0 20px 40px rgba(15, 33, 56, 0.12);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
      visibility 0.3s;
  }

  body.nav-open .primary-nav {
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  .nav-link {
    padding-block: 1rem;
    border-bottom: 1px solid var(--rule-soft);
    font-size: 0.9rem;
  }

  .nav-link::after {
    display: none;
  }

  .selection-toggle {
    padding-inline: 0.75rem;
  }

  .selection-toggle .selection-label {
    display: none;
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  :root {
    --drawer-pad: 1.15rem;
  }

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

  .book-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .add-button {
    width: 100%;
  }

  .hero-actions .btn,
  .detail-actions .btn {
    flex: 1 1 100%;
  }

  .spec-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

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

  .selection-panel {
    width: 100vw;
  }

  .about-pullquote {
    max-width: 18ch;
  }
}

@media (max-width: 400px) {
  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .book-grid {
    gap: 1.75rem 0.85rem;
  }

  .gallery-thumb {
    width: 62px;
    height: 62px;
  }
}
