:root {
  --bg: #0e0e10;
  --panel: #18181b;
  --panel-2: #212126;
  --line: rgba(255, 255, 255, .09);
  --text: #f3efe8;
  --mute: #a5a19a;
  --red: #ef3b24;
  --red-2: #ff7a3d;
  --cream: #f6e3c4;
  --vk: #2787f5;
  --ok: #2ea043;
  --grad: linear-gradient(135deg, #ff5a36 0%, #e8301c 100%);
  --radius: 14px;
  --bar-h: 64px;
  --gutter: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;

  /* ---------- motion tokens: the only place where curves and timings live (docs/MOTION.md) ---------- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);          /* arrivals: quick start, long soft landing */
  --ease-in: cubic-bezier(.55, 0, .8, .2);          /* exits */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);      /* travel between two points */
  --ease-spring: cubic-bezier(.34, 1.3, .64, 1);    /* small overshoot (state changes) */
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);      /* bigger overshoot (things that "jump") */
  --dur-press: 110ms;      /* finger/mouse goes down */
  --dur-hover: 240ms;      /* hover, focus, colour changes */
  --dur-state: 380ms;      /* a control changes state (number flip, stepper, toast) */
  --dur-enter: 720ms;      /* rows, headings, covers come into view */
  --dur-hero: 900ms;       /* the page-load sequence */
  --dur-sheet: 560ms;      /* cart drawer, cover viewer */
  --dur-fly: 760ms;        /* cover flying to the cart (app.js reads this one) */
  --dur-breathe: 7s;       /* the single slow glow in the hero */
  --dur-swap: 170ms;       /* one control replaces another in place (old fades, new comes in), a message fades */
  --step: 55ms;            /* cascade step between neighbours */
  --step-fast: 36ms;       /* the same, for a list that was just redrawn (filter, search) */
  --swap-in: 70ms;         /* the redrawn list waits for the old one to start fading */
  --first-rows-delay: 520ms; /* the first rows wait for the hero */
  --rise: 26px;            /* how far a row travels while appearing */
  --blur-in: 7px;          /* blur of what is entering the screen right now */
  --parallax: 6px;         /* how far a cover drifts inside its row while the row crosses the screen */
  --ring: rgba(255, 122, 61, .3);
}
/* a real spring where the browser can draw one (linear() easing); the cubic-bezier above stays as the fallback */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.06, 0.201, 0.374, 0.546, 0.7, 0.825, 0.919, 0.984, 1.025, 1.046, 1.054, 1.053, 1.046, 1.037, 1.027, 1.019, 1.011, 1.006, 1.002, 0.999, 0.998, 0.997, 0.997, 1);
    --ease-pop: linear(0, 0.044, 0.156, 0.307, 0.473, 0.638, 0.786, 0.912, 1.009, 1.079, 1.123, 1.144, 1.147, 1.137, 1.119, 1.095, 1.071, 1.047, 1.026, 1.008, 0.995, 0.986, 0.981, 0.978, 0.979, 0.98, 0.983, 0.987, 0.991, 0.994, 1);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 64px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--red-2); transition: color var(--dur-hover) ease; }
