/* ============================================================
   VIBEFIRE — Inner pages (store / detail / claim / checkout /
   library / reader / reviews / program / community)
   ============================================================ */

/* ---- Page hero strip ---- */
.page-hero { position: relative; overflow: hidden; padding: clamp(40px,6vw,80px) 0 clamp(28px,3vw,40px); border-bottom: 1px solid var(--line); }
.page-hero .ember-canvas { position: absolute; inset: 0; opacity: .4; z-index: 0; }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px,5vw,60px); line-height: 1.04; }
.page-hero p { color: var(--muted); font-size: var(--fs-lead); margin-top: 14px; max-width: 56ch; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted-2); margin-bottom: 18px; font-family: var(--font-mono); }
.crumbs a:hover { color: var(--fire-300); }
.crumbs span { opacity: .5; }

/* ---- Ebook card (catalog) ---- */
.book-cover { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 24px 20px; color: #fff; position: relative; }
.book-cover .bc-top { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; opacity: .85; }
.book-cover .bc-title { font-family: var(--font-display); font-size: 23px; line-height: 1.18; }
.book-cover .bc-foot { font-size: 12px; opacity: .8; }
.book-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,.2), transparent 50%); pointer-events: none; }

.cat-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 32px; }
.cat-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-search { position: relative; min-width: 240px; }
.cat-search input { height: 46px; padding-left: 42px; }
.cat-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

.ebook-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 22px; }
.ecard { display: flex; flex-direction: column; overflow: hidden; }
.ecard .cover { aspect-ratio: 3/4; position: relative; }
.ecard .cover .badge { position: absolute; top: 12px; right: 12px; left: auto; z-index: 2; background: rgba(10,10,11,.62); border-color: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ecard .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ecard h3 { font-size: 16px; line-height: 1.4; }
.ecard .sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.ecard .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; }
.ecard .price { font-family: var(--font-display); font-size: 18px; color: var(--text); }
.ecard .price.free { color: var(--ember-green); }

.empty-state { text-align: center; padding: 80px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface-1); }
.empty-state .em-flame { font-size: 40px; filter: grayscale(.3); margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; margin-bottom: 10px; }
.empty-state p { color: var(--muted); margin-bottom: 22px; }

/* ---- Detail ---- */
.detail { display: grid; grid-template-columns: 380px 1fr; gap: clamp(32px,5vw,72px); align-items: start; }
.detail-cover { position: sticky; top: calc(var(--header-h) + 24px); }
.detail-cover .cover-frame { aspect-ratio: 3/4; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-3), 0 0 70px rgba(255,69,0,.22); }
.detail-cover .quick { margin-top: 18px; display: grid; gap: 10px; }
.detail-cover .quick-row { display: flex; justify-content: space-between; font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.detail-cover .quick-row .k { color: var(--muted); }
.detail-cover .quick-row .v { color: var(--text); font-weight: 600; }

.detail-main h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px,3.6vw,44px); line-height: 1.12; }
.detail-main .d-sub { color: var(--muted); font-size: var(--fs-lead); margin-top: 12px; }
.detail-tagline { margin: 26px 0; padding: 22px 24px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-fire); font-size: 19px; line-height: 1.5; color: var(--text); }
.detail-tagline::before { content: "“"; color: var(--fire); font-family: var(--font-display); font-size: 40px; line-height: 0; vertical-align: -12px; margin-right: 6px; }
.d-price-row { display: flex; align-items: center; gap: 18px; margin: 26px 0; flex-wrap: wrap; }
.d-price { font-family: var(--font-display); font-size: 34px; color: var(--text); }
.d-price.free { color: var(--ember-green); }

.d-sec { margin-top: 44px; }
.d-sec h2 { font-size: var(--fs-h3); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.d-sec h2::before { content: ""; width: 4px; height: 18px; background: var(--fire-grad); border-radius: 2px; }
.toc-list { display: grid; gap: 2px; }
.toc-item { display: flex; gap: 14px; padding: 13px 16px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--line); font-size: 15px; align-items: center; }
.toc-item .n { font-family: var(--font-mono); font-size: 12px; color: var(--fire-300); min-width: 28px; }
.toc-item.locked { opacity: .55; }
.toc-item .lock { margin-left: auto; color: var(--muted-2); }
.aud-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.preview-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.preview-strip .ph { aspect-ratio: 3/4; border-radius: 10px; }

