/* ============================================================
   Inkshelf — appearance: schemes + the Lite style.
   <html data-scheme="light|dark|amoled" data-style="standard|glass|lite">
   is set before first paint by js/theme-boot.js.
   Light tokens live in base.css :root; dark tokens in base.css (shared by amoled).
   Liquid Glass style lives in theme-glass.css.
   ============================================================ */

/* ---------- AMOLED: true black, near-black surfaces, whisper-quiet borders ---------- */
html[data-scheme="amoled"] {
  --bg: #000;
  --surface: #0a0a0a;
  --surface-2: #161618;
  --text: #f0ece6;
  --text-2: #bdb7ae;
  --muted: #8f887f;
  --border: #19191c;
  --accent-soft: rgba(240, 80, 42, .18);

  --glass-bg: rgba(0, 0, 0, .9);
  --glass-strong: #000;
  --glass-border: rgba(255, 255, 255, .09);
  --glass-edge: rgba(255, 255, 255, .07);
  --glass-shadow: none;

  /* tabs.css liquid card: keep the colour glow, drop the grey haze */
  --liquid-hi: rgba(255, 255, 255, .1);
  --liquid-sheen: rgba(255, 255, 255, .045);
  --liquid-tint: rgba(10, 10, 12, .62);
  --blob-a: rgba(240, 80, 42, .26);
  --blob-b: rgba(224, 86, 138, .16);
  background: #000;
}
html[data-scheme="amoled"] body { background: #000; }
html[data-scheme="amoled"] .tabbar { box-shadow: none; }
html[data-scheme="amoled"] .sheet { box-shadow: none; border-top-color: rgba(255, 255, 255, .1); }
html[data-scheme="amoled"] .sheet-backdrop { background: rgba(0, 0, 0, .6); }
html[data-scheme="amoled"] .cover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .05); }
html[data-scheme="amoled"] .btn-primary { box-shadow: none; }
html[data-scheme="amoled"] .toast { background: #121214; border: 1px solid rgba(255, 255, 255, .08); box-shadow: none; }
html[data-scheme="amoled"] .busy-box { border: 1px solid var(--glass-border); }
html[data-scheme="amoled"] .settings-card { background: var(--surface); border-color: #161619; }
html[data-scheme="amoled"] .filter-box { background: var(--surface); box-shadow: inset 0 0 0 1px #19191c; }
html[data-scheme="amoled"] .detail-page .dp-mini.app-header { background: rgba(0, 0, 0, .7); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .06); }
html[data-scheme="amoled"] .detail-page .dp-ch-check { color: #34343a; }
html[data-scheme="amoled"] .detail-page .dp-ch-check.is-on { color: var(--accent-light); }
html[data-scheme="amoled"] .detail-page .dp-bar { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
/* reader: already black; make its chrome true black too */
html[data-scheme="amoled"] body.reading { --reader-glass: rgba(0, 0, 0, .72); --reader-glass-strong: rgba(0, 0, 0, .9); --reader-edge: rgba(255, 255, 255, .08); }
html[data-scheme="amoled"] .reader-strip .reader-img:not(.is-loaded) { background: #050506; }

/* ============================================================
   LITE — for low-end phones. Opaque surfaces, no blur, no big shadows,
   filters or gradients, no decorative motion. Cheap transform/opacity
   transitions (sheet, overlays, toast) stay, capped at 150ms.
   ============================================================ */
html[data-style="lite"] {
  --glass-bg: var(--bg);
  --glass-strong: var(--surface);
  --glass-shadow: none;
  --blur: none;
  --liquid-hi: transparent;
  --liquid-sheen: transparent;
  --liquid-tint: var(--surface);
  --lite-hero: #3a2f4c;
}
html[data-style="lite"][data-scheme="dark"] { --lite-hero: #2a2238; }
html[data-style="lite"][data-scheme="amoled"] { --glass-strong: #000; --lite-hero: #150f20; }

/* zero backdrop-filter, everywhere (incl. other style sheets) */
html[data-style="lite"] *,
html[data-style="lite"] *::before,
html[data-style="lite"] *::after {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* --- shell & shared components (base.css) --- */
html[data-style="lite"] .tabbar,
html[data-style="lite"] .sheet,
html[data-style="lite"] .btn-primary,
html[data-style="lite"] .cover,
html[data-style="lite"] .toast { box-shadow: none; }
html[data-style="lite"] .cover { outline: 1px solid var(--glass-edge); outline-offset: -1px; }
html[data-style="lite"] .btn-primary:active { filter: none; opacity: .88; }
html[data-style="lite"] .section-title::before { background: var(--accent); }
html[data-style="lite"] .empty-illus { background: var(--surface-2); }
html[data-style="lite"] .toast { background: #25221f; }
html[data-style="lite"] .busy-box { background: var(--surface); }
/* press scale + slide-ins are decoration */
html[data-style="lite"] .card .cover { transition: none; }
html[data-style="lite"] .card:active .cover,
html[data-style="lite"] .card.is-pressing .cover { transform: none; }
html[data-style="lite"] .slide-in-right,
html[data-style="lite"] .slide-in-left { animation: none; }
/* basic motion kept, shortened */
html[data-style="lite"] .sheet { transition: transform .15s ease-out; }
html[data-style="lite"] .sheet-backdrop { transition: opacity .15s; }

/* long lists / grids: let the browser skip off-screen work */
html[data-style="lite"] .grid-3 > .card { content-visibility: auto; contain-intrinsic-size: auto 100px auto 230px; }
html[data-style="lite"] .list-row,
html[data-style="lite"] .detail-page .dp-ch { content-visibility: auto; contain-intrinsic-size: auto 300px auto 76px; }

/* --- discover.css --- */
html[data-style="lite"] .top-tab { transition: none; }
html[data-style="lite"] .top-tab.is-active { background: none; color: var(--accent); }
html[data-style="lite"] .filter-box { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }

/* --- detail.css: flat tinted hero instead of the blurred cover --- */
html[data-style="lite"] .detail-page .dp-hero { background: var(--lite-hero); }
html[data-style="lite"] .detail-page .dp-hero-bg,
html[data-style="lite"] .detail-page .dp-hero::after,
html[data-style="lite"] .detail-page .dp-mini::before,
html[data-style="lite"] .detail-page .dp-mini::after { display: none; }
html[data-style="lite"] .detail-page .dp-hero-cover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
html[data-style="lite"] .detail-page .dp-hero-title { text-shadow: none; }
html[data-style="lite"] .detail-page .dp-author { background: rgba(255, 255, 255, .18); box-shadow: none; }
html[data-style="lite"] .detail-page .dp-mini.app-header {
  background: var(--lite-hero); box-shadow: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
html[data-style="lite"] .detail-page .dp-mini.is-shown { transition: opacity .15s ease, transform .15s ease; }
html[data-style="lite"] .detail-page .dp-bar { box-shadow: none; }
html[data-style="lite"] .detail-page .dp-fav,
html[data-style="lite"] .detail-page .dp-read,
html[data-style="lite"] .detail-page .dp-fav .icon,
html[data-style="lite"] .detail-page .dp-ch,
html[data-style="lite"] .dp-star { transition: none; }
html[data-style="lite"] .detail-page .dp-fav.is-on .icon { filter: none; }
html[data-style="lite"] .detail-page .dp-fav:active .icon,
html[data-style="lite"] .dp-star:active { transform: none; }
html[data-style="lite"] .detail-page .dp-read { box-shadow: none; }
html[data-style="lite"] .detail-page .dp-read:active { filter: none; opacity: .88; }
html[data-style="lite"] .detail-page .dp-ch.is-flash { animation: none; background-color: var(--accent-soft); }
html[data-style="lite"] .dp-dl-icon { box-shadow: none; }
@media (min-width: 760px) {
  html[data-style="lite"] .detail-page .dp-bar { box-shadow: none; }
}

/* --- tabs.css: liquid cards become plain cards --- */
html[data-style="lite"] .glass-stage::before,
html[data-style="lite"] .glass-stage::after,
html[data-style="lite"] .liquid-card::before { display: none; }
html[data-style="lite"] .liquid-card { background: var(--surface); border-color: var(--border); box-shadow: none; }
html[data-style="lite"] .summary-stat,
html[data-style="lite"] .stat-tile { background: var(--bg); border-color: var(--border); box-shadow: none; }
html[data-style="lite"] .summary-badge,
html[data-style="lite"] .avatar,
html[data-style="lite"] .about-logo { filter: none; }
html[data-style="lite"] .downloads-empty .empty-illus { background: none; }
html[data-style="lite"] .downloads-empty .empty-ground,
html[data-style="lite"] .downloads-empty .empty-ground::after { background: var(--border); filter: none; }

/* --- reader.css: opaque dark chrome --- */
html[data-style="lite"] .reader-glass { background: #141418; box-shadow: none; }
html[data-style="lite"][data-scheme="amoled"] .reader-glass { background: #000; }
html[data-style="lite"] .reader-top,
html[data-style="lite"] .reader-bottom { transition: transform .15s ease-out, opacity .15s; }
html[data-style="lite"] .reader-pill { background: #0b0b0e; box-shadow: none; transition: none; }
html[data-style="lite"] .reader-pull { background: #1c1c22; transition: opacity .15s, transform .15s; }
html[data-style="lite"] .reader-pull.is-ready { background: #c42d0e; }
html[data-style="lite"] .sheet.reader-sheet { background: #141418; box-shadow: none; }
html[data-style="lite"][data-scheme="amoled"] .sheet.reader-sheet { background: #000; }
html[data-style="lite"] .reader-sheet .chip.is-active { box-shadow: none; }
html[data-style="lite"] .reader-slider::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(240, 80, 42, .45); }
html[data-style="lite"] .reader-slider::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(240, 80, 42, .45); }
html[data-style="lite"] .reader-strip .reader-img.is-missing,
html[data-style="lite"] .reader-paged .reader-img.is-missing { background: #0d0d10; }
