/* books.css - /books shop (website/book_shop.py). Tokens from styles.css; the hero is a
 * night-navy band in both themes (the colour of the book covers). */

:root {
  --bk-night: #0F1626;
  --bk-night-2: #1B2540;
  --bk-on-night: #EEF1F8;
  --bk-on-night-dim: #AEB6CC;
  --bk-gold: #E8B04A;
  --bk-gold-ink: #2a1606;
  --bk-card: var(--white);
  --bk-shadow: 0 1px 2px rgba(26, 26, 46, .06), 0 10px 30px rgba(46, 27, 74, .10);
  --bk-shadow-lift: 0 18px 44px rgba(46, 27, 74, .20);
  --bk-sale: #C2410C;
  --bk-ok: #15803D;
}
html[data-theme="dark"] {
  --bk-night: #121826;
  --bk-night-2: #1d263a;
  --bk-card: #293043;
  --bk-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .28);
  --bk-shadow-lift: 0 18px 44px rgba(0, 0, 0, .45);
  --bk-sale: #FB923C;
  --bk-ok: #4ADE80;
}

.bk-h2 { font: 800 clamp(1.5rem, 3vw, 2.1rem)/1.15 "Playfair Display", Georgia, serif; color: var(--purple);
  margin: 0 0 .5rem; text-wrap: balance; }
.bk-h3 { font: 800 1.05rem/1.2 "Archivo", sans-serif; color: var(--ink); margin: 0 0 .6rem; }
.bk-sec-head { max-width: 720px; margin-bottom: 1.4rem; }
.bk-sec-head p { color: var(--grey); line-height: 1.6; margin: 0; }
.bk-sec-head a, .bk-prose a { color: var(--purple-bright); }

/* buttons */
.bk-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 0;
  cursor: pointer; border-radius: 11px; padding: .62rem 1.05rem; background: var(--accent); color: var(--on-accent);
  font: 700 .9rem/1.1 "Hanken Grotesk", sans-serif; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s; }
.bk-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(46, 27, 74, .2); }
.bk-btn:focus-visible, .bk-link:focus-visible, .bk-thumb:focus-visible, .bk-stage:focus-visible,
.bk-page-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.bk-btn-sm { padding: .45rem .8rem; font-size: .82rem; border-radius: 9px; }
.bk-btn-lg { padding: .85rem 1.4rem; font-size: 1rem; border-radius: 13px; }
.bk-btn-gold { background: var(--bk-gold); color: var(--bk-gold-ink); }
.bk-btn-ghost { background: transparent; color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--line); }
.bk-btn.is-added { background: var(--bk-ok); color: #fff; }
.bk-link { background: none; border: 0; padding: 0; color: var(--purple-bright); font: inherit; font-weight: 700;
  text-decoration: underline; cursor: pointer; }

/* ── hero ─────────────────────────────────────────────────────────── */
.bk-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 2rem; align-items: center; overflow: hidden; border-radius: 28px; padding: clamp(1.6rem, 4vw, 3.2rem);
  margin: .2rem 0 2.6rem; color: var(--bk-on-night);
  background: radial-gradient(900px 420px at 85% 20%, rgba(232, 176, 74, .18), transparent 60%),
              radial-gradient(700px 400px at 0% 100%, rgba(107, 63, 160, .35), transparent 60%),
              linear-gradient(135deg, var(--bk-night), var(--bk-night-2)); }
.bk-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.2px); background-size: 46px 46px;
  mask-image: linear-gradient(90deg, transparent, #000 70%); }
.bk-hero-text { position: relative; z-index: 1; }
.bk-hero-eyebrow { display: inline-block; margin: 0 0 1rem; padding: .35rem .75rem; border-radius: 999px;
  font: 700 .7rem/1 "Hanken Grotesk", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bk-gold); background: rgba(232, 176, 74, .12); box-shadow: inset 0 0 0 1px rgba(232, 176, 74, .35); }