.author { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line); }
.author .av { width: 56px; height: 56px; border-radius: 14px; background: var(--fire-grad); display: grid; place-items: center; font-family: var(--font-display); color: var(--on-fire); font-size: 22px; }
.author b { font-size: 16px; color: var(--text); }
.author small { color: var(--muted); font-size: 13px; }

/* sticky mobile CTA bar */
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: none; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(10,10,10,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line-fire); }
.cta-bar .price { font-family: var(--font-display); font-size: 22px; color: var(--text); }
.cta-bar .price.free { color: var(--ember-green); }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .detail-cover { position: static; max-width: 280px; }
  .detail-cover .cover-frame { max-width: 280px; }
  .d-desktop-cta { display: none; }
  .cta-bar { display: flex; }
  body.has-cta-bar { padding-bottom: 84px; }
}

/* ---- Claim flow ---- */
.claim-wrap { max-width: 560px; margin-inline: auto; }
.claim-card { position: relative; overflow: hidden; }
.claim-steps-ind { display: flex; gap: 8px; margin-bottom: 28px; }
.claim-steps-ind .dot { flex: 1; height: 4px; border-radius: 2px; background: var(--inactive); transition: background var(--dur-2); }
.claim-steps-ind .dot.on { background: var(--fire-grad); }
.claim-step { display: none; }
.claim-step.active { display: block; animation: fadeUp .4s var(--ease-out); }
/* Resting state must be visible — animate only the slide, never opacity, so the step
   never freezes hidden in capture/backgrounded contexts (same rule as .reveal). */
@keyframes fadeUp { from { transform: translateY(12px); } to { transform: none; } }
.claim-cover-mini { width: 92px; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; box-shadow: var(--sh-2); flex: none; }
.success-mark { width: 72px; height: 72px; border-radius: 50%; background: rgba(54,211,153,.14); border: 1px solid rgba(54,211,153,.5); display: grid; place-items: center; margin: 0 auto 20px; color: var(--ember-green); }

/* ---- Checkout ---- */
.checkout { display: grid; grid-template-columns: 1fr 400px; gap: clamp(28px,4vw,48px); align-items: start; }
.co-summary { position: sticky; top: calc(var(--header-h) + 24px); }
.pay-methods { display: grid; gap: 10px; }
.pay-opt { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line-2); cursor: pointer; transition: all var(--dur-1); }
.pay-opt:hover { border-color: var(--line-fire); }
.pay-opt.sel { border-color: var(--fire); background: rgba(255,69,0,.07); box-shadow: 0 0 0 3px rgba(255,69,0,.1); }
.pay-opt .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; position: relative; }
.pay-opt.sel .radio { border-color: var(--fire); }
.pay-opt.sel .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--fire-grad); }
.pay-opt .pm-ic { width: 40px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.summary-line { display: flex; justify-content: space-between; padding: 10px 0; font-size: 15px; color: var(--text-soft); }
.summary-line.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-size: 18px; }
.summary-line.total b { font-family: var(--font-display); font-size: 24px; color: var(--text); }
.coupon-row { display: flex; gap: 8px; }
.co-state { text-align: center; padding: 40px 20px; }
@media (max-width: 860px) {
  .checkout { grid-template-columns: 1fr; }
  .co-summary { position: static; order: -1; }
}