@media (hover: hover) and (pointer: fine) { a:not(.btn):hover { color: #ffa070; } }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--red-2); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- one language for everything you can press ---------- */
.btn, .addbtn, .cartbtn, .chip, .iconbtn, .stepper button, .viewer__nav, .viewer__close, .search__clear, .citem__del, .linkbtn {
  outline: 2px solid transparent; outline-offset: 0;
  transition:
    transform var(--dur-hover) var(--ease-spring),
    box-shadow var(--dur-hover) var(--ease-out),
    background-color var(--dur-hover) ease,
    border-color var(--dur-hover) ease,
    color var(--dur-hover) ease,
    outline-color var(--dur-hover) ease,
    outline-offset var(--dur-hover) var(--ease-out);
}
.btn:focus-visible, .addbtn:focus-visible, .cartbtn:focus-visible, .chip:focus-visible, .iconbtn:focus-visible,
.stepper button:focus-visible, .viewer__nav:focus-visible, .viewer__close:focus-visible, .search__clear:focus-visible,
.citem__del:focus-visible, .linkbtn:focus-visible {
  outline-color: var(--red-2); outline-offset: 3px; box-shadow: 0 0 0 6px var(--ring);
}
.btn:active, .addbtn:active, .cartbtn:active, .chip:active, .iconbtn:active, .viewer__nav:active, .viewer__close:active {
  transform: scale(.95); transition-duration: var(--dur-press);
}
.stepper button:active { transform: scale(.82); transition-duration: var(--dur-press); }

/* the light that runs across a button on hover (a pseudo-element that exists only while the pointer is over it) */
@media (hover: hover) and (pointer: fine) {
  :is(.btn, .addbtn, .cartbtn):hover::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(105deg, transparent 36%, rgba(255, 255, 255, .38) 50%, transparent 64%) 100% 0 / 260% 100% no-repeat;
    animation: sheen 780ms var(--ease-out) both;
  }
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(14, 14, 16, .84);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  max-width: 1100px; margin: 0 auto; height: var(--bar-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand__logo { border-radius: 50%; transition: transform var(--dur-state) var(--ease-spring); }
@media (hover: hover) and (pointer: fine) { .brand:hover .brand__logo { transform: rotate(-8deg) scale(1.08); } }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text b { font-size: 16px; letter-spacing: .01em; }
.brand__text small { color: var(--mute); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

.search {
  flex: 1; min-width: 0; position: relative; display: flex; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; height: 42px;
  transition: border-color var(--dur-hover) ease, box-shadow var(--dur-hover) var(--ease-out), background-color var(--dur-hover) ease;
}
.search:focus-within { border-color: var(--red-2); background: #26262c; box-shadow: 0 0 0 4px var(--ring), 0 10px 26px -12px rgba(239, 59, 36, .6); }
.search svg { width: 18px; height: 18px; margin-left: 12px; fill: var(--mute); flex: none; transition: transform var(--dur-state) var(--ease-spring), fill var(--dur-hover) ease; }
.search:focus-within svg { fill: var(--red-2); transform: scale(1.14) rotate(-10deg); }
.search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0;
  color: var(--text); padding: 0 12px; font-size: 15px;
}
.search input::placeholder { color: var(--mute); }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear { background: none; border: 0; color: var(--mute); font-size: 22px; line-height: 1; padding: 0 12px; cursor: pointer; height: 100%; border-radius: 0 12px 12px 0; }
.search__clear:not([hidden]) { animation: pop-in var(--dur-state) var(--ease-pop) backwards; }
@media (hover: hover) and (pointer: fine) { .search__clear:hover { color: var(--text); transform: rotate(90deg); } }

.cartbtn {
  position: relative; flex: none; display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: 0 6px 20px rgba(239, 59, 36, .35);
}
.cartbtn svg { width: 20px; height: 20px; fill: currentColor; }
.cartbtn__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #fff; color: var(--red); font-size: 13px; font-weight: 800;
}
.cartbtn__ring { position: absolute; inset: 0; border-radius: inherit; border: 2px solid #ffd2b8; opacity: 0; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .cartbtn:hover { transform: translate3d(0, -2px, 0); box-shadow: 0 12px 26px -8px rgba(239, 59, 36, .7); }
  .cartbtn:active { transform: scale(.95); }
}

/* a number that flips: the new digit rolls in, the old one rolls out (app.js: flipNum; the old digit lives in ::before, so textContent stays clean) */
.num-host { position: relative; display: inline-grid; place-items: center; overflow: hidden; }
.num-host::before { content: attr(data-prev); position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; }
.num { display: block; }
.num-host.flip > .num { animation: num-in var(--dur-state) var(--ease-pop) var(--flip-delay, 0ms) backwards; }
.num-host.flip::before { animation: num-out var(--dur-state) var(--ease-out) var(--flip-delay, 0ms) both; }
@keyframes num-in { from { opacity: 0; transform: translate3d(0, calc(var(--dir, 1) * 90%), 0) scale(.5); } }
@keyframes num-out { from { opacity: 1; } to { opacity: 0; transform: translate3d(0, calc(var(--dir, 1) * -90%), 0) scale(.5); } }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.hero::before {
  content: ''; position: absolute; inset: -12% -6% -30%; pointer-events: none; z-index: -1;
  background:
    radial-gradient(900px 360px at 85% 10%, rgba(239, 59, 36, .38), transparent 70%),
    radial-gradient(600px 300px at 0% 100%, rgba(255, 122, 61, .18), transparent 70%);
  transform: translate3d(0, calc(var(--hs, 0) * 70px), 0) scale(calc(1 + var(--hs, 0) * .1));
}
/* the glow breathes: the only endless animation of the page itself (the panda's sleeping "z" in panda.css are the others); it is paused once the hero has left the screen */
.hero::after {
  content: ''; position: absolute; right: -6%; top: -46%; width: 560px; height: 560px; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 110, 60, .34), rgba(255, 110, 60, 0) 72%);
  animation: breathe var(--dur-breathe) ease-in-out infinite;
}
.hero-off .hero::after { animation-play-state: paused; }
@keyframes breathe { 0%, 100% { opacity: .5; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.12); } }
.hero__in { position: relative; max-width: 1100px; margin: 0 auto; padding: 40px var(--gutter) 32px;
  transform: translate3d(0, calc(var(--hs, 0) * 34px), 0); opacity: calc(1 - var(--hs, 0) * .7); }