.bk-hero h1 { font: 800 clamp(2rem, 4.6vw, 3.3rem)/1.06 "Playfair Display", Georgia, serif; margin: 0 0 1rem;
  color: #fff; letter-spacing: -.01em; text-wrap: balance; }
.bk-hero-lede { color: var(--bk-on-night-dim); font-size: 1.06rem; line-height: 1.65; max-width: 58ch; margin: 0; }
.bk-hero-stats { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0 0; }
.bk-hero-stats div { padding: .6rem .95rem; border-radius: 14px; background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); min-width: 100px; }
.bk-hero-stats dt { font: 700 .62rem/1 "Hanken Grotesk", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--bk-on-night-dim); margin-bottom: .35rem; }
.bk-hero-stats dd { margin: 0; font: 800 1.35rem/1.1 "Archivo", sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.bk-hero .bk-levelnav { margin: 1.4rem 0 0; }
.bk-hero .bk-levelnav a { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.bk-hero .bk-levelnav a:hover { background: var(--bk-gold); color: var(--bk-gold-ink); }
.bk-fx { margin-top: 1rem; }
.bk-hero .bk-fx, .bk-hero .bk-fx * { color: var(--bk-on-night-dim); }
.bk-hero .bk-fx select { background: var(--bk-night-2); color: #fff; border-color: rgba(255, 255, 255, .2); }

/* fanned covers */
.bk-fan { position: relative; z-index: 1; height: clamp(300px, 34vw, 430px); perspective: 1400px; }
.bk-fan-item { position: absolute; top: 50%; left: 50%; width: clamp(150px, 15vw, 210px); border-radius: 6px 10px 10px 6px;
  overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);
  transform-origin: 50% 120%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.bk-fan-item img { display: block; width: 100%; height: auto; }
.bk-fan-item::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .08) 60%, transparent); }
.bk-fan-item.i0 { transform: translate(-50%, -50%) translateX(-58%) rotate(-14deg) scale(.88); z-index: 1; }
.bk-fan-item.i1 { transform: translate(-50%, -50%) translateX(-30%) rotate(-7deg) scale(.94); z-index: 2; }
.bk-fan-item.i2 { transform: translate(-50%, -50%) rotate(0) scale(1); z-index: 5; }
.bk-fan-item.i3 { transform: translate(-50%, -50%) translateX(30%) rotate(7deg) scale(.94); z-index: 2; }
.bk-fan-item.i4 { transform: translate(-50%, -50%) translateX(58%) rotate(14deg) scale(.88); z-index: 1; }
.bk-hero:hover .bk-fan-item.i0 { transform: translate(-50%, -50%) translateX(-72%) rotate(-18deg) scale(.88); }
.bk-hero:hover .bk-fan-item.i1 { transform: translate(-50%, -50%) translateX(-38%) rotate(-9deg) scale(.94); }
.bk-hero:hover .bk-fan-item.i3 { transform: translate(-50%, -50%) translateX(38%) rotate(9deg) scale(.94); }
.bk-hero:hover .bk-fan-item.i4 { transform: translate(-50%, -50%) translateX(72%) rotate(18deg) scale(.88); }

.bk-levelnav { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1.6rem; }
.bk-levelnav a { padding: .45rem 1rem; border-radius: 999px; text-decoration: none; background: var(--bk-card);
  color: var(--ink); font: 700 .85rem/1.2 "Hanken Grotesk", sans-serif; box-shadow: inset 0 0 0 1px var(--line);
  transition: background .15s, color .15s; }
.bk-levelnav a:hover { background: var(--accent); color: var(--on-accent); }

/* ── level + subject shelves ──────────────────────────────────────── */
.bk-level { margin: 0 0 3rem; scroll-margin-top: 80px; }
.bk-level-head { max-width: 760px; margin-bottom: 1.4rem; }
.bk-level-head p { color: var(--grey); line-height: 1.6; margin: 0 0 .5rem; }
.bk-level-more { font-weight: 700; color: var(--purple-bright); text-decoration: none; }
.bk-level-more:hover { text-decoration: underline; }

.bk-shelf { --tone: var(--lav); --tone-ink: var(--lav-ink); --tone-line: var(--lav-line);
  position: relative; border-radius: 24px; padding: 1.3rem; margin: 0 0 1.4rem; scroll-margin-top: 80px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 60%, transparent), transparent 75%);
  box-shadow: inset 0 0 0 1px var(--tone-line); }
