/* Hallmark · macrostructure: design.md-managed (Binder: masthead + shelf/front page · binder spread replaces the uniform grid on set pages)
 * genre: modern-minimal · theme: tcg-vault design.md (bone paper, ink, one signal green, Archivo wdth axis + Martian Mono numerals)
 * tone: utilitarian-tactile · anchor hue: green 155 (price up only)
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R5 V4
 * New token needing a design.md amendment: --dur-turn (600ms page turn). Spine fill stays ink (W9).
 */

/* ─── tokens (mirror resources/css/app.css :root) ─── */
:root {
  --bone: #f2efe6;
  --bone-2: #e9e5d8;
  --bone-3: #ded9c9;
  --paper: #fbf9f3;
  --ink: #141412;
  --ink-2: #23231f;
  --muted: #6d6c62;
  --flat: #9a988c;
  --hair: rgba(20, 20, 18, 0.14);
  --hair-strong: rgba(20, 20, 18, 0.26);
  --signal: #37d17f;
  --signal-deep: #12a45f;
  --rarity-silver: #9aa0a6;
  --chrome-bg: #141412;
  --chrome-fg: #f2efe6;
  --chrome-muted: #9a988c;
  --leaf-shade: rgba(20, 20, 18, 0.30);
  --holo: linear-gradient(120deg, #ff6b6b, #ffd166, #6bdc8f, #4fb8e8, #b389f0, #ff6b6b);
  --sweep: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);

  --font-display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Martian Mono", "SFMono-Regular", ui-monospace, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 90ms;
  --dur-base: 200ms;
  --dur-slow: 700ms;
  --dur-turn: 600ms;

  --radius-card: 7px;
  --radius-pill: 999px;
  --radius-pocket: 4px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --gutter: 32px;

  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bone: #141412; --bone-2: #1b1b18; --bone-3: #242420; --paper: #292925;
    --ink: #f2efe6; --muted: #a3a194; --flat: #b0ada0;
    --hair: rgba(242, 239, 230, 0.14); --hair-strong: rgba(242, 239, 230, 0.28);
    --signal-deep: #4ee496; --leaf-shade: rgba(0, 0, 0, 0.55);
    --sweep: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bone: #141412; --bone-2: #1b1b18; --bone-3: #242420; --paper: #292925;
  --ink: #f2efe6; --muted: #a3a194; --flat: #b0ada0;
  --hair: rgba(242, 239, 230, 0.14); --hair-strong: rgba(242, 239, 230, 0.28);
  --signal-deep: #4ee496; --leaf-shade: rgba(0, 0, 0, 0.55);
  --sweep: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  color-scheme: dark;
}

/* ─── base ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-variation-settings: 'wdth' 100;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono {
  font-family: var(--font-mono);
  font-variation-settings: 'wdth' 87.5, 'wght' 600;
  letter-spacing: -0.04em;
  font-feature-settings: 'tnum';
}
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
main { flex: 1; }

/* ─── topbar (frozen chrome) ─── */
.topbar { background: var(--chrome-bg); color: var(--chrome-fg); }
.topbar .wrap { display: flex; align-items: center; gap: var(--space-5); min-height: 52px; }
.brand {
  font-variation-settings: 'wdth' 66, 'wght' 800;
  text-transform: uppercase; letter-spacing: .01em; font-size: 17px;
  text-decoration: none; color: var(--chrome-fg); white-space: nowrap;
}
.brand b { color: var(--signal); font-weight: inherit; }
.nav { display: flex; gap: var(--space-5); margin-right: auto; }
.nav a, .nav span {
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--chrome-fg); padding-block: 15px 13px; border-bottom: 2px solid transparent;
}
.nav a:hover { opacity: .75; }
.nav a.is-active { border-bottom-color: var(--signal); }
.nav span { color: var(--chrome-muted); }
.theme-btn {
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--chrome-fg);
  border-radius: var(--radius-pill); cursor: pointer; display: grid; place-items: center;
}
.theme-btn:hover { background: var(--ink-2); }
.theme-btn svg { width: 18px; height: 18px; }

