/* সোনা পাবলিকেশন — নিজস্ব ডিজাইন সিস্টেম */
:root {
  /* রঙের নাম আগের মতোই রাখা হয়েছে; এখন: green-9xx = কালো, green-8xx/7xx = সবুজ, gold-xxx = লাল */
  --green-950: #0a3a2b;
  --green-900: #14211c;
  --green-800: #0f8a5f;
  --green-700: #0b7352;
  --green-100: #e2f4ec;
  --gold-600: #b3182c;
  --gold-500: #d7263d;
  --gold-400: #ff6070;
  --gold-100: #fdeaec;
  --sun-500: #d4a437;
  --sun-300: #ecd08a;
  --sun-100: #f8efd6;
  --cream: #fcf8ef;
  --paper: #ffffff;
  --ink: #161616;
  --muted: #6b665a;
  --line: #eadfc4;
  --danger: #b4321f;
  --danger-bg: #fbe9e5;
  --ok: #1d7a4d;
  --ok-bg: #e2f3ea;
  --warn-bg: #fdf2d6;
  --radius: 14px;
  --shadow: 0 10px 30px -14px rgba(15, 61, 51, .35);
  --font: "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --font-serif: "Noto Serif Bengali", "Hind Siliguri", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--cream);
  line-height: 1.65; font-size: 16px; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--gold-600); }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.3; margin: 0 0 .5em; color: var(--green-900); }