.hero__kicker { margin: 0 0 10px; color: var(--cream); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.hero h1 { margin: 0 0 14px; font-size: clamp(30px, 6vw, 52px); line-height: 1.04; letter-spacing: -.02em; font-weight: 800; }
.hero h1 .w { display: inline-block; }
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 760px; }
.steps li { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; color: #e4dfd6; }
.steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 12px; }
.steps li:nth-child(2) { --si: 1; } .steps li:nth-child(3) { --si: 2; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero__cta > :nth-child(2) { --ci: 1; } .hero__cta > :nth-child(3) { --ci: 2; }
.pill { background: rgba(246, 227, 196, .1); border: 1px solid rgba(246, 227, 196, .3); color: var(--cream); border-radius: 999px; padding: 8px 14px; font-size: 13px; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; text-align: center;
}
.btn--vk { background: var(--vk); color: #fff; box-shadow: 0 8px 20px -10px rgba(39, 135, 245, .8); }
.btn--ghost { background: rgba(255, 255, 255, .06); color: var(--text); border-color: rgba(255, 255, 255, .22); }
.btn--big { width: 100%; min-height: 54px; font-size: 17px; background: var(--grad); color: #fff; box-shadow: 0 10px 28px rgba(239, 59, 36, .4); }
.btn--big.done { box-shadow: 0 10px 28px rgba(46, 160, 67, .4); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translate3d(0, -2px, 0); }
  .btn:active { transform: scale(.95); }
  .btn--vk:hover { box-shadow: 0 14px 28px -10px rgba(39, 135, 245, .95); }
  .btn--ghost:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .4); }
  .btn--big:hover { box-shadow: 0 16px 34px -10px rgba(239, 59, 36, .8); }
}
/* "copy" button: a green fill runs across, the tick draws itself (app.js: onCopy) */
.btn--big { overflow: hidden; }
.btn__fill { position: absolute; inset: 0; background: var(--ok); transform: scaleX(0); transform-origin: 100% 50%; transition: transform var(--dur-sheet) var(--ease-in-out); pointer-events: none; }
.btn--big.done .btn__fill { transform: none; transform-origin: 0 50%; transition-timing-function: var(--ease-out); }
.btn__lbl { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.btn__lbl::before { content: attr(data-prev); position: absolute; left: 50%; top: 50%; translate: -50% -50%; white-space: nowrap; opacity: 0; pointer-events: none; }
.btn__lbl.flip::before { animation: lbl-out var(--dur-state) var(--ease-out) both; }
.btn__lbl.flip .btn__txt { animation: lbl-in var(--dur-state) var(--ease-out) backwards; }
@keyframes lbl-out { from { opacity: 1; } to { opacity: 0; translate: -50% -150%; } }
.chk { display: none; width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chk path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.btn--big.done .chk { display: block; }
.btn--big.done .chk path { animation: draw var(--dur-state) var(--ease-out) 240ms backwards; }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes lbl-in { from { opacity: 0; transform: translate3d(0, 55%, 0); } }

/* ---------- publisher chips ---------- */
.chips {
  position: sticky; top: var(--bar-h); z-index: 20;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px var(--gutter);
  background: rgba(14, 14, 16, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--dur-hover) ease, background-color var(--dur-hover) ease;
}
.chips::-webkit-scrollbar { display: none; }
.chips.is-stuck { box-shadow: 0 14px 28px -12px rgba(0, 0, 0, .7); background: rgba(14, 14, 16, .96); }
.chip {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .055); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip em { font-style: normal; color: var(--mute); font-weight: 500; transition: color var(--dur-hover) ease; }
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px rgba(239, 59, 36, .9); }
.chip[aria-pressed="true"] em { color: rgba(255, 255, 255, .8); }
/* the sliding pill: one gradient strip under all chips, clipped to the active one (app.js: placePill); the chip itself turns clear */
.chips__pill { position: absolute; left: 0; top: 10px; height: 36px; width: var(--cw, 100%); pointer-events: none;
  background: linear-gradient(100deg, #ff5a36, #e8301c); clip-path: inset(0 100% 0 0 round 18px); box-shadow: none; }
.chips.has-pill .chip[aria-pressed="true"] { background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { border-color: rgba(255, 122, 61, .6); transform: translate3d(0, -1px, 0); }
  .chip:not([aria-pressed="true"]):hover::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--red-2);
    animation: line-grow var(--dur-hover) var(--ease-out) backwards; transform-origin: 50% 50%;
  }
}
@media (min-width: 1100px) { .chips { padding-left: calc((100vw - 1100px) / 2 + var(--gutter)); padding-right: var(--gutter); } }

/* ---------- catalog ---------- */
.catalog { max-width: 1100px; margin: 0 auto; padding: 8px var(--gutter) 60px; }
.pub { padding-top: 26px; }
.pub__title { position: relative; margin: 0 0 4px; display: flex; align-items: baseline; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.pub__title i { font-style: normal; font-size: 13px; color: var(--mute); font-weight: 500; }
.pub__title::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; border-radius: 2px; transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--red), rgba(239, 59, 36, 0) 70%); }
.series { content-visibility: auto; contain-intrinsic-size: auto 380px; }   /* mean real height of a series is 378 px (402-409 px on a phone): the page height stays put while you scroll */
@media (max-width: 720px) { .series { contain-intrinsic-size: auto 405px; } }
.series__title { position: relative; margin: 18px 0 6px; padding-left: 13px; font-size: 14px; font-weight: 700; color: var(--cream); }
.series__title::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 2px; background: var(--red); transform-origin: 50% 0; }

