/* Kakapo Press - design tokens. The single source of styling truth.
   Rule (docs/DESIGN.md): no hex/rgb literals and no raw px for spacing or type
   outside this file. Feature CSS composes tokens only. */

:root {
  /* ---- Palette: paper, ink, cloth, gilt --------------------------------- */
  --paper:            #f6f1e4;   /* warm cream page */
  --paper-deep:       #ece4d2;   /* recessed panels, table stripes */
  --paper-edge:       #ded2ba;   /* hairlines on cream */
  --ink:              #241d16;   /* near-black brown body text */
  --ink-soft:         #5c5044;   /* secondary text, 6.9:1 on paper */
  --ink-faint:        #6f6353;   /* captions, meta - 5.2:1 on paper, 4.6:1 on panel */

  --leather:          #1c2620;   /* dark green-black boards: hero, footer */
  --leather-soft:     #2b3a31;   /* raised panel on leather */
  --leather-edge:     #3d5045;   /* hairlines on leather */

  /* Gilt comes in three weights because leaf behaves differently by ground:
     bright on dark boards, mid for rules and ornament on paper, and a deeper
     burnt gilt wherever it has to carry TEXT on cream and clear 4.5:1. */
  --gilt:             #b3893c;   /* rules, ornament, hairlines on paper */
  --gilt-bright:      #d9ae5f;   /* gilt on dark grounds - 7.6:1 on leather */
  --gilt-ink:         #7f5e22;   /* gilt as text/CTA on paper - 5.3:1, white on it 5.7:1 */
  --sage:             #8fb89a;   /* the holding page's green, kept for accents */
  --wine:             #7a2f33;   /* period binding red */
  --navy:             #2b3c56;   /* period binding blue */
  --ochre:            #8a6a2f;   /* period binding tan */

  /* Semantic roles ------------------------------------------------------- */
  --bg:               var(--paper);
  --bg-panel:         var(--paper-deep);
  --bg-invert:        var(--leather);
  --text:             var(--ink);
  --text-muted:       var(--ink-soft);
  --text-faint:       var(--ink-faint);
  --text-invert:      #e9e6da;
  --text-invert-muted:#b3bcae;
  --accent:           var(--gilt-ink);   /* anything that carries text or takes text on top */
  --accent-rule:      var(--gilt);       /* borders and ornament, where contrast rules do not apply */
  --accent-on-dark:   var(--gilt-bright);
  --accent-contrast:  #fffaf0;
  --border:           var(--paper-edge);
  --border-invert:    var(--leather-edge);
  --danger:           #8c2f26;
  --success:          #3f6b46;

  /* ---- Type ------------------------------------------------------------ */
  /* Self-hosted woff2 lands before launch; the stack degrades to the same
     old-style figures and generous x-height on every target platform. */
  --font-display: "Kakapo Display", "Iowan Old Style", "Palatino Linotype",
                  Palatino, "Book Antiqua", Georgia, serif;
  --font-body:    "Kakapo Text", "Iowan Old Style", Charter, Georgia,
                  "Times New Roman", serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, monospace;

  --fs-xs:   0.75rem;
  --fs-sm:   0.8125rem;
  --fs-base: 1rem;
  --fs-md:   1.0625rem;
  --fs-lg:   1.25rem;
  --fs-xl:   1.5rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.75rem;
  --fs-4xl:  3.5rem;

  --lh-tight:  1.15;
  --lh-normal: 1.45;
  --lh-loose:  1.7;

  --ls-caps:  0.18em;   /* smallcaps nav and eyebrows */
  --ls-wide:  0.08em;
  --ls-tight: -0.01em;

  /* ---- Space (4px base) ------------------------------------------------ */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-7:  2.5rem;
  --sp-8:  3rem;
  --sp-9:  4rem;
  --sp-10: 5rem;
  --sp-11: 6rem;
  --sp-12: 8rem;

  /* ---- Line, radius, shadow -------------------------------------------- */
  --radius-sm: 2px;      /* sharp corners are part of the look */
  --radius-md: 3px;
  --hairline: 1px;
  --rule-gilt: 2px;
  --shadow-card:  0 1px 2px rgba(36, 29, 22, 0.08), 0 8px 24px rgba(36, 29, 22, 0.07);
  --shadow-plate: 2px 3px 0 rgba(36, 29, 22, 0.13);
  --shadow-lift:  0 4px 10px rgba(36, 29, 22, 0.14), 0 18px 40px rgba(36, 29, 22, 0.12);

  /* ---- Motion ---------------------------------------------------------- */
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --ease: cubic-bezier(0.2, 0.6, 0.3, 1);

  /* ---- Layout ---------------------------------------------------------- */
  --measure:      68ch;    /* reading width for prose */
  --page-max:     1220px;
  --page-gutter:  var(--sp-5);

  /* ---- Z layers -------------------------------------------------------- */
  --z-base:    0;
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
  --z-toast:   400;
}

