/* philosophy. storefront, v2 (2026-11-26). Quiet white page, soft grey stages that let the book covers carry the
   colour, centred pill navigation, icon chips. Since 2026-12-05 the colours are the Philosophy App 3.0 palette: black,
   white and greys, red for sales and "few left", green for "in stock", gold for points (see :root).
   Motion follows three ideas: intentional (ramped, punchy ease-out, never floaty), effortless (short, smooth),
   organic (a light spring where something lands). Text slides up line by line; grids enter in sequence;
   every press answers with a small scale. All of it switches off under prefers-reduced-motion. */
:root {
  /* Palette (2026-12-05): the Philosophy App 3.0 / Philosophy.mn tokens (philosophy-web, src/design-system/tokens.css).
     Black, white and plain greys carry the page; red #F44336 / #E21204 is the one accent (sale, few left, counts);
     gold #CC9B58 marks points, stars and pre-orders; green #34D37C says "in stock" and "done". */
  --bg: #ffffff; --card: #f6f6f6; --card-2: #ededed; --stage: #f2f2f2; --line: #ebebeb; --line-2: #d6d6d6;
  --text: #141414; --text-2: #4d4d4d; --muted: #6b6b6b;
  --ink: #141414; --ink-hover: #333333;
  --accent: #f44336; --accent-strong: #e21204; --accent-text: #ffffff; --accent-soft: #fdecea;
  --coral: #f44336; --coral-strong: #e21204; --coral-soft: #fdecea;
  --ok: #34d37c; --ok-strong: #0e7a42; --ok-soft: #e6f9ee; --ok-text: #06301a;
  --gold: #cc9b58; --gold-strong: #7a5a22; --gold-soft: #f8f0e3;
  --r-xl: 28px; --r-lg: 22px; --r: 16px; --r-sm: 12px;
  --shadow-cover: 0 1px 1px rgb(0 0 0 / 6%), 0 10px 18px -8px rgb(0 0 0 / 28%), 0 26px 40px -22px rgb(0 0 0 / 30%);
  --shadow-cover-up: 0 2px 2px rgb(0 0 0 / 6%), 0 18px 26px -10px rgb(0 0 0 / 30%), 0 40px 60px -28px rgb(0 0 0 / 34%);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 5%);
  --font: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  /* motion tokens */
  --ease-out: cubic-bezier(.33, 1, .68, 1);
  --ease-punch: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-spring: var(--ease-punch);
  --d-press: 120ms; --d-fast: 180ms; --d: 280ms; --d-slow: 620ms;
  /* colours that change with the mode (v4): text on the ink colour, frosted glass, the always-dark panel, paper
     (white things that sit on a colour), five pastel pairs for tiles, the zone map, the wooden shelf */
  --on-ink: #ffffff; --on-coral: #ffffff; --accent-on-soft: #8f0d04;
  --glass: rgb(255 255 255 / 82%); --shade: rgb(20 20 20 / 30%); --ring: rgb(20 20 20 / 8%);
  --panel: #141414; --on-panel: #ffffff; --paper: #ffffff; --stage-glow: rgb(255 255 255 / 70%);
  --pa-bg: #f6f6f6; --pa-fg: #141414; --pb-bg: #ededed; --pb-fg: #141414; --pc-bg: #f6f6f6; --pc-fg: #141414; --pd-bg: #ededed; --pd-fg: #141414; --pe-bg: #f6f6f6; --pe-fg: #141414;
  --zm-city: #f6f6f6; --zm-city-line: #d6d6d6; --zm-mid: #e6e6e6; --zm-mid-line: #bfbfbf; --zm-road: #ffffff; --zm-road-text: #7f7f7f;
  --wood: #f6f0e6; --wood-1: #e7d6b8; --wood-2: #e2cfae; --wood-3: #d6bf98; --wood-4: #b99e74; --wood-5: #c9b089;
  --tint-l: 93%; --tint-k: .9;
  --glow-1: rgb(244 67 54 / 9%); --glow-2: rgb(204 155 88 / 17%); --glow-3: rgb(20 20 20 / 4%);
  color-scheme: light;
}
/* Dark mode (v4, 2026-12-05). theme.js puts data-theme on <html> before the first paint. */
:root[data-theme="dark"] {
  --bg: #141414; --card: #232323; --card-2: #2e2e2e; --stage: #1f1f1f; --line: #272727; --line-2: #383838;
  --text: #ffffff; --text-2: #bfbfbf; --muted: #8f8f8f;
  --ink: #ffffff; --ink-hover: #e6e6e6; --on-ink: #141414;
  --accent-strong: #f44336; --accent-soft: #2e1614; --accent-on-soft: #ffb3ab;
  --coral-strong: #f44336; --coral-soft: #2e1614; --on-coral: #ffffff;
  --ok-strong: #34d37c; --ok-soft: #12301f;
  --gold-strong: #e0b877; --gold-soft: #2e2415;
  --glass: rgb(20 20 20 / 80%); --shade: rgb(0 0 0 / 60%); --ring: rgb(255 255 255 / 14%);
  --panel: #232323; --on-panel: #ffffff; --paper: #3d3d3d; --stage-glow: rgb(255 255 255 / 6%);
  --pa-bg: #232323; --pa-fg: #ffffff; --pb-bg: #2e2e2e; --pb-fg: #ffffff; --pc-bg: #232323; --pc-fg: #ffffff; --pd-bg: #2e2e2e; --pd-fg: #ffffff; --pe-bg: #232323; --pe-fg: #ffffff;
  --zm-city: #1c1c1c; --zm-city-line: #383838; --zm-mid: #2e2e2e; --zm-mid-line: #4d4d4d; --zm-road: #141414; --zm-road-text: #8f8f8f;
  --wood: #2a241c; --wood-1: #4a3d2b; --wood-2: #453827; --wood-3: #3a2f20; --wood-4: #2a2117; --wood-5: #33291c;
  --tint-l: 17%; --tint-k: .6;
  --glow-1: rgb(244 67 54 / 12%); --glow-2: rgb(204 155 88 / 9%); --glow-3: rgb(255 255 255 / 4%);
  --shadow-cover: 0 1px 1px rgb(0 0 0 / 30%), 0 10px 18px -8px rgb(0 0 0 / 60%), 0 26px 40px -22px rgb(0 0 0 / 66%);
  --shadow-cover-up: 0 2px 2px rgb(0 0 0 / 30%), 0 18px 26px -10px rgb(0 0 0 / 62%), 0 40px 60px -28px rgb(0 0 0 / 70%);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%), 0 2px 8px rgb(0 0 0 / 30%);
  color-scheme: dark;
}
/* the black logo, wordmark and loader lettering turn white */
[data-theme="dark"] :is(.logo img, .foot-mark img, .page-loader img) { filter: invert(1); }
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ease-spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.067, 1.077 23.4%, 1.067 25.5%, 1.004 32.9%, .988 36.6%, .995 47.1%, 1); }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: 99px; z-index: 60; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.i { font-size: 20px; width: 1em; height: 1em; line-height: 1; flex: none; display: inline-grid; place-items: center; }
.show-sm { display: none !important; }

/* ---------------------------------------------------------------- buttons, pills, chips */
.pill, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.pill:hover, .btn:hover { background: var(--card); }
.pill .i { font-size: 18px; transition: transform var(--d) var(--ease-punch); }
.pill:hover .i { transform: translateX(3px); }
.pill.dark, .btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pill.dark:hover, .btn.primary:hover { background: var(--ink-hover); }
.pill.big { min-height: 54px; padding: 0 26px; font-size: 16px; }
.pill.dark.big .i { transition: transform var(--d) var(--ease-spring); }
@media (hover: hover) { .pill.dark.big:hover .i { transform: rotate(90deg); } }
.btn.block { width: 100%; min-height: 52px; }
.btn:disabled, .btn.disabled { opacity: .45; }
.btn:disabled { pointer-events: none; }
.pill:active, .btn:active, .chip:active, .icon-btn:active, .card-act:active, .stepper button:active { transform: scale(.95); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); padding: 0; text-decoration: none;
  transition: background var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.icon-btn:hover { background: var(--card); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap-chips { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; scroll-snap-align: start;
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.chip .i { font-size: 18px; }
.chip:hover { background: var(--card); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip.on .i { animation: chip-on var(--d-slow) var(--ease-spring); }
.chips.mini .chip { height: 32px; font-size: 13.5px; padding: 0 12px 0 10px; }
.chips.mini .chip .i { font-size: 15px; }
.chip-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.chip-bar .chips { flex: 1; min-width: 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.chip-bar .more { flex: none; }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); view-transition-name: top;
  transition: box-shadow var(--d) var(--ease-out); }
.top.scrolled { box-shadow: 0 1px 0 var(--line); }
.top-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 76px; }
.logo { display: inline-flex; align-items: center; text-decoration: none; justify-self: start; border-radius: 10px; }
.logo img { display: block; height: 40px; width: auto; transition: transform var(--d-slow) var(--ease-spring), opacity var(--d); }
.logo:hover img { transform: translateY(-2px); opacity: .85; }
.nav { display: flex; gap: 2px; padding: 4px; border-radius: 99px; }
.nav a { position: relative; padding: 8px 15px; border-radius: 99px; text-decoration: none; font-size: 15.5px; font-weight: 600; color: var(--text-2); border: 1px solid transparent;
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out); }
.nav a:hover { color: var(--text); background: var(--card); }
.nav a[aria-current] { color: var(--text); background: var(--card); border-color: var(--line); }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cart-link { position: relative; }
.cart-link .count { position: absolute; top: -3px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.cart-link .count.bump { animation: bump var(--d-slow) var(--ease-spring); }

/* sheets: search and the phone menu open from the top */
.sheet { position: fixed; left: 0; right: 0; top: 0; z-index: 40; max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); box-shadow: 0 24px 60px -20px rgb(0 0 0 / 25%); border-radius: 0 0 var(--r-xl) var(--r-xl); padding: 14px 0 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; height: 50px; margin-bottom: 4px; }
.sheet:not([hidden]) { animation: sheet-in var(--d) var(--ease-punch); }
.sheet.closing { animation: sheet-out var(--d-fast) var(--ease-in) forwards; }
body.sheet-open::after { content: ''; position: fixed; inset: 0; z-index: 35; background: var(--shade); animation: fade-in var(--d) var(--ease-out); }
.search { display: flex; align-items: center; gap: 12px; height: 62px; }
.search > .i { font-size: 24px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 56px; border: 0; background: transparent; font-size: 22px; letter-spacing: -.015em; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.menu-list { display: grid; padding-top: 4px; }
.menu-list a { padding: 12px 0; font-size: 22px; letter-spacing: -.02em; text-decoration: none; border-bottom: 1px solid var(--line); }
.menu-sheet .chips { margin-top: 16px; }

main { padding-bottom: 96px; min-height: 60vh; }

/* ---------------------------------------------------------------- hero */
.hero { text-align: center; padding: 76px 0 56px; max-width: 920px; margin: 0 auto; }
.hero h1 { font-size: clamp(38px, 5.4vw, 66px); line-height: 1.02; letter-spacing: -.028em; text-wrap: balance; }
.hero-sub { margin: 20px auto 0; max-width: 560px; font-size: 18px; color: var(--text-2); text-wrap: pretty; }
/* headline lines slide up one after another */
.ln { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: top; padding-bottom: .06em; }
.ln > span { display: inline-block; }
.js .ln > span { animation: slide-up var(--d-slow) var(--ease-punch) both; }
.js .ln[data-i="1"] > span { animation-delay: 90ms; }
.js .ln[data-i="2"] > span { animation-delay: 180ms; }
.js .ln[data-i="3"] > span { animation-delay: 270ms; }
.js .hero-sub { animation: rise var(--d-slow) var(--ease-punch) 200ms both; }

/* ---------------------------------------------------------------- grid & cards */
.shelf { margin-top: 88px; }
.shelf.first { margin-top: 0; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.shelf-head h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -.02em; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--stage); border-radius: var(--r-xl); padding: 16px 20px 20px; isolation: isolate; overflow: hidden; }
.card-stage { height: clamp(220px, 21vw, 300px); overflow: hidden; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 40px 0 10px; }
.card-stage .cover { max-height: 100%; max-width: 74%; width: auto; height: auto; object-fit: contain; border-radius: 3px; box-shadow: var(--shadow-cover);
  transition: transform var(--d-slow) var(--ease-spring), box-shadow var(--d-slow) var(--ease-out); }
.card-stage .cover.photo { max-width: 100%; border-radius: 0; box-shadow: none; transform: scale(1.32); }
.card-stage:has(.photo) { padding-top: 30px; }
.ph { display: grid; place-items: center; aspect-ratio: 3 / 4; height: 100%; max-width: 74%; border-radius: 4px; background: linear-gradient(160deg, var(--bg), var(--accent-soft)); box-shadow: var(--shadow-cover); color: var(--accent-strong); padding: 12px; text-align: center; font-size: 13px; font-weight: 500; line-height: 1.25; overflow: hidden; }
/* A book without a cover photo: one 3:4 card-sized cover for every title. Before, the size followed the
   length of the title (owner question 2026-12-04). It fills the stage height, or 74% of its width if that is less. */