/* ─── masthead ─── */
.masthead { padding-block: var(--space-6) var(--space-6); }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 var(--space-4); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; border-bottom: 1px solid var(--hair-strong); }
.crumbs a:hover { color: var(--ink); }
.h1 {
  margin: 0;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 62, 'wght' 900;
  text-transform: uppercase;
  font-size: clamp(64px, 11vw, 156px);
  line-height: .84;
  letter-spacing: .002em;
  overflow-wrap: anywhere; min-width: 0;
}
.h1.set { font-size: clamp(56px, 9vw, 128px); }
.lede { max-width: 44ch; margin: var(--space-4) 0 0; font-size: 18px; line-height: 1.45; }
.lede .mono { font-size: .86em; }
.source { margin: var(--space-2) 0 0; font-size: 13px; color: var(--muted); }

.mast-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }
.mast-row > div:first-child { min-width: 0; }

/* segmented pill control (toolbar voice) */
.seg { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: var(--radius-pill); padding: 3px; gap: 2px; background: var(--paper); }
.seg button {
  border: 0; background: transparent; border-radius: var(--radius-pill);
  padding: 8px 16px; min-height: 36px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bone); }
.seg button:not([aria-pressed="true"]):hover { background: var(--bone-2); }

/* ─── section heads ─── */
.h2 {
  margin: 0;
  font-variation-settings: 'wdth' 66, 'wght' 800;
  text-transform: uppercase; font-size: 26px; line-height: 1; letter-spacing: .008em;
}
.sub { margin: var(--space-2) 0 0; color: var(--muted); font-size: 14px; max-width: 52ch; }

/* ─── the page (bone paper, raised) + pockets ─── */
.page {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: var(--pad, 18px);
  display: flex; flex-direction: column;
}
.pockets {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--pgap, 12px) var(--pgap, 12px);
}
.pk { min-width: 0; position: relative; }
.sleeve {
  position: relative; display: block; width: 100%;
  aspect-ratio: 63 / 88;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--radius-pocket);
}
/* stacked-sleeve edges for duplicates: x2 = one edge, x3+ = two */
.sleeve[data-q]::before, .sleeve[data-q]::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-pocket);
  border: 1px solid var(--hair-strong); background: var(--bone-2);
}
.sleeve[data-q]::before { transform: translate(3px, 3px); }
.sleeve[data-q="3"]::after { transform: translate(6px, 6px); z-index: -1; }
.sleeve[data-q="3"]::before { z-index: 0; }
.sleeve .card {
  position: relative; z-index: 1; display: block; width: 100%; height: 100%;
  border-radius: var(--radius-pocket); overflow: hidden;
  background: var(--bone-3);
  box-shadow: 0 0 0 1px var(--hair-strong);
  transition: transform var(--dur-base) var(--ease);
}
.sleeve .card img { width: 100%; height: 100%; object-fit: cover; }
.sleeve:hover .card, .sleeve:focus-visible .card { transform: translateY(-7px); }
.sleeve:focus-visible { outline-offset: 4px; }
/* chase tier: thin holo hairline + one sweep per hover */
.pk.chase .card { box-shadow: none; }
.pk.chase .card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-pocket); padding: 1.5px;
  background: var(--holo);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; z-index: 2; pointer-events: none;
}
.pk.chase .card::after {
  content: ""; position: absolute; inset: 0; background: var(--sweep);
  transform: translateX(-120%); opacity: 0; pointer-events: none; z-index: 1;
}
.pk.chase .sleeve:hover .card::after, .pk.chase .sleeve:focus-visible .card::after {
  animation: sweep var(--dur-slow) var(--ease) 1;
}
@keyframes sweep { 0% { transform: translateX(-120%); opacity: 1; } 100% { transform: translateX(120%); opacity: 1; } }
.pk.silver .card { box-shadow: 0 0 0 1px var(--rarity-silver); }

