/* VIP Books — modern animated theme. Logical properties throughout, so every rule works in RTL and LTR. */

:root {
  --bg: #07070c;
  --bg-2: #0c0c15;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #f4f4f9;
  --muted: #a3a3b9;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --gold: #f5c451;
  --on-accent: #fff;
  --glass: rgba(14, 14, 24, .62);
  --shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 18px 40px -12px rgba(0, 0, 0, .65);
  --cover-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 22px 44px -14px rgba(0, 0, 0, .75);
  --r: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;
  --head-h: 72px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f6fb;
  --bg-2: #ffffff;
  --surface: rgba(16, 16, 40, .035);
  --surface-2: rgba(16, 16, 40, .06);
  --line: rgba(16, 16, 40, .09);
  --line-2: rgba(16, 16, 40, .16);
  --text: #0d0d1c;
  --muted: #5d5d74;
  --glass: rgba(255, 255, 255, .7);
  --shadow: 0 1px 1px rgba(16, 16, 40, .05), 0 18px 40px -16px rgba(16, 16, 40, .25);
  --cover-shadow: 0 2px 4px rgba(16, 16, 40, .12), 0 22px 44px -16px rgba(16, 16, 40, .45);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16.5px; line-height: 1.7; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
.rtl h1, .rtl h2, .rtl h3 { letter-spacing: 0; line-height: 1.35; }
p { margin: 0 0 1em; }
.wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(820px, 100% - 40px); }
.num { unicode-bidi: isolate; direction: ltr; }
.ico { flex: none; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
::selection { background: color-mix(in srgb, var(--accent) 55%, transparent); color: #fff; }

/* ---------- Buttons ---------- */
.btn { --h: 48px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--h); padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 1rem; line-height: 1.2; border: 1px solid transparent; cursor: pointer; isolation: isolate; overflow: hidden; transition: transform .35s var(--spring), box-shadow .35s var(--ease), background .3s, border-color .3s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-sm { --h: 42px; padding: 0 16px; font-size: .94rem; }
.btn-lg { --h: 62px; padding: 0 28px; font-size: 1.1rem; width: 100%; max-width: 480px; border-radius: 18px; white-space: normal; text-align: center; }
.btn-primary, .btn-buy { color: var(--on-accent); background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 40%, var(--accent-2)) 60%, var(--accent-2)); background-size: 160% 100%; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover, .btn-buy:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 16px 40px -10px color-mix(in srgb, var(--accent) 90%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--text); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 60%, var(--line-2)); transform: translateY(-2px); }
.btn-glass { background: var(--surface); border-color: var(--line); }
.btn-glass:hover { background: var(--surface-2); }
.btn .ico-arrow { transition: transform .35s var(--spring); }
.btn:hover .ico-arrow { transform: translateX(4px); }
.rtl .ico-arrow { transform: scaleX(-1); }
.rtl .btn:hover .ico-arrow { transform: scaleX(-1) translateX(4px); }
.btn-shine { position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); transform: translateX(-120%); animation: shine 4.2s var(--ease) infinite 1.2s; pointer-events: none; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn-label { position: relative; }