.card-stage { container-type: size; }
.card-stage .ph.cover { height: min(100cqh, 98.6cqw); width: auto; max-width: none; max-height: none; aspect-ratio: 3 / 4; }
.badge { position: absolute; top: 14px; left: 14px; z-index: 2; height: 28px; padding: 0 11px; border-radius: 99px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 800; letter-spacing: 0; }
.new-badge { background: var(--accent); color: var(--accent-text); }
.sale-badge { background: var(--coral-strong); color: var(--on-coral); }
.low-badge { background: var(--coral-soft); color: var(--coral-strong); }
.muted-badge { background: var(--bg); color: var(--muted); }
.card-act { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 99px; border: 0; padding: 0; background: var(--bg); color: var(--text); display: grid; place-items: center; box-shadow: var(--shadow-sm);
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.card-act .i { font-size: 18px; transition: transform var(--d) var(--ease-spring); }
/* Hover only where there is a real pointer: on a phone a tapped button stays "hovered", and the turned plus
   turned the check that follows it too, so it looked like "<" (2026-12-06, same fix as geren). */
@media (hover: hover) {
  button.card-act:hover { background: var(--ink); color: var(--on-ink); }
  button.card-act:hover .i { transform: rotate(90deg); }
}
.card-act.added { background: var(--accent); color: var(--accent-text); animation: pop var(--d-slow) var(--ease-spring); }
/* the check after "added" never turns, even while the pointer still rests on the button (a mouse, or a phone browser
   that says it can hover); the hover rule above is more specific, so the override names :hover too */
.card-act.added .i, button.card-act.added:hover .i, .pill[data-add].added .i, .pill.dark.big.added:hover .i { transform: none; }
span.card-act { pointer-events: none; color: var(--muted); }
.card .badge { pointer-events: none; }
.line-img, .o-img { display: block; border-radius: 12px; }
.card-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 16px; }
.card-text { min-width: 0; }
.card h3 { font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-link { text-decoration: none; }
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card .by { margin-top: 3px; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prices { display: inline-flex; flex-direction: column; align-items: flex-end; flex: none; }
.price { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.price.sale { color: var(--coral-strong); }
.prices .was { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.card.is-out .cover, .card.is-out .ph { opacity: .5; filter: grayscale(.6); }
.card-more { justify-content: center; align-items: center; flex-direction: row; gap: 10px; min-height: 160px; text-decoration: none; font-size: 18px; font-weight: 500; }
.card-more .i { transition: transform var(--d) var(--ease-punch); }
.card-more:hover .i { transform: translateX(5px); }
.empty-inline { grid-column: 1 / -1; padding: 40px 0; text-align: center; }

/* entering: cards and headings rise in sequence as they scroll in */
.js [data-reveal]:not(.in) { opacity: 0; transform: translateY(22px) scale(.985); }
.js [data-reveal].in { transition: opacity var(--d-slow) var(--ease-out), transform var(--d-slow) var(--ease-spring); transition-delay: calc(var(--i, 0) * 55ms); }
.js [data-reveal].in.settled { transition-delay: 0s; }
.grid.leaving > * { animation: shuffle-out var(--d-fast) var(--ease-in) forwards; animation-delay: calc(var(--i, 0) * 18ms); }

/* category tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); background: var(--card); text-decoration: none;
  transition: background var(--d-fast) var(--ease-out), transform var(--d) var(--ease-spring); }
.tile:hover { background: var(--card-2); transform: translateY(-3px); }
.tile-ic { grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 99px; background: var(--bg); display: grid; place-items: center; }
.tile-t { font-weight: 500; line-height: 1.25; }
.tile small { color: var(--muted); font-size: 13px; }

/* category groups on the home page (DESIGN.md §2.2) */
.group .shelf-head h2 { font-size: clamp(24px, 2.6vw, 32px); }
.fan-c { position: absolute; width: 74px; height: 74px; border-radius: 16px; overflow: hidden; border: 3px solid var(--paper); background: var(--stage); box-shadow: 0 8px 18px -8px rgb(0 0 0 / 35%);
  transition: transform var(--d-slow) var(--ease-spring); }
.fan-c img { width: 100%; height: 100%; object-fit: cover; }
.fan-c img.photo { transform: scale(1.5); }
/* traditions: big coloured tiles with a fan of covers */
.trads { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.trad { position: relative; min-height: 236px; padding: 20px 20px; border-radius: var(--r-xl); text-decoration: none; overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--d) var(--ease-spring); }
.trad:hover { transform: translateY(-4px); }
.trad:active { transform: scale(.98); }
.trad-n { font-size: clamp(18px, 1.6vw, 23px); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; }
.trad-s { margin-top: 6px; font-size: 14px; font-weight: 700; opacity: .8; }
.trad-0 { --p-bg: var(--pa-bg); --p-fg: var(--pa-fg); }
.trad-1 { --p-bg: var(--pb-bg); --p-fg: var(--pb-fg); }
.trad-2 { --p-bg: var(--pc-bg); --p-fg: var(--pc-fg); }
.trad-3 { --p-bg: var(--pd-bg); --p-fg: var(--pd-fg); }
.trad-4 { --p-bg: var(--pe-bg); --p-fg: var(--pe-fg); }
:is(.trad-0, .trad-1, .trad-2, .trad-3, .trad-4) { background: var(--p-bg); color: var(--p-fg); }
.fan { position: absolute; right: 14px; bottom: 16px; width: 150px; height: 96px; }
.fan .fan-c:nth-child(1) { right: 66px; bottom: 0; transform: rotate(-12deg); }
.fan .fan-c:nth-child(2) { right: 34px; bottom: 10px; transform: rotate(-3deg); z-index: 1; }
.fan .fan-c:nth-child(3) { right: 0; bottom: 2px; transform: rotate(9deg); z-index: 2; }
.trad:hover .fan-c:nth-child(1) { transform: translate(-14px, -6px) rotate(-20deg); }
.trad:hover .fan-c:nth-child(2) { transform: translateY(-14px) rotate(-2deg); }
.trad:hover .fan-c:nth-child(3) { transform: translate(10px, -4px) rotate(16deg); }
/* book forms: icon tiles */
.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.format { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: var(--r-lg); background: var(--card); text-decoration: none;
  transition: background var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.format:hover { background: var(--card-2); }
.format:active { transform: scale(.97); }
.format-ic { width: 48px; height: 48px; border-radius: 99px; background: var(--bg); display: grid; place-items: center; }
.format-ic .i { font-size: 23px; transition: transform var(--d-slow) var(--ease-spring); }
.format:hover .format-ic .i { transform: rotate(-12deg) scale(1.12); }
.format-t { font-weight: 700; line-height: 1.25; }
.format small { color: var(--muted); font-size: 13px; margin-top: -8px; }
/* series and collections: cards with stacked covers */
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.collection { display: flex; align-items: center; gap: 18px; padding: 14px 20px 14px 14px; border-radius: var(--r-xl); background: var(--card); text-decoration: none;
  transition: background var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.collection:hover { background: var(--card-2); }
.collection:active { transform: scale(.985); }
.stack { position: relative; flex: none; width: 108px; height: 86px; }
.stack .fan-c { width: 64px; height: 64px; bottom: 8px; }
.stack .fan-c:nth-child(1) { left: 0; transform: rotate(-8deg); }
.stack .fan-c:nth-child(2) { left: 22px; transform: rotate(-1deg); z-index: 1; }
.stack .fan-c:nth-child(3) { left: 44px; transform: rotate(7deg); z-index: 2; }
.collection:hover .stack .fan-c:nth-child(1) { transform: translate(-6px, -3px) rotate(-14deg); }
.collection:hover .stack .fan-c:nth-child(2) { transform: translateY(-8px) rotate(-1deg); }
.collection:hover .stack .fan-c:nth-child(3) { transform: translate(8px, -3px) rotate(13deg); }
.collection-t { flex: 1; min-width: 0; display: grid; gap: 3px; }
.collection-t strong { font-size: 16px; line-height: 1.25; }
.collection-t small { color: var(--muted); font-size: 13.5px; }
.collection > .i { color: var(--muted); transition: transform var(--d) var(--ease-punch), color var(--d-fast) var(--ease-out); }
.collection:hover > .i { transform: translate(3px, -3px); color: var(--text); }

/* pre-order */
.pre-badge { background: var(--ink); color: var(--on-ink); }
.stock.pre { background: var(--accent-soft); color: var(--accent-strong); }
.pre-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-on-soft); font-size: 14.5px; }
.pre-note .i { font-size: 19px; margin-top: 1px; color: var(--accent-strong); }

/* "Дулаан мөчүүд": story cards under the headline */
.stories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: -8px 0 64px; }
.story { position: relative; display: flex; align-items: center; gap: 16px; min-height: 124px; padding: 14px 18px 14px 14px; border-radius: var(--r-xl); text-decoration: none; overflow: hidden;
  transition: transform var(--d) var(--ease-spring); }
.story:hover { transform: translateY(-3px); }
.story:active { transform: scale(.985); }
.story-0 { background: var(--pa-bg); color: var(--pa-fg); }
.story-1 { background: var(--pb-bg); color: var(--pb-fg); }
.story-2 { background: var(--pd-bg); color: var(--pd-fg); }
.story-pic { flex: none; width: 96px; height: 96px; border-radius: 18px; overflow: hidden; background: var(--stage); box-shadow: 0 8px 18px -10px rgb(0 0 0 / 40%); transform: rotate(-4deg); transition: transform var(--d-slow) var(--ease-spring); }
.story:hover .story-pic { transform: rotate(2deg) scale(1.05); }
.story-pic img { width: 100%; height: 100%; object-fit: cover; }
.story-pic img.photo { transform: scale(1.5); }
.story-t { flex: 1; min-width: 0; display: grid; gap: 4px; }
.story-tag { justify-self: start; font-size: 12px; font-weight: 800; letter-spacing: .02em; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--paper) 72%, transparent); }
.story-t strong { font-size: 17px; line-height: 1.2; }
.story-x { font-size: 13.5px; line-height: 1.4; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story > .i { position: absolute; top: 14px; right: 14px; font-size: 18px; opacity: .6; transition: transform var(--d) var(--ease-punch), opacity var(--d-fast); }
.story:hover > .i { transform: translate(3px, -3px); opacity: 1; }

/* "Хаанаас эхлэх вэ": tips by tradition */
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.tip { display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 180px; border-radius: var(--r-xl); text-decoration: none; transition: transform var(--d) var(--ease-spring); }
.tip:hover { transform: translateY(-3px); }
.tip-trad { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.tip-x { flex: 1; font-size: 15px; line-height: 1.5; }
.tip-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; opacity: .85; }
.tip-more .i { font-size: 16px; transition: transform var(--d) var(--ease-punch); }
.tip:hover .tip-more .i { transform: translateX(4px); }

/* "Бидэнтэй уулзаарай" */
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; color: var(--accent-strong); margin-bottom: 10px; }
.eyebrow .i { font-size: 18px; }
.visit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; margin-top: 88px; padding: 36px; border-radius: 36px; background: var(--card); overflow: hidden; }
.visit h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.02em; margin-bottom: 18px; }
.visit ul { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.visit li { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.visit li .i { color: var(--accent-strong); }
.visit-pic { position: relative; min-height: 240px; display: grid; place-items: center; }
.visit-pic.photo-frame img { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--r-xl); }
.fan.big { position: relative; right: auto; bottom: auto; width: 300px; height: 220px; }
.fan.big .fan-c { width: 150px; height: 150px; border-radius: 26px; border-width: 5px; }
.fan.big .fan-c:nth-child(1) { right: 140px; bottom: 10px; }
.fan.big .fan-c:nth-child(2) { right: 75px; bottom: 40px; }
.fan.big .fan-c:nth-child(3) { right: 0; bottom: 6px; }
.fan.big .fan-c:nth-child(n+4) { display: none; }
.visit:hover .fan.big .fan-c:nth-child(1), .about-fan:hover .fan.big .fan-c:nth-child(1) { transform: translate(-16px, -6px) rotate(-18deg); }
.visit:hover .fan.big .fan-c:nth-child(2), .about-fan:hover .fan.big .fan-c:nth-child(2) { transform: translateY(-16px) rotate(-2deg); }
.visit:hover .fan.big .fan-c:nth-child(3), .about-fan:hover .fan.big .fan-c:nth-child(3) { transform: translate(12px, -6px) rotate(15deg); }

/* "Бидний тухай" */
.about-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 56px 0 40px; }
.about-hero h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.02; letter-spacing: -.028em; }
.about-intro { margin-top: 20px; font-size: 18px; line-height: 1.65; color: var(--text-2); max-width: 58ch; }
.about-intro p + p { margin-top: 12px; }
.js .about-intro { animation: rise var(--d-slow) var(--ease-punch) 220ms both; }
.about-fan { display: grid; place-items: center; min-height: 300px; border-radius: 36px; background: var(--pa-bg); }
.about-photos { display: grid; gap: 10px; }
.about-photos img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-xl); }
.about-photos.n2 { grid-template-columns: 1fr 1fr; }
.about-photos.n3 { grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; height: 420px; }
.about-photos.n3 img:first-child { grid-row: 1 / 3; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { padding: 22px; border-radius: var(--r-xl); background: var(--card); display: grid; gap: 4px; }
.stat-v { font-size: clamp(34px, 3.6vw, 48px); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--accent-strong); }
.stat span { color: var(--text-2); font-size: 15px; }
.beliefs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.belief { padding: 24px; border-radius: var(--r-xl); border: 1px solid var(--line); }
.belief-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-weight: 800; font-size: 14px; margin-bottom: 16px; }
.belief h3 { font-size: 20px; margin-bottom: 8px; }
.belief p { color: var(--text-2); line-height: 1.6; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; display: grid; gap: 18px; max-width: 820px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.timeline li { position: relative; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 18px; padding-left: 36px; }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 6px; width: 20px; height: 20px; border-radius: 99px; background: var(--bg); border: 4px solid var(--accent); }
.tl-date { font-weight: 800; color: var(--accent-strong); padding-top: 2px; }
.tl-body h3 { font-size: 19px; margin-bottom: 4px; }
.tl-body h3 a { text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.tl-body p { color: var(--text-2); line-height: 1.6; }
.club { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 32px; align-items: center; margin-top: 88px; padding: 32px; border-radius: 36px; background: var(--pd-bg); color: var(--pd-fg); }
.club .eyebrow { color: var(--pd-fg); }
.club h2 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.02em; }
.club-when { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; }
.club-x { margin: 14px 0 20px; line-height: 1.65; }
.club-pic { border-radius: var(--r-xl); overflow: hidden; background: var(--stage); aspect-ratio: 1 / 1; }
.club-pic img { width: 100%; height: 100%; object-fit: cover; }
.club-pic img.photo { transform: scale(1.25); }

/* delivery zones on a real map (2026-12-06). The map picture is grey OpenStreetMap; zones are ink at three
   strengths, the chosen one turns red. In dark mode the picture is inverted so streets stay readable. */