/* Kakapo Press - element defaults and layout primitives. Tokens only. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  font-variant-numeric: oldstyle-num;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin: 0 0 var(--sp-3);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-4); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

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

ul, ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }

/* Layout ---------------------------------------------------------------- */

.bk-page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--page-gutter);
}

.bk-section { padding-block: var(--sp-9); }
.bk-section--tight { padding-block: var(--sp-7); }

.bk-invert {
  background: var(--bg-invert);
  color: var(--text-invert);
}
.bk-invert a:hover { color: var(--accent-on-dark); }

.bk-prose { max-width: var(--measure); }
.bk-prose p { color: var(--text-muted); }

/* Section heading with the ornament rule -------------------------------- */

.bk-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.bk-head h2 { margin: 0; white-space: nowrap; }
.bk-head::after {
  content: "";
  flex: 1;
  height: var(--hairline);
  background: var(--border);
}
.bk-invert .bk-head::after { background: var(--border-invert); }
.bk-head .bk-head-link {
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.bk-head .bk-head-link:hover { color: var(--accent); }

.bk-eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}
.bk-invert .bk-eyebrow { color: var(--accent-on-dark); }

.bk-grid { display: grid; gap: var(--sp-5); }
.bk-grid--4 { grid-template-columns: repeat(4, 1fr); }
.bk-grid--3 { grid-template-columns: repeat(3, 1fr); }
.bk-grid--2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .bk-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .bk-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .bk-grid--4, .bk-grid--3, .bk-grid--2 { grid-template-columns: 1fr; }
  :root { --fs-3xl: 2.1rem; --fs-4xl: 2.4rem; --page-gutter: var(--sp-4); }
}

/* Kakapo Press - component library. One block per component, class-prefixed.
   Tokens only: no literal colours, no raw px for type or space. */

/* ======================================================================
   Announcement bar + header
   ====================================================================== */

.bk-announce {
  background: var(--leather);
  color: var(--text-invert-muted);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-align: center;
  padding: var(--sp-2) var(--sp-4);
}
.bk-announce strong { color: var(--accent-on-dark); font-weight: 600; }

.bk-header {
  border-bottom: var(--hairline) solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
}
.bk-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding-block: var(--sp-4);
}

.bk-wordmark { display: flex; align-items: center; gap: var(--sp-3); }
.bk-wordmark-mark {
  width: 2.25rem; height: 2.25rem;
  flex: none;
  color: var(--accent);
}
.bk-wordmark-text { line-height: 1; white-space: nowrap; }
.bk-wordmark-name {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.bk-wordmark-sub {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: var(--sp-1);
}

.bk-nav { display: flex; gap: var(--sp-4); align-items: center; flex: none; }
.bk-nav a {
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-block: var(--sp-2);
  border-bottom: var(--rule-gilt) solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.bk-nav a:hover, .bk-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent-rule);
}

/* Tools grow to fill the row and, crucially, may shrink to nothing so the
   header can never push the basket off-screen. */
.bk-header-tools {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

/* The primary nav is the first thing to go when the row is tight: below this
   width the search + basket + wordmark still fit, and every nav link also
   lives in the footer. */
@media (max-width: 1080px) {
  .bk-nav { display: none; }
}

/* ======================================================================
   Buttons, search, badges
   ====================================================================== */

.bk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm);
  border: var(--hairline) solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.bk-btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}
.bk-btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--accent-contrast); }
.bk-btn--outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.bk-btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.bk-invert .bk-btn--outline { color: var(--text-invert); border-color: var(--border-invert); }
.bk-invert .bk-btn--outline:hover { border-color: var(--accent-on-dark); color: var(--accent-on-dark); }
.bk-btn--block { width: 100%; }

.bk-search {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  flex: 1 1 auto;
  min-width: 0;
  max-width: 22rem;
}
.bk-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text);
  width: 100%;
}
.bk-search input::placeholder { color: var(--text-faint); }
.bk-search svg { color: var(--text-faint); flex: none; }