.row {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 76px 148px; align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: 12px; border: 1px solid transparent;
  transition: background-color var(--dur-hover) ease, border-color var(--dur-hover) ease;
}
.row.in-cart { background: rgba(239, 59, 36, .08); border-color: rgba(239, 59, 36, .35); }
.row.flash::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--red-2); pointer-events: none; animation: row-flash 900ms var(--ease-out) forwards; }
@keyframes row-flash { from { opacity: 1; transform: scale(.985); } to { opacity: 0; transform: scale(1.02); } }
.row__thumb {
  position: relative; width: 52px; height: 78px; padding: 0; border: 0; border-radius: 7px; overflow: hidden; cursor: zoom-in;
  background: var(--panel-2); box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  transition: transform var(--dur-hover) var(--ease-spring), box-shadow var(--dur-hover) var(--ease-out);
}
.row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.row__name { font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.row__price { text-align: right; font-weight: 800; font-size: 16px; white-space: nowrap; }
.row__price small { font-weight: 600; color: var(--mute); }
.row__buy { display: flex; justify-content: flex-end; }
/* the button and the counter share one cell: while one replaces the other they overlap (no empty frame) */
.buy, #viewerAction { display: inline-grid; justify-items: end; }
.buy > *, #viewerAction > * { grid-area: 1 / 1; }
.swap-out { animation: swap-out var(--dur-swap) var(--ease-in) forwards; pointer-events: none; }
@keyframes swap-out { to { opacity: 0; transform: scale(.86); } }
@media (hover: hover) and (pointer: fine) {
  .row:hover { background: var(--panel); }
  /* a soft light follows the pointer inside the row (app.js writes --mx/--my); the pseudo-element exists only under the pointer */
  .row:hover::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 122, 61, .13), transparent 62%); }
  .row.in-cart:hover { background: rgba(239, 59, 36, .12); }
  .row:hover .row__thumb { transform: translate3d(0, -2px, 0) scale(1.05); box-shadow: 0 10px 18px -6px rgba(0, 0, 0, .7); }
}

.addbtn {
  position: relative;
  height: 38px; min-width: 128px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 6px 14px -8px rgba(239, 59, 36, .8);
}
.addbtn.is-back { animation: pop-in var(--dur-state) var(--ease-pop) backwards; }
@media (hover: hover) and (pointer: fine) {
  .addbtn:hover { transform: translate3d(0, -2px, 0); box-shadow: 0 12px 20px -8px rgba(239, 59, 36, .85); }
  .addbtn:active { transform: scale(.95); }
}