.cap {
  display: flex; align-items: baseline; gap: 6px; margin-top: 7px; min-width: 0;
  font-size: 11px; line-height: 1.2; white-space: nowrap;
}
.cap .n { font-size: 10px; color: var(--muted); }
.cap .q { font-size: 10px; color: var(--muted); }
.cap .r { font-size: 10px; font-weight: 800; letter-spacing: .04em; font-variation-settings: 'wdth' 70, 'wght' 800; }
.cap .p { margin-left: auto; font-size: 10.5px; }
.r.silver { color: var(--rarity-silver); }
.r.chase { background: var(--holo); -webkit-background-clip: text; background-clip: text; color: transparent; }
.up { color: var(--signal-deep); }
.dn { color: var(--flat); }
.cap .name {
  font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  font-variation-settings: 'wdth' 80, 'wght' 700;
}

/* empty pocket: the number pencilled in */
.pk.empty .sleeve { cursor: pointer; }
.pk.empty .slot, .pk.gap .slot, .pk.blank .slot {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  height: 100%; border-radius: var(--radius-pocket);
  border: 1px dashed var(--hair-strong); background: var(--bone-2);
  text-align: center; padding: 8px; transition: background-color var(--dur-base) var(--ease);
}
.pk.empty .sleeve:hover .slot { background: var(--bone-3); }
.slot .pencil { font-family: var(--font-mono); font-variation-settings: 'wdth' 87.5, 'wght' 400; font-size: clamp(15px, 2vw, 22px); color: var(--muted); letter-spacing: -0.04em; }
.slot .nm { font-size: 11px; line-height: 1.2; color: var(--muted); font-variation-settings: 'wdth' 80, 'wght' 600; }
/* collapsed gap marker */
.pk.gap .slot { background: transparent; border: 1px solid var(--hair-strong); gap: 4px; }
.pk.gap .sleeve, .pk.blank .sleeve { cursor: default; }
.slot .range { font-family: var(--font-mono); font-variation-settings: 'wdth' 87.5, 'wght' 600; letter-spacing: -0.04em; font-size: clamp(12px, 1.4vw, 15px); }
.slot .count { font-size: 12px; font-weight: 700; }
.slot .list { font-size: 10.5px; line-height: 1.3; color: var(--muted); margin: 2px 0 0; padding: 0; list-style: none; }
.pk.blank .slot { border: 0; background: transparent; }

.page-foot {
  margin-top: auto; padding-top: var(--space-4);
  display: flex; justify-content: space-between; gap: var(--space-3);
  font-size: 12px; color: var(--muted); border-top: 1px solid var(--hair);
  margin-inline: calc(var(--pad, 18px) * -1); padding-inline: var(--pad, 18px);
  padding-bottom: 0;
}
.page-foot .mono { color: var(--ink); font-size: 11px; }