.bk-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: var(--sp-1) var(--sp-2);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--bg-panel);
}
.bk-badge--gilt { border-color: var(--accent-rule); color: var(--accent); background: transparent; }

/* ======================================================================
   Book plate: the cover stand-in
   His listings carry no photographs, so a book is represented by a bound
   board with a gilt-ruled paper label. Deliberate, not a placeholder.
   Cloth colour comes from a period-binding set, chosen per book at render.
   ====================================================================== */

.bk-plate {
  position: relative;
  aspect-ratio: 2 / 3;
  background:
    repeating-linear-gradient(90deg,
      rgba(255,255,255,0.035) 0 1px, rgba(0,0,0,0.03) 1px 2px),
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.03) 0 1px, rgba(0,0,0,0.025) 1px 2px),
    var(--plate-cloth, var(--leather));
  box-shadow: var(--shadow-plate);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4) var(--sp-8);
  overflow: hidden;
  container-type: inline-size;   /* the label scales with the board, not the page */
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
/* the spine edge */
.bk-plate::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--sp-3);
  background: linear-gradient(90deg, rgba(0,0,0,0.34), rgba(0,0,0,0.06));
}
/* the gilt double rule */
.bk-plate::after {
  content: "";
  position: absolute;
  inset: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
  border: var(--hairline) solid var(--gilt-bright);
  outline: var(--hairline) solid var(--gilt-bright);
  outline-offset: 3px;
  opacity: 0.55;
  pointer-events: none;
}

.bk-plate-label {
  position: relative;
  text-align: center;
  color: var(--gilt-bright);
  padding-inline: var(--sp-3);
  margin-left: var(--sp-2);
}
.bk-plate-author {
  display: block;
  font-size: clamp(0.5rem, 5cqi, var(--fs-xs));
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: var(--sp-3);
}
.bk-plate-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 11cqi, var(--fs-lg));
  line-height: var(--lh-tight);
  text-wrap: balance;
}
.bk-plate-foot {
  position: absolute;
  left: var(--sp-6);
  right: var(--sp-4);
  bottom: var(--sp-4);
  text-align: center;
  font-size: clamp(0.5rem, 4.5cqi, var(--fs-xs));
  letter-spacing: var(--ls-wide);
  color: var(--gilt-bright);
  opacity: 0.7;
}
/* In the cart line the plate is a ~72px thumbnail, too small to set the
   typographic label without the title, author and year overlapping. There it
   shows just the bound board and gilt rule; the title is printed beside it. */
.bk-line-plate .bk-plate-label,
.bk-line-plate .bk-plate-foot { display: none; }

/* period binding cloths */
.bk-plate--leather { --plate-cloth: var(--leather); }
.bk-plate--wine    { --plate-cloth: var(--wine); }
.bk-plate--navy    { --plate-cloth: var(--navy); }
.bk-plate--ochre   { --plate-cloth: var(--ochre); }
.bk-plate--sage    { --plate-cloth: #4a6b55; }
.bk-plate--slate   { --plate-cloth: #3f4750; }

/* when a real photograph exists it simply replaces the label */
.bk-plate--photo { padding: 0; background: var(--bg-panel); }
.bk-plate--photo img { width: 100%; height: 100%; object-fit: cover; }
.bk-plate--photo::after { display: none; }

/* ======================================================================
   Book card
   ====================================================================== */

/* cards in a grid run to equal height so the price rules line up across a row */
.bk-card { display: flex; flex-direction: column; height: 100%; }

/* Hovering a book lifts it off the shelf: it rises, tilts a touch toward you,
   the gilt frame catches the light, and a soft shadow floats beneath.
   Pure CSS, no script. */
.bk-card:hover .bk-plate {
  transform: perspective(900px) translateY(-8px) rotateX(4.5deg) scale(1.018);
  box-shadow: 0 20px 38px -16px rgba(20, 28, 22, 0.5), var(--shadow-plate);
}
.bk-card:hover .bk-plate::after { opacity: 0.92; }   /* the gilt double rule brightens */
.bk-card:hover .bk-card-title { color: var(--accent); }

/* Books settle onto the shelf as they scroll into view. Uses scroll-driven CSS
   (animation-timeline: view()) so there is still zero JavaScript; browsers
   without it simply show the books, and reduced-motion users get no movement. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .bk-card {
      animation: bk-shelf-rise linear both;
      animation-timeline: view();
      animation-range: entry 8% entry 55%;
    }
    @keyframes bk-shelf-rise {
      from { opacity: 0; transform: translateY(1.75rem); }
      to   { opacity: 1; transform: translateY(0); }
    }
  }
}

.bk-card-body { padding-top: var(--sp-4); display: flex; flex-direction: column; flex: 1; }
.bk-card-author {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--sp-2);
}
.bk-card-title {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-2);
  transition: color var(--dur-fast) var(--ease);
}
.bk-card-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  flex: 1;
}
.bk-card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  border-top: var(--hairline) solid var(--border);
  padding-top: var(--sp-3);
}
.bk-price {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-variant-numeric: lining-nums;
}
.bk-price--lg { font-size: var(--fs-2xl); }

/* ======================================================================
   Hero
   ====================================================================== */

.bk-hero { padding-block: var(--sp-10) var(--sp-9); }
.bk-hero-inner {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--sp-9);
  align-items: center;
}
.bk-hero h1 {
  font-size: var(--fs-4xl);
  color: var(--text-invert);
  margin-bottom: var(--sp-5);
  text-wrap: balance;
}
.bk-hero-lede {
  font-size: var(--fs-lg);
  color: var(--text-invert-muted);
  line-height: var(--lh-loose);
  max-width: 46ch;
}
.bk-hero-actions { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-6); }