.stepper { position: relative; display: inline-flex; align-items: center; height: 38px; border-radius: 10px; border: 1px solid rgba(239, 59, 36, .6); overflow: hidden; background: rgba(0, 0, 0, .25); }
.stepper button { width: 38px; height: 100%; border: 0; background: none; font-size: 20px; font-weight: 700; cursor: pointer; color: #fff; border-radius: 0; }
.stepper output { min-width: 34px; height: 100%; font-weight: 800; }
@media (hover: hover) and (pointer: fine) { .stepper button:hover { background: rgba(255, 255, 255, .12); } }
/* the button turns into a counter: the counter pops, the minus and plus slide out from the middle */
.stepper.is-new { animation: stepper-in var(--dur-state) var(--ease-pop) backwards; }
.stepper.is-new > button:first-child { animation: slide-r var(--dur-sheet) var(--ease-out) backwards; }
.stepper.is-new > button:last-child { animation: slide-l var(--dur-sheet) var(--ease-out) backwards; }
.stepper.is-new output { animation: pop-in var(--dur-state) var(--ease-pop) 80ms backwards; }
@keyframes stepper-in { from { opacity: 0; transform: scale(.7); } }
@keyframes slide-r { from { transform: translate3d(24px, 0, 0); opacity: 0; } }
@keyframes slide-l { from { transform: translate3d(-24px, 0, 0); opacity: 0; } }

.empty { max-width: 1100px; margin: 40px auto; padding: 0 var(--gutter); color: var(--mute); text-align: center; }
.empty:not([hidden]) { animation: rv-rise var(--dur-enter) var(--ease-out) backwards; }
.empty.is-out, .search__clear.is-out { animation: fade-out var(--dur-swap) var(--ease-in) forwards; pointer-events: none; }
@keyframes fade-out { to { opacity: 0; transform: scale(.94); } }
/* the old list stays on screen as a picture while it fades (app.js: ghostOut) */
.ghost { position: fixed; inset: 0; z-index: 15; overflow: hidden; pointer-events: none; }

@media (max-width: 720px) {
  :root { --bar-h: 58px; }
  .brand__text, .cartbtn__label { display: none; }
  .cartbtn { padding: 0 12px; }
  .hero__in { padding: 22px var(--gutter) 18px; }
  .hero h1 { font-size: 28px; margin-bottom: 14px; }
  .hero h1 br { display: none; }
  .hero::after { width: 380px; height: 380px; right: -30%; top: -30%; }
  /* the three steps are the only how-to on a phone, so they stay — just tighter */
  .steps { grid-template-columns: 1fr; gap: 6px; margin-bottom: 16px; }
  .steps li { padding: 8px 12px; font-size: 13px; }
  .hero__cta .btn { flex: 1 1 140px; }
  .row { grid-template-columns: 52px minmax(0, 1fr); grid-template-areas: "thumb name" "thumb buy"; row-gap: 6px; align-items: start; }
  .row__thumb { grid-area: thumb; }
  .row__name { grid-area: name; }
  .row__price { display: none; }
  .row__buy { grid-area: buy; justify-content: space-between; align-items: center; gap: 10px; }
  .row__buy .mprice { display: block; font-weight: 800; font-size: 16px; }
}
@media (min-width: 721px) { .row__buy .mprice { display: none; } }

/* ---------- hover preview ---------- */
.peek {
  position: fixed; z-index: 60; pointer-events: none; left: 0; top: 0;
  padding: 6px; border-radius: 14px; background: #fff; box-shadow: var(--shadow);
}
.peek:not([hidden]) { animation: peek-in var(--dur-state) var(--ease-out) backwards; }
@keyframes peek-in { from { opacity: 0; scale: .9; } }
.peek img { width: 250px; max-width: 40vw; height: auto; border-radius: 9px; background: var(--panel-2); }
@media (hover: none) { .peek { display: none !important; } }

/* ---------- viewer (cover lightbox) ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 20px 12px;
}
/* the backdrop darkens and blurs by itself, so the cover that grows out of its thumbnail is never dimmed with it */
.viewer::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: rgba(6, 6, 8, 0);
  -webkit-backdrop-filter: blur(0px) saturate(1); backdrop-filter: blur(0px) saturate(1);
  transition: background-color var(--dur-state) var(--ease-in-out), -webkit-backdrop-filter var(--dur-state) var(--ease-in-out), backdrop-filter var(--dur-state) var(--ease-in-out);
}
.viewer.open::before { background: rgba(6, 6, 8, .7); -webkit-backdrop-filter: blur(16px) saturate(.9); backdrop-filter: blur(16px) saturate(.9);
  transition-duration: var(--dur-sheet); transition-timing-function: var(--ease-out); }