/* ─── HOME ─── */
.home-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-8); padding-bottom: var(--space-8); align-items: start;
}
.frontpage { --pad: 20px; --pgap: 14px; margin-top: var(--space-5); max-width: 580px; }
.frontpage .cap { flex-wrap: wrap; row-gap: 2px; }
.frontpage .cap .name { flex: 1 1 100%; order: -1; font-size: 13px; }
.frontpage.is-grid .pockets { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.shelf-wrap { margin-top: var(--space-5); }
.shelf {
  display: flex; align-items: flex-end; gap: 6px; padding: 0 var(--space-2);
  border-bottom: 3px solid var(--ink); min-height: 320px;
}
.spine {
  --fill: 0;
  position: relative; flex: none; height: 300px; width: var(--w, 64px);
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  border: 1px solid var(--hair-strong); border-bottom: 0; border-radius: 4px 4px 0 0;
  background: var(--bone-3);
  transition: transform var(--dur-base) var(--ease);
}
a.spine:hover, a.spine:focus-visible { transform: translateY(-14px); }
.spine .cap-label {
  background: var(--chrome-bg); color: var(--chrome-fg); border-radius: 3px 3px 0 0;
  padding: 10px 0 8px; text-align: center;
  font-variation-settings: 'wdth' 62, 'wght' 900; font-size: 20px; line-height: 1; letter-spacing: .02em;
}
.spine .body { position: relative; flex: 1; overflow: hidden; }
.spine .fillbar { position: absolute; inset: auto 0 0 0; height: calc(var(--fill) * 1%); background: var(--ink); }
.spine .title {
  position: absolute; inset: 14px 0 34px; display: flex; justify-content: center;
  writing-mode: vertical-rl;
  font-variation-settings: 'wdth' 66, 'wght' 800; text-transform: uppercase; font-size: 15px; letter-spacing: .04em;
  white-space: nowrap;
}
.spine .title.on-fill { color: var(--bone); clip-path: inset(calc((100 - var(--fill)) * 1%) 0 0 0); }
.spine .title.on-body { clip-path: inset(0 0 calc(var(--fill) * 1%) 0); }
.spine .tally {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 10px; color: var(--bone);
}
.spine.loose .tally { color: var(--ink); }
.spine.loose .body { background: repeating-linear-gradient(to bottom, transparent 0 calc(100% / 23 - 1px), var(--hair-strong) calc(100% / 23 - 1px) calc(100% / 23)); }
.shelf-legend { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: var(--space-5); margin-top: var(--space-3); font-size: 13px; }
.shelf-legend dt { font-weight: 700; }
.shelf-legend dd { margin: 0; color: var(--muted); }
.shelf-legend .mono { color: var(--ink); font-size: 11.5px; }
.rule-note { margin: var(--space-5) 0 0; font-size: 14px; color: var(--muted); max-width: 46ch; }

.dividers { margin-top: var(--space-6); }
.dividers h3 { margin: 0 0 var(--space-2); font-size: 15px; font-weight: 800; }
.dividers table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dividers th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--hair-strong); }
.dividers th.num, .dividers td.num { text-align: right; }
.dividers td { padding: 7px 0; border-bottom: 1px solid var(--hair); vertical-align: baseline; }
.dividers td.ab { width: 58px; font-variation-settings: 'wdth' 66, 'wght' 800; text-transform: uppercase; }
.dividers td.num .mono { font-size: 12px; }
.dividers td.num .of { color: var(--muted); }
.dividers .more { margin-top: var(--space-3); }
.linkbtn { border: 0; background: none; padding: 10px 0; cursor: pointer; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* ─── SET ─── */
.set-mast { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-5); align-items: end; }
.set-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: var(--space-4); font-size: 14px; }
.set-meta .mono { font-size: 12.5px; }
.progress { margin-top: var(--space-4); max-width: 520px; }
.bar { height: 6px; background: var(--bone-3); border-radius: var(--radius-pill); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }
.progress p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.progress p .mono { color: var(--ink); font-size: 12px; }
.set-logo { width: 170px; height: auto; }
.mast-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-5); }
.set-masthead { padding-block: var(--space-6) var(--space-5); }
.set-masthead .h1.set { font-size: clamp(56px, 7.5vw, 112px); }

.set-grid {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: var(--space-7); align-items: start; padding-bottom: var(--space-8);
}
.binder { --pk: 124px; --pad: 18px; --pgap: 10px; }
.binder:focus-visible { outline-offset: 8px; }
.binder-frame { display: flex; align-items: stretch; }
.binder-spine {
  width: 46px; flex: none; background: var(--chrome-bg); color: var(--chrome-fg);
  border-radius: 6px 0 0 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.binder-spine .ab { font-variation-settings: 'wdth' 62, 'wght' 900; font-size: 20px; letter-spacing: .02em; }
.binder-spine .vt { writing-mode: vertical-rl; transform: rotate(180deg); font-variation-settings: 'wdth' 66, 'wght' 800; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; color: var(--chrome-muted); }
.binder-spine .mono { font-size: 10px; color: var(--chrome-fg); writing-mode: vertical-rl; transform: rotate(180deg); }

.spread {
  position: relative; display: grid; grid-template-columns: repeat(var(--cols, 2), calc(var(--pk) * 3 + var(--pgap) * 2 + var(--pad) * 2 + 2px));
  width: max-content; perspective: 2600px; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.spread > .slotpage { min-height: 100%; }
.spread > .slotpage + .slotpage .page { border-left-color: var(--hair-strong); }
.slotpage .page { height: 100%; border-radius: 0 3px 3px 0; }
.slotpage:first-child .page { border-radius: 0; }
.spread[data-cols="1"] .slotpage .page { border-radius: 0 3px 3px 0; }
.leaf {
  position: absolute; top: 0; bottom: 0; z-index: 5;
  transform-style: preserve-3d; will-change: transform; pointer-events: none;
}
.leaf .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf .face .page { height: 100%; }
.leaf .back { transform: rotateY(180deg); }
.leaf .face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--shade, 0);
  background: linear-gradient(to var(--shade-dir, left), var(--leaf-shade), transparent 70%);
}
.page.blankpage { background: var(--paper); }

