/* Қаражат: bright, trustworthy fintech. Light by default; the reader has a night mode. Mobile first.
   Geologica (display), Onest (UI), Literata (reading). */
@font-face { font-family: Geologica; src: url(/fonts/geologica.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Onest; src: url(/fonts/onest.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Literata; src: url(/fonts/lit-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Literata; src: url(/fonts/lit-400i.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Literata; src: url(/fonts/lit-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --paper: #f5f7fc; --paper2: #ecf1fb; --card: #ffffff; --ink: #0e1a3a; --ink2: #3b4a6b; --muted: #68759a; --line: #e1e7f2;
  --brand: #047857; --brand2: #10b981; --brand-h: #065f46; --on-brand: #ffffff; --gold: #c27c0e; --blue: #2f5bff; --blue2: #1d3bd8;
  --night: #0e1a3a; --on-night: #ffffff; --ok: #047857; --bad: #dc2626;
  --display: Geologica, 'Segoe UI', system-ui, sans-serif; --serif: Literata, Georgia, serif;
  --sans: Onest, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 20px; --shadow: 0 1px 2px rgba(14, 26, 58, .05), 0 16px 36px -18px rgba(14, 26, 58, .22);
  --cover-shadow: 0 2px 4px rgba(14, 26, 58, .18), 0 18px 34px -14px rgba(14, 26, 58, .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
/* Night reading mode (toggle on the chapter page). */
:root[data-theme="dark"] {
  --paper: #0b1120; --paper2: #111a2e; --card: #152039; --ink: #e8eefc; --ink2: #b6c1da; --muted: #8a97b5; --line: #233150;
  --brand: #10b981; --brand2: #34d399; --brand-h: #34d399; --on-brand: #03140d; --gold: #f5b84b; --ok: #34d399; --bad: #f87171;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 1rem/1.6 var(--sans); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-h); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 4.6vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.narrowish { max-width: 900px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ok { color: var(--ok); }
.err { color: var(--bad); font-weight: 600; margin: .25rem 0 .5rem; }
.mt { margin-top: 3rem; }
.kicker { font: 700 .75rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 0 0 .6rem; }
.textlink { font-weight: 600; text-decoration: none; }
.textlink:hover { text-decoration: underline; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font: 900 1.35rem/1 var(--display); color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.mark { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 .95rem/1 var(--sans); }
.navbtn { font-weight: 600; text-decoration: none; padding: .45rem .9rem; border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--card); font-size: .9rem; }
.navbtn:hover { border-color: var(--brand); color: var(--brand); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 46px; padding: .7rem 1.3rem; border: 0; border-radius: 12px;
  background: var(--brand); color: var(--on-brand); font: 700 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer; text-align: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); transition: background .15s, transform .15s; }
.btn:hover { background: var(--brand-h); color: var(--on-brand); }
.btn:active { transform: translateY(1px); }
.btn.big { min-height: 54px; padding: .9rem 1.6rem; font-size: 1.08rem; }
.btn.small { min-height: 38px; padding: .45rem .9rem; font-size: .9rem; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn.light { background: var(--on-night); color: var(--night); }
.btn.light:hover { background: #fff; color: var(--night); }
.cta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.cta-col { display: grid; gap: .6rem; margin-top: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.25rem; }
.cov { border-radius: 3px 6px 6px 3px; box-shadow: var(--cover-shadow); aspect-ratio: 3 / 4; object-fit: cover; width: 100%; height: auto; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ticks { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .45rem; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before { content: ''; position: absolute; left: .1rem; top: .5em; width: .75rem; height: .4rem; border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg); }
.mini-shelf { display: flex; justify-content: center; gap: 8px; margin: 1.6rem auto; max-width: 420px; }
.mini-shelf .cov, .mini-shelf a { width: 19%; }
.mini-shelf.locked .cov { filter: grayscale(.6) brightness(.8); }
details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
details summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--brand); transition: transform .25s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details > :not(summary) { padding: 0 1.2rem; }
details > p:last-child { padding-bottom: 1rem; margin: 0; }

/* pay by another bank (Halyk) via WhatsApp */
.halyk { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; padding: .75rem .9rem; border-radius: 14px; background: #f0fdf6; border: 1px dashed #86d6ae;
  color: var(--ink2); font-size: .9rem; text-decoration: none; line-height: 1.35; }
.halyk:hover { color: var(--ink); border-style: solid; }
.halyk b { color: var(--brand); }
.halyk .ic { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; height: 26px; color: #16a34a; flex: none; }


/* footer */
.foot { border-top: 1px solid var(--line); padding: 2.4rem 0 3rem; color: var(--ink2); background: var(--paper2); }
.foot-brand { display: flex; align-items: center; gap: .5rem; font: 900 1.2rem/1 var(--display); color: var(--ink); margin-bottom: .8rem; }

/* forms and small pages */
.narrowpage main { padding: 1.6rem 16px 3rem; }
.box { max-width: 480px; margin: 0 auto; }
.form { display: grid; gap: .45rem; }
label { font-weight: 600; font-size: .9rem; color: var(--ink2); margin-top: .4rem; }
input, select { width: 100%; min-height: 48px; padding: .65rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: 500 1.05rem var(--sans); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.form .btn { margin-top: .6rem; }
.checkout { max-width: 520px; margin: 0 auto; display: grid; gap: 1rem; }
.summary { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: start; }
.summary h1 { font-size: 1.45rem; margin-bottom: .3rem; }
.summary .fan { position: relative; height: 128px; }
.summary .fan .cov { position: absolute; width: 64px; top: 0; }
.summary .fan .cov:nth-child(1) { left: 0; top: 14px; transform: rotate(-8deg); }
.summary .fan .cov:nth-child(2) { left: 8px; top: 8px; transform: rotate(-4deg); }
.summary .fan .cov:nth-child(3) { left: 16px; top: 4px; }
.summary .fan .cov:nth-child(4) { left: 24px; top: 8px; transform: rotate(4deg); }
.summary .fan .cov:nth-child(5) { left: 32px; top: 14px; transform: rotate(8deg); }
.price { margin: .2rem 0 .4rem; }
.price b { font: 900 1.8rem/1 var(--display); }
.price s { color: var(--muted); margin-left: .4rem; }
.summary .ticks { margin-top: .6rem; color: var(--ink2); }
.promo { background: transparent; border: 0; }
.promo summary { padding: .4rem 0; font-weight: 600; color: var(--brand); justify-content: flex-start; }
.promo summary::after, .promo[open] summary::after { content: ''; }
.promo > :not(summary) { padding: 0; }
.promo-row { display: flex; gap: .5rem; }
.promo-row input { text-transform: uppercase; }
.promo-row .btn { white-space: nowrap; min-height: 48px; }
.stepper { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 1.2rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.stepper li { flex: 1; padding-top: .5rem; border-top: 3px solid var(--line); }
.stepper li.done { border-color: var(--ok); color: var(--ok); }
.stepper li.now { border-color: var(--brand); color: var(--ink); }
.wait { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; border-radius: 10px; background: var(--paper2); font-weight: 600; margin: 1rem 0; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fallback { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.fallback h2 { font-size: 1.3rem; }

/* cabinet */
.cab { padding-top: 1.8rem; padding-bottom: 3rem; }
.cab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: 1rem; }
.resume { display: grid; grid-template-columns: 84px 1fr; gap: 1rem; align-items: center; text-decoration: none; color: var(--ink); margin-bottom: 1.8rem; }
.resume:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.resume h2 { font-size: 1.3rem; margin-bottom: .2rem; }
.resume p { margin: 0 0 .5rem; color: var(--ink2); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc, var(--brand)); border-radius: 3px; }
.shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1rem; }
.shelfbook { display: grid; gap: .5rem; align-content: start; }
.shelfbook h3 { font-size: 1rem; margin: .4rem 0 0; }
.shelfbook h3 a { color: var(--ink); text-decoration: none; }
.shelfbook p { margin: 0; }
.upsell { margin-top: 2.4rem; text-align: center; }
.upsell .mini-shelf { margin: 1rem auto 1.2rem; }

/* book page */
.bookhome { padding-top: 1.6rem; padding-bottom: 3rem; }
.bh-top { display: grid; grid-template-columns: 120px 1fr; gap: 1.2rem; align-items: start; margin-bottom: 2rem; }
.bh-top h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); margin-bottom: .2rem; }
.toc { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: .6rem; align-items: baseline; padding: .85rem .2rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.toc a:hover { background: var(--card); }
.toc .lbl { font-size: .8rem; font-weight: 700; color: var(--acc); text-transform: uppercase; letter-spacing: .05em; }
.toc .tt { font-family: var(--serif); }
.toc .seen .tt { color: var(--ink2); }
.tag { font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }

/* reader */
.reading { --fs: 1.12rem; }
.reading .top { position: static; }
.readbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; }
.readbar i { display: block; height: 100%; width: 0; background: var(--brand); }
.reader { max-width: 42rem; margin: 0 auto; padding: 1rem 16px 4rem; }
.rtools { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: 1.6rem; }
.crumb { font-size: .9rem; font-weight: 600; text-decoration: none; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtools > span { display: flex; flex: none; }
.tool-txt { display: inline-grid; place-items: center; padding: 0 .7rem; text-decoration: none; }
.tool { min-width: 40px; min-height: 40px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; font: 600 .9rem var(--sans); cursor: pointer; margin-left: .3rem; }
.chlabel { font: 700 .8rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--acc); margin-bottom: .7rem; }
.reader h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); margin-bottom: 1.4rem; }
.text { font: 400 var(--fs)/1.78 var(--serif); }
.text p { margin: 0 0 1.05em; }
.text h3 { font-family: var(--display); font-size: 1.35em; margin: 1.8em 0 .6em; }
.text ul, .text ol { padding-left: 1.3em; }
.text li { margin-bottom: .45em; }
.text strong { font-weight: 700; }
.task { margin: 2em 0 .8em; padding: 1.2em 1.3em; border-radius: 12px; background: color-mix(in srgb, var(--acc) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent); }
.task-t { font: 700 .78rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--acc); margin-bottom: .8em; }
.task p:last-child { margin: 0; }
.taskbtn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; margin: 0 0 2em; border: 1.5px dashed color-mix(in srgb, var(--acc) 60%, transparent); background: transparent; color: var(--ink); border-radius: 12px; font: 600 .95rem var(--sans); cursor: pointer; }
.taskbtn.on { border-style: solid; background: color-mix(in srgb, var(--ok) 14%, transparent); border-color: var(--ok); color: var(--ok); }
.sell { margin: 2.4rem 0 1rem; text-align: center; border-top: 4px solid var(--acc); }
.pager { display: flex; justify-content: space-between; gap: .6rem; margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* audio player */
.player { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; margin: 0 0 1.8rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pp { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand); cursor: pointer; display: grid; place-items: center; }
.pp svg { width: 22px; height: 22px; fill: currentColor; }
.pp .i-pause, .player.playing .pp .i-play { display: none; }
.player.playing .pp .i-pause { display: inline; }
.pmid { flex: 1; min-width: 0; }
.ptitle { font-size: .85rem; font-weight: 600; color: var(--ink2); display: flex; gap: .3rem; }
.ptime { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.seek { width: 100%; min-height: 24px; padding: 0; border: 0; background: transparent; accent-color: var(--brand); box-shadow: none; }
.spd { flex: none; min-width: 48px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 700 .85rem var(--sans); cursor: pointer; }

@media (min-width: 640px) {
  .shelf { grid-template-columns: repeat(3, 1fr); }
  .cta-col { grid-auto-flow: column; justify-content: start; }
  .sell .cta-col { justify-content: center; }
  .bh-top { grid-template-columns: 180px 1fr; gap: 2rem; }
  .summary { grid-template-columns: 120px 1fr; }
}
@media (min-width: 900px) {
  .shelf { grid-template-columns: repeat(5, 1fr); }
}
