/* iHisob landing. Brand purple comes from the app (#6950F3). */
@font-face { font-family: "Figtree"; src: url("../assets/fonts/Figtree-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/Figtree-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/Figtree-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../assets/fonts/Figtree-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --brand: #6950f3;
  --brand-ink: #4a39b8;
  --brand-fill: #6950f3;
  --brand-fill-hover: #4a39b8;
  --on-brand: #fff;
  --bg: #fff;
  --surface: #f6f5fc;
  --surface-2: #ece9ff;
  --card: #fff;
  --demo-fill: #fff;
  --text: #16132b;
  --muted: #5d5a73;
  --line: #e6e3f5;
  --owe: #d92d3a;
  --ok: #1f9d55;
  --shadow: 0 1px 2px rgba(34, 24, 99, .06), 0 12px 32px rgba(34, 24, 99, .08);
  --phone-shadow: 0 30px 60px rgba(34, 24, 99, .28);
  --radius: 20px;
  --gutter: 16px;
  --max: 1120px;
  /* One rhythm below the hero: the gap between sections and between feature rows. */
  --space: clamp(80px, 10vw, 120px);
  --unsure: color-mix(in srgb, #f5b700 38%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #8b7bfa;
    --brand-ink: #b3a8ff;
    --brand-fill-hover: #5b43e6;
    --bg: #0f0d1c;
    --surface: #1a1733;
    --surface-2: #231f45;
    --card: #181530;
    --demo-fill: #231f45;
    --text: #f1effc;
    --muted: #a9a5c4;
    --line: #2a2650;
    --owe: #ff6b75;
    --ok: #4cd08a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    --phone-shadow: 0 30px 60px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  --brand: #8b7bfa;
  --brand-ink: #b3a8ff;
  --brand-fill-hover: #5b43e6;
  --bg: #0f0d1c;
  --surface: #1a1733;
  --surface-2: #231f45;
  --card: #181530;
  --demo-fill: #231f45;
  --text: #f1effc;
  --muted: #a9a5c4;
  --line: #2a2650;
  --owe: #ff6b75;
  --ok: #4cd08a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  --phone-shadow: 0 30px 60px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand-fill); color: var(--on-brand); padding: 8px 14px; border-radius: 999px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: calc(var(--space) / 2) 0; }
section[id] { scroll-margin-top: 72px; }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 7vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); text-wrap: balance; }
h3 { font-size: 1.25rem; letter-spacing: -.01em; font-weight: 600; }
p { margin: 0; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); }
.center { text-align: center; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
/* Under 860px the sections live in a panel under the bar, opened by .menu-btn; from 860px they sit in the bar. */
.menu { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 8px var(--gutter) 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.site-header.menu-open .menu { display: grid; gap: 4px; }
.site-header.menu-open { border-bottom-color: var(--line); }
.nav { display: grid; gap: 2px; }
.nav a { text-decoration: none; display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 12px; color: var(--text); font-weight: 600; font-size: 1.1rem; }
.nav a:hover { background: var(--surface); }
.menu-theme { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; margin-top: 6px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--muted); font: 500 1rem/1 inherit; cursor: pointer; text-align: left; }
.menu-theme svg { width: 20px; height: 20px; }
.menu-btn svg path { transition: transform .2s, opacity .2s; transform-origin: 12px 12px; }
.menu-btn[aria-expanded="true"] .m1 { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .m2 { opacity: 0; }
.menu-btn[aria-expanded="true"] .m3 { transform: translateY(-5px) rotate(-45deg); }
.tools .theme-btn { display: none; }
.no-js .menu-btn { display: none; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang { position: relative; display: inline-flex; align-items: center; color: var(--text); }
.lang select { appearance: none; -webkit-appearance: none; border: 0; background: var(--surface); color: var(--text); font: 600 .9rem/1 inherit; min-height: 44px; padding: 0 34px 0 38px; border-radius: 999px; cursor: pointer; }
.lang select:hover { background: var(--surface-2); }
.lang select:focus-visible { outline: 2px solid var(--brand, #6950f3); outline-offset: 2px; }
.lang svg { position: absolute; pointer-events: none; }
.lang-globe { left: 13px; width: 18px; height: 18px; color: var(--muted); }
.lang-chevron { right: 11px; width: 16px; height: 16px; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }
@media (min-width: 860px) {
  .menu, .site-header.menu-open .menu { display: contents; }
  .nav { display: flex; gap: 4px; margin-left: 24px; }
  .nav a { min-height: 40px; padding: 0 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .95rem; }
  .nav a:hover { color: var(--text); }
  .menu-theme, .menu-btn { display: none; }
  .tools .theme-btn { display: grid; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0; text-decoration: none; font: 600 1rem/1 inherit; cursor: pointer; background: var(--brand-fill); color: var(--on-brand); transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); background: var(--brand-fill-hover); }
.btn.small { min-height: 40px; padding: 0 18px; font-size: .92rem; }
.btn.ghost { background: var(--surface); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.store { background: #000; color: #fff; min-height: 56px; padding: 0 24px 0 18px; gap: 12px; text-align: left; }
.store:hover { background: #222; }
.store .soon { display: none; }
.store.is-soon .live { display: none; }
.store small { display: block; font-size: .68rem; font-weight: 400; line-height: 1.1; opacity: .85; }
.store strong { display: block; font-size: 1.25rem; line-height: 1.1; font-weight: 600; letter-spacing: -.01em; }
:root[data-theme="dark"] .store { background: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .store { background: #fff; color: #000; } }
/* Before launch (no appStoreUrl): a status, not a button. Outlined, muted, a clock; nothing to press. */
:root .store.is-soon, :root .store.is-soon:hover { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 30%, transparent); min-height: 52px; padding: 0 20px 0 16px; cursor: default; transform: none; }
.store.is-soon .soon { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 500; }
.store.is-soon svg { width: 20px; height: 20px; flex: none; }
.share svg { width: 20px; height: 20px; margin-left: -4px; }

/* The two ways to act before launch: share the site, ask on Telegram. */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.share-status { font-size: .95rem; font-weight: 600; color: var(--ok); }
.share-status:empty { display: none; }
.ask a { color: var(--brand-ink); font-weight: 600; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ask a:hover { text-decoration-thickness: 2px; }

/* Hero: the tagline, then the core moment: a sentence turning into expense cards. */
.hero { padding: 24px 0 32px; }
.hero-card { background: var(--surface); border-radius: 32px; padding: 40px 20px 32px; display: grid; gap: 20px; justify-items: start; }
.hero-title { font-size: clamp(2rem, 9.4vw, 5.5rem); letter-spacing: -.03em; line-height: 1.02; text-wrap: balance; }
.hero-lead { color: var(--text); max-width: 34ch; text-wrap: balance; }
.hero-cta { display: grid; gap: 14px; justify-items: start; }
.meta { font-size: .95rem; color: var(--muted); }
.hero .demo { justify-self: stretch; margin: 8px 0 0; }
@media (min-width: 860px) {
  .hero-card {
    padding: 64px; column-gap: 64px; row-gap: 20px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas: "title title" "lead demo" "actions demo" ". demo" "chips chips";
  }
  .hero-title { grid-area: title; margin-bottom: 28px; }
  .hero-lead { grid-area: lead; }
  .hero-cta { grid-area: actions; margin-top: 8px; }
  .hero .demo { grid-area: demo; margin: 0; align-self: start; }
  .hero .chips { grid-area: chips; margin-top: 12px; }
}

/* What sets iHisob apart, said right under the demo: offline, on the iPhone, free. */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--text); font-size: .95rem; font-weight: 600; line-height: 1.2; }
.chips svg { flex: none; width: 18px; height: 18px; color: var(--brand-ink); }

/* The demo: the "+" page in miniature. Without JS or with Reduce Motion it is the finished, still picture. */
.demo { margin: 0; display: grid; position: relative; }
.demo-stage { display: grid; gap: 10px; }
.said { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 8px 8px 18px; border-radius: 22px; background: var(--demo-fill); font-weight: 500; font-size: 1.05rem; line-height: 1.35; }
.said-line { flex: 1; display: grid; }
.said-text, .said-typed { grid-area: 1 / 1; }
.said-typed { display: none; }
.send { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-fill); color: var(--on-brand); transition: opacity .3s, transform .3s cubic-bezier(.16, 1, .3, 1); }
.send svg { width: 20px; height: 20px; }
.cards { display: grid; gap: 8px; }
.rec { display: flex; align-items: center; gap: 14px; border-radius: 16px; padding: 12px 16px 12px 12px; background: var(--demo-fill); }
.badge { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.badge svg { width: 22px; height: 22px; }
/* The second demo card: Bozor/Базар in uz and ru, Coffee in en (each is what the app reads from that sentence). */
.badge .ic-coffee, html[lang="en"] .badge .ic-bazaar { display: none; }
html[lang="en"] .badge .ic-coffee { display: block; }
.badge.taxi { background: color-mix(in srgb, #a259e6 16%, var(--card)); color: #8b3fd4; }
.badge.food { background: color-mix(in srgb, #2f7bf2 16%, var(--card)); color: #2a6fe0; }
.badge.pharm { background: color-mix(in srgb, #e5484d 15%, var(--card)); color: #d0353b; }
:root[data-theme="dark"] .badge.taxi { color: #c99bf5; }
:root[data-theme="dark"] .badge.food { color: #8db6ff; }
:root[data-theme="dark"] .badge.pharm { color: #ff8a8e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.taxi { color: #c99bf5; }
  :root:not([data-theme="light"]) .badge.food { color: #8db6ff; }
  :root:not([data-theme="light"]) .badge.pharm { color: #ff8a8e; }
}
.rec-text { display: grid; gap: 1px; }
.rec-name { font-size: .92rem; color: var(--muted); line-height: 1.2; }
.rec-amt { font-size: clamp(1.2rem, 3.6vw, 1.45rem); font-weight: 800; letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; }

/* Live: main.js types the sentence into .said-typed, then the cards rise in. */
.demo.is-live .said-text { visibility: hidden; }
.demo.is-live .said-typed { display: block; }
.demo.is-live .said-typed::after { content: ""; display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; vertical-align: -.2em; background: var(--brand); animation: caret 1s steps(1) infinite; }
.demo.is-live.is-empty .send { opacity: .35; }
.demo.is-live.is-sent .send { transform: scale(.88); }
.demo.is-live .rec { opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .35s ease, transform .35s ease; }
.demo.is-live.show-cards .rec { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1); }
.demo.is-live.show-cards .rec + .rec { transition-delay: .14s; }
.demo.is-live.is-clearing .said-typed { opacity: 0; transition: opacity .35s ease; }
@keyframes caret { 50% { opacity: 0; } }
/* The pause sits in the stage's corner, in the send button's column, beside the last card. */
.demo:has(.demo-pause:not([hidden])) .cards { margin-right: 52px; }
.demo-pause { position: absolute; right: 6px; bottom: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.demo-pause:hover { color: var(--text); background: var(--surface-2); }
.demo-pause svg { width: 18px; height: 18px; }
.demo-pause .i-play, .demo-pause.is-paused .i-pause { display: none; }
.demo-pause.is-paused .i-play { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Phone frame */
.phone { position: relative; background: #0b0a14; border-radius: 15% / 7%; padding: 2.6%; box-shadow: var(--phone-shadow), inset 0 0 0 2px #2a2840; }
.phone picture { display: block; }
.phone img { border-radius: 12.5% / 5.8%; width: 100%; aspect-ratio: 720 / 1565; object-fit: cover; background: var(--surface-2); }
.phone::after { content: ""; position: absolute; top: 3.6%; left: 50%; width: 28%; height: 2.6%; transform: translateX(-50%); background: #000; border-radius: 99px; }

/* Sections */
h2 + .lead { margin-top: 14px; }
.sub { margin-top: 16px; color: var(--text); max-width: 46ch; }

/* Feature rows: text beside a real screen */
.rows { display: grid; gap: var(--space); }
.row { display: grid; gap: 32px; align-items: center; }
.row .copy { display: grid; gap: 0; }
.phone-wrap { justify-self: center; width: min(260px, 70%); }
@media (min-width: 860px) {
  .row { grid-template-columns: 1fr 1fr; gap: 80px; }
  .row.flip .copy { order: 2; }
  .phone-wrap { width: 300px; }
  .row:not(.flip) .phone-wrap, .row:not(.flip) .check { justify-self: start; }
  .row.flip .phone-wrap { justify-self: end; }
}

/* A flagged card checked, then saved: the "+" page in miniature, drawn like the hero demo. */
.check { margin: 0; justify-self: center; width: min(360px, 100%); }
.check-stage { display: grid; gap: 10px; padding: 16px; border-radius: 28px; background: var(--surface); }
.check .said { font-size: 1rem; min-height: 56px; }
.unsure { background: var(--unsure); color: inherit; margin: 0 -6px; padding: 0 6px; border-radius: 999px; }
.check-step { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 2px 0; font-size: .9rem; font-weight: 500; color: var(--muted); }
.check-step svg { width: 16px; height: 16px; }
.save-cap { display: grid; place-items: center; min-height: 50px; margin-top: 6px; border-radius: 999px; background: var(--brand-fill); color: var(--on-brand); font-weight: 700; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; }

/* More features: short cards without a screen */
.extras-grid { display: grid; gap: 28px; margin-top: 32px; }
.extra { border-top: 1px solid var(--line); padding-top: 20px; }
.extra h3 { margin-bottom: 8px; }
.extra p { color: var(--muted); }
@media (min-width: 760px) { .extras-grid { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* Privacy */
.privacy-cols { display: grid; gap: 28px; margin-top: 32px; }
.checks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; font-weight: 600; }
.checks li { display: flex; align-items: center; gap: 10px; }
.checks svg { flex: none; width: 20px; height: 20px; color: var(--ok); }
.privacy-cols h3 { margin-bottom: 8px; }
.privacy-cols p { color: var(--muted); }
.sent { margin-top: 14px; border-top: 1px solid var(--line); }
.sent summary { padding: 14px 0; color: var(--brand-ink); }
.sent p { font-size: .95rem; }
@media (min-width: 860px) { .privacy-cols { grid-template-columns: 1fr 1.4fr; gap: 64px; } }
.more { margin-top: 22px; }
.more a { color: var(--brand-ink); font-weight: 600; }

/* FAQ */
.faq-wrap { display: grid; gap: 24px; align-items: start; }
.faq { display: grid; gap: 36px; }
.faq-group h3 { font-size: 1rem; font-weight: 700; letter-spacing: 0; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .faq-wrap { grid-template-columns: 1fr 1.6fr; gap: 64px; } .faq { margin-top: 10px; } }
details { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--brand), var(--brand)) center / 100% 2px no-repeat, linear-gradient(var(--brand), var(--brand)) center / 2px 100% no-repeat; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 0 18px; color: var(--muted); }

/* Final call: the one-liner again, and the same two actions. */
.final { padding: calc(var(--space) / 2) 0 72px; }
.final-row { display: grid; gap: 24px; padding-top: 48px; border-top: 1px solid var(--line); }
.final-copy { display: grid; gap: 12px; }
.final h2 { max-width: 22ch; }
.final-cta { display: grid; gap: 12px; justify-items: start; }
@media (min-width: 860px) { .final-row { grid-template-columns: 1fr auto; align-items: end; gap: 48px; } .final-cta { justify-items: end; } }

.site-footer { padding: 40px 0 56px; color: var(--muted); font-size: .92rem; }
.foot { display: grid; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); text-decoration: underline; }
@media (min-width: 760px) { .foot { grid-template-columns: 1fr auto; align-items: center; } }

/* Legal pages */
.legal { max-width: 720px; margin: 0 auto; padding: 48px var(--gutter) 24px; display: grid; gap: 14px; }
.legal h1 { font-size: clamp(2rem, 6vw, 3rem); }
.legal h2 { font-size: 1.35rem; margin-top: 18px; letter-spacing: -.01em; }
.legal p, .legal li { color: var(--muted); }
.legal ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal .updated { font-size: .9rem; }
.not-found img { border-radius: 18px; margin: 0 auto; }
html[lang="uz"] .legal [lang]:not([lang="uz"]),
html[lang="ru"] .legal [lang]:not([lang="ru"]),
html[lang="en"] .legal [lang]:not([lang="en"]) { display: none; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