.binder-ctl { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); flex-wrap: wrap; }
.turn {
  width: 44px; height: 44px; border-radius: var(--radius-pill); border: 1px solid var(--hair-strong);
  background: var(--paper); cursor: pointer; display: grid; place-items: center; flex: none;
  transition: background-color var(--dur-base) var(--ease);
}
.turn:hover:not(:disabled) { background: var(--ink); color: var(--bone); }
.turn:disabled { opacity: .35; cursor: default; }
.turn svg { width: 16px; height: 16px; }
.where { font-size: 13px; min-width: 0; }
.where .mono { font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-left: auto; }
.tabs { display: flex; gap: 6px; margin-top: var(--space-3); overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.tabs button {
  flex: none; border: 1px solid var(--hair-strong); background: transparent; border-radius: var(--radius-pill);
  padding: 6px 12px; min-height: 34px; cursor: pointer; font-family: var(--font-mono);
  font-variation-settings: 'wdth' 87.5, 'wght' 500; letter-spacing: -0.04em; font-size: 11px;
}
.tabs button[aria-current="true"] { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.tabs button:not([aria-current="true"]):hover { background: var(--bone-2); }

.flatgrid { --pgap: 14px; display: none; }
.flatgrid .pockets { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 14px; }
.view-grid .flatgrid { display: block; }
.view-grid .binder { display: none; }

.wanted h2 { margin-bottom: var(--space-2); }
.wanted table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: var(--space-4); }
.wanted th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--hair-strong); }
.wanted td { padding: 0; border-bottom: 1px solid var(--hair); }
.wanted td > button, .wanted td > span { display: block; width: 100%; text-align: left; padding: 8px 8px 8px 0; border: 0; background: none; cursor: pointer; }
.wanted tr:hover td { background: var(--bone-2); }
.wanted .num { text-align: right; padding-right: 0; }
.wanted td.num > span, .wanted td.num > button { text-align: right; padding-right: 0; }
.wanted .mono { font-size: 11.5px; }
.wanted .r { font-size: 10px; font-weight: 800; font-variation-settings: 'wdth' 70, 'wght' 800; }
.wanted tfoot td { border-bottom: 0; padding-top: 10px; font-size: 13px; color: var(--muted); }
.wanted tfoot .mono { color: var(--ink); }

/* ─── card dialog: the card pulled out of its pocket ─── */
dialog.pull {
  border: 0; padding: 0; background: var(--bone); color: var(--ink);
  width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border-radius: var(--radius-card); box-shadow: 0 0 0 1px var(--hair-strong);
}
dialog.pull::backdrop { background: rgba(20, 20, 18, .62); }
.pull-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--space-6); padding: var(--space-6); }
.pull-art { border-radius: 12px; overflow: hidden; aspect-ratio: 600 / 825; background: var(--bone-3); }
.pull-art img { width: 100%; height: 100%; object-fit: cover; }
.pull.missing .pull-art img { filter: grayscale(1); opacity: .55; }
.pull h2 { margin: 0; font-variation-settings: 'wdth' 66, 'wght' 800; text-transform: uppercase; font-size: 34px; line-height: .95; overflow-wrap: anywhere; }
.pull .where-line { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.pull .price-big { margin-top: var(--space-5); font-family: var(--font-mono); font-variation-settings: 'wdth' 87.5, 'wght' 700; letter-spacing: -0.05em; font-size: 40px; line-height: 1; }
.pull .delta { margin: 8px 0 0; font-size: 13px; }
.pull .delta .mono { font-size: 12px; }
.pull dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: var(--space-5) 0 0; font-size: 14px; border-top: 1px solid var(--hair); padding-top: var(--space-4); }
.pull dt { color: var(--muted); }
.pull dd { margin: 0; }
.pull dd .mono { font-size: 12.5px; }
.pull .status { display: inline-block; margin-top: var(--space-4); font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--hair-strong); }
.pull .status.own { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.pull-close {
  position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: var(--radius-pill);
  border: 1px solid var(--hair-strong); background: var(--paper); cursor: pointer; display: grid; place-items: center;
}
.pull-close:hover { background: var(--ink); color: var(--bone); }
.pull-close svg { width: 16px; height: 16px; }

.img-missing { display: grid; place-items: center; height: 100%; font-size: 11px; color: var(--muted);
  background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hair) 6px 7px); }