.bk-shelf.cat-tone-green, .bk-product.cat-tone-green, .bk-card.cat-tone-green { --tone: var(--green); --tone-ink: var(--green-ink); --tone-line: var(--green-line); }
.bk-shelf.cat-tone-orange, .bk-product.cat-tone-orange, .bk-card.cat-tone-orange { --tone: var(--orange); --tone-ink: var(--orange-ink); --tone-line: var(--orange-line); }
.bk-shelf.cat-tone-pink, .bk-product.cat-tone-pink, .bk-card.cat-tone-pink { --tone: var(--pink); --tone-ink: var(--pink-ink); --tone-line: var(--pink-line); }
.bk-shelf.cat-tone-teal, .bk-product.cat-tone-teal, .bk-card.cat-tone-teal { --tone: var(--teal); --tone-ink: var(--teal-ink); --tone-line: var(--teal-line); }
.bk-shelf.cat-tone-yellow, .bk-product.cat-tone-yellow, .bk-card.cat-tone-yellow { --tone: var(--yellow); --tone-ink: var(--yellow-ink); --tone-line: var(--yellow-line); }
.bk-shelf.cat-tone-blue, .bk-product.cat-tone-blue, .bk-card.cat-tone-blue { --tone: var(--blue); --tone-ink: var(--blue-ink); --tone-line: var(--blue-line); }
.bk-shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.bk-shelves .bk-shelf { margin: 0; }
.bk-shelf { display: grid; gap: 1.1rem; align-content: start; }
.bk-shelf-head { display: grid; gap: .55rem; align-content: start; }
.bk-shelf-wide { grid-column: 1 / -1; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.bk-shelf-wide .bk-shelf-head { position: sticky; top: 76px; }
.bk-shelf-code { margin: 0 0 .2rem; font: 800 .78rem/1 "Archivo", sans-serif; letter-spacing: .1em; color: var(--tone-ink); }
.bk-shelf-head h3 { margin: 0; font: 800 1.45rem/1.15 "Archivo", sans-serif; color: var(--ink); }
.bk-shelf-copy { margin: 0; color: var(--grey); font-size: .88rem; line-height: 1.6; }
.bk-shelf-stat { margin: 0; font-size: .8rem; font-weight: 700; color: var(--tone-ink); }
.bk-shelf-deal { margin: .2rem 0 0; padding: .6rem .75rem; border-radius: 12px; font-size: .85rem; line-height: 1.5;
  color: var(--ink); background: var(--bk-card); box-shadow: inset 0 0 0 1px var(--tone-line); }
.bk-shelf-deal .bk-link { display: block; margin-top: .2rem; }
.bk-shelf .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-shelf-wide .bk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .bk-shelf-wide .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bk-shelf-deal s { color: var(--grey); font-size: .82rem; }

.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.bk-card { display: flex; flex-direction: column; background: var(--bk-card); border-radius: 18px; overflow: hidden;
  box-shadow: var(--bk-shadow); transition: transform .2s ease, box-shadow .2s ease; }
.bk-card:hover { transform: translateY(-4px); box-shadow: var(--bk-shadow-lift); }
.bk-card-cover { position: relative; display: block; padding: 1rem 1.2rem .4rem; text-decoration: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone, var(--lav)) 70%, transparent), transparent); }
.bk-cover-img { display: block; width: 100%; height: auto; border-radius: 4px 8px 8px 4px;
  box-shadow: 0 14px 26px rgba(15, 22, 38, .3), 0 0 0 1px rgba(0, 0, 0, .05); transition: transform .3s ease; }
.bk-card:hover .bk-cover-img { transform: rotate(-1.5deg) scale(1.02); }
.bk-card-peek { position: absolute; left: 50%; bottom: 1rem; transform: translate(-50%, 6px); opacity: 0;
  padding: .35rem .7rem; border-radius: 999px; background: rgba(15, 22, 38, .85); color: #fff; font-size: .75rem;
  font-weight: 700; white-space: nowrap; transition: opacity .2s, transform .2s; }