/* ---- Library ---- */
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.lib-rank { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-radius: var(--r-lg); background: var(--surface-1); border: 1px solid var(--line-fire); }
.lib-rank .big-flame { font-size: 30px; }
.lib-rank .rk b { font-family: var(--font-display); font-size: 18px; color: var(--text); display: block; }
.lib-rank .rk small { color: var(--muted); font-size: 12px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 20px; }
.lib-card { display: flex; gap: 16px; padding: 18px; }
.lib-card .cover { width: 92px; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; flex: none; box-shadow: var(--sh-2); }
.lib-card h3 { font-size: 15px; line-height: 1.35; }
.lib-card .gauge { height: 7px; border-radius: 99px; background: var(--inactive); overflow: hidden; margin: 12px 0 6px; }
.lib-card .gauge i { display: block; height: 100%; background: var(--fire-grad); border-radius: 99px; }
.lib-card .gtext { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.lib-card .acts { display: flex; gap: 8px; margin-top: 12px; }

/* ---- Reader ---- */
.reader { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - var(--header-h)); }
.reader-toc { border-right: 1px solid var(--line); padding: 24px 18px; overflow-y: auto; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); }
.reader-toc h4 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 14px; }
.reader-toc a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); transition: all var(--dur-1); }
.reader-toc a:hover { background: var(--surface-1); color: var(--text); }
.reader-toc a.cur { background: rgba(255,69,0,.1); color: var(--fire-300); }
.reader-main { padding: clamp(28px,4vw,64px); }
.reader-doc { max-width: 680px; margin-inline: auto; }
.reader-doc h2 { font-size: 30px; margin: 36px 0 18px; }
.reader-doc p { margin-bottom: 20px; line-height: var(--lh-body); color: var(--text-soft); }
.reader-bar { position: sticky; top: var(--header-h); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(20px,4vw,40px); background: rgba(10,10,10,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.reader-tools { display: flex; gap: 8px; align-items: center; }
.reader-tools .tbtn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted); }
.reader-tools .tbtn:hover { color: var(--text); border-color: var(--line-fire); }
.reader-progress { flex: 1; max-width: 320px; height: 6px; border-radius: 99px; background: var(--inactive); overflow: hidden; }
.reader-progress i { display: block; height: 100%; width: 0; background: var(--fire-grad); }
[data-theme="light"] .reader-main { background: #fbfaf8; color: #1a1a1a; }
[data-theme="light"] .reader-doc p { color: #2a2a2a; }
[data-theme="light"] .reader-doc h2 { color: #111; }
.pdf-note { margin-top: 40px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-1); border: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); font-family: var(--font-mono); line-height: 1.6; }
@media (max-width: 760px) {
  .reader { grid-template-columns: 1fr; }
  .reader-toc { display: none; }
}

/* ---- Reviews ---- */
.review-grid { columns: 3; column-gap: 20px; }
.review-grid > * { break-inside: avoid; margin-bottom: 20px; }
.review { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.review .stars { display: flex; gap: 3px; color: var(--amber); }
.review .rq { font-size: 16px; color: var(--text); line-height: 1.6; }
.review .ctx { font-size: 13px; color: var(--muted); }
.review .ba-mini { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.review .ba-mini span { padding: 7px 11px; border-radius: 8px; }
.review .ba-mini .b { background: rgba(255,255,255,.04); color: var(--muted); }
.review .ba-mini .a { background: rgba(255,69,0,.1); color: var(--fire-300); }
.review .who { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.review .who .av { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--fire-300); }
@media (max-width: 900px) { .review-grid { columns: 2; } }
@media (max-width: 600px) { .review-grid { columns: 1; } }

/* ---- Program ---- */
.mod-list { display: grid; gap: 10px; counter-reset: mod; }
.mod { display: flex; gap: 16px; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line); align-items: flex-start; transition: border-color var(--dur-1); }
.mod:hover { border-color: var(--line-fire); }
.mod .mn { counter-increment: mod; font-family: var(--font-display); font-size: 20px; color: var(--fire-300); min-width: 44px; }
.mod .mn::before { content: "0" counter(mod); }
.mod b { font-size: 16px; color: var(--text); display: block; margin-bottom: 4px; }
.mod p { font-size: 14px; color: var(--muted); line-height: 1.5; }
.waitlist { padding: clamp(28px,4vw,44px); border-radius: var(--r-xl); border: 1px solid var(--line-fire); background: var(--surface-1); position: relative; overflow: hidden; }
.waitlist .ember-canvas { position: absolute; inset: 0; opacity: .35; }
.waitlist > * { position: relative; z-index: 1; }

/* ---- Community ---- */
.level-ladder { display: grid; gap: 12px; }
.level-row { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--line); transition: all var(--dur-2); }
.level-row:hover { border-color: var(--line-fire); transform: translateX(4px); }
.level-row .lfl { font-size: 22px; min-width: 130px; }
.level-row .lname { font-family: var(--font-display); font-size: 18px; color: var(--text); }
.level-row .ldesc { color: var(--muted); font-size: 14px; margin-left: auto; text-align: right; max-width: 40ch; }
.cafe-cta { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(24px,3vw,40px); border-radius: var(--r-xl); background: linear-gradient(135deg, rgba(255,69,0,.12), rgba(255,178,0,.05)); border: 1px solid var(--line-fire); }
@media (max-width: 700px) {
  .level-row { flex-wrap: wrap; gap: 10px; }
  .level-row .lfl { min-width: auto; }
  .level-row .ldesc { margin-left: 0; text-align: left; }
  .cafe-cta { grid-template-columns: 1fr; text-align: center; }
}

/* shared: two-up section header w/ link handled by .sec-head from home.css */
.page-section { padding-block: clamp(48px,6vw,88px); }