/* ─── footer (frozen chrome) ─── */
.footer { background: var(--chrome-bg); color: var(--chrome-muted); font-size: 12.5px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); padding-block: var(--space-5); }
.footer a { color: var(--chrome-fg); }
.footer p { margin: 0; max-width: 70ch; }

/* ─── responsive ─── */
@media (max-width: 1360px) {
  .binder { --pk: 112px; }
}
@media (max-width: 1180px) {
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .wanted { max-width: 640px; }
}
@media (max-width: 1060px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-7); }
  .frontpage { max-width: none; }
}
@media (max-width: 899px) {
  :root { --gutter: 16px; }
  .binder { --pk: calc((100vw - 2 * var(--gutter) - 2 * var(--pad) - 2 * var(--pgap) - 2px) / 3); --pad: 10px; --pgap: 8px; }
  .binder-spine { display: none; }
  .slotpage .page, .spread[data-cols="1"] .slotpage .page { border-radius: 3px; }
  .hint { display: none; }
  .set-mast { grid-template-columns: minmax(0, 1fr); }
  .set-logo { display: none; }
  .mast-side { align-items: flex-start; }
}
@media (max-width: 720px) {
  .nav { gap: var(--space-4); }
  .nav span { display: none; }
  .masthead { padding-block: var(--space-6) var(--space-5); }
  .lede { font-size: 16px; }
  .frontpage { --pad: 10px; --pgap: 8px; }
  .frontpage .cap .name, .frontpage .cap .q { display: none; }
  .frontpage .cap { flex-wrap: nowrap; }
  .frontpage .cap .r, .binder .cap .r, .binder .cap .q { display: none; }
  .frontpage.is-grid .pockets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cap { gap: 4px; margin-top: 5px; }
  .cap .p { font-size: 9.5px; }
  .cap .n { font-size: 9px; }
  .slot .nm, .slot .list { display: none; }
  .slot .count { font-size: 10.5px; }
  .shelf { min-height: 250px; }
  .spine { height: 230px; }
  .shelf-legend { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .pull-body { grid-template-columns: minmax(0, 1fr); padding: var(--space-5) var(--space-4); gap: var(--space-4); }
  .pull-art { max-width: 220px; }
  .pull h2 { font-size: 28px; padding-right: 48px; }
  .pull .price-big { font-size: 32px; }
  .page-foot { font-size: 11px; }
  .flatgrid .pockets { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
  .h2 { font-size: 22px; }
}

/* ─── reduced motion: instant swaps, hover collapses to a ring ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
  .sleeve:hover .card, .sleeve:focus-visible .card { transform: none; box-shadow: 0 0 0 2px var(--ink); }
  a.spine:hover, a.spine:focus-visible { transform: none; box-shadow: 0 0 0 2px var(--ink); }
}

/* pressed state for every control */
.seg button:active, .tabs button:active, .turn:active:not(:disabled), .pull-close:active, .theme-btn:active, .linkbtn:active { transform: translateY(1px); }

/* narrow phones: caption price drops under the card number, dates never split */
.source .mono, .set-meta .mono { white-space: nowrap; }
.cap { overflow: hidden; }
@media (max-width: 400px) {
  .frontpage .cap { flex-wrap: wrap; }
  .frontpage .cap .p { margin-left: 0; flex-basis: 100%; }
}