.zmap-wrap { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #ececec; isolation: isolate; }
:root[data-theme="dark"] .zmap-wrap { background: #1d1d1d; }
.zmap-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.zmap-scroll::-webkit-scrollbar { display: none; }
/* Never drawn narrower than 720 px, so names stay readable; a narrower box scrolls (or drags) sideways. */
.zmap { display: block; width: max(100%, 720px); max-width: none; height: auto; }
.zmap-scroll.dragging { cursor: grabbing; }
.zm-base { image-rendering: auto; }
:root[data-theme="dark"] .zm-base { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92); }
.zm-shape { transition: fill var(--d) var(--ease-out), stroke var(--d) var(--ease-out), opacity var(--d) var(--ease-out); }
.zm-city .zm-shape { fill: rgb(20 20 20 / 6%); stroke: rgb(20 20 20 / 55%); stroke-width: 3; stroke-dasharray: 12 9; }
.zm-middle .zm-shape { fill: rgb(20 20 20 / 14%); stroke: rgb(20 20 20 / 70%); stroke-width: 3.5; }
.zm-center .zm-shape { fill: rgb(20 20 20 / 30%); stroke: #141414; stroke-width: 4.5; }
:root[data-theme="dark"] .zm-city .zm-shape { fill: rgb(255 255 255 / 5%); stroke: rgb(255 255 255 / 50%); }
:root[data-theme="dark"] .zm-middle .zm-shape { fill: rgb(255 255 255 / 11%); stroke: rgb(255 255 255 / 66%); }
:root[data-theme="dark"] .zm-center .zm-shape { fill: rgb(255 255 255 / 24%); stroke: #ffffff; }
.zmap-wrap.chosen .zm-zone:not(.on) .zm-shape { opacity: .55; }
.zm-me[hidden] { display: none; }
.zm-zone.on .zm-shape { fill: rgb(244 67 54 / 22%); stroke: #e53935; stroke-dasharray: none; opacity: 1; }
.zm-center.on .zm-shape { fill: rgb(244 67 54 / 34%); }
.zmap-wrap.pick .zmap { cursor: pointer; }
.zm-marks { pointer-events: none; }
.zm-mark circle { fill: var(--bg); stroke: var(--text); stroke-width: 3; }
.zm-mark text, .zm-tag text { paint-order: stroke; stroke: var(--bg); stroke-width: 7px; stroke-linejoin: round; fill: var(--text); }
.zm-mark text { font-size: 26px; font-weight: 700; }
.zm-mark-mid circle { fill: var(--text); stroke: var(--bg); }
.zm-tag-n { font-size: 32px; font-weight: 800; }
.zm-tag-f { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.zm-sq circle { fill: #e53935; stroke: #ffffff; stroke-width: 4; }
.zm-me-dot { fill: #1e88e5; stroke: #ffffff; stroke-width: 5; }
.zm-me-ring { fill: rgb(30 136 229 / 22%); stroke: none; transform-box: fill-box; transform-origin: center; animation: ping 2.4s var(--ease-out) infinite; }
.zmap-locate { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 99px;
  background: var(--glass); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; box-shadow: var(--shadow-sm); cursor: pointer; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform var(--d-press) var(--ease-out); }
.zmap-locate:active { transform: scale(.96); }
.zmap-locate .i { font-size: 18px; }
.zmap-locate[aria-busy="true"] { opacity: .7; }
.zmap-note { margin: 0; padding: 8px 14px 10px; font-size: 12.5px; color: var(--muted); background: var(--card); display: flex; gap: 10px; justify-content: space-between; }
.zmap-note span { white-space: nowrap; }
.js .zmap-wrap[data-reveal]:not(.in) .zm-zone { opacity: 0; }
.js .zmap-wrap.in .zm-zone { animation: zone-in var(--d-slow) var(--ease-spring) both; transform-box: view-box; transform-origin: 1001px 515px; }
.js .zmap-wrap.in .zm-middle { animation-delay: 120ms; }
.js .zmap-wrap.in .zm-city { animation-delay: 240ms; }

.zones { display: grid; gap: 28px; margin: 8px 0 36px; }
.zones-map { width: 100%; }
.zones-side { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.zones-side h2 { margin: 0 0 12px !important; }
.zones-side .faraway { margin-top: 0; }

/* zone cards: three rings, the one that is this zone filled */
.zlist { display: grid; gap: 8px; }
.zl { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg);
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.zlist.pick .zl { cursor: pointer; }
.zlist.pick .zl:hover { border-color: var(--line-2); }
.zlist.pick .zl:active { transform: scale(.99); }
.zl input { position: absolute; opacity: 0; pointer-events: none; }
.zl.on, .zl:has(input:checked) { border-color: #e53935; box-shadow: 0 0 0 1px #e53935; background: var(--accent-soft, var(--card)); }
.zl:has(input:focus-visible) { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.zl-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.zl-t strong { font-weight: 800; font-size: 16px; }
.zl-t small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.zl-fee { font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zl-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; border: 1.5px solid var(--line-2); color: transparent; font-size: 14px; flex: none;
  transition: background var(--d-fast), border-color var(--d-fast), color var(--d-fast); }
.zl:has(input:checked) .zl-check { background: #e53935; border-color: #e53935; color: #ffffff; }
.zring { position: relative; flex: none; width: 34px; height: 34px; }
.zring i { position: absolute; inset: 0; margin: auto; border-radius: 99px; border: 1.5px solid var(--line-2); }
.zring i:nth-child(2) { width: 64%; height: 64%; }
.zring i:nth-child(3) { width: 30%; height: 30%; }
.zring-center i:nth-child(3), .zring-middle i:nth-child(2), .zring-city i:nth-child(1) { background: var(--text); border-color: var(--text); }
.zring-middle i:nth-child(3) { background: var(--bg); }
.zring-city i:nth-child(2) { background: var(--bg); }
.zl:has(input:checked) .zring-center i:nth-child(3), .zl:has(input:checked) .zring-middle i:nth-child(2), .zl:has(input:checked) .zring-city i:nth-child(1) { background: #e53935; border-color: #e53935; }
.zdot { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 99px; vertical-align: -1px; margin-right: 8px; border: 1.5px solid var(--text); }
.zdot-center { background: var(--text); }
.zdot-middle { background: color-mix(in srgb, var(--text) 45%, transparent); }
.zdot-city { background: transparent; border-style: dashed; }

/* the picker at checkout */
.zone-pick { display: grid; gap: 12px; margin-bottom: 16px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid transparent; transition: border-color var(--d-fast); }
.zone-pick.invalid { border-color: var(--coral-strong); box-shadow: 0 0 0 4px var(--coral-soft); animation: nudge 360ms var(--ease-out); }
.zone-head { display: grid; gap: 2px; }
.zone-ask { font-weight: 800; font-size: 17px; margin: 0; }
.zone-hint { margin: 0; font-size: 14px; color: var(--text-2); }
.zone-hint.warn { color: var(--coral-strong); font-weight: 700; }
.zone-hint.good { color: var(--text); font-weight: 700; }
.co-form .zl { display: flex; margin: 0; font-weight: 400; font-size: 15px; }
.faraway { display: flex; gap: 14px; align-items: flex-start; margin-top: 14px; padding: 16px; border-radius: var(--r); background: var(--card); }
.faraway > .i { font-size: 24px; color: var(--accent-strong); margin-top: 2px; }
.faraway strong { font-weight: 800; }
.faraway p { margin: 4px 0 0 !important; color: var(--text-2); font-size: 14.5px; }
.faraway-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.faraway-links .pill { min-height: 38px; font-size: 14px; padding: 0 14px; }
.trust li span .zdot { margin-right: 8px; }
@keyframes zone-in { from { opacity: 0; transform: scale(.86); } }
@keyframes ping { 0% { opacity: .8; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.9); } }
/* phones: the map is wider than the screen and scrolls sideways, starting at the square */
@media (max-width: 640px) {
  .zmap-note { flex-direction: column; gap: 2px; }
  .zone-pick { padding: 10px; margin-left: -6px; margin-right: -6px; }
}

/* ---------------------------------------------------------------- list pages */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 22px; font-size: 13.5px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.list-head { padding: 26px 0 26px; }
.list-head h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.04; letter-spacing: -.025em; }
.list-head .count { margin-top: 10px; }
.list-head .intro { margin-top: 14px; max-width: 720px; color: var(--text-2); }
.list-head .intro p + p { margin-top: 10px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 26px; }
.select-pill select { appearance: none; -webkit-appearance: none; height: 40px; padding: 0 36px 0 15px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 14.5px; cursor: pointer; max-width: 240px; }
.select-pill { position: relative; display: inline-flex; }
.select-pill::after { content: "\3b5a"; font-family: "hgi-shop"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; pointer-events: none; }
.select-pill select:hover { background-color: var(--card); }
.price-range { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 6px; border-radius: 99px; border: 1px solid var(--line); }
.price-range input { width: 96px; height: 32px; border: 0; background: transparent; padding: 0 8px; font-size: 14.5px; outline: none; -moz-appearance: textfield; }
.price-range input::-webkit-inner-spin-button { display: none; }
.price-range span { color: var(--muted); }
.toggle { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 8px; border-radius: 99px; border: 1px solid var(--line); font-size: 14.5px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--line-2); transition: background var(--d) var(--ease-out); }
.toggle .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--d) var(--ease-spring); }
.toggle input:checked + .track { background: var(--ink); }
.toggle input:checked + .track::after { transform: translateX(14px); background: var(--on-ink); }
.toggle input:focus-visible + .track { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.js .filters [type=submit] { display: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 44px; }
.empty { text-align: center; padding: 72px 0; }
.empty p { color: var(--muted); margin-bottom: 18px; }
.empty h1 { font-size: 40px; letter-spacing: -.025em; margin-bottom: 12px; }

/* ---------------------------------------------------------------- book page */
.book { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; margin-top: 20px; align-items: start; }
.book-media { position: sticky; top: 96px; }
.stage { position: relative; aspect-ratio: 1 / 1; border-radius: 32px; background: var(--stage); display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 11%; }
.stage .badge { top: 18px; left: 18px; }
.book-cover { max-height: 100%; max-width: 82%; width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: var(--shadow-cover-up); }
.stage .ph.book-cover { height: 86%; }
.stage:has(.photo) { padding: 0; overflow: hidden; }
.book-cover.photo { max-width: 100%; border-radius: 0; box-shadow: none; scale: 1.22; }
.js .stage .book-cover { animation: land var(--d-slow) var(--ease-spring) both; }
.book-cover.swap { animation: flip-in var(--d) var(--ease-punch); }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.thumbs a { flex: none; width: 68px; height: 68px; border-radius: var(--r); background: var(--stage); padding: 4px; display: grid; place-items: center; border: 2px solid transparent; transition: border-color var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.thumbs a:active { transform: scale(.94); }
.thumbs a[aria-current] { border-color: var(--ink); }
.thumbs img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 2px; }
.book-info { padding-top: 8px; min-width: 0; }
.book-info .chips.mini { margin-bottom: 18px; flex-wrap: wrap; overflow: visible; }
.book-info h1 { font-size: clamp(32px, 3.8vw, 50px); line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; }
.subtitle { margin-top: 10px; font-size: 19px; color: var(--text-2); }
.book-info .by { margin-top: 12px; font-size: 16px; color: var(--text-2); }
.book-info .by a { text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.buy { margin-top: 26px; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); }
.buy-price { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.buy-price .prices { flex-direction: row; align-items: baseline; gap: 10px; }
.buy-price .price { font-size: 32px; letter-spacing: -.015em; }
.buy-price .was { font-size: 17px; }
.buy > .muted { margin-top: 10px; }
.buy-row { display: flex; gap: 10px; margin-top: 18px; }
.buy-row .pill.big { flex: 1; min-width: 0; padding: 0 18px; }
.stepper { display: inline-flex; align-items: center; height: 54px; border-radius: 99px; border: 1px solid var(--line-2); padding: 0 5px; flex: none; }
.stepper button { width: 42px; height: 42px; border-radius: 99px; border: 0; background: transparent; font-size: 20px; line-height: 1; transition: background var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.stepper button:hover { background: var(--card); }
.stepper select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; width: 34px; text-align: center; text-align-last: center; font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.stock { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.stock.ok { background: var(--accent-soft); color: var(--accent-strong); }
.stock.low { background: var(--coral-soft); color: var(--coral-strong); }
.stock.out { background: var(--card); color: var(--muted); }
.desc { margin-top: 28px; font-size: 16.5px; line-height: 1.7; color: var(--text-2); max-width: 64ch; }
.desc p + p { margin-top: 14px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; margin: 28px 0 0; }
.facts > div { padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 15.5px; }
.trust { margin-top: 28px; padding: 22px; border-radius: var(--r-lg); background: var(--card); }
.trust h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; letter-spacing: -.015em; margin-bottom: 8px; }
.trust ul { list-style: none; margin: 0 0 12px; padding: 0; }
.trust li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.trust li strong { font-weight: 500; white-space: nowrap; }
.trust p { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }

/* ---------------------------------------------------------------- cart & checkout */
.cart, .checkout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.cart-lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 20px 16px 16px; border-radius: var(--r-lg); background: var(--card); animation: rise var(--d) var(--ease-punch) both; }
.line img, .line .ph { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: var(--stage); }
.line .ph { max-width: 76px; aspect-ratio: auto; box-shadow: none; font-size: 10px; padding: 6px; }
.line .t { font-weight: 500; text-decoration: none; }
.line .was { margin-left: 6px; color: var(--muted); }
.line .problem { color: var(--coral-strong); font-size: 14px; margin-top: 2px; }
.ctrl { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.ctrl button { width: 32px; height: 32px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg); font-size: 16px; line-height: 1; transition: transform var(--d-press) var(--ease-out), background var(--d-fast) var(--ease-out); }
.ctrl button:hover { background: var(--card-2); }
.ctrl button:active { transform: scale(.92); }
.ctrl span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.ctrl .rm { width: auto; border: 0; background: none; padding: 0 8px; color: var(--muted); font-size: 14px; }
.ctrl .rm:hover { color: var(--coral-strong); background: none; }
.amt { font-weight: 500; font-variant-numeric: tabular-nums; }
.summary { position: sticky; top: 96px; padding: 24px; border-radius: var(--r-xl); background: var(--card); }
.summary h2 { font-size: 20px; margin-bottom: 14px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 0; margin: 0 0 14px; }
.summary dt { padding-right: 12px; }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.summary .small { margin: 12px 0; }
.sum-lines { display: grid; gap: 6px; margin-bottom: 14px; font-size: 14px; }
.sum-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.tick { display: inline-block; animation: tick var(--d) var(--ease-punch); }
.co-form fieldset { border: 0; margin: 0 0 14px; padding: 22px; border-radius: var(--r-xl); background: var(--card); min-width: 0; }
.co-form legend { float: left; width: 100%; padding: 0; margin-bottom: 16px; font-size: 18px; font-weight: 500; letter-spacing: -.015em; }
.co-form legend + * { clear: both; }
.co-form label, .lookup label { display: grid; gap: 6px; margin-bottom: 12px; font-size: 14px; font-weight: 500; }
.co-form input:not([type=radio]):not([type=checkbox]), .co-form select, .co-form textarea, .lookup input { width: 100%; min-height: 50px; padding: 0 15px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); font-size: 16px; font-weight: 400;
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out); }
.co-form textarea { padding: 13px 15px; resize: vertical; }
.co-form input:focus, .co-form select:focus, .co-form textarea:focus, .lookup input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--ring); }
.co-form .invalid { border-color: var(--coral-strong) !important; box-shadow: 0 0 0 4px var(--coral-soft) !important; animation: nudge 360ms var(--ease-out); }
.co-form .radio { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; margin: 0 0 8px !important; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); cursor: pointer;
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.radio:active { transform: scale(.99); }
.radio:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.radio input { margin-top: 3px; accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.radio strong { display: block; font-weight: 500; }
.radio small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.co-form .check, .filters .check, .check { display: flex !important; align-items: center; gap: 10px; grid-template-columns: none; font-weight: 400 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.sub { margin-top: 12px; }
.sub:not([hidden]) { animation: rise var(--d) var(--ease-punch); }
.note { padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); margin-bottom: 12px; font-size: 14px; }
.error { color: var(--coral-strong); background: var(--coral-soft); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14.5px; animation: nudge 360ms var(--ease-out); }
.pay, .done { grid-column: 1 / -1; padding: 32px; border-radius: var(--r-xl); background: var(--card); text-align: center; animation: rise var(--d-slow) var(--ease-punch); }
.pay h2, .done h2 { font-size: 30px; letter-spacing: -.02em; }
.pay > p { margin-top: 6px; }
.sandbox { display: inline-block; margin-top: 10px !important; padding: 6px 12px; border-radius: 99px; background: var(--coral-soft); color: var(--coral-strong); font-size: 14px; }
.pay-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: center; margin: 24px auto; max-width: 820px; text-align: left; }
.qr { margin: 0; text-align: center; }
.qr img { width: 100%; background: #fff; border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow-sm); }
.qr figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.app-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.app-list a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg); font-size: 13px; text-decoration: none; transition: transform var(--d-press) var(--ease-out); }
.app-list a:active { transform: scale(.97); }
.app-list img { width: 28px; height: 28px; border-radius: 8px; }
.status { margin: 14px 0; color: var(--text-2); }
.done h2::before { content: "\4908"; font-family: "hgi-shop"; display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 30px; font-weight: normal; letter-spacing: 0; animation: pop var(--d-slow) var(--ease-spring) both; }
.done p { margin: 10px 0 20px; }

/* order page, lookup, prose */
.alert { padding: 14px 16px; border-radius: var(--r); background: var(--coral-soft); color: var(--coral-strong); margin-bottom: 18px; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 26px; counter-reset: s; }
.steps li { flex: 1; position: relative; padding-top: 30px; font-size: 14px; color: var(--muted); text-align: center; }
.steps li::before { content: ''; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 99px; background: var(--line-2); z-index: 1; }
.steps li::after { content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.steps li:first-child::after { display: none; }
.steps li.done, .steps li.now { color: var(--text); }
.steps li.done::before, .steps li.done::after, .steps li.now::after { background: var(--ink); }
.steps li.now::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); animation: pop var(--d-slow) var(--ease-spring); }
.pending { padding: 18px; border-radius: var(--r-lg); background: var(--card); margin-bottom: 18px; display: grid; gap: 10px; justify-items: start; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.o-items { display: grid; gap: 10px; }
.o-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px 12px 12px; border-radius: var(--r-lg); background: var(--card); }
.o-item img, .o-item .ph { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: var(--stage); }
.o-item a { font-weight: 500; text-decoration: none; }
.o-item small { display: block; color: var(--muted); }
.lookup { max-width: 460px; padding: 24px; border-radius: var(--r-xl); background: var(--card); display: grid; }
.lookup .btn { margin-top: 6px; }
.prose { max-width: 720px; padding-top: 28px; }
.prose:has(.zones) { max-width: 1120px; }
.prose h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -.025em; margin-bottom: 26px; }
.prose h2 { font-size: 22px; letter-spacing: -.02em; margin: 32px 0 10px; }
.prose p, .prose li { color: var(--text-2); line-height: 1.7; }
.prose p + p { margin-top: 12px; }
.prose a { text-underline-offset: 3px; }

/* ---------------------------------------------------------------- footer & toast */
.foot { background: var(--card); margin-top: 40px; border-radius: 36px 36px 0 0; }
.foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.foot-brand p { margin-top: 10px; max-width: 280px; color: var(--text-2); }
.foot h2 { font-size: 14px; font-weight: 600; letter-spacing: 0; margin-bottom: 12px; }
.foot a { display: block; color: var(--text-2); text-decoration: none; padding: 4px 0; font-size: 15px; }
.foot a:hover { color: var(--text); }
.foot p { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.foot-note { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line-2); font-size: 13.5px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 50; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); padding: 12px 12px 12px 20px; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: 14.5px; box-shadow: 0 20px 40px -14px rgb(0 0 0 / 40%);
  transform: translateX(-50%); }
.toast:not([hidden]) { animation: toast-in var(--d-slow) var(--ease-spring); }
.toast.closing { animation: toast-out var(--d-fast) var(--ease-in) forwards; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast a { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--on-ink); color: var(--ink); display: inline-flex; align-items: center; text-decoration: none; font-weight: 500; }

/* ---------------------------------------------------------------- page transitions (cross-document) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out var(--d-fast) var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in var(--d) var(--ease-punch) both; }
::view-transition-group(*) { animation-duration: 420ms; animation-timing-function: var(--ease-punch); }
::view-transition-group(top) { animation: none; }

/* ---------------------------------------------------------------- keyframes */
@keyframes slide-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-16px) scale(.99); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 24px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
@keyframes chip-on { from { transform: rotate(-90deg) scale(.6); } }
@keyframes land { from { opacity: 0; transform: translateY(24px) rotate(-2deg) scale(.96); } }
@keyframes flip-in { from { opacity: .3; transform: perspective(800px) rotateY(-24deg) scale(.96); } }
@keyframes shuffle-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes tick { from { opacity: 0; transform: translateY(60%); } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav a { padding: 8px 11px; font-size: 15px; }
}
@media (max-width: 960px) {
  .stories { grid-template-columns: 1fr 1fr; }
  .top-row { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .show-sm { display: inline-grid !important; }
  .hide-sm { display: none !important; }
  .book { grid-template-columns: 1fr; gap: 28px; }
  .book-media { position: static; }
  .cart, .checkout, .order-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .top-row { height: 64px; }
  .logo img { height: 34px; }
  .hero { padding: 40px 0 32px; }
  .hero-sub { font-size: 16.5px; margin-top: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { padding: 10px 12px 14px; border-radius: 20px; }
  .card-stage { height: 196px; padding: 34px 0 4px; }
  .card-stage .cover, .ph { max-width: 82%; }
  .badge { top: 10px; left: 10px; height: 24px; padding: 0 9px; font-size: 12px; }
  .card-act { top: 8px; right: 8px; width: 34px; height: 34px; }
  .card-body { flex-direction: column; gap: 6px; margin-top: 12px; }
  .card h3 { font-size: 14.5px; }
  .prices { align-items: flex-start; flex-direction: row; gap: 6px; align-items: baseline; }
  .price { font-size: 15px; }
  .chip-bar { margin-left: -16px; margin-right: -16px; padding-left: 16px; }
  .chip-bar .chips { padding-right: 16px; margin-right: 0; }
  .chip-bar .more { display: none; }
  .shelf { margin-top: 64px; }
  .list-head { padding: 18px 0 20px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 2px 16px; }
  .filters > * { flex: none; }
  .stage { border-radius: 24px; }
  .buy { padding: 16px; }
  .buy-price .price { font-size: 28px; }
  .facts { grid-template-columns: 1fr; }
  .line { grid-template-columns: 60px minmax(0, 1fr); padding: 12px; }
  .line .amt { grid-column: 2; }
  .line img, .line .ph { width: 60px; height: 60px; }
  .co-form fieldset, .summary, .lookup { padding: 18px; border-radius: var(--r-lg); }
  .pay { padding: 22px 16px; }
  .pay-grid { grid-template-columns: 1fr; }
  .qr { max-width: 260px; margin: 0 auto; }
  .steps li { font-size: 12px; }
  .foot { border-radius: 28px 28px 0 0; }
  .foot-note { flex-direction: column; gap: 4px; }
  .search input { font-size: 19px; }
  .zones-side { grid-template-columns: 1fr; }
  .stories { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin: -4px -16px 48px; padding: 4px 16px; }
  .stories::-webkit-scrollbar { display: none; }
  .story { scroll-snap-align: start; min-height: 112px; }
  .story-pic { width: 80px; height: 80px; }
  .visit, .club { grid-template-columns: 1fr; padding: 24px 20px; border-radius: 28px; margin-top: 64px; }
  .fan.big { width: 240px; height: 180px; }
  .fan.big .fan-c { width: 120px; height: 120px; }
  .fan.big .fan-c:nth-child(1) { right: 112px; }
  .fan.big .fan-c:nth-child(2) { right: 60px; }
  .about-hero { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 24px; }
  .about-photos.n3 { height: 300px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .trads { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px; }
  .trads::-webkit-scrollbar { display: none; }
  .trad { min-height: 200px; scroll-snap-align: start; }
  .formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collections { grid-template-columns: 1fr; }
}
/* page loader: the brush lettering "Эрүүл ухааныг эрхэмлэнэ" while a slow page loads (shop.js shows it after 350 ms) */
.page-loader { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); animation: loader-in var(--d) var(--ease) both; }
.page-loader[hidden] { display: none; }
.page-loader img { width: min(320px, 72vw); height: auto; animation: loader-breathe 2.4s ease-in-out infinite; }
.page-loader p { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
@keyframes loader-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes loader-breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .72; transform: scale(.985); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
  .js [data-reveal]:not(.in) { opacity: 1; transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------------------------------------------------------------- account ("Миний булан") */
.acct-link { position: relative; }
.acct-link.in::after { content: ''; position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.text-btn { padding: 6px 2px; border: 0; background: none; font-size: 14.5px; font-weight: 600; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.text-btn:hover { color: var(--text); }
.acct-login .lookup { gap: 2px; }
.acct-login .small { margin-top: 12px; }
.acct-sent { margin-bottom: 14px; font-weight: 600; overflow-wrap: anywhere; }
.lookup input.code-in { font-size: 26px; font-weight: 700; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; }
.acct-alt { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.acct-head p { overflow-wrap: anywhere; }
.acct { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-bottom: 64px; }
.acct h2 { font-size: 20px; margin-bottom: 14px; }
.acct-orders { display: grid; gap: 10px; }
.acct-order { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px 14px 14px; border-radius: var(--r-lg); background: var(--card); text-decoration: none; transition: background var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
a.acct-order:hover { background: var(--card-2); }
a.acct-order:active { transform: scale(.99); }
.ao-covers { display: flex; }
.ao-covers img, .ao-covers .ph, .ao-more { width: 52px; height: 52px; border-radius: 10px; background: var(--stage); object-fit: contain; box-shadow: 0 0 0 2px var(--card); }
.ao-covers > * + * { margin-left: -18px; }
.ao-more { display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--text-2); }
.ao-body { min-width: 0; }
.ao-body strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ao-body small { display: block; color: var(--muted); font-size: 13.5px; }
.ao-end { display: grid; justify-items: end; gap: 4px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tag.go { background: var(--accent-soft); color: var(--accent-strong); }
.tag.wait { background: var(--coral-soft); color: var(--coral-strong); }
.tag.quiet { background: var(--card-2); color: var(--text-2); }
.acct-empty { display: grid; justify-items: start; gap: 14px; padding: 28px; border-radius: var(--r-xl); background: var(--card); }
.acct-side { display: grid; gap: 16px; }
.points-card { padding: 24px; border-radius: var(--r-xl); background: var(--panel); color: var(--on-panel); }
.pc-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: rgb(255 255 255 / 78%); }
.pc-label .i { font-size: 18px; color: var(--accent); }
.pc-num { display: block; margin: 6px 0 8px; font-size: 52px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.points-card .small { color: rgb(255 255 255 / 70%); }
.pc-list { list-style: none; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid rgb(255 255 255 / 16%); display: grid; gap: 10px; }
.pc-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14.5px; }
.pc-list small { display: block; color: rgb(255 255 255 / 56%); font-size: 12.5px; }
.pc-list b { color: var(--accent); font-variant-numeric: tabular-nums; }
.pc-list b.neg { color: #ff8a80; }
.acct-profile { max-width: none; }
.acct-profile h2, .acct-address h2 { font-size: 17px; }
.acct-address { padding: 22px 24px; border-radius: var(--r-xl); background: var(--card); }
.acct-address p { margin-bottom: 8px; overflow-wrap: anywhere; }
.co-acct { margin-bottom: 14px; padding: 12px 16px; border-radius: var(--r); background: var(--card); font-size: 14.5px; overflow-wrap: anywhere; }
.co-acct a { font-weight: 700; }
@media (max-width: 900px) {
  .acct { grid-template-columns: minmax(0, 1fr); }
  .acct-side { display: contents; }
  .points-card { order: -1; }
  .acct-profile, .acct-address { order: 1; }
}
@media (max-width: 560px) {
  .acct-order { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px; }
  .ao-covers { grid-column: 1 / -1; }
  .ao-covers img, .ao-covers .ph, .ao-more { width: 46px; height: 46px; }
  .pc-num { font-size: 44px; }
  .acct-head .pill { min-height: 38px; padding: 0 14px; }
}

/* ---------------------------------------------------------------- reviews */
.st { width: 18px; height: 18px; flex: none; fill: var(--line-2); stroke: var(--line-2); stroke-width: 1.6; stroke-linejoin: round; }
.st.on { fill: var(--gold); stroke: var(--gold); }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.card .rate { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 13.5px; font-weight: 700; }
.card .rate .st { width: 14px; height: 14px; }
.card .rate small { font-weight: 500; color: var(--muted); }
.rate-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; text-decoration: none; font-size: 15px; }
.rate-link span:last-child { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.reviews { margin: 56px 0 24px; scroll-margin-top: 96px; }
.rv-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.rv-grid.solo { grid-template-columns: minmax(0, 520px); }
.rv-grid.solo .rv-list:empty { display: none; }
.rv-side { display: grid; gap: 16px; padding: 24px; border-radius: var(--r-xl); background: var(--card); }
.rv-sum { display: flex; align-items: center; gap: 14px; }
.rv-avg { font-size: 52px; line-height: 1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rv-sum small { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.rv-dist { display: grid; gap: 5px; }
.rv-dist div { display: grid; grid-template-columns: 12px minmax(0, 1fr) 24px; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rv-dist span:last-child { text-align: right; color: var(--muted); }
.rv-dist progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--card-2); appearance: none; -webkit-appearance: none; }
.rv-dist progress::-webkit-progress-bar { background: var(--card-2); }
.rv-dist progress::-webkit-progress-value { background: var(--gold); border-radius: 99px; }
.rv-dist progress::-moz-progress-bar { background: var(--gold); border-radius: 99px; }
.rv-none { font-weight: 600; }
.rv-signin a { font-weight: 700; }
.rv-form { display: grid; gap: 4px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.rv-form h3 { font-size: 17px; margin-bottom: 6px; }
.rv-form label { display: grid; gap: 6px; margin-bottom: 10px; font-size: 14px; font-weight: 500; }
.rv-form input:not([type=radio]), .rv-form textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); font-size: 16px; font-weight: 400; }
.rv-form textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.rv-form input:focus, .rv-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--ring); }
.rv-pick { position: relative; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin-bottom: 12px; }
.rv-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rv-pick label { display: block; margin: 0; padding: 3px; cursor: pointer; border-radius: 10px; }
.rv-pick .st { width: 34px; height: 34px; transition: transform var(--d-fast) var(--ease-spring), fill var(--d-fast), stroke var(--d-fast); }
.rv-pick input:checked ~ label .st, .rv-pick label:hover .st, .rv-pick label:hover ~ label .st { fill: var(--gold); stroke: var(--gold); }
.rv-pick label:active .st { transform: scale(.86); }
.rv-pick input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 1px; }
.rv-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.rv-list { display: grid; gap: 12px; }
.rv { padding: 20px 22px; border-radius: var(--r-lg); background: var(--card); }
.rv header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.rv header time { margin-left: auto; font-size: 13px; color: var(--muted); }
.rv .tag { display: inline-flex; align-items: center; gap: 4px; }
.rv .tag .i { font-size: 13px; }
.rv p { overflow-wrap: anywhere; }
.rv p + p { margin-top: 8px; }
.acct-h2 { margin-top: 32px; }
.to-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.to-review a { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; border-radius: var(--r-lg); background: var(--card); text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background var(--d-fast) var(--ease-out); }
.to-review a:hover { background: var(--card-2); }
.to-review a:hover .st { fill: var(--gold); stroke: var(--gold); }
.to-review img, .to-review .ph { width: 46px; height: 46px; border-radius: 10px; background: var(--stage); object-fit: contain; }
.to-review span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .rv-grid { grid-template-columns: minmax(0, 1fr); }
  .acct-main { display: contents; }
  .acct-main > h2:first-child, .acct-orders, .acct-empty { order: 0; }
  .acct-h2, .to-review { order: 0; }
}
@media (max-width: 560px) {
  .reviews { margin-top: 40px; }
  .rv-side { padding: 18px; border-radius: var(--r-lg); }
  .rv { padding: 16px 18px; }
}

/* ---------------------------------------------------------------- phone tab bar (M11) */
.tabbar { display: none; }
@media (max-width: 960px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    box-shadow: 0 -1px 0 var(--line); view-transition-name: tabbar; }
  .tb { display: grid; justify-items: center; gap: 2px; padding: 4px 0 2px; border: 0; background: none; color: var(--muted); text-decoration: none; font: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color var(--d-fast) var(--ease-out); }
  .tb-ic { position: relative; display: grid; place-items: center; width: 56px; height: 32px; border-radius: 99px; transition: background var(--d) var(--ease-punch), transform var(--d-press) var(--ease-out); }
  .tb-ic .i { font-size: 23px; }
  .tb-l { font-size: 11.5px; font-weight: 700; letter-spacing: .01em; }
  .tb[aria-current] { color: var(--ink); }
  .tb[aria-current] .tb-ic { background: var(--accent-soft); }
  .tb[aria-current] .tb-ic .i { color: var(--accent-strong); }
  .tb:active .tb-ic { transform: scale(.9); }
  .tb .count { position: absolute; top: -2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-text);
    font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
  .tb .count.bump { animation: bump var(--d-slow) var(--ease-spring); }
  .tb .dot { display: none; }
  .tb.acct-link.in .dot { display: block; position: absolute; top: 3px; right: 14px; width: 9px; height: 9px; border-radius: 99px; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
  .acct-link.in::after { content: none; }
  .tb.acct-link.in .tb-ic::after { content: none; }
  /* room for the bar under the page and above it for the toast */
  body:has(.tabbar) .foot { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body:has(.tabbar) .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  ::view-transition-group(tabbar) { animation: none; }
}

/* ---------------------------------------------------------------- polish (2026-11-27): Onest, cards, cart, book page */
h1, h2, h3 { letter-spacing: -.022em; }
.hero h1 { letter-spacing: -.038em; }
.list-head h1, .book-info h1 { letter-spacing: -.032em; }
.shelf-head h2 { letter-spacing: -.028em; }
/* Cards: the title gets the full width (two lines, always the same height) and the price sits under it, so the
   prices of a row line up and long titles are not cut short by the price. */
.card-body { flex: 1; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 6px; }
.card h3 { min-height: 2.6em; }
.card .prices { flex-direction: row; align-items: baseline; gap: 8px; }
.top-order { min-height: 40px; }
/* cart */
.ctrl button { width: 36px; height: 36px; }
.ctrl .rm { height: 36px; }
.line .problem { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 600; }
.fix { border: 0; background: none; padding: 0; font: inherit; font-size: 14px; font-weight: 700; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cart-note { margin: 12px 0 0; padding: 12px 14px; border-radius: var(--r); background: var(--coral-soft); color: var(--coral-strong); font-size: 14px; font-weight: 600; }
.cart-note a, .cart-note .fix { color: var(--coral-strong); }
.summary .btn.block { margin-top: 14px; }
.btn.disabled, .btn[aria-disabled="true"], .btn:disabled { opacity: .45; cursor: not-allowed; }
/* book page: long descriptions fold */
.desc.fold:not(.open) { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.desc-more { margin-top: 8px; font-size: 15px; }
/* phone buy bar, above the tab bar */
.buybar { display: none; }
@media (max-width: 960px) {
  .buybar:not([hidden]) { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 29; display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 18px; border-radius: 99px; background: var(--bg); box-shadow: 0 10px 30px -8px rgb(0 0 0 / 28%), 0 0 0 1px var(--line); animation: rise var(--d) var(--ease-punch); }
  .bb-text { flex: 1; min-width: 0; display: grid; }
  .bb-text strong { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bb-text .prices { flex-direction: row; align-items: baseline; gap: 6px; }
  .bb-text .price { font-size: 15px; }
  .buybar .pill { min-height: 44px; flex: none; }
  .ctrl button { width: 40px; height: 40px; }
  body:has(.buybar:not([hidden])) .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* My shelf on /account (owner request 2026-11-28): bought books stand on light wooden shelves; a tap lifts the
   book out and it grows to the middle of the screen while the page fades (shop.js), then the book page opens. */
.shelf-wrap { margin: 4px 0 40px; }
.shelf-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.shelf-top h2 { font-size: 20px; }
.bookshelf {
  --book-h: 168px; --board: 22px; --lift: 26px; --row: calc(var(--book-h) + var(--lift) + var(--board));
  display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); grid-auto-rows: var(--row);
  align-items: end; justify-items: center; column-gap: 18px; padding: 10px 26px 0; border-radius: 22px;
  background-color: var(--wood);
  background-image: repeating-linear-gradient(to bottom,
    rgba(120, 90, 50, 0) 0, rgba(120, 90, 50, 0) calc(var(--row) - var(--board) - 26px),
    rgba(120, 90, 50, .07) calc(var(--row) - var(--board)),
    var(--wood-1) calc(var(--row) - var(--board)), var(--wood-2) calc(var(--row) - var(--board) + 3px),
    var(--wood-3) calc(var(--row) - 5px), var(--wood-4) calc(var(--row) - 5px), var(--wood-5) var(--row));
  box-shadow: inset 0 0 0 1px rgba(120, 90, 50, .08);
}
.shelf-book { position: relative; display: inline-flex; align-items: flex-end; height: var(--book-h); max-width: 100%; margin-bottom: var(--board);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1); -webkit-tap-highlight-color: transparent; }
.shelf-book img, .shelf-plain { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; border-radius: 2px 5px 5px 2px;
  box-shadow: 0 12px 14px -8px rgba(60, 40, 15, .45), 0 2px 3px rgba(60, 40, 15, .18); }
/* a hint of a spine and of light on the cover */
.shelf-book::after { content: ''; position: absolute; inset: 0; border-radius: 2px 5px 5px 2px; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .22), rgba(255, 255, 255, .16) 3%, rgba(255, 255, 255, 0) 9%), linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 40%); }
.shelf-book:hover, .shelf-book:focus-visible { transform: translateY(-10px); }
.shelf-book:focus-visible { outline: none; }
.shelf-book:focus-visible img, .shelf-book:focus-visible .shelf-plain { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.shelf-book.pulled { visibility: hidden; }
.shelf-plain { display: flex; flex-direction: column; justify-content: space-between; width: 112px; padding: 12px 10px; background: linear-gradient(160deg, #2b3a55, #1d2638); color: #f4efe6; text-align: left; overflow: hidden; }
.shelf-plain b { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-plain small { font-size: 11px; opacity: .75; }
.bookshelf.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: var(--row); padding: 28px 20px calc(var(--board) + 24px); text-align: center; color: var(--muted); }
.shelf-ghost { position: fixed; z-index: 1001; margin: 0; object-fit: contain; border-radius: 3px 8px 8px 3px; pointer-events: none; will-change: transform;
  box-shadow: 0 30px 60px -20px rgba(30, 20, 5, .55), 0 8px 18px rgba(30, 20, 5, .25); }
.shelf-veil { position: fixed; inset: 0; z-index: 1000; background: var(--bg); opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
  .bookshelf { --book-h: 124px; --board: 18px; --lift: 20px; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); column-gap: 12px; padding: 8px 14px 0; border-radius: 18px; }
  .shelf-plain { width: 84px; padding: 9px 8px; }
  .shelf-plain b { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) { .shelf-book { transition: none; } .shelf-book:hover { transform: none; } }

/* ================================================================ v3 (2026-12-05): "books in motion"
   The covers carry the page. A row of real covers drifts under the headline and can be dragged; every card stands
   on a stage tinted from its own cover (shop.js reads the colour) and the book leans towards the pointer; books
   without a photo get a typeset cover in one of six house colours; shelves scroll sideways; an added book flies
   to the bag; the header gathers into a floating glass capsule once the page scrolls. docs/DESIGN.md §2.9. */
:root { --r-stage: 26px; }

/* ---- header: clear at the top of the page, a floating capsule once scrolled */
.top { height: 76px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
.top.scrolled { box-shadow: none; }
.top-row { position: relative; pointer-events: auto; isolation: isolate; border-radius: 99px;
  transition: max-width var(--d-slow) var(--ease-punch), height var(--d-slow) var(--ease-punch), margin-top var(--d-slow) var(--ease-punch), padding var(--d-slow) var(--ease-punch); }
.top-row::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: transparent; transition: background-color var(--d) var(--ease-out), box-shadow var(--d) var(--ease-out); }
.top.scrolled .top-row { max-width: min(1180px, calc(100% - 24px)); height: 60px; margin-top: 8px; padding: 0 9px 0 22px; }
.top.scrolled .top-row::before { background: var(--glass); backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px); box-shadow: 0 0 0 1px var(--line), 0 16px 36px -16px rgb(0 0 0 / 26%); }
/* the pill behind the menu follows the pointer and rests on the current page */
.nav { position: relative; }
.nav-ink { position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; z-index: -1; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); opacity: 0; pointer-events: none; }
.nav.ready .nav-ink { transition: transform var(--d-slow) var(--ease-spring), width var(--d-slow) var(--ease-spring), opacity var(--d-fast) var(--ease-out); }
.nav.inked a, .nav.inked a:hover, .nav.inked a[aria-current] { background: none; border-color: transparent; }

/* ---- hero: big headline over a soft glow in the two brand colours, search first */
/* .lead spans the window (it sits outside .wrap); it clips the glow sideways so nothing makes the page wider */
.lead { position: relative; isolation: isolate; overflow-x: clip; }
.lead::before { content: ''; position: absolute; z-index: -1; left: -12%; right: -12%; top: -150px; height: 640px; pointer-events: none;
  background: radial-gradient(34% 46% at 30% 46%, var(--glow-1), transparent 72%), radial-gradient(30% 44% at 70% 36%, var(--glow-2), transparent 72%), radial-gradient(28% 40% at 52% 78%, var(--glow-3), transparent 72%);
  animation: glow 16s ease-in-out infinite alternate; }
.hero { max-width: none; padding: 56px 0 28px; }
.hero h1 { font-size: clamp(42px, 7vw, 100px); line-height: .98; letter-spacing: -.046em; }
.hero-sub { margin-top: 22px; font-size: clamp(16.5px, 1.4vw, 20px); }
.hero-search { display: flex; align-items: center; gap: 10px; width: min(540px, 100%); height: 60px; margin: 30px auto 0; padding: 0 8px 0 20px; border-radius: 99px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: 0 0 0 1px var(--line), 0 20px 44px -24px rgb(0 0 0 / 34%); transition: box-shadow var(--d) var(--ease-out), transform var(--d) var(--ease-spring); }
.hero-search:focus-within { box-shadow: 0 0 0 2px var(--ink), 0 26px 56px -26px rgb(0 0 0 / 40%); transform: scale(1.015); }
.hero-search > .i { font-size: 22px; color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: 17px; text-align: left; }
.hero-search input::-webkit-search-cancel-button { display: none; }
.icon-btn.go { width: 44px; height: 44px; background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.icon-btn.go:hover { background: var(--ink-hover); }
.icon-btn.go .i { transition: transform var(--d) var(--ease-punch); }
.hero-search:focus-within .go .i, .icon-btn.go:hover .i { transform: translateX(2px); }
.js .hero-search { animation: rise var(--d-slow) var(--ease-punch) 300ms both; }

@keyframes glow { from { transform: translate3d(-3%, 0, 0) scale(1); } to { transform: translate3d(3%, 14px, 0) scale(1.08); } }

/* ---- cards: a tinted stage, the book on it, the words underneath on the white page */
.shelf-head h2 { font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.034em; }
.grid { gap: 36px 22px; }
.card { background: none; border-radius: 0; padding: 0; overflow: visible; }
.card-stage { position: relative; z-index: 2; pointer-events: none; height: auto; aspect-ratio: 1 / 1.14; padding: 0; overflow: visible; border-radius: var(--r-stage); background: hsl(var(--th, 0) calc(var(--ts, 0%) * var(--tint-k)) var(--tint-l));
  display: grid; place-items: center; container-type: size; transition: background-color 700ms var(--ease-out); }
.bk { position: relative; display: block; line-height: 0; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform var(--d-slow) var(--ease-spring); }
.bk::before, .bk::after { content: ''; position: absolute; inset: 0; border-radius: 3px; pointer-events: none; }
/* spine light on the left edge, and a glare that follows the pointer */
.bk::before { z-index: 1; background: linear-gradient(90deg, rgb(0 0 0 / 14%), rgb(255 255 255 / 22%) 2.4%, rgb(255 255 255 / 0%) 7.5%); }
.bk::after { z-index: 1; background: radial-gradient(110% 85% at var(--gx, 30%) var(--gy, 0%), rgb(255 255 255 / 38%), rgb(255 255 255 / 0%) 62%); opacity: 0; transition: opacity var(--d) var(--ease-out); }
.card:hover .bk { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px) scale(1.045); }
.card:hover .bk::after, .stage.tilting .bk::after { opacity: 1; }
.tilting .bk { transition-duration: 140ms; transition-timing-function: var(--ease-out); }
.card-stage .cover { max-width: 66cqw; max-height: 78cqh; width: auto; height: auto; border-radius: 3px; box-shadow: var(--shadow-cover); transform: none; transition: box-shadow var(--d-slow) var(--ease-out); }
.card:hover .card-stage .cover { box-shadow: var(--shadow-cover-up); }
.badge { z-index: 3; }
.card-act { top: auto; right: 12px; bottom: 12px; z-index: 3; width: 42px; height: 42px; pointer-events: auto; background: var(--ink); color: var(--on-ink); box-shadow: 0 10px 22px -10px rgb(0 0 0 / 55%);
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), opacity var(--d) var(--ease-out), transform var(--d) var(--ease-spring); }
button.card-act:hover { background: var(--ink-hover); }
@media (hover: hover) and (pointer: fine) {
  .card-act { opacity: 0; transform: translateY(8px) scale(.86); }
  .card:hover .card-act, .card-act:focus-visible, .card-act.added { opacity: 1; transform: none; }
  .card:hover .card-act:active { transform: scale(.92); }
}
.card-body { margin-top: 14px; padding: 0 4px; gap: 3px; }
.card h3 { font-size: 15.5px; font-weight: 700; line-height: 1.28; }
.card .prices { margin-top: auto; padding-top: 6px; }
.card-more { aspect-ratio: 1 / 1.14; min-height: 0; align-self: start; border-radius: var(--r-stage); background: var(--stage); transition: background var(--d-fast) var(--ease-out); }
.card-more:hover { background: var(--card-2); }

/* ---- typeset covers for books without a photo */
.tc { position: relative; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; place-items: normal; padding: 11% 9% 10%; text-align: left; font-size: 6.4cqh; font-weight: 800; line-height: 1.08;
  border-radius: 3px; overflow: hidden; background: var(--tc-bg, #141414); color: var(--tc-fg, #ffffff); box-shadow: var(--shadow-cover); }
.tc b { order: 1; letter-spacing: -.03em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: .1em; }
.tc small { order: 2; margin-top: .9em; font-size: .5em; font-weight: 600; line-height: 1.28; letter-spacing: .01em; opacity: .82; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc small:empty { display: none; }
/* the shop's mark in the corner, like a publisher's device */
.tc::after { content: ''; position: absolute; left: 9%; bottom: 7.5%; width: 13%; aspect-ratio: 1; background: currentColor; opacity: .5;
  -webkit-mask: url(logo-mark.svg) center / contain no-repeat; mask: url(logo-mark.svg) center / contain no-repeat; }
.card-stage .tc.cover, .stage .tc.book-cover { height: 78cqh; width: auto; max-width: none; max-height: none; aspect-ratio: 2 / 3; }
.tc-0 { --tc-bg: #141414; --tc-fg: #ffffff; }
.tc-1 { --tc-bg: #f6f6f6; --tc-fg: #141414; }
.tc-2 { --tc-bg: #333333; --tc-fg: #f2f2f2; }
.tc-3 { --tc-bg: #e21204; --tc-fg: #ffffff; }
.tc-4 { --tc-bg: #cc9b58; --tc-fg: #1f1708; }
.tc-5 { --tc-bg: #282e3a; --tc-fg: #e3e8ef; }
:is(.card-stage, .stage, .book-top):has(.tc-3) { --th: 4; --ts: 62%; }
:is(.card-stage, .stage, .book-top):has(.tc-4) { --th: 35; --ts: 46%; }
:is(.card-stage, .stage, .book-top):has(.tc-5) { --th: 220; --ts: 20%; }

/* ---- shelves that scroll sideways */
.rail-nav { display: flex; align-items: center; gap: 8px; }
.rail-nav .icon-btn:disabled { opacity: .35; pointer-events: none; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 66px) / 4); gap: 22px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  padding: 12px 2px 8px; margin: -12px -2px 0; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* ---- topics: a slow band of big words */
.band { overflow: hidden; padding: 4px 0 10px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.band-track { display: flex; align-items: center; width: max-content; animation: band 48s linear infinite; }
.band:hover .band-track, .band:focus-within .band-track { animation-play-state: paused; }
.band-w { display: inline-flex; align-items: flex-start; gap: 6px; padding-right: clamp(26px, 3.6vw, 56px); font-size: clamp(34px, 5.4vw, 76px); font-weight: 800; line-height: 1.12; letter-spacing: -.042em; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: color var(--d) var(--ease-out); }
.band-w span { display: inline-block; transition: transform var(--d-slow) var(--ease-spring); }
.band-w sup { margin-top: .55em; font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0; color: var(--muted); }
.band-w::after { content: ''; align-self: center; width: .16em; height: .16em; margin-left: clamp(20px, 3vw, 48px); border-radius: 99px; background: var(--accent); }
.band:hover .band-w { color: var(--line-2); }
.band .band-w:hover, .band-w:focus-visible { color: var(--text); }
.band-w:hover span { transform: skewX(-8deg) translateX(4px); }
@keyframes band { to { transform: translateX(-50%); } }

/* ---- book page */
.stage { background: hsl(var(--th, 0) calc(var(--ts, 0%) * var(--tint-k)) var(--tint-l)); padding: 0; container-type: size; transition: background-color 700ms var(--ease-out); }
.stage::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(closest-side, var(--stage-glow), transparent); pointer-events: none; }
.stage .bk { transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.book-cover { max-width: 62cqw; max-height: 80cqh; view-transition-name: book-cover; }
.pill[data-add].added { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pill[data-add].added .i { animation: pop var(--d-slow) var(--ease-spring); }
/* the copy of a cover that flies to the bag */
.fly { position: fixed; z-index: 90; left: 0; top: 0; pointer-events: none; will-change: transform; }
.fly > * { display: block; width: 100%; height: 100%; border-radius: 4px; object-fit: cover; box-shadow: var(--shadow-cover); will-change: transform, opacity; }

/* ---- footer: the wordmark, full width, slides up as the page ends */
.foot { overflow: hidden; }
.foot-mark { padding-top: 18px; padding-bottom: 30px; }
.foot-mark img { width: min(100%, 520px); height: auto; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .foot-mark img { animation: mark-up linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  }
}
@keyframes mark-up { from { transform: translateY(46%); opacity: .2; } to { transform: none; opacity: 1; } }

@media (max-width: 1180px) {
  .rail { grid-auto-columns: calc((100% - 44px) / 3); }
}
@media (max-width: 700px) {
  .top { height: 64px; }
  .top.scrolled .top-row { height: 52px; margin-top: 6px; padding: 0 6px 0 16px; max-width: calc(100% - 16px); }
  .hero { padding: 30px 0 18px; }
  .hero-search { height: 54px; margin-top: 22px; padding: 0 6px 0 16px; }
  .icon-btn.go { width: 42px; height: 42px; }
  .grid { gap: 26px 12px; }
  .card { padding: 0; border-radius: 0; }
  /* phones: the book stands a little lower, so the badge above it and the add button beside it stay clear */
  .card-stage { height: auto; padding: 0 0 5%; border-radius: 20px; align-items: end; }
  .card-stage .cover { max-width: 64cqw; max-height: 76cqh; }
  .card-stage .tc.cover { height: 76cqh; }
  .card-act { top: auto; right: 8px; bottom: 8px; width: 38px; height: 38px; }
  .card-body { margin-top: 10px; padding: 0 2px; }
  .card-more { border-radius: 20px; }
  .rail { grid-auto-columns: 44%; gap: 12px; margin: -12px -16px 0; padding: 12px 16px 8px; scroll-padding-inline: 16px; }
  .rail-nav .icon-btn { display: none; }
  .band-w sup { font-size: 12px; }
  .foot-mark { padding-top: 10px; padding-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .lead::before { animation: none; }
  .band { -webkit-mask-image: none; mask-image: none; }
  .band-track { animation: none; width: auto; flex-wrap: wrap; row-gap: 6px; }
  .band-w[aria-hidden] { display: none; }
  .bk, .card:hover .bk { transform: none; }
}

/* ================================================================ v4 (2026-12-05): new layout, light and dark
   Header: logo, menu, a wide search field, the mode switch, account, bag. Home: words on the left and a wall of
   moving covers on the right; news as a bento; new books beside a sticky index; traditions that open like an
   accordion; numbered reading tips; a dark "visit us" panel. Catalogue: a sticky tree of categories beside the
   grid. Book page: one tinted panel with the words, the book and the buy card. Phones get a floating tab bar.
   Every colour comes from a variable so both modes share the rules. docs/DESIGN.md §2.10. */

/* ---- header */
.top-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 26px; }
.nav { justify-self: start; }
.find { display: inline-flex; align-items: center; gap: 10px; width: clamp(200px, 21vw, 300px); height: 42px; padding: 0 9px 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 14.5px; font-weight: 500; text-align: left; transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out), transform var(--d-press) var(--ease-out); }
.find .i { font-size: 18px; }
.find span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find kbd { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); font: 600 12px/1 var(--font); color: var(--muted); }
.find:hover { background: var(--card-2); border-color: var(--line-2); color: var(--text); }
.find:active { transform: scale(.98); }
/* the mode switch: one drawn shape, a sun with eight rays that folds into a crescent */
.theme-ic { position: relative; display: block; width: 16px; height: 16px; border-radius: 50%; background: currentColor; transform: scale(.5);
  box-shadow: 0 -14px 0 -5px, 0 14px 0 -5px, 14px 0 0 -5px, -14px 0 0 -5px, 10px 10px 0 -5px, -10px 10px 0 -5px, 10px -10px 0 -5px, -10px -10px 0 -5px;
  transition: transform var(--d-slow) var(--ease-spring), box-shadow var(--d) var(--ease-out); }
.theme-ic::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; background: var(--bg); transform: translate(80%, -80%) scale(0); transition: transform var(--d-slow) var(--ease-spring), background var(--d-fast) var(--ease-out); }
.theme-btn:hover .theme-ic::after { background: var(--card); }
[data-theme="dark"] .theme-ic { transform: scale(1) rotate(-24deg); box-shadow: 0 0 0 -8px, 0 0 0 -8px, 0 0 0 -8px, 0 0 0 -8px, 0 0 0 -8px, 0 0 0 -8px, 0 0 0 -8px, 0 0 0 -8px; }
[data-theme="dark"] .theme-ic::after { transform: translate(36%, -36%) scale(1); }
@media (max-width: 1140px) {
  .find { width: 42px; padding: 0; justify-content: center; background: var(--bg); color: var(--text); }
  .find span, .find kbd { display: none; }
  .find .i { font-size: 20px; }
}

/* ---- home: words left, a wall of covers right */
.lead-row { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; }
.lead.solo .lead-row { grid-template-columns: minmax(0, 1fr); }
.hero { margin: 0; padding: 40px 0 56px; text-align: left; }
.lead.solo .hero { text-align: center; padding: 64px 0 40px; }
.hero h1 { font-size: clamp(40px, 5.5vw, 82px); line-height: .98; text-wrap: balance; }
.hero-sub { margin: 24px 0 0; max-width: 30em; }
.hero-search { margin: 34px 0 0; }
.lead.solo .hero-sub, .lead.solo .hero-search { margin-left: auto; margin-right: auto; }
.lead::before { left: -12%; right: -12%; top: -170px; height: 760px; }
/* three columns drift past each other; each track holds its covers twice, so sliding it by half loops */
.wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; height: min(660px, calc(100svh - 96px)); min-height: 460px; overflow: hidden; transform: rotate(5deg) scale(1.06);
  -webkit-mask-image: linear-gradient(transparent, #000 17%, #000 83%, transparent); mask-image: linear-gradient(transparent, #000 17%, #000 83%, transparent); }
.js .wall { animation: fade-in 900ms var(--ease-out) 200ms both; }
.wall-col { min-width: 0; min-height: 0; }
.wall-track { display: flex; flex-direction: column; gap: 16px; padding-bottom: 16px; animation: wall-up 76s linear infinite; will-change: transform; }
.wall-1 .wall-track { animation-direction: reverse; animation-duration: 92s; }
.wall-2 .wall-track { animation-duration: 62s; }
.wall:hover .wall-track, .wall:focus-within .wall-track { animation-play-state: paused; }
.wall-item { display: block; border-radius: 6px; -webkit-user-drag: none; }
.wall-item img { width: 100%; height: auto; border-radius: 6px; box-shadow: var(--shadow-cover); transition: transform var(--d-slow) var(--ease-spring), box-shadow var(--d-slow) var(--ease-out); }
.wall-item:hover img, .wall-item:focus-visible img { transform: scale(1.05); box-shadow: var(--shadow-cover-up); }
@keyframes wall-up { to { transform: translateY(-50%); } }
@keyframes wall-side { to { transform: translateX(-50%); } }

/* ---- news: a bento, the first story large */
.stories { margin: 0 0 24px; }
.stories.n1 { grid-template-columns: minmax(0, 1fr); }
.stories.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 961px) {
  .stories.n3 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .stories.n3 .story-0 { grid-row: 1 / 3; flex-direction: column-reverse; align-items: flex-start; justify-content: space-between; gap: 28px; min-height: 320px; padding: 30px; border-radius: 34px; }
  .stories.n3 .story-0 .story-pic { align-self: flex-end; width: 168px; height: 168px; border-radius: 28px; }
  .stories.n3 .story-0 .story-t { flex: none; gap: 8px; max-width: 30em; padding-right: 36px; }
  .stories.n3 .story-0 strong { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.06; letter-spacing: -.032em; }
  .stories.n3 .story-0 .story-x { font-size: 16px; -webkit-line-clamp: 3; }
  .stories.n3 .story-0 > .i { top: 24px; right: 24px; font-size: 22px; }
}

/* ---- sections */
.shelf { margin-top: 104px; }
.shelf-head { margin-bottom: 26px; }

/* ---- new books: a sticky index on the left, the books on the right */
.shelf.index { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 48px; align-items: start; }
.index-side { position: sticky; top: 96px; display: grid; gap: 22px; justify-items: start; }
.index-side h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.04; letter-spacing: -.034em; }
.index-nav { display: grid; width: 100%; border-top: 1px solid var(--line-2); }
.idx { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line-2); text-decoration: none; font-size: 16.5px; font-weight: 600; color: var(--muted);
  transition: color var(--d-fast) var(--ease-out); }
.idx::before { content: ''; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 99px; background: var(--accent); transform: scale(0); transition: transform var(--d) var(--ease-spring); }
.idx span { transition: transform var(--d) var(--ease-punch); }
.idx small { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.idx:hover, .idx.on { color: var(--text); }
.idx:hover span, .idx.on span { transform: translateX(16px); }
.idx.on::before { transform: scale(1); }
.shelf.index .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---- traditions: panels that open like an accordion (wide screens) */
@media (min-width: 1181px) {
  .trads { display: flex; gap: 12px; height: 348px; }
  .trad { flex: 1 1 0; min-width: 0; min-height: 0; padding: 22px 20px; border-radius: 30px; }
  .js .trads .trad[data-reveal].in.settled, .trads .trad { transition: flex-grow 700ms var(--ease-punch), transform var(--d) var(--ease-spring), opacity var(--d-slow) var(--ease-out); }
  .trads .trad:hover, .trads .trad:focus-visible, .trads:not(:hover):not(:focus-within) .trad:first-child { flex-grow: 2.4; transform: none; }
  .trad-n { font-size: min(18px, 1.26vw); letter-spacing: -.03em; transition: font-size 700ms var(--ease-punch); }
  .trads .trad:hover .trad-n, .trads .trad:focus-visible .trad-n, .trads:not(:hover):not(:focus-within) .trad:first-child .trad-n { font-size: 28px; }
  .trad .fan { right: 22px; bottom: 24px; transform: scale(1.5); transform-origin: 100% 100%; opacity: 0; transition: opacity var(--d) var(--ease-out), transform 700ms var(--ease-punch); }
  .trads .trad:hover .fan, .trads .trad:focus-visible .fan, .trads:not(:hover):not(:focus-within) .trad:first-child .fan { opacity: 1; transform: scale(1.72); }
  .trad::after { content: "\2197"; position: absolute; left: 20px; bottom: 20px; font-size: 22px; line-height: 1; font-weight: 500; opacity: .7; transition: transform var(--d) var(--ease-punch), opacity var(--d-fast); }
  .trad:hover::after { transform: translate(3px, -3px); opacity: 1; }
}

/* ---- the second band (authors): smaller, hollow letters, runs the other way */
.band.back .band-track { animation-direction: reverse; animation-duration: 70s; }
.band.back .band-w { font-size: clamp(26px, 3.8vw, 54px); font-weight: 800; color: transparent; -webkit-text-stroke: 1.2px var(--text-2); }
.band.back .band-w::after { background: var(--coral); }
.band.back:hover .band-w { color: transparent; -webkit-text-stroke-color: var(--line-2); }
.band.back .band-w:hover, .band.back .band-w:focus-visible { color: var(--text); -webkit-text-stroke-color: var(--text); }

/* ---- "where to start": numbered rows; a row fills with its tradition's colour under the pointer */
.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.guide-row { position: relative; isolation: isolate; display: grid; grid-template-columns: 56px minmax(0, .8fr) minmax(0, 1.6fr) auto; gap: 28px; align-items: center; padding: 26px 22px; border-bottom: 1px solid var(--line-2);
  text-decoration: none; background: none; color: var(--text); transition: color var(--d) var(--ease-out), padding var(--d-slow) var(--ease-punch); }
.guide-row::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--p-bg); transform: scaleY(0); transform-origin: 50% 100%; transition: transform var(--d-slow) var(--ease-punch); }
.guide-row:hover, .guide-row:focus-visible { color: var(--p-fg); padding-left: 34px; }
.guide-row:hover::before, .guide-row:focus-visible::before { transform: scaleY(1); }
.guide-n { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); transition: color var(--d) var(--ease-out); }
.guide-row:hover .guide-n { color: inherit; }
.guide-t { font-size: clamp(22px, 2.3vw, 32px); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.guide-x { font-size: 15.5px; line-height: 1.5; color: var(--text-2); transition: color var(--d) var(--ease-out); }
.guide-row:hover .guide-x { color: inherit; }
.guide-more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.guide-more .i { font-size: 17px; transition: transform var(--d) var(--ease-punch); }
.guide-row:hover .guide-more .i { transform: translate(3px, -3px); }

/* ---- "visit us": the dark panel */
.visit { margin-top: 104px; padding: 44px; border-radius: 40px; background: var(--panel); color: var(--on-panel); box-shadow: inset 0 0 0 1px var(--line); }
.visit .eyebrow, .visit li .i { color: var(--accent); }
.visit h2 { font-size: clamp(32px, 4vw, 54px); letter-spacing: -.036em; }
.visit li { color: color-mix(in srgb, var(--on-panel) 84%, transparent); }
.visit .pill.dark { background: var(--on-panel); border-color: var(--on-panel); color: var(--panel); }
.visit .pill.dark:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.visit .fan-c { border-color: var(--on-panel); }

/* ---- catalogue: a sticky tree of categories beside the grid; the filters run along the top */
.list-head { padding: 30px 0 34px; }
.list-head h1 { font-size: clamp(36px, 5.6vw, 76px); line-height: 1; letter-spacing: -.04em; }
.catalog { display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-areas: "tree bar" "tree main"; gap: 0 48px; align-items: start; }
.cat-side { display: contents; }
.cat-tree { grid-area: tree; position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; scrollbar-width: none; display: grid; gap: 2px; padding-bottom: 8px; }
.cat-tree::-webkit-scrollbar { display: none; }
.cat-tree a { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out); }
.cat-tree a small { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.cat-tree a:hover { background: var(--card); color: var(--text); }
.cat-tree a.on { background: var(--ink); color: var(--on-ink); font-weight: 700; }
.cat-tree a.on small { color: inherit; opacity: .7; }
.cat-g { display: grid; gap: 2px; margin-top: 16px; }
.cat-tree a.cat-gt { font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cat-tree a.cat-gt.on { color: var(--on-ink); }
.cat-chips { display: none; }
.catalog .filters { grid-area: bar; margin: 0 0 26px; }
.cat-main { grid-area: main; min-width: 0; }
.catalog .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 961px) { .filters:not(.searching) .pick-cat { display: none; } }

/* ---- book page: one tinted panel (words, the book, the buy card), then the text beside the facts */
.book { display: block; margin-top: 16px; }
.book-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .86fr) minmax(0, .96fr); gap: 40px; align-items: center; padding: 48px; border-radius: 44px;
  background: hsl(var(--th, 0) calc(var(--ts, 0%) * var(--tint-k)) var(--tint-l)); transition: background-color 700ms var(--ease-out); }
.book-info { padding: 0; }
.book-info h1 { font-size: clamp(30px, 3.5vw, 52px); line-height: 1.02; letter-spacing: -.036em; }
.book-media { position: static; min-width: 0; }
.book-top .stage { aspect-ratio: 4 / 5; border-radius: 0; background: none; }
.book-top .stage::before { inset: 4%; }
.book-top .stage .badge { top: 0; left: 0; }
.book-cover { max-width: 84cqw; max-height: 92cqh; }
.stage .tc.book-cover { height: 90cqh; }
.thumbs { justify-content: center; }
.thumbs a { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.buy { margin: 0; padding: 26px; border: 0; border-radius: 30px; background: var(--bg); box-shadow: 0 30px 60px -34px rgb(0 0 0 / 34%), 0 0 0 1px var(--line); }
.buy-row { flex-wrap: wrap; }
.buy-facts { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.buy-facts li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--text-2); }
.buy-facts .i { font-size: 19px; color: var(--accent-strong); }
.book-more { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 64px; align-items: start; margin-top: 56px; }
.book-more:not(:has(.desc)) { grid-template-columns: minmax(0, 1fr); }
.book-more:not(:has(.desc)) .book-text { display: none; }
.book-text .desc { margin-top: 0; font-size: 17.5px; line-height: 1.75; max-width: 66ch; }
.book-side { position: sticky; top: 96px; display: grid; gap: 22px; }
.book-side .facts, .book-side .trust { margin-top: 0; }
@media (max-width: 1180px) {
  .book-top { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); grid-template-areas: "media info" "media buy"; gap: 24px 36px; padding: 36px; }
  .book-media { grid-area: media; }
  .book-info { grid-area: info; align-self: end; }
  .buy { grid-area: buy; align-self: start; }
}

/* ---- phones and small tablets */
@media (max-width: 1180px) {
  .shelf.index { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; }
  .catalog { grid-template-columns: 210px minmax(0, 1fr); gap: 0 32px; }
}
@media (max-width: 960px) {
  .lead-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hero { padding: 34px 0 20px; }
  .hero h1 { font-size: clamp(40px, 9vw, 72px); }
  /* the wall lies down: two rows that run sideways */
  .wall { transform: none; height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 4px -28px 0; padding: 10px 0 30px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
  .wall-2 { display: none; }
  .wall-track { flex-direction: row; width: max-content; gap: 12px; padding: 0 12px 0 0; animation-name: wall-side; animation-duration: 64s; }
  .wall-1 .wall-track { animation-duration: 80s; }
  .wall-item img { width: auto; height: 168px; max-width: none; }
  .shelf { margin-top: 76px; }
  .shelf.index { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .index-side { position: static; gap: 14px; min-width: 0; width: 100%; }
  .index-side .more { display: none; }
  .index-nav { display: flex; gap: 8px; border: 0; overflow-x: auto; scrollbar-width: none; margin: 0 -28px; padding: 2px 28px; width: auto; justify-self: stretch; }
  .index-nav::-webkit-scrollbar { display: none; }
  .idx { flex: none; height: 40px; padding: 0 15px; align-items: center; border: 1px solid var(--line); border-radius: 99px; font-size: 15px; color: var(--text); }
  .idx::before { content: none; }
  .idx:hover span, .idx.on span { transform: none; }
  .idx.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
  .idx.on small { color: inherit; opacity: .7; }
  .catalog { display: block; }
  .cat-tree { display: none; }
  .cat-chips { display: block; margin-bottom: 14px; }
  .book-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "info" "buy"; gap: 22px; padding: 22px; border-radius: 32px; }
  .book-top .stage { aspect-ratio: 1 / 1; }
  .book-info { align-self: auto; }
  .book-more { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 36px; }
  .book-side { position: static; }
  .guide-row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "n t more" ". x x"; gap: 6px 12px; padding: 20px 6px; }
  .guide-row:hover, .guide-row:focus-visible { padding-left: 12px; }
  .guide-n { grid-area: n; }
  .guide-t { grid-area: t; }
  .guide-x { grid-area: x; }
  .guide-more { grid-area: more; }
  /* the tab bar floats above the page as a rounded dock */
  .tabbar { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 6px; border-radius: 28px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -14px rgb(0 0 0 / 38%); }
  body:has(.tabbar) .foot { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  body:has(.tabbar) .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .buybar:not([hidden]) { bottom: calc(90px + env(safe-area-inset-bottom)); }
  body:has(.buybar:not([hidden])) .toast { bottom: calc(162px + env(safe-area-inset-bottom)); }
}
@media (max-width: 700px) {
  .wall { margin: 2px -16px 0; padding-bottom: 24px; }
  .wall-item img { height: 138px; }
  .index-nav { margin: 0 -16px; padding: 2px 16px; }
  .shelf.index .grid, .catalog .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visit { margin-top: 76px; padding: 26px 22px; border-radius: 30px; }
  .book-top { padding: 16px; border-radius: 26px; }
  .buy { padding: 18px; border-radius: 22px; }
  .list-head { padding: 20px 0 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .wall-track { animation: none; }
  .wall-item[aria-hidden] { display: none; }
  .trads .trad { transition: none; }
}
/* switching the mode: the whole page is one picture and the new one opens as a circle (shop.js) */
.theme-turn * { view-transition-name: none !important; }
.theme-turn::view-transition-old(root), .theme-turn::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-turn::view-transition-new(root) { z-index: 2; }
/* a small cover file still stands as tall as its neighbours (62cqh is no wider than the 66cqw limit for any upright book) */
.card-stage img.cover { min-height: 62cqh; object-fit: cover; }
@media (max-width: 700px) { .trads, .stories { scroll-padding-inline: 16px; } }
@media (max-width: 700px) { .catalog .filters { margin: 0 -16px 20px; } }

/* ================================================================ palette roles (2026-12-05)
   With the Philosophy App palette the page is black, white and grey, so each colour has one job:
   red = sale, few left, errors and counts; green = in stock, added, done; gold = points, stars, pre-order;
   everything else (new badge, focus ring, current tab, numbers) is ink. */
:focus-visible, .zl:has(input:focus-visible), .toggle input:focus-visible + .track { outline-color: var(--ink); }
.ph:not(.tc) { background: linear-gradient(160deg, var(--bg), var(--card-2)); color: var(--text-2); }
.new-badge { background: var(--bg); color: var(--text); }
.card-act.added, .pill[data-add].added { background: var(--ok); border-color: var(--ok); color: var(--ok-text); }
.stock.ok, .tag.go { background: var(--ok-soft); color: var(--ok-strong); }
.stock.pre { background: var(--gold-soft); color: var(--gold-strong); }
.pre-note { background: var(--gold-soft); color: var(--text); }
.pre-note .i { color: var(--gold-strong); }
.done h2::before { background: var(--ok); color: var(--ok-text); }
.steps li.now::before { background: var(--ok); box-shadow: 0 0 0 5px var(--ok-soft); }
.acct-link.in::after, .tb.acct-link.in .dot { background: var(--ok); }
.eyebrow { color: var(--muted); }
.stat-v, .tl-date { color: var(--text); }
.timeline li::before { border-color: var(--ink); }
.belief-n { background: var(--ink); color: var(--on-ink); }
.faraway > .i, .buy-facts .i { color: var(--text-2); }
.pc-label .i, .pc-list b { color: var(--gold); }
.visit .eyebrow { color: color-mix(in srgb, var(--on-panel) 60%, transparent); }
.visit li .i { color: var(--on-panel); }
.visit .pill.dark:hover { background: color-mix(in srgb, var(--on-panel) 86%, transparent); border-color: transparent; color: var(--panel); }
.shelf-book:focus-visible img, .shelf-book:focus-visible .shelf-plain { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.band.back .band-w::after { background: var(--gold); }
/* tiles are plain grey now: the first story is the ink tile, and a reading-tip row turns ink under the pointer */
.story-0 { background: var(--ink); color: var(--on-ink); }
.story-0 .story-tag { background: color-mix(in srgb, var(--on-ink) 16%, transparent); }
.guide-row::before { background: var(--ink); }
.guide-row:hover, .guide-row:focus-visible { color: var(--on-ink); }
@media (max-width: 960px) {
  .tb[aria-current] .tb-ic { background: var(--card-2); }
  .tb[aria-current] .tb-ic .i { color: var(--text); }
}

/* ================================================================ bare covers (2026-12-05)
   Books stand on the page itself, like a shelf in a reading app: no box behind the cover. Every cover fills its
   column and stands on the same line as its neighbours; the words sit under it, then one row with the price, a
   one-word note (new, sale, few left) and the add button. shop.js gives each image its own proportion (--ar), so a
   tall cover is made narrower to fit and is never cropped. */
:root { --cover-edge: rgb(0 0 0 / 7%); }
:root[data-theme="dark"] { --cover-edge: rgb(255 255 255 / 9%); }
.grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 44px 30px; }
.shelf.index .grid, .catalog .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rail { grid-auto-columns: calc((100% - 120px) / 5); gap: 30px; }
.card-stage { aspect-ratio: 2 / 3; background: none; border-radius: 0; place-items: end start; transition: none; }
.bk::before, .bk::after { border-radius: 4px; }
.card-stage .cover { border-radius: 4px; box-shadow: 0 0 0 1px var(--cover-edge), var(--shadow-cover); }
.card:hover .card-stage .cover { box-shadow: 0 0 0 1px var(--cover-edge), var(--shadow-cover-up); }
.card-stage img.cover { width: min(100cqw, calc(100cqh * var(--ar, 1))); height: auto; max-width: none; max-height: 100cqh; min-height: 0; object-fit: cover; object-position: center top; }
.card-stage .tc.cover { width: 100cqw; height: auto; aspect-ratio: 2 / 3; }
.card:hover .bk { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px) scale(1.02); }
.card-body { margin-top: 14px; padding: 0; gap: 2px; }
.card h3 { font-size: 15px; font-weight: 700; line-height: 1.3; min-height: 0; }
.card .by { margin-top: 1px; font-size: 13.5px; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 10px; min-height: 42px; }
.card-meta { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.card .prices { margin: 0; padding: 0; }
.card .price { font-size: 15px; }
.card .badge { position: static; height: auto; padding: 0; border-radius: 0; background: none; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.card .sale-badge, .card .low-badge { color: var(--accent-strong); }
.card .pre-badge { color: var(--gold-strong); }
.card-act { position: relative; inset: auto; z-index: 3; flex: none; width: 34px; height: 34px; opacity: 1; transform: none; background: var(--card); color: var(--text); box-shadow: none; }
.card-act .i { font-size: 17px; }
button.card-act:hover { background: var(--ink); color: var(--on-ink); }
.card-act.added, button.card-act.added:hover { background: var(--ok); color: var(--ok-text); }
@media (hover: hover) and (pointer: fine) {
  .card-act { opacity: 1; transform: none; }
  .card:hover .card-act:active { transform: scale(.92); }
}
.card-more { aspect-ratio: 2 / 3; border-radius: 6px; background: none; border: 1px solid var(--line-2); }
.card-more:hover { background: var(--card); }
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; }
  .shelf.index .grid, .catalog .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail { grid-auto-columns: calc((100% - 72px) / 4); gap: 24px; }
}
@media (max-width: 960px) {
  .grid, .shelf.index .grid, .catalog .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rail { grid-auto-columns: calc((100% - 48px) / 3); }
}
@media (max-width: 700px) {
  .grid, .shelf.index .grid, .catalog .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 18px; }
  .rail { grid-auto-columns: 42%; gap: 16px; }
  .card-stage { padding: 0; border-radius: 0; }
  .card-stage .cover, .card-stage img.cover { max-width: none; max-height: 100cqh; }
  .card-stage .tc.cover { height: auto; }
  .card-body { margin-top: 10px; padding: 0; }
  .card h3 { font-size: 14.5px; }
  .card-act { inset: auto; width: 34px; height: 34px; }
  .card-more { border-radius: 6px; }
}

/* ---------- master pass (2026-12-05): contrast, tap targets, spacing (DESIGN.md §2.13) ---------- */
/* Contrast: grey text reads at 4.5:1 on the grey cards too (--muted above), counts and "few left" use the deep red. */
:root { --count-bg: #e21204; --coral-ink: #c00f03; }
:root[data-theme="dark"] { --coral-ink: #ff7a6e; }
.cart-link .count, .tb .count { background: var(--count-bg); }
.stock.low, .book-top .low-badge { color: var(--coral-ink); }
.tc small { font-size: max(.5em, 9px); }

/* Tap targets: the small round "+" answers a finger 6px beyond its edge; the logo and the number box are taller. */
.card-act::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.logo { padding-block: 10px; margin-block: -10px; }
.stepper select { min-height: 42px; }

/* Checkout: the form's section titles weigh the same as the summary's. */
.co-form legend { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }

/* Home: the three "browse by" rails read as one group, so they sit closer to each other than to other sections. */
.shelf.group + .shelf.group { margin-top: 72px; }

/* Book page: the add button never loses its label; on a narrow phone it drops its icon, then takes its own row. */
.buy-row .pill.big { flex: 1 1 auto; min-width: max-content; }

@media (max-width: 700px) {
  .stories { margin-inline: -16px; }
  .shelf.group + .shelf.group { margin-top: 56px; }
  .price-range { height: 44px; }
  .price-range input { height: 36px; }
}
@media (max-width: 420px) {
  .buy { padding: 16px; }
  .buy-row .pill.big { padding: 0 14px; }
  .buy-row .pill.big .i { display: none; }
  .stepper { padding: 0 3px; }
  .stepper button { width: 38px; }
}
/* A long section title keeps its room on a phone: the pill beside it says only "Бүгд". */
@media (max-width: 640px) { .more-x { display: none; } .shelf-head h2 { text-wrap: balance; } }

/* ---------------------------------------------------------------- book finder (2026-12-06) */
.finder-fab { position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 32; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 16px;
  border: 0; border-radius: 99px; background: var(--ink); color: var(--on-ink); font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / 45%), 0 0 0 1px rgb(255 255 255 / 6%); transition: transform var(--d-press) var(--ease-out), opacity var(--d-fast); }
.finder-fab:hover { background: var(--ink-hover); }
.finder-fab:active { transform: scale(.96); }
.finder-fab .i { font-size: 20px; }
.finder-on .finder-fab { opacity: 0; pointer-events: none; }
.finder-fab.tucked { opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; }
.finder { position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 45; width: min(400px, calc(100vw - 40px)); height: min(620px, calc(100dvh - 120px));
  display: flex; flex-direction: column; border-radius: 28px; background: var(--bg); color: var(--text); overflow: hidden;
  box-shadow: 0 30px 80px -24px rgb(0 0 0 / 45%), 0 0 0 1px var(--line); transform-origin: bottom right; }
.finder[hidden] { display: none; }
.finder.opening { animation: finder-in var(--d) var(--ease-punch); }
@keyframes finder-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.finder-head { display: flex; align-items: center; gap: 10px; padding: 14px 10px 12px 16px; border-bottom: 1px solid var(--line); }
.finder-av { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: 19px; }
.finder-who { flex: 1; min-width: 0; display: grid; }
.finder-who strong { font-weight: 800; font-size: 16px; }
.finder-who small { color: var(--muted); font-size: 12.5px; }
.finder-head .icon-btn { width: 40px; height: 40px; flex: none; }
.finder-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-padding-bottom: 12px; }
.fmsg { max-width: 92%; line-height: 1.45; font-size: 15px; }
.fmsg p { margin: 0; }
.fmsg.bot { align-self: flex-start; padding: 11px 14px; border-radius: 6px 20px 20px 20px; background: var(--card); }
.fmsg.you { align-self: flex-end; padding: 10px 14px; border-radius: 20px 6px 20px 20px; background: var(--ink); color: var(--on-ink); font-weight: 600; animation: fmsg-in var(--d-fast) var(--ease-out); }
.fmsg.bot:has(.fcards) { max-width: 100%; width: 100%; }
@keyframes fmsg-in { from { opacity: 0; transform: translateY(6px); } }
.fmsg.typing { display: inline-flex; gap: 5px; padding: 15px 16px; }
.fmsg.typing span { width: 7px; height: 7px; border-radius: 99px; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.fmsg.typing span:nth-child(2) { animation-delay: .15s; }
.fmsg.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; animation: fmsg-in var(--d) var(--ease-out); }
.fchip { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background var(--d-fast), border-color var(--d-fast), transform var(--d-press) var(--ease-out); }
.fchip:hover { border-color: var(--ink); }
.fchip:active { transform: scale(.96); }
.fchips.used { display: none; }
.fcards { display: grid; gap: 8px; margin-top: 10px; }
.fcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 16px; background: var(--bg); }
.fcard-cover { display: block; aspect-ratio: 2 / 3; border-radius: 4px 7px 7px 4px; overflow: hidden; box-shadow: var(--shadow-sm); }
.fcard-cover .cover { width: 100%; height: 100%; object-fit: cover; display: block; font-size: 7px; }
.fcard-cover .cover.photo { object-fit: contain; background: var(--stage); }
.fcard-t { min-width: 0; display: grid; align-content: start; gap: 2px; }
.fcard-title { font-weight: 800; font-size: 14.5px; line-height: 1.3; text-decoration: none; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcard-title:hover { text-decoration: underline; }
.fcard-t > small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard-why { margin: 4px 0 0 !important; font-size: 12.5px; color: var(--text-2); }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.fcard-foot .prices { font-size: 14.5px; }
.fcard-foot .card-act { width: 36px; height: 36px; }
.finder-say { display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.finder-say input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.finder-say input:focus { outline: none; border-color: var(--ink); }
.finder-send { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 0; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: 19px; cursor: pointer; }
.finder-send:active { transform: scale(.94); }
.finder-band { display: flex; align-items: center; gap: 20px; margin: 64px 0 0; padding: 26px 28px; border-radius: 28px; background: var(--card); }
.finder-band h2 { margin: 0 0 4px; font-size: 21px; }
.finder-band p { margin: 0; color: var(--text-2); }
.finder-band > div { flex: 1; min-width: 0; }
.finder-band .btn { flex: none; }
.finder-band-i { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-size: 24px; }
@media (max-width: 959px) {
  .finder-fab { right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); width: 54px; height: 54px; padding: 0; justify-content: center; }
  .finder-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body:has(.buybar:not([hidden])) .finder-fab { display: none; }
  .finder { left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: min(86dvh, 720px); border-radius: 28px 28px 0 0; transform-origin: bottom center; }
  .finder-on body { overflow: hidden; }
}
@media (max-width: 640px) {
  .finder-band { flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 20px; margin-top: 48px; }
  .finder-band .btn { width: 100%; }
}

/* ---------------------------------------------------------------- loyalty points (2026-12-06: 5%, shown up front) */
.points-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 24px; align-items: center; margin: 4px 0 40px; padding: 28px 30px; border-radius: 28px;
  background: var(--panel); color: var(--on-panel); position: relative; overflow: hidden; }
.points-hero::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgb(204 155 88 / 35%), transparent 70%); pointer-events: none; }
.ph-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: #e0b877; }
.ph-num { display: block; margin: 6px 0 8px; font-size: clamp(44px, 7vw, 68px); line-height: 1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.points-hero p { margin: 0; color: rgb(255 255 255 / 72%); font-size: 14.5px; }
.ph-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; position: relative; z-index: 1; }
.ph-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgb(255 255 255 / 7%); }
.ph-list span { display: grid; font-size: 14px; }
.ph-list small { color: rgb(255 255 255 / 55%); font-size: 12px; }
.ph-list b { font-weight: 800; font-variant-numeric: tabular-nums; color: #34d37c; }
.ph-list b.neg { color: #ff8a80; }
.ph-empty { position: relative; z-index: 1; }
.co-points { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 14px; background: var(--gold-soft, var(--card)); font-size: 14px; }
.co-points .i { color: var(--gold-strong, #cc9b58); font-size: 18px; }
.order-points { display: flex; align-items: center; gap: 10px; margin: 20px 0 0; padding: 14px 16px; border-radius: 18px; background: var(--gold-soft, var(--card)); }
.order-points .i { color: var(--gold-strong, #cc9b58); font-size: 20px; }
.buy-facts .hgi-star { color: var(--gold-strong, #cc9b58); }
@media (max-width: 760px) {
  .points-hero { grid-template-columns: 1fr; padding: 24px 22px; gap: 18px; }
}
.rate-link.first { color: var(--text-2); }
.rate-link.first .stars { opacity: .45; }
.rate-link.first:hover { color: var(--text); }

/* ==================================================================
   Ink pass (2026-12-06, owner): the design language of the Philosophy 3.0 landing page
   (philosophy-landing, App 4.0 "Ink"), carried into the shop. Monochrome first, light is the only
   decoration; big medium-weight headlines with tight tracking; small upper-case kickers with a dot;
   hairline borders instead of filled boxes; large pill buttons; the brand moment is the "flood", a
   full-bleed band in the opposite mode that grows from a rounded card to the full width as it scrolls
   in; numbers in a hairline grid; a soft light that follows the mouse across cards; a thin reading
   line along the top of the window. Shop colours (sale red, in-stock green, points gold) stay.
   Everything stands still under reduced motion. docs/DESIGN.md §2.15.
   ================================================================== */
:root { --text: #0a0a0a; --ink: #0a0a0a; --spot: rgb(0 0 0 / 4.5%); --hair: rgb(0 0 0 / 8%); --hair-2: rgb(0 0 0 / 16%); }
:root[data-theme="dark"] {
  --bg: #0a0a0a; --card: #121212; --card-2: #1f1f1f; --stage: #121212; --line: #282828; --line-2: #454545;
  --text: #f7f7f7; --text-2: #a3a3a3; --muted: #8a8a8a; --ink: #f7f7f7; --ink-hover: #e0e0e0; --on-ink: #0a0a0a;
  --glass: rgb(10 10 10 / 78%); --panel: #121212; --paper: #2a2a2a;
  --pa-bg: #121212; --pb-bg: #1f1f1f; --pc-bg: #121212; --pd-bg: #1f1f1f; --pe-bg: #121212;
  --zm-road: #0a0a0a;
  --spot: rgb(255 255 255 / 7.5%); --hair: rgb(255 255 255 / 12%); --hair-2: rgb(255 255 255 / 24%);
}
main { overflow-x: clip; }

/* ---- type: medium weight, tight tracking, balanced lines */
.hero h1, .shelf-head h2, .index-side h2, .visit h2, .about-hero h1, .flood h2, .list-head h1, .book-title { font-weight: 500; }
.hero h1 { font-size: clamp(44px, 6.4vw, 98px); line-height: .94; letter-spacing: -.045em; }
.shelf-head h2, .index-side h2 { font-size: clamp(32px, 4.2vw, 60px); line-height: .98; letter-spacing: -.04em; }
.index-side h2 { font-size: clamp(32px, 3.3vw, 46px); }  /* the narrow index column keeps "Шинэ ном" on one line */
.hero-sub { color: var(--text-2); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; }
.nav a { font-weight: 500; }

/* ---- kicker: a small upper-case label with a dot (the old eyebrow takes the same shape) */
.kicker, .eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 12px; line-height: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kicker::before, .eyebrow::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.eyebrow .i { display: none; }
.visit .eyebrow { color: var(--muted); }

/* ---- section heads sit on a hairline */
.shelf > .shelf-head, .index-side { border-top: 1px solid var(--hair); padding-top: 26px; }
.shelf.guide .shelf-head { margin-bottom: 8px; }

/* ---- buttons: big pills, a light sweep across the main one */
.btn.big { min-height: 56px; padding: 0 28px; border-radius: 999px; font-size: 17px; font-weight: 600; gap: 10px; }
.btn.big .i { font-size: 20px; }
.btn.primary, .pill.dark { position: relative; overflow: hidden; isolation: isolate; }
.btn.primary::after, .pill.dark::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, currentColor 18%, transparent) 50%, transparent 65%); translate: -110% 0; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .btn.primary:hover::after, .pill.dark:hover::after { translate: 110% 0; transition: translate 750ms var(--ease-out); }
}

/* ---- hero: no coloured glow any more, one soft spotlight */
.lead::before { animation: none; left: 50%; right: auto; top: -10%; width: min(1400px, 160vw); height: auto; aspect-ratio: 1.4; transform: translate(-50%, -18%);
  background: radial-gradient(closest-side, var(--spot), color-mix(in srgb, var(--spot) 35%, transparent) 55%, transparent 75%); }

/* ---- reading line along the top of the window (shop.js sets --sp) */
.top-progress { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--text); opacity: .85; transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); pointer-events: none; z-index: 2; }

/* ---- the flood: a full-bleed band in the opposite mode. It grows from a rounded card to the full width as it
   scrolls in (shop.js sets --fi from 1 to 0); without script it is simply full width. */
.flood { --bg: #0a0a0a; --card: #121212; --card-2: #1f1f1f; --line: #282828; --line-2: #454545; --text: #f7f7f7; --text-2: #a3a3a3; --muted: #8a8a8a;
  --ink: #f7f7f7; --ink-hover: #e0e0e0; --on-ink: #0a0a0a; --panel: #0a0a0a; --on-panel: #f7f7f7; --spot: rgb(255 255 255 / 7.5%); --hair: rgb(255 255 255 / 12%);
  color-scheme: dark; position: relative; width: 100vw; margin-left: calc(50% - 50vw); margin-right: 0; background: var(--bg); color: var(--text);
  clip-path: inset(0 calc(var(--fi, 0) * 3.5vw) round calc(var(--fi, 0) * 56px)); }
:root[data-theme="dark"] .flood { --bg: #f7f7f7; --card: #ffffff; --card-2: #efefef; --line: #e3e3e3; --line-2: #cfcfcf; --text: #0a0a0a; --text-2: #4d4d4d; --muted: #6b6b6b;
  --ink: #0a0a0a; --ink-hover: #333333; --on-ink: #ffffff; --panel: #f7f7f7; --on-panel: #0a0a0a; --spot: rgb(0 0 0 / 4.5%); --hair: rgb(0 0 0 / 8%); color-scheme: light; }
.finder-flood { margin-top: clamp(80px, 10vw, 136px); padding: clamp(88px, 11vw, 168px) 0; text-align: center; }
.flood-in { width: min(100% - 40px, 1000px); margin: 0 auto; display: grid; justify-items: center; }
.flood-in .kicker { margin-bottom: 26px; }
.finder-flood h2 { font-size: clamp(40px, 6.6vw, 104px); line-height: .95; letter-spacing: -.045em; text-wrap: balance; }
.flood-lead { margin: 26px 0 0; max-width: 34em; color: var(--text-2); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; text-wrap: pretty; }
.flood-in .btn { margin-top: 38px; }
/* "visit us" becomes the closing flood */
.visit.flood { margin-top: clamp(88px, 11vw, 144px); margin-bottom: -96px; padding: clamp(80px, 10vw, 140px) max(28px, calc(50vw - 632px)); border-radius: 0; box-shadow: none; gap: clamp(32px, 6vw, 96px); }
.visit.flood h2 { font-size: clamp(40px, 6vw, 92px); line-height: .95; letter-spacing: -.045em; margin-bottom: 28px; }
.visit.flood li { color: var(--text-2); font-size: 17px; }
.visit.flood li .i { color: var(--text); }
.visit.flood + * { margin-top: 0; }

/* ---- cards: hairline edges, and a soft light under the mouse (shop.js sets --mx / --my) */
.belief, .stat, .story { box-shadow: inset 0 0 0 1px var(--hair); border-color: transparent; }
:is(.belief, .stat, .story, .guide-row) { position: relative; isolation: isolate; }
:is(.belief, .stat, .story, .guide-row)::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 62%); opacity: 0; transition: opacity 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { :is(.belief, .stat, .story, .guide-row):hover::before { opacity: 1; } }

/* ---- numbers in a hairline grid (about page) */
.stats { gap: 0; margin-top: 40px; border-top: 1px solid var(--hair); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { padding: 30px 24px 26px; border-radius: 0; background: none; box-shadow: none; border-bottom: 1px solid var(--hair); border-left: 1px solid var(--hair); gap: 12px; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat-v { font-size: clamp(52px, 6vw, 96px); font-weight: 500; letter-spacing: -.05em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; transition: transform 500ms var(--ease-punch); }
@media (hover: hover) and (pointer: fine) { .stat:hover .stat-v { transform: translateX(8px); } }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 24px 14px 20px; }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
}

/* ---- authors: a quiet strip between two hairlines */
.band { border-block: 1px solid var(--hair); padding: 18px 0 20px; }
.band-w { font-weight: 500; letter-spacing: -.04em; }
.band-w::after { background: var(--line-2); }

/* ---- footer: on the page, hairlines, upper-case column heads */
.foot { background: var(--bg); border-radius: 0; border-top: 1px solid var(--hair); margin-top: 0; }
.foot h2 { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.foot-note { border-top-color: var(--hair); }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .foot a { transition: color var(--d-fast) var(--ease-out), transform 400ms var(--ease-punch); }
  .foot a:hover { transform: translateX(4px); }
}

@media (max-width: 700px) {
  .shelf > .shelf-head, .index-side { padding-top: 20px; }
  .finder-flood { margin-top: 64px; }
  .flood-in .btn { width: 100%; }
  .visit.flood { padding: 72px 20px; margin-top: 72px; }
}
@media (prefers-reduced-motion: reduce) { .flood { clip-path: none; } }
/* the closing band holds only the shop's address (owner, 2026-12-06) */
.visit.flood { grid-template-columns: minmax(0, 1fr); }
.visit.flood h2 { margin-bottom: 0; text-wrap: balance; }