p { margin: 0 0 1em; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- বাটন ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  padding: .7em 1.35em; border-radius: 999px; border: 1.5px solid transparent;
  font: 600 1rem/1.2 var(--font); cursor: pointer; transition: .18s; text-decoration: none; white-space: nowrap;
}
.btn-gold { background: var(--gold-500); color: #fff; }
.btn-gold:hover { background: var(--gold-600); color: #fff; transform: translateY(-1px); }
.btn-green { background: var(--green-800); color: #fff; }
.btn-green:hover { background: var(--green-700); color: #fff; }
.btn-outline { background: transparent; color: var(--green-800); border-color: var(--green-800); }
.btn-outline:hover { background: var(--green-800); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--gold-100); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.9); color: #fff; }
.btn-sm { padding: .42em .95em; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- হেডার ---------- */
.topbar { background: var(--green-950); color: #d9d9d5; font-size: .85rem; text-align: center; padding: .4em 1em; }
.site-header { background: rgba(251, 248, 241, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-in { display: flex; align-items: center; gap: 1.2rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--green-900); font-family: var(--font-serif); font-weight: 700; font-size: 1.25rem; }
.brand:hover { color: var(--green-900); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, var(--gold-400), var(--gold-600)); color: #fff; font-size: 1.35rem; box-shadow: 0 4px 12px -4px rgba(179, 24, 44, .6);
}
.nav { display: flex; gap: 1.2rem; margin-left: 1rem; }
.nav a { color: var(--ink); font-weight: 500; padding: .3rem 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.brand { white-space: nowrap; }
.cart-link { white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--green-700); border-color: var(--gold-500); }
.header-search { margin-left: auto; position: relative; flex: 0 1 280px; }
.header-search input { width: 100%; padding: .55em 1em .55em 2.4em; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; }
.header-search svg { position: absolute; left: .85em; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.cart-link { position: relative; padding: .45em .8em; border-radius: 999px; color: var(--ink); font-weight: 600; }
.cart-link .count { background: var(--gold-500); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .5em; margin-left: .25em; }
.menu-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--green-900); }

/* ---------- ফ্ল্যাশ বার্তা ---------- */
.flash { padding: .8em 1.1em; border-radius: 12px; margin: 1rem 0; font-weight: 500; }
.flash.success { background: var(--ok-bg); color: var(--ok); }
.flash.info { background: var(--warn-bg); color: #7a5a0c; }
.flash.error { background: var(--danger-bg); color: var(--danger); }

/* ---------- হিরো ---------- */
.hero {
  background:
    radial-gradient(800px 380px at 88% -10%, rgba(215, 38, 61, .38), transparent 62%),
    radial-gradient(700px 360px at -5% 110%, rgba(15, 138, 95, .38), transparent 60%),
    linear-gradient(160deg, #0a0a0a, #151716 70%, #0f1110);
  color: #f1f1ee; padding: 4.5rem 0 4rem; position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 380px; height: 380px; border: 1.5px solid rgba(255, 96, 112, .35); border-radius: 50%; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; position: relative; z-index: 1; }
.eyebrow { display: inline-block; font-size: .85rem; letter-spacing: .04em; color: var(--gold-400); border: 1px solid rgba(255, 96, 112, .5); padding: .25em .9em; border-radius: 999px; margin-bottom: 1rem; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: .35em; }
.hero h1 em { color: var(--gold-400); font-style: normal; }
.hero p.lead { font-size: 1.12rem; color: #dfe2df; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1.4rem; }
.trust { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: #cfd2cf; font-size: .92rem; }
.trust span::before { content: "✓ "; color: var(--gold-400); font-weight: 700; }
.hero-stack { position: relative; height: 340px; }
.hero-stack .cover { position: absolute; width: 190px; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .6); }
.hero-stack .cover:nth-child(1) { left: 6%; top: 40px; rotate: -8deg; }
.hero-stack .cover:nth-child(2) { left: 32%; top: 0; rotate: 2deg; z-index: 2; width: 210px; }
.hero-stack .cover:nth-child(3) { right: 0; top: 56px; rotate: 9deg; }

/* ---------- সেকশন ---------- */
.section { padding: 3.2rem 0; }
.section.alt { background: #f0f0ec; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.section-head h2 { margin: 0; font-size: 1.7rem; }
.section-head h2::after { content: ""; display: block; width: 46px; height: 3px; background: var(--gold-500); margin-top: .45rem; border-radius: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip { padding: .45em 1.1em; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.chip:hover, .chip.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.chip small { opacity: .65; margin-left: .3em; }

/* ---------- বইয়ের কার্ড ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.book-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; display: flex; flex-direction: column; transition: .2s; position: relative; }
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.book-card .cover-wrap { display: block; margin-bottom: .8rem; }
.book-card h3 { font-size: 1.05rem; margin: 0 0 .15rem; }
.book-card h3 a { color: var(--green-900); }
.book-card .author { font-size: .88rem; color: var(--muted); margin-bottom: .55rem; }
.book-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.price { font-weight: 700; color: var(--green-800); font-size: 1.1rem; }
.price del { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: .35em; }
.price.free { color: var(--ok); }
.badge { position: absolute; top: .65rem; left: .65rem; z-index: 2; background: var(--gold-500); color: #fff; font-size: .78rem; font-weight: 700; padding: .12em .65em; border-radius: 999px; }
.badge.free { background: var(--ok); }
.tag { display: inline-block; font-size: .78rem; color: var(--green-700); background: var(--green-100); border-radius: 999px; padding: .08em .7em; }

/* ---------- কভার ---------- */
.cover { aspect-ratio: 3 / 4.3; border-radius: 6px 10px 10px 6px; overflow: hidden; position: relative; box-shadow: 0 14px 24px -14px rgba(0, 0, 0, .5), inset 6px 0 8px -4px rgba(0, 0, 0, .28); background: var(--green-800); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-gen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; text-align: center; padding: 1.1rem .9rem; color: #f6f6f3; background: linear-gradient(160deg, var(--cv, #0f3d33), #06150f); }
.cover-gen::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(255, 96, 112, .75); border-radius: 4px; pointer-events: none; }
.cover-gen .c-top { font-size: .68rem; letter-spacing: .18em; color: var(--gold-400); }
.cover-gen .c-title { font-family: var(--font-serif); font-weight: 700; font-size: 1.12rem; line-height: 1.3; color: #fff; text-wrap: balance; }
.cover-gen .c-sub { font-size: .7rem; color: #cfcfca; margin-top: .35rem; }
.cover-gen .c-author { font-size: .72rem; color: var(--gold-400); }
.cover-lg .c-title { font-size: 1.7rem; } .cover-lg .c-top { font-size: .8rem; } .cover-lg .c-author { font-size: .9rem; } .cover-lg .c-sub { font-size: .85rem; }

/* ---------- ফিচার / ধাপ ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.feature .ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--gold-100); color: var(--gold-600); font-size: 1.4rem; margin-bottom: .7rem; }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: .94rem; margin: 0; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.step { counter-increment: s; position: relative; padding: 1.2rem 1.2rem 1.2rem 1.2rem; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.step::before { content: counter(s, bengali); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--green-800); color: var(--gold-400); font-weight: 700; margin-bottom: .6rem; }
.cta-band { background: linear-gradient(120deg, var(--green-900), var(--green-700)); color: #fff; border-radius: 22px; padding: 2.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 .3rem; }
.cta-band p { margin: 0; color: #d4d6d3; }

/* ---------- বইয়ের বিস্তারিত পাতা ---------- */
.book-detail { display: grid; grid-template-columns: 320px 1fr; gap: 3rem; padding: 2.5rem 0; }
.book-detail .cover { max-width: 320px; position: sticky; top: 96px; }
.book-detail h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: .2em; }
.buy-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; margin: 1.4rem 0; box-shadow: var(--shadow); }
.buy-box .big-price { font-size: 2rem; font-weight: 700; color: var(--green-800); font-family: var(--font-serif); }
.buy-box .big-price del { font-size: 1.05rem; color: var(--muted); font-weight: 400; }
.buy-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.toc { list-style: none; padding: 0; margin: 0; counter-reset: c; }
.toc li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7em 0; border-bottom: 1px dashed var(--line); }
.toc li .no { color: var(--gold-600); font-weight: 700; margin-right: .6em; }
.lock { color: var(--muted); font-size: .88rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 1.4rem; color: var(--muted); font-size: .94rem; margin-bottom: 1rem; }

/* ---------- ফর্ম ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.field { margin-bottom: 1.05rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.input, select.input, textarea.input {
  width: 100%; padding: .7em .95em; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; color: var(--ink);
}
.input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(15, 138, 95, .2); }
textarea.input { min-height: 120px; resize: vertical; }
.error { color: var(--danger); font-size: .88rem; margin-top: .25rem; }
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 2.5rem 0; }
.auth-card { width: min(440px, 100% - 32px); }
.checkbox { display: flex; align-items: center; gap: .5em; font-weight: 500; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- কার্ট / চেকআউট ---------- */
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.line-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.line-item .cover { width: 70px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; margin: 0 0 1rem; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; text-align: right; font-weight: 600; }
.summary .total { font-size: 1.25rem; color: var(--green-800); border-top: 1px solid var(--line); padding-top: .7rem; }
.pay-box { background: linear-gradient(160deg, #fff, #fff4f5); border: 1.5px solid var(--gold-400); border-radius: var(--radius); padding: 1.3rem; }
.bkash-num { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px dashed var(--gold-500); border-radius: 12px; padding: .7em 1em; font-size: 1.4rem; font-weight: 700; letter-spacing: .04em; color: var(--green-900); }
.bkash-num button { margin-left: auto; }
.qr { width: 190px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.pay-steps { padding-left: 1.2em; margin: 1rem 0; }
.pay-steps li { margin-bottom: .35rem; }

/* ---------- স্ট্যাটাস ---------- */
.status { display: inline-block; border-radius: 999px; padding: .1em .85em; font-size: .85rem; font-weight: 600; }
.status.pending { background: var(--warn-bg); color: #8a6208; }
.status.paid { background: var(--ok-bg); color: var(--ok); }
.status.rejected { background: var(--danger-bg); color: var(--danger); }

/* ---------- ইউজার ড্যাশবোর্ড ---------- */
.dash-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; padding: 2rem 0 3rem; align-items: start; }
.side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem; position: sticky; top: 90px; }
.side .who { padding: .8rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.side .who b { display: block; color: var(--green-900); }
.side a, .side button.link { display: flex; align-items: center; gap: .6em; width: 100%; padding: .6em .8em; border-radius: 10px; color: var(--ink); font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.side a:hover, .side a.active, .side button.link:hover { background: var(--gold-100); color: var(--green-800); }
.lib-card { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.progress { height: 7px; border-radius: 99px; background: #e8e8e3; overflow: hidden; margin: .5rem 0 .2rem; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--green-700)); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .big { font-size: 3rem; }

/* ---------- টেবিল ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th { text-align: left; background: #f2f2ee; color: var(--green-900); font-weight: 600; padding: .75em 1em; white-space: nowrap; }
table.t td { padding: .75em 1em; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: #fafaf8; }
.pager { display: flex; gap: .4rem; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }
.pager a, .pager span { padding: .4em .9em; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.pager .active span, .pager span[aria-current] { background: var(--green-800); color: #fff; border-color: var(--green-800); }
nav[role=navigation] svg { width: 18px; display: inline; }
nav[role=navigation] > div:first-child { display: none; }
nav[role=navigation] .hidden { display: block; }
nav[role=navigation] span.relative, nav[role=navigation] a.relative { padding: .4em .8em; border-radius: 8px; border: 1px solid var(--line); background: #fff; margin: 0 2px; display: inline-block; }
nav[role=navigation] span[aria-current=page] > span { background: var(--green-800); color: #fff; padding: .4em .8em; border-radius: 8px; display: inline-block; }
nav[role=navigation] p { color: var(--muted); font-size: .9rem; }

/* ---------- ফুটার ---------- */
.site-footer { background: var(--green-950); color: #b9bcb9; margin-top: 3rem; padding: 3rem 0 1.5rem; }
.site-footer h4 { color: var(--gold-400); font-family: var(--font); font-size: 1rem; }
.site-footer a { color: #e2e4e2; }
.site-footer a:hover { color: var(--gold-400); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; } .foot-grid li { margin-bottom: .4rem; }
.copy { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 2rem; padding-top: 1.2rem; font-size: .88rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ---------- রিডার ---------- */
body.reader-body { background: #eeeeea; }
.reader-bar { position: sticky; top: 0; z-index: 30; background: var(--green-900); color: #f4ecd8; display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem; }
.reader-bar a, .reader-bar button { color: #f4ecd8; }
.reader-bar .rt { font-family: var(--font-serif); font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar .ctl { background: rgba(255, 255, 255, .1); border: 0; border-radius: 8px; padding: .35em .75em; cursor: pointer; font: inherit; }
.reader-bar .ctl:hover { background: rgba(255, 255, 255, .22); }
.reader-prog { position: sticky; top: 49px; height: 3px; background: rgba(0, 0, 0, .08); z-index: 29; }
.reader-prog i { display: block; height: 100%; width: 0; background: var(--gold-500); }
.reader-layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 52px); }
.reader-toc { background: #fafaf8; border-right: 1px solid var(--line); padding: 1rem; position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; }
.reader-toc a { display: block; padding: .55em .7em; border-radius: 8px; color: var(--ink); font-size: .95rem; }
.reader-toc a.current { background: var(--gold-100); color: var(--green-900); font-weight: 600; }
.reader-toc a.locked { color: #9a9486; }
.paper { position: relative; max-width: 760px; margin: 1.5rem auto 3rem; background: #ffffff; border-radius: 6px; padding: clamp(1.4rem, 4vw, 3.2rem); box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .4); overflow: hidden; }
.prose { font-family: var(--font-serif); font-size: var(--rfs, 1.15rem); line-height: 2; color: #1f1f1d; user-select: none; -webkit-user-select: none; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.4em; }
.prose blockquote { border-left: 4px solid var(--gold-500); margin: 1.4em 0; padding: .2em 1.2em; background: var(--gold-100); border-radius: 0 10px 10px 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.chapter-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); border-bottom: 2px solid var(--gold-400); padding-bottom: .4em; margin-bottom: 1.2em; }
.watermark { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.watermark span { position: absolute; white-space: nowrap; font: 600 .95rem var(--font); color: rgba(0, 0, 0, .07); rotate: -28deg; user-select: none; }
.reader-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; max-width: 760px; margin: 0 auto 3rem; padding: 0 .75rem; }
.reader-nav .btn { white-space: normal; text-align: center; flex: 1 1 200px; }
.reader-layout > div, .dash-wrap > *, .two-col > *, .grid > *, .book-detail > *, .admin-shell > * { min-width: 0; }
.paper { margin-inline: .6rem; }
@media (min-width: 800px) { .paper { margin-inline: auto; } }
.prose { overflow-wrap: anywhere; }
.prose img, .prose table { max-width: 100%; }
.sample-note { max-width: 760px; margin: 1rem auto 0; }
.shield { display: none; position: fixed; inset: 0; background: #fff; z-index: 999; place-items: center; font-weight: 700; }
@media print { body.reader-body > * { display: none !important; } body.reader-body::before { content: "প্রিন্ট করা নিষেধ"; display: block; padding: 3rem; font-size: 2rem; } }

/* ---------- অ্যাডমিন ---------- */
body.admin-body { background: #f1f1ee; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: var(--green-950); color: #d4d6d3; padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { color: #fff; padding: 0 .6rem 1rem; margin-bottom: .6rem; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.admin-side a, .admin-side button.link { display: flex; justify-content: space-between; align-items: center; gap: .6em; padding: .65em .9em; border-radius: 10px; color: #d4d6d3; font: inherit; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; margin-bottom: 2px; }
.admin-side a:hover, .admin-side a.active { background: rgba(255, 96, 112, .18); color: var(--gold-400); }
.admin-side .pill { background: var(--gold-500); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 .55em; }
.admin-main { padding: 1.6rem clamp(1rem, 3vw, 2.4rem) 3rem; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.admin-top h1 { margin: 0; font-size: 1.6rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat .n { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; color: var(--green-800); line-height: 1.2; }
.stat .l { color: var(--muted); font-size: .9rem; }
.stat.hot { background: linear-gradient(150deg, var(--gold-500), var(--gold-600)); border: 0; } .stat.hot .n, .stat.hot .l { color: #fff; }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .4em 1em; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.tabs a.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }
.thumb { width: 38px; }
.inline-form { display: inline; }
.admin-login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(700px 400px at 80% 0, rgba(215, 38, 61, .3), transparent), linear-gradient(160deg, var(--green-950), var(--green-800)); }
.editor { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .95rem; min-height: 340px; line-height: 1.7; }
.swatch { width: 48px; height: 40px; padding: 0; border: 1.5px solid var(--line); border-radius: 8px; background: none; }

/* ---------- রেসপন্সিভ ---------- */
@media (max-width: 980px) {
  .hero-grid, .book-detail, .two-col, .dash-wrap { grid-template-columns: 1fr; }
  .hero-stack { height: 260px; max-width: 420px; margin: 0 auto; }
  .hero-stack .cover { width: 130px !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .features, .steps { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .book-detail .cover { position: relative; top: auto; margin-inline: auto; max-width: 240px; }
  .side { position: static; display: flex; overflow-x: auto; gap: .3rem; }
  .side .who { display: none; }
  .side a, .side button.link { white-space: nowrap; width: auto; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: .2rem; padding: .6rem; }
  .admin-side .brand { width: 100%; }
  .admin-side a, .admin-side button.link { width: auto; }
  .reader-layout { grid-template-columns: 1fr; }
  .reader-toc { display: none; position: fixed; inset: 52px 0 0 0; z-index: 40; height: auto; }
  .reader-toc.open { display: block; }
}
@media (max-width: 1100px) {
  .header-search { display: none; }
  .nav { gap: .9rem; }
}
@media (max-width: 900px) {
  .menu-toggle { display: block; margin-left: auto; }
  .header-in { flex-wrap: wrap; }
  .nav, .header-actions { display: none; width: 100%; }
  .header-in.open .nav, .header-in.open .header-actions { display: flex; }
  .header-in.open .header-search { display: block; flex: 1 1 100%; }
  .nav { flex-direction: column; margin: 0; gap: .2rem; }
  .header-actions { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .grid-2, .row { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0; }
  .section { padding: 2.2rem 0; }
  .line-item { grid-template-columns: 56px 1fr; }
  .line-item .cover { width: 56px; }
  .line-item > :last-child { grid-column: 2; }
}
@media (max-width: 520px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .features, .steps, .foot-grid { grid-template-columns: 1fr; }
  .book-card { padding: .6rem; }
  .lib-card { grid-template-columns: 78px 1fr; }
}
/* ছবির ওপর বইয়ের নাম (ওভারলে কভার) */
.cover-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 9cqw 8cqw 0; pointer-events: none; background: linear-gradient(180deg, rgba(4, 28, 20, .55), rgba(4, 28, 20, 0) 48%); }
.cover-ov::after { content: ""; position: absolute; inset: 3.2cqw; border: 1px solid rgba(236, 208, 138, .75); border-radius: 3px; }
.cover-ov .o-brand { font-size: clamp(.5rem, 3.6cqw, .85rem); letter-spacing: .2em; color: var(--sun-300); }
.cover-ov .o-rule { width: 22cqw; height: 1px; margin: 3cqw 0; background: linear-gradient(90deg, transparent, var(--sun-300), transparent); }
.cover-ov .o-title { font-family: var(--font-serif); font-weight: 700; color: #fff; font-size: clamp(.9rem, 11.5cqw, 2.6rem); line-height: 1.2; text-shadow: 0 3px 14px rgba(0, 0, 0, .55); text-wrap: balance; }
.cover-ov .o-sub { margin-top: 2.5cqw; font-family: var(--font-serif); font-weight: 700; color: var(--sun-300); font-size: clamp(.7rem, 7.4cqw, 1.7rem); line-height: 1.25; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); text-wrap: balance; }
.cover-ov .o-author { margin-top: 4cqw; font-size: clamp(.5rem, 4.2cqw, 1rem); color: #f1f1ee; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.cover { background: #0a3a2b; }

/* লোগো ও ওয়াটারমার্ক */
.brand-logo { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 4px 8px rgba(120, 85, 10, .35)); }
.admin-side .brand-logo, .site-footer .brand-logo { width: 40px; height: 40px; }
.hero-wm { position: absolute; right: -70px; bottom: -90px; width: 460px; height: 460px; opacity: .08; pointer-events: none; z-index: 0; }
.site-footer { position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; right: -50px; bottom: -70px; width: 360px; height: 360px; background: url("../img/logo.svg") center / contain no-repeat; opacity: .07; pointer-events: none; }
.site-footer > .container { position: relative; z-index: 1; }
@media (max-width: 760px) { .hero-wm { width: 300px; height: 300px; right: -90px; bottom: -60px; } }

/* কভারের আইকন: কভারের মাপ অনুযায়ী বড়-ছোট হয় */
.cover { container-type: inline-size; }
.cover-gen .c-icon { width: 30cqw; height: 30cqw; margin-inline: auto; display: grid; place-items: center; font-size: 15cqw; line-height: 1; border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .22), rgba(255, 255, 255, .05)); border: 1px solid rgba(236, 208, 138, .55); box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .6); }
.cover-gen .c-title { font-size: clamp(.8rem, 8.2cqw, 1.9rem); }
.cover-gen .c-sub { font-size: clamp(.55rem, 4.4cqw, 1rem); }
.cover-gen .c-top { font-size: clamp(.5rem, 3.6cqw, .85rem); }
.cover-gen .c-author { font-size: clamp(.55rem, 4.2cqw, .95rem); }

/* ===== থিম: হালকা ক্রিম-সোনালি, কালো লেখা, সবুজ ও লাল অ্যাকসেন্ট ===== */
body { background: radial-gradient(900px 500px at 100% 0, rgba(212, 164, 55, .09), transparent 60%), var(--cream); }
.topbar { background: var(--green-950); color: var(--sun-300); letter-spacing: .02em; }
.brand-mark { background: radial-gradient(circle at 30% 25%, #f6df9c, var(--sun-500)); color: var(--green-950); box-shadow: 0 5px 14px -5px rgba(160, 118, 20, .8); }
.hero {
  background:
    radial-gradient(640px 360px at 92% -8%, rgba(215, 38, 61, .13), transparent 62%),
    radial-gradient(760px 420px at -4% 108%, rgba(15, 138, 95, .16), transparent 62%),
    linear-gradient(165deg, #fffbf2, #f9f0d9 62%, #f4e7c4);
  color: var(--ink); border-bottom: 1px solid var(--line);
}
.hero::after { border: 1.5px solid rgba(212, 164, 55, .55); }
.hero::before { content: ""; position: absolute; left: -90px; top: -90px; width: 260px; height: 260px; border: 1.5px solid rgba(15, 138, 95, .25); border-radius: 50%; }
.hero h1 { color: var(--green-900); }
.hero h1 em { color: var(--gold-500); }
.hero p.lead { color: #4b463a; }
.eyebrow { color: var(--gold-600); border-color: rgba(215, 38, 61, .35); background: rgba(255, 255, 255, .7); font-weight: 600; }
.trust { color: #4b463a; }
.trust span::before { color: var(--green-800); }
.hero .btn-outline { color: var(--green-900); border-color: var(--green-900); background: rgba(255, 255, 255, .6); }
.hero .btn-outline:hover { background: var(--green-900); color: #fff; }
.hero-stack .cover { box-shadow: 0 28px 40px -20px rgba(60, 40, 10, .55); animation: floaty 6s ease-in-out infinite; }
.hero-stack .cover:nth-child(2) { animation-delay: -2s; } .hero-stack .cover:nth-child(3) { animation-delay: -4s; }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
.hero-grid > div:first-child > * { animation: rise .7s both; }
.hero-grid > div:first-child > *:nth-child(2) { animation-delay: .08s; } .hero-grid > div:first-child > *:nth-child(3) { animation-delay: .16s; }
.hero-grid > div:first-child > *:nth-child(4) { animation-delay: .24s; } .hero-grid > div:first-child > *:nth-child(5) { animation-delay: .32s; }
.section.alt { background: linear-gradient(180deg, #faf2dc, #f6ebcc); border-block: 1px solid var(--line); }
.section-head h2::after { background: linear-gradient(90deg, var(--gold-500), var(--sun-500)); width: 56px; }
.book-card { border-color: var(--line); }
.book-card:hover { box-shadow: 0 18px 34px -18px rgba(90, 60, 10, .45); border-color: var(--sun-300); }
.badge { background: var(--gold-500); box-shadow: 0 4px 10px -4px rgba(179, 24, 44, .7); }
.price { color: var(--green-800); }
.tag { background: var(--sun-100); color: #8a6512; }
.feature .ico { background: var(--sun-100); color: #9a7418; }
.step::before { background: var(--green-950); color: var(--sun-300); }
.step, .feature, .card, .book-card, .buy-box, .stat, .side, .table-wrap, .lib-card { background: #fff; }
.cta-band { background: linear-gradient(120deg, var(--green-950), #0f6b4c); position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -50px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1.5px solid rgba(236, 208, 138, .5); }
.cta-band > * { position: relative; z-index: 1; }
.site-footer { background: var(--green-950); color: #c7d8cf; border-top: 4px solid var(--sun-500); }
.site-footer h4 { color: var(--sun-300); }
.site-footer a { color: #e3ece7; } .site-footer a:hover { color: var(--sun-300); }
.cover-gen::before { border-color: rgba(236, 208, 138, .8); }
.cover-gen .c-top, .cover-gen .c-author { color: var(--sun-300); }
.admin-side a:hover, .admin-side a.active { color: var(--sun-300); background: rgba(236, 208, 138, .13); }
.reader-bar { background: var(--green-950); }
.reader-toc a.current { background: var(--sun-100); }
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: -2.2rem; position: relative; z-index: 2; box-shadow: var(--shadow); }
.stats-strip > div { background: #fff; padding: 1.1rem 1rem; text-align: center; }
.stats-strip b { display: block; font-family: var(--font-serif); font-size: 1.5rem; color: var(--green-800); line-height: 1.2; }
.stats-strip span { color: var(--muted); font-size: .9rem; }
.quote-band { text-align: center; padding: 3.4rem 1rem; }
.quote-band blockquote { font-family: var(--font-serif); font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.7; color: var(--green-900); max-width: 820px; margin: 0 auto .8rem; }
.quote-band blockquote::before { content: "“"; display: block; font-size: 3.4rem; line-height: .6; color: var(--sun-500); }
@media (max-width: 760px) { .stats-strip { grid-template-columns: repeat(2, 1fr); margin-top: -1.4rem; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@counter-style bengali { system: numeric; symbols: "০" "১" "২" "৩" "৪" "৫" "৬" "৭" "৮" "৯"; }
.verify-bar { background: #fdf2d6; color: #7a5a0c; text-align: center; padding: .55rem 1rem; font-size: .93rem; border-bottom: 1px solid #f0dca0; }
.verify-bar button { background: none; border: 0; color: var(--gold-600); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* বইয়ের পাতার আস্থা-চিপ, শেয়ার, FAQ */
.trust-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.trust-chips span { font-size: .82rem; background: var(--sun-100); color: #7a5a0c; border-radius: 999px; padding: .25em .85em; }
.book-extra { max-width: 820px; margin: 0 0 2rem; }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.4rem; }
.share-row a, .share-row button { padding: .35em .95em; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.share-row a:hover, .share-row button:hover { border-color: var(--green-800); color: var(--green-800); }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1.1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--green-900); }
.faq p { margin: .6rem 0 0; color: var(--muted); }
/* রিডার থিম */
body.reader-body.th-sepia { background: #e9dcc0; }
body.th-sepia .paper { background: #f6ecd2; } body.th-sepia .prose { color: #3d3222; }
body.th-sepia .reader-toc { background: #efe3c6; }
body.reader-body.th-night { background: #0e1110; }
body.th-night .paper { background: #171a19; box-shadow: none; } body.th-night .prose, body.th-night .chapter-title { color: #d9dcd9; }
body.th-night .prose h1, body.th-night .prose h2, body.th-night .prose h3 { color: #f1d98c; }
body.th-night .prose blockquote { background: #202523; border-left-color: #d4a437; }
body.th-night .reader-toc { background: #141716; border-color: #232726; } body.th-night .reader-toc a { color: #cfd2cf; } body.th-night .reader-toc a.current { background: #232726; color: #f1d98c; }
body.th-night .watermark span { color: rgba(255, 255, 255, .07); }
body.th-night .prose table, body.th-night .prose th, body.th-night .prose td { border-color: #2a2f2d; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .92em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5em .75em; text-align: left; vertical-align: top; }
.prose th { background: var(--sun-100); color: var(--green-900); }
.prose blockquote p { margin: .3em 0; }
.prose h2 { font-size: 1.35em; border-left: 4px solid var(--gold-500); padding-left: .6em; margin-top: 1.8em; }
.prose h3 { font-size: 1.15em; color: var(--green-800); }
.prose li { margin-bottom: .35em; }

/* কভারে লেখকের ছবি */
.cover-photo { position: absolute; left: 50%; bottom: 7cqw; translate: -50% 0; width: 25cqw; height: 25cqw; border-radius: 50%; padding: .8cqw; background: linear-gradient(135deg, #f8e3a3, #d4a437 55%, #a1701a); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .75); z-index: 2; }
.cover-photo img, .c-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; border-radius: 50%; display: block; border: .6cqw solid #0a3a2b; }
.c-photo { padding: .8cqw; background: linear-gradient(135deg, #f8e3a3, #d4a437 55%, #a1701a) !important; border: 0 !important; width: 34cqw !important; height: 34cqw !important; }
.cover-gen .c-icon.c-photo img { border-radius: 50%; }
/* লেখক পরিচিতি কার্ড */
.author-card { display: flex; gap: 1.1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.4rem 0; }
.author-card img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; border: 3px solid var(--sun-500); flex: none; }
.author-card .a-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; color: var(--green-900); }
.author-card .a-role { color: var(--muted); font-size: .92rem; }
.brand-strip { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; margin-top: .8rem; }
.brand-strip img { height: 38px; width: auto; filter: grayscale(.1); opacity: .95; }

/* PDF রিডার */
body.pdf-body { background: #e9e6dc; }
.pdf-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 14px 8px 60px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5); border-radius: 3px; overflow: hidden; max-width: 100%; user-select: none; -webkit-user-select: none; }
.pdf-page canvas { display: block; }
.pdf-msg { padding: 3rem 1rem; color: var(--muted); }
/* ওয়াটারমার্ক আরও স্পষ্ট, যাতে স্ক্রিনশটেও থাকে */
.watermark span { color: rgba(15, 61, 51, .15) !important; font-size: 1.08rem !important; font-weight: 700 !important; letter-spacing: .02em; }
.pdf-page .watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pdf-page .watermark span { position: absolute; white-space: nowrap; rotate: -28deg; user-select: none; }
body.th-night .watermark span { color: rgba(255, 255, 255, .13) !important; }

.foot-brands { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid rgba(255, 255, 255, .1); }
.foot-brands span { color: var(--sun-300); font-size: .9rem; }
.foot-brands a { background: #fff; border-radius: 12px; padding: .45rem .9rem; display: inline-flex; }
.foot-brands img { height: 38px; width: auto; }

/* টিপ-বক্সের রঙ, টেবিলে শব্দ না ভাঙা */
.prose blockquote.cl-tip { background: #fdf3d2; border-left-color: #d4a437; }
.prose blockquote.cl-warn { background: #fde8ea; border-left-color: #d7263d; }
.prose blockquote.cl-think { background: #e3f1fb; border-left-color: #2c7fb8; }
.prose blockquote.cl-note { background: #e2f4ec; border-left-color: #0f8a5f; }
.prose blockquote.cl-dua { background: #f4ecdc; border-left-color: #8a6d3b; }
.prose td, .prose th { word-break: normal; overflow-wrap: normal; min-width: 96px; font-size: .9em; }
.prose table { -webkit-overflow-scrolling: touch; }
.err-box { text-align: center; padding: 4rem 1rem; }
.err-box .code { font-family: var(--font-serif); font-size: 4rem; color: var(--sun-500); line-height: 1; }

/* অটো-কভারে লেখকের ছবি ঠিকভাবে ভরানো */
.cover-gen .c-icon.c-photo { display: block !important; position: relative; overflow: hidden; border-radius: 50%; aspect-ratio: 1; }
.cover-gen .c-icon.c-photo img { position: absolute; inset: .8cqw; width: calc(100% - 1.6cqw); height: calc(100% - 1.6cqw); object-fit: cover; object-position: 50% 22%; border-radius: 50%; border: 0; }

/* ===== ৩D বইয়ের মকআপ ===== */
.b3d-wrap { perspective: 1500px; position: relative; }
.b3d-wrap::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -22px; height: 30px; background: radial-gradient(ellipse at center, rgba(40, 25, 5, .5), transparent 70%); filter: blur(7px); z-index: -1; }
.b3d { --d: 26px; position: relative; width: 100%; aspect-ratio: 3 / 4.3; transform-style: preserve-3d; transform: rotateY(var(--ry, -24deg)); transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
.b3d-face { position: absolute; backface-visibility: hidden; }
.b3d-front { inset: 0; transform: translateZ(calc(var(--d) / 2)); }
.b3d-front .cover { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 3px 7px 7px 3px; box-shadow: none; }
.b3d-front::after { content: ""; position: absolute; inset: 0; border-radius: 3px 7px 7px 3px; pointer-events: none; background: linear-gradient(100deg, rgba(0, 0, 0, .35) 0, rgba(255, 255, 255, .16) 3.5%, rgba(0, 0, 0, 0) 7%, rgba(255, 255, 255, .06) 55%, rgba(0, 0, 0, .12) 100%); }
.b3d-back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: var(--cvc, #0a3a2b); }
.b3d-spine { top: 0; left: 0; width: var(--d); height: 100%; transform-origin: left center; transform: translateZ(calc(var(--d) / 2)) rotateY(90deg); background: linear-gradient(90deg, rgba(0, 0, 0, .4), rgba(255, 255, 255, .1) 45%, rgba(0, 0, 0, .35)), var(--cvc, #0a3a2b); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 9px 0; overflow: hidden; color: #fff; }
.b3d-spine span { writing-mode: vertical-rl; font: 700 11px/1 var(--font-serif); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 78%; }
.b3d-spine small { writing-mode: vertical-rl; font-size: 8px; color: var(--sun-300); white-space: nowrap; }
.b3d-pages { top: 1.5%; right: 0; left: auto; width: var(--d); height: 97%; transform-origin: right center; transform: translateZ(calc(var(--d) / 2)) rotateY(-90deg); background: repeating-linear-gradient(0deg, #fbf5e4 0 2px, #e2d6b6 2px 3px); box-shadow: inset 0 0 8px rgba(0, 0, 0, .18); }

/* হিরোর ঘুরন্ত বইয়ের সারি */
.flow { position: relative; height: 430px; }
.flow-item { position: absolute; left: 50%; top: 18px; width: 190px; margin-left: -95px; perspective: 1400px; transition: transform .9s cubic-bezier(.2, .7, .2, 1), opacity .7s; z-index: calc(10 - var(--a, 0)); transform: translateX(calc(var(--o, 0) * 150px)) scale(calc(1 - var(--a, 0) * .1)); }
.flow-item .b3d { --ry: calc(var(--o, 0) * -32deg); }
.flow-item.far { opacity: 0; pointer-events: none; }
.flow-item .b3d-wrap::after { opacity: calc(1 - var(--a, 0) * .3); }
.flow-item:not(.center) .b3d { filter: brightness(.82); }
.flow-item.center .b3d { --ry: -14deg; }
.flow-item.center { transform: translateX(0) scale(1.12); }
.flow-item a { display: block; }
@media (max-width: 980px) { .flow { height: 340px; } .flow-item { width: 150px; margin-left: -75px; transform: translateX(calc(var(--o, 0) * 105px)) scale(calc(1 - var(--a, 0) * .1)); } .flow-item.center { transform: translateX(0) scale(1.1); } }

/* বইয়ের পাতায় বড় মকআপ */
.book-detail .b3d-wrap { max-width: 300px; position: sticky; top: 96px; margin-inline: auto; }
.book-detail .b3d-wrap:hover .b3d { transform: rotateY(-8deg); }
.book-detail .b3d { --ry: -22deg; }
@media (max-width: 980px) { .book-detail .b3d-wrap { position: relative; top: auto; max-width: 230px; } }

/* কার্ডে হালকা কাত হওয়া */
.book-card .cover { transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s; transform-origin: left center; }
.book-card:hover .cover { transform: perspective(900px) rotateY(-14deg) translateX(4px); box-shadow: 14px 18px 26px -14px rgba(0, 0, 0, .55), inset 6px 0 8px -4px rgba(0, 0, 0, .28); }

/* ফোন ও ল্যাপটপে পড়ার মকআপ */
.devices { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.device-stage { position: relative; min-height: 380px; display: grid; place-items: center; }
.device-laptop { width: min(100%, 560px); position: relative; }
.device-laptop .screen { background: #0e0f0f; border: 10px solid #1b1d1c; border-bottom-width: 14px; border-radius: 14px 14px 4px 4px; overflow: hidden; aspect-ratio: 16 / 10; box-shadow: 0 30px 50px -28px rgba(0, 0, 0, .6); }
.device-laptop .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.device-laptop .base { height: 14px; margin: 0 -4%; background: linear-gradient(#cfd2d0, #9ea2a0); border-radius: 0 0 14px 14px; box-shadow: 0 14px 18px -10px rgba(0, 0, 0, .5); }
.device-phone { position: absolute; right: 1%; bottom: -14px; width: 170px; background: #0e0f0f; border: 7px solid #1b1d1c; border-radius: 28px; overflow: hidden; aspect-ratio: 9 / 18.5; box-shadow: 0 26px 40px -18px rgba(0, 0, 0, .7); }
.device-phone::before { content: ""; position: absolute; top: 6px; left: 50%; translate: -50% 0; width: 54px; height: 14px; background: #1b1d1c; border-radius: 99px; z-index: 2; }
.device-phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.device-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.device-list li { padding: .55rem 0 .55rem 2rem; position: relative; border-bottom: 1px dashed var(--line); }
.device-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green-800); font-weight: 700; }
@media (max-width: 900px) { .devices { grid-template-columns: 1fr; gap: 1.5rem; } .device-phone { width: 120px; } .device-stage { min-height: 300px; } }
@media (prefers-reduced-motion: reduce) { .flow-item, .b3d { transition: none !important; } }

/* হিরোর বইয়ের সারি: লেখার ওপর না এসে নিজের কলামে থাকে */
.hero-grid { grid-template-columns: 1fr 1fr; }
.flow { height: 400px; overflow: visible; }
.flow-item { width: 175px; margin-left: -87px; transform: translateX(calc(var(--o, 0) * 96px)) scale(calc(1 - var(--a, 0) * .12)); }
.flow-item.center { transform: translateX(0) scale(1.1); }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } .flow { height: 330px; max-width: 420px; margin: 0 auto; } .flow-item { width: 140px; margin-left: -70px; transform: translateX(calc(var(--o, 0) * 78px)) scale(calc(1 - var(--a, 0) * .12)); } .flow-item.center { transform: translateX(0) scale(1.08); } }