.bk-card:hover .bk-card-peek, .bk-card-cover:focus-visible .bk-card-peek { opacity: 1; transform: translate(-50%, 0); }
.bk-card-body { display: flex; flex-direction: column; gap: .3rem; padding: .7rem 1rem 1rem; flex: 1; }
.bk-card-paper { margin: 0; font: 700 .7rem/1.2 "Hanken Grotesk", sans-serif; letter-spacing: .06em;
  text-transform: uppercase; color: var(--tone-ink, var(--lav-ink)); }
.bk-card h4 { margin: 0; font: 800 1rem/1.25 "Archivo", sans-serif; }
.bk-card h4 a { color: var(--ink); text-decoration: none; }
.bk-card h4 a:hover { color: var(--purple-bright); }
.bk-card-meta { margin: 0; font-size: .78rem; color: var(--grey); }
.bk-card-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.bk-ed-tag { font-size: .7rem; font-weight: 700; padding: .18rem .5rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--purple); }
.bk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .5rem; flex-wrap: wrap; }
.bk-price { font: 600 .8rem/1.2 "Hanken Grotesk", sans-serif; color: var(--grey); }
.bk-price b { font: 800 1.15rem/1 "Archivo", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.bk-price small { font-size: .72rem; }
.bk-price s { color: var(--grey); margin-right: .2rem; }

/* ── bundles ──────────────────────────────────────────────────────── */
.bk-offers { margin: 3rem 0; scroll-margin-top: 80px; }
.bk-offer-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.bk-offer { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.2rem; border-radius: 18px; }
.bk-offer b { font: 900 1.7rem/1 "Archivo", sans-serif; white-space: nowrap; }
.bk-offer span { font-size: .88rem; line-height: 1.45; }
.bk-offer.o1 { background: var(--lav); color: var(--lav-ink); }
.bk-offer.o2 { background: var(--orange); color: var(--orange-ink); }
.bk-offer.o3 { background: var(--green); color: var(--green-ink); }
.bk-bundles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1100px) { .bk-bundles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bk-bundle { display: grid; grid-template-columns: 128px 1fr; gap: 1rem; align-items: center; padding: 1rem 1.1rem;
  background: var(--bk-card); border-radius: 18px; box-shadow: var(--bk-shadow); position: relative; overflow: hidden; }
.bk-bundle::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--bk-gold); }
.bk-bundle-stack { position: relative; height: 150px; }
.bk-bundle-stack img { position: absolute; top: 8px; width: 82px; height: auto; border-radius: 3px 6px 6px 3px;
  box-shadow: 0 8px 18px rgba(15, 22, 38, .3); }
.bk-bundle-stack img:nth-child(1) { left: 0; transform: rotate(-6deg); z-index: 3; }
.bk-bundle-stack img:nth-child(2) { left: 30px; transform: rotate(4deg); z-index: 2; }
.bk-bundle-stack img:nth-child(3) { left: 14px; top: 2px; transform: rotate(-1deg); z-index: 1; opacity: .9; }
.bk-bundle-stack img:nth-child(4) { left: 44px; top: 2px; transform: rotate(9deg); z-index: 0; opacity: .85; }
.bk-bundle-tag { margin: 0 0 .25rem; font: 800 .68rem/1.2 "Hanken Grotesk", sans-serif; letter-spacing: .08em;
  text-transform: uppercase; color: var(--bk-sale); }
.bk-bundle h4 { margin: 0 0 .2rem; font: 800 1.02rem/1.25 "Archivo", sans-serif; color: var(--ink); }
.bk-bundle-papers { margin: 0 0 .6rem; font-size: .8rem; color: var(--grey); }
.bk-bundle-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.bk-bundle-sm { grid-template-columns: 96px 1fr; padding: .8rem .9rem; box-shadow: inset 0 0 0 1px var(--line); }
.bk-bundle-sm .bk-bundle-stack { height: 112px; }
.bk-bundle-sm .bk-bundle-stack img { width: 62px; }
.bk-bundle-sm .bk-bundle-stack img:nth-child(2) { left: 24px; }

/* ── inside the book ──────────────────────────────────────────────── */
.bk-inside { margin: 3rem 0; }
.bk-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.bk-page { margin: 0; }
.bk-page-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.bk-page img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff;
  box-shadow: var(--bk-shadow); transition: transform .25s ease, box-shadow .25s; }