/* ---------- Header ---------- */
.site-head { position: fixed; inset-inline: 0; top: 0; z-index: 50; padding: 12px 16px 0; transition: transform .45s var(--ease); }
.head-in { display: flex; align-items: center; gap: 18px; height: 60px; width: min(1240px, 100%); margin-inline: auto; padding-inline: 14px 10px; border-radius: 20px; border: 1px solid transparent; transition: background .35s, border-color .35s, box-shadow .35s; }
.site-head.scrolled .head-in { background: var(--glass); border-color: var(--line); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); box-shadow: var(--shadow); }
.site-head.hide { transform: translateY(-110%); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; flex: none; }
.brand-logo { max-height: 40px; width: auto; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--gold), var(--accent)); box-shadow: 0 6px 20px -6px var(--accent); }
.brand-mark span { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); font-size: .95rem; font-weight: 700; color: var(--text); }
.head-nav { margin-inline-start: 12px; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 8px 14px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: color .25s, background .25s; }
.nav-list a:hover, .nav-list .current-menu-item a { color: var(--text); background: var(--surface); }
.head-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background .25s, transform .3s var(--spring); }
.icon-btn:hover { background: var(--surface-2); transform: rotate(-12deg); }
.theme-btn .ico-moon, [data-theme="light"] .theme-btn .ico-sun { display: none; }
[data-theme="light"] .theme-btn .ico-moon { display: block; }
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; transition: background .25s; }
.lang-btn:hover { background: var(--surface-2); }
.lang-btn .ico-chev { width: 16px; transition: transform .3s var(--ease); }
.lang[data-open] .ico-chev { transform: rotate(180deg); }
.lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 10px); min-width: 210px; max-height: min(70vh, 420px); overflow: auto; list-style: none; margin: 0; padding: 6px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow); opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top; pointer-events: none; transition: opacity .22s, transform .3s var(--ease); }
.lang[data-open] .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a[aria-current] { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.lang-menu small { color: var(--muted); font-size: .72rem; letter-spacing: .06em; }

/* ---------- Ambient background ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; opacity: .55; background: radial-gradient(closest-side, var(--c), transparent 70%); animation: drift 22s var(--ease) infinite alternate; will-change: transform; }
.aurora span:nth-child(1) { --c: color-mix(in srgb, var(--accent) 70%, transparent); inset-inline-start: -18vmax; top: -24vmax; }
.aurora span:nth-child(2) { --c: color-mix(in srgb, var(--accent-2) 45%, transparent); inset-inline-end: -20vmax; top: -10vmax; animation-duration: 26s; animation-delay: -6s; }
.aurora span:nth-child(3) { --c: color-mix(in srgb, var(--gold) 30%, transparent); inset-inline-start: 30%; bottom: -40vmax; animation-duration: 30s; animation-delay: -12s; }
.aurora.soft span { opacity: .28; }
.aurora.small span { width: 40vmax; height: 40vmax; }
[data-theme="light"] .aurora span { opacity: .35; }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } 100% { transform: translate3d(-4vmax, 7vmax, 0) scale(.95); } }
.grid-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%); opacity: .55; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: calc(var(--head-h) + 64px) 0 72px; min-height: min(100svh, 920px); display: flex; align-items: center; }
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.kicker { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .9rem; font-weight: 500; margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 0 var(--accent-2); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.hero-title { font-size: clamp(2.4rem, 5.6vw, 4.6rem); font-weight: 700; line-height: 1.08; margin-bottom: 22px; }
.rtl .hero-title { line-height: 1.3; }
.hero-title .w { display: inline-block; margin-inline-end: .24em; animation: rise .9s var(--ease) both; animation-delay: calc(var(--d) * 70ms + 80ms); }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-block: .06em; }
@keyframes rise { from { opacity: 0; transform: translateY(.5em) rotate(2deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.hero-text { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--muted); max-width: 36em; margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.stats > div { padding: 12px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 104px; }
.stats dt { font-size: 1.6rem; font-weight: 700; line-height: 1.1; display: flex; align-items: center; min-height: 1.8rem; }
.stats dt .ico { color: var(--gold); width: 26px; height: 26px; }
.stats dd { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }

/* 3D ring of covers */
.ring-stage { position: relative; height: 520px; perspective: 1500px; display: grid; place-items: center; }
.ring { --w: 190px; --radius: calc(var(--w) * var(--count) / 5.2); position: relative; width: var(--w); aspect-ratio: 2 / 3; transform-style: preserve-3d; animation: spin 42s linear infinite; }
.ring-stage:hover .ring { animation-play-state: paused; }
.ring-item { position: absolute; inset: 0; transform: rotateY(calc(360deg / var(--count) * var(--i))) translateZ(var(--radius)); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: filter .3s; }
.ring-item .cover { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; box-shadow: var(--cover-shadow); -webkit-box-reflect: below 6px linear-gradient(transparent 72%, rgba(255, 255, 255, .16)); }
.ring-item:hover { filter: brightness(1.12); }
.ring-floor { position: absolute; bottom: 30px; width: 80%; height: 60px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 45%, transparent), transparent); filter: blur(10px); }
@keyframes spin { from { transform: rotateX(-6deg) rotateY(0); } to { transform: rotateX(-6deg) rotateY(-360deg); } }