.viewer__close, .viewer__nav, .viewer figcaption {
  opacity: 0;
  transition:
    opacity var(--dur-state) var(--ease-in-out),
    transform var(--dur-state) var(--ease-in-out),
    background-color var(--dur-hover) ease,
    border-color var(--dur-hover) ease,
    box-shadow var(--dur-hover) var(--ease-out),
    outline-color var(--dur-hover) ease,
    outline-offset var(--dur-hover) var(--ease-out);
}
.viewer.open .viewer__close, .viewer.open .viewer__nav, .viewer.open figcaption { opacity: 1; }
.viewer__nav--prev { transform: translate3d(-14px, 0, 0); }
.viewer__nav--next { transform: translate3d(14px, 0, 0); }
.viewer.open .viewer__nav { transform: none; transition-delay: 120ms; transition-timing-function: var(--ease-out); }
.viewer__close { transform: scale(.7); }
.viewer.open .viewer__close { transform: none; transition-delay: 120ms; }
.viewer__body { position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(92vw, 520px); }
.viewer__body img {
  /* the box is reserved up front (2:3), so the caption does not jump while the cover loads */
  height: min(70vh, 560px, 132vw); width: auto; aspect-ratio: 2 / 3; object-fit: contain;
  border-radius: 12px; background: var(--panel-2);
  box-shadow: var(--shadow);
}
.viewer figcaption { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: center; transform: translate3d(0, 14px, 0); }
.viewer.open figcaption { transform: none; transition-delay: 160ms; }
.viewer__name { font-size: 15px; font-weight: 600; }
.viewer__row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.viewer__row b { font-size: 20px; }
.viewer__close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .4); font-size: 28px; line-height: 1; cursor: pointer;
}
.viewer__nav {
  flex: none; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .4); font-size: 30px; line-height: 1; padding-bottom: 4px;
}
@media (hover: hover) and (pointer: fine) {
  .viewer__nav:hover, .viewer__close:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); }
  .viewer.open .viewer__nav--prev:hover { transform: translate3d(-3px, 0, 0) scale(1.06); transition-delay: 0s; }
  .viewer.open .viewer__nav--next:hover { transform: translate3d(3px, 0, 0) scale(1.06); transition-delay: 0s; }
  .viewer.open .viewer__close:hover { transform: rotate(90deg) scale(1.06); transition-delay: 0s; }
}
.viewer.open .viewer__nav:active, .viewer.open .viewer__close:active { transform: scale(.9); transition-delay: 0s; }
@media (max-width: 720px) {
  .viewer { gap: 4px; padding: 16px 4px; }
  .viewer__nav { width: 38px; height: 38px; font-size: 24px; }
}