.bk-page:nth-child(odd) img { transform: rotate(-1deg); }
.bk-page:nth-child(even) img { transform: rotate(1deg); }
.bk-page-btn:hover img { transform: rotate(0) translateY(-4px); box-shadow: var(--bk-shadow-lift); }
.bk-page figcaption { margin-top: .7rem; font-size: .82rem; color: var(--grey); line-height: 1.45; }
.bk-anatomy { list-style: none; counter-reset: an; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem; margin: 1.4rem 0 0; padding: 0; }
.bk-anatomy li { counter-increment: an; display: grid; gap: .25rem; padding: 1rem; border-radius: 16px;
  background: var(--bk-card); box-shadow: inset 0 0 0 1px var(--line); }
.bk-anatomy li::before { content: counter(an); width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 800 .85rem/1 "Archivo", sans-serif; }
.bk-anatomy b { color: var(--ink); }
.bk-anatomy span { font-size: .86rem; color: var(--grey); line-height: 1.5; }

/* ── editions ─────────────────────────────────────────────────────── */
.bk-editions { margin: 3rem 0; }
.bk-ed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.bk-ed { position: relative; padding: 1.5rem; border-radius: 22px; background: var(--bk-card); box-shadow: var(--bk-shadow); }
.bk-ed-recent { box-shadow: var(--bk-shadow), inset 0 0 0 2px var(--purple-bright); }
.bk-ed-badge { position: absolute; top: 1.2rem; right: 1.2rem; margin: 0; padding: .25rem .6rem; border-radius: 999px;
  font-size: .7rem; font-weight: 800; background: var(--accent-soft); color: var(--purple); }
.bk-ed h3 { margin: 0; font: 800 1.35rem/1.2 "Archivo", sans-serif; color: var(--ink); }
.bk-ed-years { margin: .2rem 0 .7rem; font: 700 .95rem/1 "Playfair Display", serif; font-style: italic; color: var(--gold); }
.bk-ed p { color: var(--grey); line-height: 1.6; }
.bk-ed ul { margin: .8rem 0; padding-left: 1.1rem; color: var(--ink); font-size: .9rem; line-height: 1.8; }
.bk-ed-price { margin: 0; color: var(--ink) !important; }
.bk-ed-price b { font: 800 1.2rem/1 "Archivo", sans-serif; }

/* prose */
.bk-prose { margin: 3rem 0; max-width: 820px; }
.bk-prose p, .bk-prose li { color: var(--ink); line-height: 1.75; }
.bk-prose p { margin: 0 0 1rem; }
.bk-prose h3 { font: 800 1.1rem/1.3 "Archivo", sans-serif; color: var(--ink); margin: 1.4rem 0 .5rem; }
.bk-prose-2 { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4rem; }
.bk-plain { padding-left: 1.2rem; margin: 0 0 1rem; }

/* ── product page ─────────────────────────────────────────────────── */
.bk-product { --tone: var(--lav); --tone-ink: var(--lav-ink); --tone-line: var(--lav-line);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.4rem, 3vw, 3rem);
  align-items: start; margin: .4rem 0 2rem; }
.bk-gallery { position: sticky; top: 76px; display: grid; gap: .8rem; }
.bk-stage { position: relative; display: block; width: 100%; padding: clamp(1rem, 3vw, 2.2rem); border: 0;
  border-radius: 26px; cursor: zoom-in; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--tone) 85%, #fff), var(--tone));
  box-shadow: inset 0 0 0 1px var(--tone-line); }