.bk-hero-feature {
  background: var(--leather-soft);
  border: var(--hairline) solid var(--border-invert);
  padding: var(--sp-6);
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: var(--sp-5);
  align-items: start;
}
.bk-hero-feature h3 { color: var(--text-invert); font-size: var(--fs-lg); }
.bk-hero-feature p {
  color: var(--text-invert-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
@media (max-width: 980px) {
  .bk-hero-inner { grid-template-columns: 1fr; gap: var(--sp-7); }
}

/* ======================================================================
   Trust strip
   ====================================================================== */

.bk-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  border-block: var(--hairline) solid var(--border);
  padding-block: var(--sp-5);
}
.bk-trust-item { display: flex; gap: var(--sp-3); align-items: flex-start; }
.bk-trust-item svg { color: var(--accent); flex: none; margin-top: var(--sp-1); }
.bk-trust-title {
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
.bk-trust-note { font-size: var(--fs-sm); color: var(--text-faint); line-height: var(--lh-normal); }
@media (max-width: 900px) { .bk-trust { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bk-trust { grid-template-columns: 1fr; } }

/* ======================================================================
   Case card: the attribution work, published
   ====================================================================== */

.bk-case {
  border: var(--hairline) solid var(--border);
  background: var(--bg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.bk-case:hover { border-color: var(--accent-rule); box-shadow: var(--shadow-card); }
/* on a leather ground the card keeps its shape but changes its cloth */
.bk-invert .bk-case {
  background: var(--leather-soft);
  border-color: var(--border-invert);
}
.bk-invert .bk-case:hover { border-color: var(--accent-on-dark); box-shadow: none; }
.bk-invert .bk-case h3 { color: var(--text-invert); }
.bk-invert .bk-case p { color: var(--text-invert-muted); }
.bk-invert .bk-case-foot { color: var(--accent-on-dark); }

.bk-case-status {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--success);
}
.bk-case-status--open { color: var(--wine); }
.bk-invert .bk-case-status { color: var(--sage); }
.bk-invert .bk-case-status--open { color: var(--accent-on-dark); }
.bk-case h3 { margin: 0; }
.bk-case p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.bk-case-foot {
  margin-top: auto;
  padding-top: var(--sp-4);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  color: var(--accent);
}

/* ======================================================================
   Collection tile
   ====================================================================== */

.bk-tile {
  position: relative;
  border: var(--hairline) solid var(--border);
  background: var(--bg-panel);
  padding: var(--sp-6);
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.bk-tile:hover { border-color: var(--accent-rule); background: var(--bg); }
.bk-tile h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-1); }
.bk-tile span { font-size: var(--fs-sm); color: var(--text-faint); }

/* ======================================================================
   Video card
   ====================================================================== */

.bk-video { display: block; }
.bk-video-frame {
  aspect-ratio: 16 / 9;
  background: var(--leather-soft);
  border: var(--hairline) solid var(--border-invert);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.bk-video-frame img { width: 100%; height: 100%; object-fit: cover; }
.bk-video-play {
  position: absolute;
  width: 3.25rem; height: 3.25rem;
  border-radius: 50%;
  background: rgba(28, 38, 32, 0.78);
  border: var(--hairline) solid var(--gilt-bright);
  display: grid;
  place-items: center;
  color: var(--gilt-bright);
}
.bk-video h3 { font-size: var(--fs-base); margin: var(--sp-4) 0 var(--sp-1); }
.bk-video span { font-size: var(--fs-sm); color: var(--text-faint); }

/* ======================================================================
   Biblio table (book detail)
   ====================================================================== */

.bk-biblio { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.bk-biblio th, .bk-biblio td {
  text-align: left;
  padding: var(--sp-3) var(--sp-3);
  border-bottom: var(--hairline) solid var(--border);
  vertical-align: top;
}
.bk-biblio th {
  width: 12rem;
  font-weight: 400;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  font-size: var(--fs-xs);
  color: var(--text-faint);
}

/* ======================================================================
   Footer
   ====================================================================== */

.bk-footer { padding-block: var(--sp-9) var(--sp-7); }
.bk-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--sp-7);
}
.bk-footer h2 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--accent-on-dark);
  margin-bottom: var(--sp-4);
}
.bk-footer ul { list-style: none; margin: 0; padding: 0; }
.bk-footer li { margin-bottom: var(--sp-3); }
.bk-footer a, .bk-footer p { color: var(--text-invert-muted); font-size: var(--fs-sm); }
.bk-footer-legal {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: var(--hairline) solid var(--border-invert);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--text-invert-muted);
}
@media (max-width: 900px) { .bk-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .bk-footer-grid { grid-template-columns: 1fr; } }