/* ---------- cart drawer ---------- */
.shade { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--dur-state) var(--ease-in-out); }
.shade.open { opacity: 1; transition: opacity var(--dur-sheet) var(--ease-out); }
.cart {
  position: fixed; z-index: 75; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translate3d(100%, 0, 0); transition: transform var(--dur-state) var(--ease-in-out);
}
.cart.open { transform: none; transition: transform var(--dur-sheet) var(--ease-out); }
.cart__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cart__head h2 { margin: 0; font-size: 20px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); font-size: 24px; line-height: 1; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .iconbtn:hover { transform: rotate(90deg); background: #2b2b32; border-color: rgba(255, 255, 255, .25); } }
.cart__empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 30px; text-align: center; color: var(--mute); }
.cart__empty img { border-radius: 10px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translate3d(0, 0, 0) rotate(-1.5deg); } 50% { transform: translate3d(0, -7px, 0) rotate(1.5deg); } }
.cart__list { flex: 1; list-style: none; margin: 0; padding: 6px 12px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.citem { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.citem img { width: 44px; height: 66px; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.citem__name { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.citem__row { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.citem__sum { font-weight: 800; }
.citem__sum small { color: var(--mute); font-weight: 500; }
.citem .stepper { height: 34px; }
.citem .stepper button { width: 34px; }
.citem__del { background: none; border: 0; color: var(--mute); cursor: pointer; font-size: 13px; text-decoration: underline; padding: 6px 4px; border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .citem__del:hover { color: #ff9a7a; } }
.citem.is-new { animation: cart-rise var(--dur-enter) var(--ease-out) backwards; }
.citem.is-leaving { animation: cart-leave 260ms var(--ease-in) forwards; pointer-events: none; }
@keyframes cart-rise { from { opacity: 0; transform: translate3d(28px, 0, 0); } }
@keyframes cart-leave { to { opacity: 0; transform: translate3d(48px, 0, 0); } }
/* when the drawer opens, its contents arrive one after another */
.cart.is-entering .cart__head, .cart.is-entering .citem, .cart.is-entering .cart__foot > *, .cart.is-entering .cart__empty > * {
  animation: cart-rise var(--dur-enter) var(--ease-out) calc(140ms + var(--i, 0) * var(--step)) backwards;
}
.cart.is-entering .cart__foot > :nth-child(1) { --i: 3; } .cart.is-entering .cart__foot > :nth-child(2) { --i: 4; }
.cart.is-entering .cart__foot > :nth-child(3) { --i: 5; } .cart.is-entering .cart__foot > :nth-child(4) { --i: 6; } .cart.is-entering .cart__foot > :nth-child(5) { --i: 7; }
.cart.is-entering .cart__empty > :nth-child(2) { --i: 2; }
.cart__foot {
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; gap: 12px;
}
.cart__total { display: flex; align-items: baseline; justify-content: space-between; color: var(--mute); }
.cart__total b { display: inline-block; color: var(--text); font-size: 24px; transform-origin: 100% 60%; }
.num-host.is-text { place-items: center start; white-space: nowrap; }
.num-host.is-text::before { place-items: center start; }
.cart__total b.num-host.is-text { place-items: center end; }
.cart__total b.num-host.is-text::before { place-items: center end; }
.sendbox { background: rgba(46, 160, 67, .12); border: 1px solid rgba(46, 160, 67, .45); border-radius: 12px; padding: 12px; }
.sendbox:not([hidden]) { animation: rv-rise var(--dur-enter) var(--ease-out) backwards; }
.sendbox p { margin: 0 0 10px; font-size: 14px; }
.sendbox__row { display: grid; gap: 8px; }
.preview summary { cursor: pointer; color: var(--mute); font-size: 13px; transition: color var(--dur-hover) ease; }
@media (hover: hover) and (pointer: fine) { .preview summary:hover { color: var(--text); } }
.preview textarea { width: 100%; margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 13px/1.45 ui-monospace, Consolas, monospace; resize: vertical; }
.linkbtn { align-self: center; background: none; border: 0; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; padding: 4px; }
@media (hover: hover) and (pointer: fine) { .linkbtn:hover { color: var(--text); } }

/* ---------- toast & footer ---------- */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px; background: #fff; color: #111; font-weight: 600; box-shadow: var(--shadow);
  pointer-events: none;   /* a message never takes a tap away from the button under it */
}
/* while the cart or the cover viewer is open the toast moves up, so it never covers the cart footer (copy button, links) */
body.is-locked .toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); }
@media (min-width: 721px) { body.is-locked .toast { left: calc((100vw - 460px) / 2); } }
.toast.show { animation: toast-in var(--dur-state) var(--ease-pop) backwards; }
.toast.leave { animation: toast-out 220ms var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; translate: 0 22px; scale: .92; } }
@keyframes toast-out { to { opacity: 0; translate: 0 12px; scale: .96; } }
.footer { max-width: 1100px; margin: 0 auto; padding: 24px var(--gutter) 48px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; }
.footer p { margin: 0 0 8px; max-width: 720px; }

/* ---------- flying cover and sparks (created by app.js) ---------- */
.fly { position: fixed; left: 0; top: 0; z-index: 120; margin: 0; pointer-events: none; border-radius: 7px; overflow: hidden; box-shadow: 0 10px 24px rgba(0, 0, 0, .55); background: var(--panel-2); will-change: transform, opacity; }
.fly img { width: 100%; height: 100%; object-fit: cover; }
.spark { position: fixed; left: 0; top: 0; z-index: 120; border-radius: 50%; pointer-events: none; will-change: transform, opacity; }

/* ---------- progress line in the top bar ---------- */
/* the bar is as wide as the screen and slides in from the left; its bright head is part of it, so nothing is stretched */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 14px; overflow: hidden; pointer-events: none; }
.progress i { position: absolute; left: 0; right: 0; bottom: 1px; height: 3px; transform: translate3d(-100%, 0, 0); background: var(--grad); }
.progress i::after { content: ''; position: absolute; right: 0; bottom: -5px; width: 72px; height: 14px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 90, .95), rgba(255, 110, 60, 0)); transform: translate3d(36px, 0, 0); }