.bk-stage img { display: block; width: min(100%, 440px); height: auto; margin: 0 auto; border-radius: 5px 9px 9px 5px;
  box-shadow: 0 24px 50px rgba(15, 22, 38, .35); background: #fff; transition: opacity .2s; }
.bk-stage-cap { position: absolute; left: 1rem; bottom: .9rem; padding: .3rem .7rem; border-radius: 999px;
  background: rgba(15, 22, 38, .78); color: #fff; font-size: .75rem; font-weight: 700; max-width: calc(100% - 9rem);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-stage-zoom { position: absolute; right: 1rem; bottom: .9rem; padding: .3rem .7rem; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: #1A1A2E; font-size: .75rem; font-weight: 700; }
.bk-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem; scrollbar-width: thin; }
.bk-thumb { flex: 0 0 auto; width: 70px; padding: 0; border: 0; border-radius: 6px; cursor: pointer; background: none;
  opacity: .65; transition: opacity .15s, transform .15s; }
.bk-thumb img { display: block; width: 100%; height: auto; border-radius: 5px; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.bk-thumb:hover { opacity: 1; }
.bk-thumb.is-on { opacity: 1; transform: translateY(-2px); }
.bk-thumb.is-on img { box-shadow: 0 0 0 2px var(--purple-bright); }

.bk-buy h1 { font: 800 clamp(1.8rem, 3.6vw, 2.6rem)/1.08 "Playfair Display", Georgia, serif; color: var(--purple);
  margin: 0 0 .4rem; text-wrap: balance; }
.bk-buy h1 span { display: block; font-size: .62em; color: var(--ink); }
.bk-buy-sub { margin: 0 0 .9rem; font-weight: 700; color: var(--tone-ink); }
.bk-buy-lede { color: var(--grey); line-height: 1.65; margin: 0 0 1.2rem; }
.bk-edpicks { border: 0; padding: 0; margin: 0 0 1.1rem; display: grid; gap: .6rem; }
.bk-edpicks legend { font: 800 .72rem/1 "Hanken Grotesk", sans-serif; letter-spacing: .1em; text-transform: uppercase;
  color: var(--grey); margin-bottom: .6rem; }
.bk-edpick { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "r main price" "r meta price";
  gap: .1rem .8rem; align-items: center; padding: .85rem 1rem; border-radius: 16px; cursor: pointer;
  background: var(--bk-card); box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s, background .15s; }
.bk-edpick input { grid-area: r; width: 18px; height: 18px; accent-color: var(--purple-bright); }
.bk-edpick-main { grid-area: main; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.bk-edpick-main b { color: var(--ink); }
.bk-edpick-main small { color: var(--gold); font-weight: 700; }
.bk-edpick-meta { grid-area: meta; font-size: .8rem; color: var(--grey); }
.bk-edpick-price { grid-area: price; font-weight: 600; color: var(--grey); font-size: .85rem; text-align: right; }
.bk-edpick-price b { font: 800 1.1rem/1 "Archivo", sans-serif; color: var(--ink); }
.bk-edpick.is-on { box-shadow: inset 0 0 0 2px var(--purple-bright); background: var(--accent-soft); }
.bk-buy-row { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.bk-buy-price { margin: 0 .6rem 0 0; font: 700 1rem/1 "Hanken Grotesk", sans-serif; color: var(--grey); }
.bk-buy-price b { font: 900 2rem/1 "Archivo", sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.bk-perks { list-style: none; padding: 0; margin: 0 0 .8rem; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .9rem;
  font-size: .86rem; color: var(--ink); }
.bk-fx-sm { margin: 0 0 1rem; font-size: .85rem; }
.bk-buy-bundles { display: grid; gap: .7rem; margin-top: 1.2rem; }

.bk-stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden;
  border-radius: 20px; background: var(--line); margin: 1rem 0 2.6rem; box-shadow: var(--bk-shadow); }
.bk-stats-band div { background: var(--bk-card); padding: 1.1rem; text-align: center; display: grid; gap: .2rem; }
.bk-stats-band b { font: 900 1.6rem/1.1 "Archivo", sans-serif; color: var(--purple); font-variant-numeric: tabular-nums; }
.bk-stats-band span { font-size: .78rem; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: .08em; }

.bk-chapters { margin: 0 0 2.6rem; }
.bk-table-wrap { overflow-x: auto; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); background: var(--bk-card); }
.bk-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.bk-table th, .bk-table td { padding: .6rem 1rem; border-bottom: 1px solid var(--line); text-align: right; }
.bk-table thead th { font: 800 .78rem/1.2 "Hanken Grotesk", sans-serif; color: var(--grey); text-transform: uppercase;
  letter-spacing: .06em; background: color-mix(in srgb, var(--tone) 50%, transparent); }
.bk-table thead th small { display: block; text-transform: none; letter-spacing: 0; color: var(--gold); }
.bk-table th[scope="row"], .bk-table thead th:first-child { text-align: left; font-weight: 600; color: var(--ink); }
.bk-table th[scope="row"] span { display: inline-block; min-width: 1.8rem; font: 800 .8rem/1 "Archivo", sans-serif; color: var(--tone-ink); }
.bk-table td { font-variant-numeric: tabular-nums; color: var(--ink); }
.bk-table tbody tr:last-child > * { border-bottom: 0; }
.bk-table tbody tr:hover { background: color-mix(in srgb, var(--tone) 30%, transparent); }
.bk-related { margin: 2.6rem 0; }

/* ── cart ─────────────────────────────────────────────────────────── */
.bk-cartfab { position: fixed; right: 20px; bottom: 92px; z-index: 900; display: inline-flex; align-items: center;
  gap: .5rem; padding: .7rem 1.05rem; border: 0; border-radius: 999px; cursor: pointer; background: var(--bk-night);
  color: #fff; font: 800 .92rem/1 "Hanken Grotesk", sans-serif; box-shadow: 0 12px 30px rgba(15, 22, 38, .35);
  transition: transform .2s; }
.bk-cartfab:hover { transform: translateY(-2px); }
.bk-cartfab b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .3rem;
  border-radius: 999px; background: var(--bk-gold); color: var(--bk-gold-ink); font-size: .78rem; }
.bk-cartfab.bump { animation: bkbump .45s ease; }
@keyframes bkbump { 40% { transform: scale(1.12); } }

.bk-drawer-bg { position: fixed; inset: 0; z-index: 2147483000; background: rgba(15, 22, 38, .5); opacity: 0;
  transition: opacity .2s; }
.bk-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 2147483001; width: min(460px, 100vw);
  display: flex; flex-direction: column; background: var(--page); color: var(--ink);
  box-shadow: -20px 0 50px rgba(0, 0, 0, .25); transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.bk-drawer.open { transform: none; }
.bk-drawer-bg.open { opacity: 1; }
.bk-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line); }
.bk-drawer-head h2 { margin: 0; font: 800 1.2rem/1.2 "Archivo", sans-serif; }
.bk-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--bk-card); color: var(--ink);
  font-size: 1.2rem; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.bk-drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.bk-drawer-foot { padding: 1rem 1.2rem 1.2rem; border-top: 1px solid var(--line); background: var(--bk-card); }
