/* DPDC Balance Checker — landing page
   Palette mirrors the app's theme (AppPrimary #5A2EE6, ui/theme/Color.kt). */

/* The app's own faces (app/src/main/res/font/), converted to woff2.
   The two Bangla faces are gated on the Bangla block, so they're fetched only
   when Bangla is actually on screen and a mixed-script string routes per
   character — the web equivalent of the app's scriptAwareFontFamily routing:
   Latin -> Switzer, Bangla body -> Tiro, Bangla titles -> Shurjo Bold.
   ponytail: no Shurjo Regular face, so Bangla numerals in body copy take Tiro
   rather than Shurjo. Add one if real BN numbers land on the page. */
@font-face {
  font-family: "Switzer";
  src: url("../fonts/switzer_variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Tiro Bangla";
  src: url("../fonts/tiro_bangla_regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0980-09FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Shurjo";
  src: url("../fonts/shurjo_bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0980-09FF, U+200C-200D, U+25CC;
}

:root {
  --brand: #5A2EE6;
  --brand-ink: #ffffff;
  --bg: #ffffff;
  --bg-alt: #f7f6fd;
  --fg: #14171f;
  --muted: #5b6270;
  --card: #ffffff;
  --line: #e7e5f3;
  --shadow: 0 1px 2px rgba(20, 23, 31, .04), 0 12px 32px rgba(90, 46, 230, .07);
  --radius: 18px;
  --font-body: "Switzer", "Tiro Bangla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: "Switzer", "Shurjo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9d80ff;
    --brand-ink: #16101f;
    --bg: #0f121a;
    --bg-alt: #141824;
    --fg: #eef0f5;
    --muted: #a2a9b8;
    --card: #171c28;
    --line: #262c3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

h1, h2, h3, .brand, .btn, .faq summary { font-family: var(--font-title); line-height: 1.2; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); }
.section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: -.02em;
  margin: 0 0 6px;
}
.section .lede { color: var(--muted); margin: 0 0 40px; max-width: 52ch; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 600; }
.brand img { width: 28px; height: 28px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--fg); }
@media (max-width: 720px) { .nav a:not(.btn) { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: var(--brand-ink);
  text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 11px 20px; border-radius: 999px;
  transition: transform .15s, opacity .15s;
}
.btn:hover { opacity: .92; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero .wrap { display: grid; gap: 40px; grid-template-columns: 1fr 1.15fr; align-items: center; }
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08; letter-spacing: -.03em; margin: 0 0 12px;
}
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0 0 28px; max-width: 46ch; }
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.play-badge img { height: 56px; width: auto; }
.hero-note { margin-top: 22px; font-size: .9rem; color: var(--muted); }
/* The hero art is a pre-rendered mockup with its own device frames and a
   transparent background — no .phone frame here. */
.hero-art { max-width: 720px; justify-self: center; width: 100%; }

/* Entrance. CSS-only and short on purpose: it runs on load with no JS gate, and
   an element still at opacity 0 doesn't count for LCP — so the whole thing is
   done in under half a second rather than trading paint time for polish. Only
   opacity/translate/scale, which the compositor handles without layout. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: hero-rise .42s cubic-bezier(.2, .7, .3, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: .06s; }
  .hero-copy > :nth-child(3) { animation-delay: .12s; }
  .hero-copy > :nth-child(4) { animation-delay: .18s; }
  .hero-art { animation: hero-art-in .5s cubic-bezier(.2, .7, .3, 1) .08s both; }
}

@keyframes hero-rise {
  from { opacity: 0; translate: 0 12px; }
}
@keyframes hero-art-in {
  from { opacity: 0; translate: 0 20px; scale: .97; }
}
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 480px; margin: 0 auto; }
}

/* phone frame — used by the hero and the screenshot rail */
.phone {
  border: 8px solid #1b1f2b;
  border-radius: 34px;
  overflow: hidden;
  background: #1b1f2b;
  box-shadow: var(--shadow);
}
.phone img { border-radius: 26px; }

/* ---------- features ---------- */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 16px 0 4px; font-size: 1.05rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: .96rem; }
/* Icons are the app's own vector drawables, inlined in the HTML so they draw in
   currentColor. Inline rather than a CSS mask or <img>: a mask that fails to
   load renders nothing at all, silently. */
.icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 13px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

/* ---------- screenshot rail ---------- */
.rail {
  display: flex; gap: 20px; overflow-x: auto;
  /* `safe` keeps the first phone reachable when the rail overflows — plain
     `center` clips the overflowing start edge. */
  justify-content: safe center;
  padding: 4px 24px 24px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail .phone { flex: 0 0 230px; scroll-snap-align: center; }
/* Each phone rides the shared .reveal fade, one after the next. */
.rail .phone:nth-child(2) { transition-delay: .08s; }
.rail .phone:nth-child(3) { transition-delay: .16s; }
.rail .phone:nth-child(4) { transition-delay: .24s; }

/* ---------- steps ---------- */
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { list-style: none; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 34px; height: 34px; margin-bottom: 14px;
  border-radius: 50%; background: var(--brand); color: var(--brand-ink);
  font-weight: 600; font-size: .95rem;
}
.steps h3 { margin: 0 0 4px; font-size: 1.05rem; }
.steps p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---------- faq ---------- */
.faq { max-width: 720px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  display: inline-block;
  color: var(--muted); font-weight: 400;
  transition: transform .3s ease, color .3s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); color: var(--fg); }
.faq p { color: var(--muted); margin: 12px 0 0; }

/* Open/close animation. Deliberately NOT the height 0->auto + interpolate-size
   recipe on ::details-content: tried it first and the content stayed collapsed
   in Chrome 151 here, so the answer would never have shown. This fades and
   slides the content instead; the row's own height still snaps. */
.faq details::details-content {
  opacity: 0;
  translate: 0 -6px;
  transition: opacity .25s ease, translate .25s ease, content-visibility .25s allow-discrete;
}
.faq details[open]::details-content { opacity: 1; translate: none; }

/* ---------- cta + footer ---------- */
.cta { text-align: center; }
.cta .wrap { display: grid; justify-items: center; gap: 24px; }
.cta img.app-icon { width: 84px; height: 84px; border-radius: 20px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 56px;
  color: var(--muted); font-size: .9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.site-footer nav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.disclaimer { flex-basis: 100%; margin: 0; font-size: .82rem; opacity: .8; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .faq details::details-content, .faq summary::after { transition: none; }
}