/* Marquee */
.marquee { position: relative; z-index: 1; display: grid; gap: 16px; padding: 8px 0 24px; overflow: hidden; direction: ltr; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-row { overflow: hidden; }
.marquee-track { display: flex; gap: 16px; width: max-content; animation: marquee 90s linear infinite; }
.marquee-row.rev .marquee-track { animation-direction: reverse; animation-duration: 110s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track a { flex: none; width: 104px; transition: transform .4s var(--spring); }
.marquee-track a:hover { transform: translateY(-6px) scale(1.06); }
.marquee-track .cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; box-shadow: var(--cover-shadow); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.sec { position: relative; padding: 96px 0 24px; }
.sec-tight { padding: 56px 0 0; }
.sec-head { max-width: 680px; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; margin-bottom: 10px; }
.sec-head p { color: var(--muted); font-size: 1.08rem; margin: 0; }

/* Bundles */
.bgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.bcard { position: relative; display: flex; flex-direction: column; border-radius: 24px; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, linear-gradient(140deg, var(--line-2), transparent 40%, transparent 60%, var(--line-2)) border-box; border: 1px solid transparent; overflow: hidden; transition: transform .5s var(--spring), box-shadow .4s; }
.bcard:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 70%, transparent); background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, linear-gradient(140deg, var(--accent), transparent 45%, transparent 55%, var(--accent-2)) border-box; }
.bcard-media { position: relative; height: 250px; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), var(--surface); overflow: hidden; }
.fan { position: relative; width: 100px; aspect-ratio: 2 / 3; }
.fan-item { --o: calc(var(--i) - (var(--n) - 1) / 2); position: absolute; inset: 0; transform: translateX(calc(var(--o) * 30px)) rotate(calc(var(--o) * 7deg)) translateY(calc(var(--o) * var(--o) * 3px)); transform-origin: 50% 120%; transition: transform .6s var(--spring); z-index: calc(10 - var(--i)); }
.fan-item .cover { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; box-shadow: var(--cover-shadow); }
.bcard:hover .fan-item { transform: translateX(calc(var(--o) * 52px)) rotate(calc(var(--o) * 11deg)) translateY(calc(var(--o) * var(--o) * 5px - 8px)); }
.fan.big { width: 170px; }
.bcard-price { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; padding: 4px 12px; border-radius: 999px; background: var(--gold); color: #1d1600; font-weight: 700; font-size: .95rem; box-shadow: 0 6px 18px -6px var(--gold); }
.bcard-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.bcard-body h3 { font-size: 1.25rem; margin-bottom: 4px; }
.bcard-body p { color: var(--muted); margin-bottom: 18px; font-size: .95rem; }
.bcard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.bcard-actions .btn-buy { flex: 1 1 auto; }

/* Toolbar */
.toolbar { position: sticky; top: calc(var(--head-h) + 8px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px; margin-bottom: 30px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.search { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.search .ico { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.search input::placeholder { color: var(--muted); }
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { position: relative; z-index: 1; height: 38px; padding: 0 14px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 500; transition: color .25s; }
.seg button.on { color: #fff; }
.seg small { opacity: .7; font-size: .8em; }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--pw, 0); transform: translateX(var(--px, 0)); border-radius: 10px; background: linear-gradient(120deg, var(--accent), var(--accent-2)); transition: transform .45s var(--spring), width .45s var(--spring); }

/* Book grid + cards */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 34px 22px; }
.card[hidden] { display: none; }
.card-link { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.card-cover { position: relative; display: block; border-radius: 12px; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0)); transition: transform .5s var(--ease), box-shadow .4s; box-shadow: var(--cover-shadow); will-change: transform; }
.card-cover .cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.card-link:hover .card-cover { --ty: -8px; box-shadow: 0 30px 50px -18px rgba(0, 0, 0, .7), 0 0 0 1px var(--line-2); }
.glare { position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .35), transparent 55%); opacity: 0; transition: opacity .3s; pointer-events: none; mix-blend-mode: soft-light; }
.card-link:hover .glare { opacity: 1; }
.card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-num { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.card-title { font-weight: 600; line-height: 1.45; transition: color .25s; }
.card-link:hover .card-title { color: color-mix(in srgb, var(--accent-2) 70%, var(--text)); }
.price-tag { align-self: start; margin-top: auto; padding: 3px 11px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.price-tag.solo { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.price-tag.bundle { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
[data-theme="light"] .price-tag.solo { color: #8a5f00; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Typographic cover (no image) */
.cover-text { display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 2 / 3; padding: 14% 11%; border-radius: 12px; color: #fff; background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent 60%), linear-gradient(160deg, var(--accent), #1b1446 75%); border-block-start: 5px solid var(--gold); container-type: inline-size; }
.ct-brand { font-size: max(9px, 7cqw); opacity: .8; letter-spacing: .04em; }
.ct-title { font-weight: 700; font-size: max(12px, 11cqw); line-height: 1.3; }
.ct-ed { font-size: max(8px, 6cqw); opacity: .7; }

/* CTA band */
.cta-band { padding-bottom: 40px; }
.cta-card { position: relative; overflow: hidden; text-align: center; padding: 72px 24px; border-radius: 32px; border: 1px solid var(--line); background: var(--bg-2); }
.cta-card > :not(.aurora) { position: relative; z-index: 1; }
.cta-card h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.cta-card p { color: var(--muted); margin-bottom: 26px; }

/* ---------- Book page ---------- */
.book-page { position: relative; overflow: hidden; padding: calc(var(--head-h) + 40px) 0 40px; min-height: 70vh; }
.book-page > .wrap { position: relative; z-index: 1; }
.crumb { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; margin-bottom: 26px; transition: color .25s, gap .3s var(--spring); }
.crumb:hover { color: var(--text); gap: 12px; }
.crumb .ico { transform: scaleX(-1); }
.rtl .crumb .ico { transform: none; }
.book-hero, .bundle-hero { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.bundle-hero { grid-template-columns: minmax(300px, 1.1fr) 1fr; }
.book-visual { display: grid; place-items: center; padding: 20px 0 30px; }
.book3d { --w: min(340px, 72vw); position: relative; width: var(--w); perspective: 1800px; }
.book3d-inner { position: relative; transform-style: preserve-3d; transform: rotateY(calc(var(--base, -22deg) + var(--ry, 0deg))) rotateX(calc(4deg + var(--rx, 0deg))); transition: transform .8s var(--ease); animation: bookIn 1.2s var(--ease) both; }
.rtl .book3d-inner { --base: 22deg; }
@keyframes bookIn { from { opacity: 0; transform: rotateY(calc(var(--base, -22deg) * -1.6)) translateY(30px); } }
.book3d-cover { position: relative; z-index: 2; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px 12px 12px 4px; transform: translateZ(14px); box-shadow: inset 4px 0 10px rgba(0, 0, 0, .25); }
.rtl .book3d-cover { border-radius: 12px 4px 4px 12px; }
.book3d-pages { position: absolute; top: 1.2%; bottom: 1.2%; inset-inline-start: calc(100% - 14px); width: 28px; transform: rotateY(90deg); background: repeating-linear-gradient(90deg, #f4f1ea 0 1px, #d9d4c7 1px 2px); border-radius: 2px; }
.rtl .book3d-pages { transform: rotateY(-90deg); }
.book3d-spine { position: absolute; inset: 0; transform: translateZ(-14px); background: #141428; border-radius: 4px 12px 12px 4px; box-shadow: 0 30px 60px rgba(0, 0, 0, .5); }
.book3d-shadow { position: absolute; inset-inline: 8%; bottom: -34px; height: 40px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); filter: blur(6px); }
.book3d::after { content: ""; position: absolute; inset: 10% -10%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 50%, transparent), transparent); filter: blur(30px); opacity: .7; }
.book-title { font-size: clamp(2rem, 4.4vw, 3.5rem); font-weight: 700; margin-bottom: 10px; }
.book-sub { font-size: 1.2rem; color: var(--muted); margin-bottom: 18px; }
.chips { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .92rem; font-weight: 500; }
.chips .ico { width: 16px; height: 16px; color: var(--accent-2); }
.buy-zone { margin-bottom: 22px; }
.pay-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; margin: 12px 0 0; }
.pay-note .ico { width: 16px; height: 16px; color: #4ade80; }
.also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.also a { padding: 4px 12px; border-radius: 999px; border: 1px dashed var(--line-2); transition: border-color .25s, color .25s; }
.also a:hover { color: var(--text); border-color: var(--accent-2); }
.in-bundle { margin-top: 26px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.in-bundle > p { font-weight: 500; margin-bottom: 14px; }
.mates { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; }
.mates a { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; line-height: 1.35; color: var(--muted); transition: color .25s; }
.mates a:hover { color: var(--text); }
.mates .cover { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; transition: transform .4s var(--spring); }
.mates a:hover .cover { transform: translateY(-4px); }
.mates li.cur .cover { outline: 2px solid var(--gold); outline-offset: 3px; }
.bundle-img { width: 100%; border-radius: 24px; box-shadow: var(--shadow); aspect-ratio: 16 / 9; object-fit: cover; }
.about { margin-top: 72px; padding: clamp(24px, 4vw, 44px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); max-width: 900px; }
.about h2 { font-size: 1.6rem; }
.prose { color: color-mix(in srgb, var(--text) 85%, var(--muted)); font-size: 1.06rem; }
.prose h2, .prose h3 { color: var(--text); margin-top: 1.4em; }
.prose ol, .prose ul { padding-inline-start: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--accent-2); font-weight: 700; }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.page-body { padding-top: 10px; }
.page-img { border-radius: 20px; margin: 20px 0; }
.more { margin-top: 80px; }
.more-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.more-head h2 { font-size: 1.8rem; margin: 0; }
.scroller-btns { display: flex; gap: 8px; }
.scroller-btns button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; transition: background .25s, transform .3s var(--spring); }
.scroller-btns button:hover { background: var(--surface-2); transform: scale(1.08); }
.scroller-btns [data-scroll="-1"] .ico { transform: scaleX(-1); }
.rtl .scroller-btns [data-scroll="-1"] .ico { transform: none; }
.rtl .scroller-btns [data-scroll="1"] .ico { transform: scaleX(-1); }
.scroller { list-style: none; margin: 0; padding: 4px 4px 24px; display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.scroller::-webkit-scrollbar { display: none; }
.scroller .card { scroll-snap-align: start; }

/* Sticky buy bar */
.buybar { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; padding: 0 12px max(12px, env(safe-area-inset-bottom)); transform: translateY(120%); transition: transform .5s var(--spring); pointer-events: none; }
.buybar.show { transform: none; pointer-events: auto; }
.buybar-in { display: flex; align-items: center; gap: 12px; width: min(760px, 100%); margin-inline: auto; padding: 10px 10px 10px 14px; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.buybar-cover { width: 34px; height: 51px; object-fit: cover; border-radius: 4px; flex: none; }
.buybar-cover.cover-text { padding: 2px; font-size: 3px; }
.buybar-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buybar .btn { white-space: nowrap; }

/* 404 */
.nf { text-align: center; }
.nf-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.nf-code { font-size: clamp(6rem, 20vw, 12rem); font-weight: 700; line-height: 1; margin: 0; background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Footer */
.site-foot { margin-top: 80px; border-top: 1px solid var(--line); background: var(--bg-2); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 48px 0 28px; }
.foot-brand p { color: var(--muted); margin-top: 12px; }
.foot-list { list-style: none; margin: 0 0 6px; padding: 0; }
.foot-list a, .foot-langs a { display: inline-block; padding: 4px 0; color: var(--muted); transition: color .2s; }
.foot-list a:hover, .foot-langs a:hover, .foot-langs a[aria-current] { color: var(--text); }
.foot-langs { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px 18px; }
.foot-bottom { padding: 18px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Reveal on scroll (only when JS runs) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease) var(--rd, 0s), transform .9s var(--ease) var(--rd, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .card.reveal.in { transition-duration: .7s; }

/* Page transitions (Chrome/Edge/Safari 18+) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .bgrid { grid-template-columns: repeat(2, 1fr); }
  .ring-stage { height: 440px; }
  .ring { --w: 160px; }
}
@media (max-width: 900px) {
  .hero { min-height: 0; padding-top: calc(var(--head-h) + 40px); }
  .hero-in { grid-template-columns: 1fr; gap: 10px; }
  .ring-stage { height: 360px; order: -1; margin-top: -10px; }
  .ring { --w: 130px; }
  .book-hero, .bundle-hero { grid-template-columns: 1fr; }
  .book-info { text-align: center; }
  .chips, .also, .pay-note { justify-content: center; }
  .btn-lg { max-width: none; }
  .in-bundle { text-align: start; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 28px, 1240px); }
  .site-head { padding: 8px 8px 0; }
  .head-in { padding-inline: 10px 6px; gap: 8px; }
  .head-nav, .store-btn span, .lang-btn > span { display: none; }
  .store-btn { width: 42px; padding: 0; }
  .lang-btn { width: 42px; padding: 0; justify-content: center; }
  .lang-btn .ico-chev { display: none; }
  .hero-title { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .hero-actions .btn { flex: 1 1 auto; }
  .stats > div { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .ring-stage { height: 300px; }
  .ring { --w: 108px; }
  .sec { padding-top: 72px; }
  .bgrid { grid-template-columns: 1fr; }
  .toolbar { top: calc(var(--head-h) - 4px); padding: 8px; border-radius: 16px; }
  .search { flex-basis: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 0 8px; font-size: .9rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 26px 14px; }
  .card-title { font-size: .95rem; }
  .book-page { padding-top: calc(var(--head-h) + 24px); }
  .book3d { --w: min(250px, 66vw); }
  .scroller { grid-auto-columns: 140px; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .card-cover { transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition: none !important; }
.js .no-anim .reveal, .no-anim.js .reveal { opacity: 1; transform: none; }