.bk-line { display: grid; grid-template-columns: 52px 1fr auto; gap: .8rem; align-items: center; padding: .7rem 0;
  border-bottom: 1px solid var(--line); }
.bk-line img { width: 52px; height: auto; border-radius: 3px 5px 5px 3px; box-shadow: 0 4px 10px rgba(15, 22, 38, .25); }
.bk-line-t b { display: block; font-size: .9rem; line-height: 1.3; }
.bk-line-t b a { color: var(--ink); text-decoration: none; }
.bk-line-t span { font-size: .78rem; color: var(--grey); }
.bk-line-r { text-align: right; display: grid; gap: .25rem; justify-items: end; }
.bk-line-r b { font: 800 .95rem/1 "Archivo", sans-serif; }
.bk-line-r button { border: 0; background: none; color: var(--grey); font-size: .75rem; cursor: pointer; text-decoration: underline; }
.bk-save-row { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .7rem; margin-top: .5rem;
  border-radius: 10px; background: var(--green); color: var(--green-ink); font-size: .84rem; font-weight: 700; }
.bk-hint { margin: .9rem 0 0; padding: .7rem .8rem; border-radius: 12px; background: var(--yellow); color: var(--yellow-ink);
  font-size: .84rem; line-height: 1.45; }
.bk-hint button { margin-left: .3rem; }
.bk-sum { display: grid; gap: .35rem; margin-bottom: .9rem; font-size: .9rem; }
.bk-sum div { display: flex; justify-content: space-between; }
.bk-sum .tot { font: 900 1.25rem/1.2 "Archivo", sans-serif; }
.bk-sum .sv { color: var(--bk-ok); font-weight: 700; }
.bk-empty { text-align: center; padding: 2.4rem 1rem; color: var(--grey); }
.bk-empty p:first-child { font-size: 2.4rem; margin: 0; }
.bk-form { display: grid; gap: .7rem; }
.bk-form label { display: grid; gap: .3rem; font-size: .82rem; font-weight: 700; color: var(--ink); }
.bk-form input, .bk-form textarea { width: 100%; max-width: none; padding: .65rem .8rem; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--bk-card); color: var(--ink); font: 500 .95rem/1.3 "Hanken Grotesk", sans-serif; }
.bk-form input:focus, .bk-form textarea:focus { outline: none; border-color: var(--purple-bright); }
.bk-form .bad { border-color: var(--bk-sale); }
.bk-err { margin: 0; color: var(--bk-sale); font-size: .84rem; font-weight: 700; }
.bk-methods { display: flex; flex-wrap: wrap; gap: .4rem; }
.bk-methods button { padding: .45rem .8rem; border-radius: 999px; border: 0; cursor: pointer; background: var(--bk-card);
  color: var(--ink); font: 700 .82rem/1.2 "Hanken Grotesk", sans-serif; box-shadow: inset 0 0 0 1.5px var(--line); }