/* ---------- scroll choreography (assets/app.js) ---------- */
/* before anything is revealed the elements wait invisible; a reveal is a keyframe animation that plays once and is then taken off (class rv-play) */
.js-reveal .rv:not(.in) { opacity: 0; }
.js-reveal .rv.rv-play { animation: rv-rise var(--dur-enter) var(--ease-out) var(--d, 0ms) backwards; }
.js-reveal .pub__title.rv.rv-play { animation-name: rv-wipe; animation-duration: calc(var(--dur-enter) + 240ms); }
.js-reveal .pub__title.rv.rv-play::after { animation: line-grow calc(var(--dur-enter) + 240ms) var(--ease-out) calc(var(--d, 0ms) + 200ms) backwards; }
.js-reveal .series__title.rv.rv-play { animation-name: rv-slide; }
.js-reveal .series__title.rv.rv-play::before { animation: mark-grow var(--dur-enter) var(--ease-out) calc(var(--d, 0ms) + 80ms) backwards; }
.js-reveal .row.rv.rv-play .row__thumb { animation: pop-in var(--dur-enter) var(--ease-pop) calc(var(--d, 0ms) + 50ms) backwards; }
.js-reveal .row.rv.rv-play .row__name { animation: fade-left var(--dur-enter) var(--ease-out) calc(var(--d, 0ms) + 110ms) backwards; }
.js-reveal .row.rv.rv-play .row__price { animation: fade-left var(--dur-enter) var(--ease-out) calc(var(--d, 0ms) + 160ms) backwards; }
.js-reveal .row.rv.rv-play .row__buy { animation: pop-in var(--dur-enter) var(--ease-pop) calc(var(--d, 0ms) + 210ms) backwards; }
@keyframes rv-rise { from { opacity: 0; transform: translate3d(0, var(--rise), 0) scale(.97); filter: blur(var(--blur-in)); } }
@keyframes rv-slide { from { opacity: 0; transform: translate3d(-34px, 0, 0); filter: blur(var(--blur-in)); } }
@keyframes rv-wipe { from { opacity: 0; clip-path: inset(-6px 100% -6px -6px); transform: translate3d(-18px, 0, 0); } to { opacity: 1; clip-path: inset(-6px -6px -6px -6px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.55) rotate(-7deg); } }
@keyframes fade-left { from { opacity: 0; transform: translate3d(14px, 0, 0); } }
@keyframes line-grow { from { transform: scaleX(0); } }
@keyframes mark-grow { from { transform: scaleY(0); } }

/* covers: the frame jumps in with the row, the picture settles into it when it has loaded */
.js-reveal .row__thumb img { opacity: 0; transform: scale(1.12); }
.js-reveal .row__thumb img.ld { opacity: 1; transform: none; }
.js-reveal .row__thumb img.ld-fade { transition: opacity var(--dur-state) ease, transform var(--dur-enter) var(--ease-out); }

/* page-load sequence: runs once, when app.js has drawn the list (html gets .fx-go) */
.js-reveal:not(.fx-go) :is(.brand, .search, .cartbtn, .hero .w, .steps li, .steps b, .hero__cta > *) { opacity: 0; }
.js-reveal.fx-go :is(.brand, .search, .cartbtn) { animation: drop-in var(--dur-enter) var(--ease-out) backwards; }
.js-reveal.fx-go .search { animation-delay: 80ms; }
.js-reveal.fx-go .cartbtn { animation-delay: 160ms; }
.js-reveal.fx-go .hero h1 .w { animation: word-in var(--dur-hero) var(--ease-out) calc(160ms + var(--wi, 0) * 90ms) backwards; }
.js-reveal.fx-go .steps li { animation: rv-rise var(--dur-hero) var(--ease-out) calc(520ms + var(--si, 0) * 110ms) backwards; }
.js-reveal.fx-go .steps b { animation: pop-in var(--dur-hero) var(--ease-pop) calc(680ms + var(--si, 0) * 110ms) backwards; }
.js-reveal.fx-go .hero__cta > * { animation: rv-rise var(--dur-hero) var(--ease-out) calc(860ms + var(--ci, 0) * 90ms) backwards; }
@keyframes drop-in { from { opacity: 0; transform: translate3d(0, -12px, 0); } }
@keyframes word-in { from { opacity: 0; transform: translate3d(0, .5em, 0) rotate(2.5deg); filter: blur(10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js-reveal .rv, .js-reveal .row__thumb img { opacity: 1; transform: none; }
  .hero::before, .hero__in { transform: none; opacity: 1; }
  .viewer.open::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(6, 6, 8, .86); }
}