/* Storefront-only additions: listings, forms, detail layout, pagination.
   Tokens only, same rules as components.css. */

.bk-skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: var(--sp-3) var(--sp-4);
  z-index: var(--z-toast);
}
.bk-skip:focus { left: var(--sp-4); top: var(--sp-2); }

:where(a, button, input, select, textarea):focus-visible {
  outline: var(--rule-gilt) solid var(--accent);
  outline-offset: 2px;
}

.bk-panel { background: var(--bg-panel); }
.bk-lede { font-size: var(--fs-lg); color: var(--text-muted); }
.bk-lede-invert { color: var(--text-invert-muted); line-height: var(--lh-loose); }
.bk-price--gilt { color: var(--accent-on-dark); }

/* Listing bar ----------------------------------------------------------- */

.bk-listing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  border-bottom: var(--hairline) solid var(--border);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.bk-listing-count {
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.bk-sortbar { margin: 0; display: flex; gap: var(--sp-3); align-items: center; }

.bk-empty {
  border: var(--hairline) solid var(--border);
  background: var(--bg-panel);
  padding: var(--sp-6);
  color: var(--text-muted);
  max-width: var(--measure);
}

/* Pagination ------------------------------------------------------------ */

.bk-pagination {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--sp-8);
  font-variant-numeric: tabular-nums;
}
.bk-page-link {
  display: inline-block;
  min-width: 2.4rem;
  text-align: center;
  padding: var(--sp-2) var(--sp-3);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.bk-page-link:hover { border-color: var(--accent); color: var(--accent); }
.bk-page-link--current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.bk-page-gap { color: var(--text-faint); padding-inline: var(--sp-1); }

/* Breadcrumbs ----------------------------------------------------------- */

.bk-crumbs {
  font-size: var(--fs-sm);
  color: var(--text-faint);
  padding-block: var(--sp-5) 0;
}
.bk-crumbs a:hover { color: var(--accent); }

/* Book detail ----------------------------------------------------------- */

.bk-detail {
  display: grid;
  grid-template-columns: 22rem 1fr;
  gap: var(--sp-9);
  align-items: start;
}
.bk-detail-buy {
  position: sticky;
  top: 7rem;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.bk-detail-actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.bk-detail-imprint {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}
.bk-scan {
  border: var(--hairline) solid var(--border);
  background: var(--bg-panel);
  padding: var(--sp-5);
}
.bk-scan h3 { font-size: var(--fs-base); margin-bottom: var(--sp-2); }
.bk-scan p { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-3); }
.bk-note {
  border-left: var(--rule-gilt) solid var(--accent-rule);
  padding: var(--sp-3) var(--sp-5);
  margin: var(--sp-6) 0;
  background: var(--bg-panel);
}
.bk-note p { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.bk-enquire { margin-top: var(--sp-9); }

@media (max-width: 900px) {
  .bk-detail { grid-template-columns: 1fr; }
  .bk-detail-buy { position: static; }
}

/* Author index ---------------------------------------------------------- */

.bk-author-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3;
  column-gap: var(--sp-7);
}
.bk-author-list li {
  break-inside: avoid;
  padding-block: var(--sp-2);
  border-bottom: var(--hairline) solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
}
.bk-author-list span { color: var(--text-faint); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .bk-author-list { columns: 2; } }
@media (max-width: 560px) { .bk-author-list { columns: 1; } }

.bk-tile--sm { min-height: 0; padding: var(--sp-4) var(--sp-5); }
.bk-tile--sm h3 { font-size: var(--fs-base); }

/* Forms ----------------------------------------------------------------- */

.bk-form {
  border: var(--hairline) solid var(--border);
  background: var(--bg-panel);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 34rem;
}
.bk-form h3 { margin: 0; }
.bk-form-note { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
.bk-form-hp { position: absolute; left: -9999px; }
.bk-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.bk-field > span {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-faint);
}
.bk-field--inline { flex-direction: row; align-items: center; gap: var(--sp-3); }
.bk-field input,
.bk-field textarea,
.bk-field select {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
}
.bk-field textarea { resize: vertical; }
.bk-form .bk-btn { align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Model withdrawal form: quoted statutory text, set apart from our own prose */
.bk-form-model {
  border: var(--hairline) solid var(--border);
  background: var(--bg-panel);
  padding: var(--sp-5);
  font-size: var(--fs-sm);
  line-height: var(--lh-loose);
  max-width: var(--measure);
}
.bk-prose table.bk-biblio { margin-bottom: var(--sp-6); }

/* Basket, cart and checkout ---------------------------------------------- */

.bk-basket {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex: none;
}
.bk-basket:hover { color: var(--accent); }

.bk-lines { width: 100%; border-collapse: collapse; }
.bk-lines td {
  padding: var(--sp-4) var(--sp-3);
  border-bottom: var(--hairline) solid var(--border);
  vertical-align: top;
}
.bk-line-plate { width: 5.5rem; }
.bk-line-plate .bk-plate { width: 4.5rem; }
.bk-line-title { font-family: var(--font-display); font-size: var(--fs-lg); }
.bk-line-title:hover { color: var(--accent); }
.bk-line-price { text-align: right; font-family: var(--font-display); white-space: nowrap; }
.bk-line-remove { text-align: right; width: 5rem; }
.bk-line-gone { color: var(--danger); font-size: var(--fs-sm); margin-top: var(--sp-2); }

.bk-linkish {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--text-faint);
  text-decoration: underline;
}
.bk-linkish:hover { color: var(--accent); }

.bk-cart-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

.bk-checkout {
  display: grid;
  grid-template-columns: 1fr 20rem;
  gap: var(--sp-8);
  align-items: start;
}
.bk-form--wide { max-width: none; }

/* Shipping-method chooser on the checkout form */
.bk-ship-options { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.bk-ship-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: var(--hairline) solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
}
.bk-ship-option:has(input:checked) { border-color: var(--accent); background: var(--bg-panel); }
.bk-ship-option input { accent-color: var(--accent); flex: none; }
.bk-ship-desc { flex: 1; }
.bk-ship-price { font-weight: 600; white-space: nowrap; color: var(--text); }
.bk-ship-price:empty::before { content: ''; }
.bk-summary {
  border: var(--hairline) solid var(--border);
  background: var(--bg-panel);
  padding: var(--sp-5);
  position: sticky;
  top: 7rem;
}
.bk-summary h3 { font-size: var(--fs-base); margin-bottom: var(--sp-4); }
.bk-summary-line {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  padding-block: var(--sp-2);
  border-bottom: var(--hairline) solid var(--border);
}
.bk-summary-line--total { font-weight: 600; border-bottom: 0; }

.bk-alert {
  border-left: var(--rule-gilt) solid var(--danger);
  background: var(--bg-panel);
  color: var(--text);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  max-width: var(--measure);
}

@media (max-width: 900px) {
  .bk-checkout { grid-template-columns: 1fr; }
  .bk-summary { position: static; }
  .bk-line-plate { display: none; }
}