.bk-methods button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.bk-paytable { width: 100%; border-collapse: collapse; margin: .7rem 0; font-size: .9rem; background: var(--bk-card);
  border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bk-paytable th, .bk-paytable td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--line); }
.bk-paytable th { color: var(--grey); font-weight: 600; width: 38%; }
.bk-paytable td { font-weight: 700; word-break: break-all; }
.bk-paytable tr:last-child > * { border-bottom: 0; }
.bk-done-ref { display: inline-block; padding: .25rem .6rem; border-radius: 8px; background: var(--accent-soft);
  color: var(--purple); font: 800 .9rem/1.2 "Archivo", sans-serif; }
.bk-wa { width: 100%; margin-top: .6rem; background: #1FA855; color: #fff; }
.bk-steps-mini { margin: .5rem 0 0; padding-left: 1.2rem; font-size: .88rem; line-height: 1.7; }

/* lightbox */
.bk-lb { position: fixed; inset: 0; z-index: 2147483002; display: grid; grid-template-rows: auto 1fr auto; place-items: center;
  background: rgba(10, 14, 24, .92); padding: 1rem; }
.bk-lb img { max-width: min(100%, 900px); max-height: calc(100vh - 8rem); width: auto; height: auto; border-radius: 6px;
  background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.bk-lb p { color: #fff; margin: .8rem 0 0; font-weight: 600; text-align: center; }
.bk-lb .bk-x { justify-self: end; background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.bk-lb-nav { display: flex; gap: .6rem; }
.bk-lb-nav button { padding: .5rem .9rem; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .14);
  color: #fff; font-weight: 700; cursor: pointer; }

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .bk-shelves { grid-template-columns: 1fr; }
  .bk-shelf-wide { grid-template-columns: 1fr; gap: 1rem; }
  .bk-shelf-wide .bk-shelf-head { position: static; }
  .bk-hero { grid-template-columns: 1fr; }
  .bk-fan { height: 280px; order: -1; }
  .bk-fan-item { width: 140px; }
  .bk-product { grid-template-columns: 1fr; }
  .bk-gallery { position: static; }
  .bk-pages, .bk-anatomy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-prose-2 { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .bk-hero { border-radius: 20px; padding: 1.3rem 1.1rem; }
  .bk-fan { height: 220px; }
  .bk-fan-item { width: 112px; }
  .bk-shelf { padding: 1rem .8rem; border-radius: 18px; }
  .bk-shelf .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .bk-card-cover { padding: .7rem .8rem .3rem; }
  .bk-card-body { padding: .6rem .7rem .8rem; }
  .bk-card-foot .bk-btn { width: 100%; }
  .bk-ed-grid { grid-template-columns: 1fr; }
  .bk-bundles { grid-template-columns: 1fr; }
  .bk-bundle { grid-template-columns: 96px 1fr; }
  .bk-bundle-stack img { width: 62px; }
  .bk-bundle-stack { height: 112px; }
  .bk-perks { grid-template-columns: 1fr; }
  .bk-stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-buy-row .bk-btn-lg { flex: 1 1 140px; }
  .bk-cartfab { right: 12px; bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-fan-item, .bk-card, .bk-cover-img, .bk-drawer, .bk-page img { transition: none !important; }
}
