/* ==========================================================================
   Bharata-varsha — the app's web pages (About, Help, FAQ, Privacy)

   Colours, type and radii follow the app's own theme
   (lib/theme/app_theme.dart): deep navy chrome, gold accents, warm
   neutrals; Playfair Display for headings and Inter for text, both bundled
   with the app and served from assets/fonts/ (SIL Open Font License 1.1).
   Small icons are Lucide (ISC licence), the icon set the app uses.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.ttf") format("truetype"); font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/PlayfairDisplay-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/PlayfairDisplay-Bold.ttf") format("truetype"); font-weight: 600 700; font-style: normal; font-display: swap; }
/* Kannada, behind Inter as in the app (kSansFallback); only fetched when a page shows Kannada text */
@font-face { font-family: "Noto Sans Kannada"; src: url("fonts/NotoSansKannada-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; unicode-range: U+0C80-0CFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Kannada"; src: url("fonts/NotoSansKannada-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; unicode-range: U+0C80-0CFF, U+200C-200D, U+25CC; }
@font-face { font-family: "Playfair Display"; src: url("fonts/PlayfairDisplay-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }

/* --- Tokens: the app's AppColors ---------------------------------------- */
:root {
  --navy: #172340;
  --navy-deep: #0F1524;
  --navy-ink: #0B1020;
  --gold: #F4A125;
  --gold-deep: #B45309;
  --gold-soft: #FDE7B8;
  --saffron: #EC7513;
  --cream: #FFFCF5;
  --parchment: #F6F3EC;
  --paper: #FAF7EF;

  /* Light theme, as the app's light ColorScheme */
  --bg: var(--parchment);
  --bg-alt: var(--paper);
  --surface: #FFFFFF;
  --surface-2: #F1ECE2;
  --ink: #1C1917;
  --muted: #615A55;
  --border: #E9E4DA;
  --accent: var(--navy);          /* primary in light */
  --on-accent: #FFFFFF;
  --eyebrow: var(--gold-deep);
  --link: var(--navy);
  --focus: var(--gold-deep);
  --nav-bg: rgba(246, 243, 236, .88);
  --badge-bg: var(--gold-soft);
  --badge-ink: var(--navy-deep);
  --shadow: 0 1px 2px rgba(15, 21, 36, .04), 0 10px 24px rgba(15, 21, 36, .07);
  --shadow-lift: 0 2px 4px rgba(15, 21, 36, .08), 0 18px 36px rgba(15, 21, 36, .12);

  --r-card: 22px;
  --r-tile: 16px;
  --r-chip: 999px;
  --wrap: 1120px;
  --serif: "Playfair Display", "Noto Sans Kannada", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Noto Sans Kannada", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Dark theme, as the app's dark ColorScheme: gold becomes the primary */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F1A;
    --bg-alt: #0D1422;
    --surface: #121A2B;
    --surface-2: #18223A;
    --ink: #E4EAF1;
    --muted: #929BAA;
    --border: #263042;
    --accent: var(--gold);
    --on-accent: var(--navy-deep);
    --eyebrow: var(--gold);
    --link: var(--gold);
    --focus: var(--gold);
    --nav-bg: rgba(10, 15, 26, .88);
    --badge-bg: #18223A;
    --badge-ink: var(--gold-soft);
    --shadow: 0 10px 24px rgba(0, 0, 0, .4);
    --shadow-lift: 0 14px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0F1A;
  --bg-alt: #0D1422;
  --surface: #121A2B;
  --surface-2: #18223A;
  --ink: #E4EAF1;
  --muted: #929BAA;
  --border: #263042;
  --accent: var(--gold);
  --on-accent: var(--navy-deep);
  --eyebrow: var(--gold);
  --link: var(--gold);
  --focus: var(--gold);
  --nav-bg: rgba(10, 15, 26, .88);
  --badge-bg: #18223A;
  --badge-ink: var(--gold-soft);
  --shadow: 0 10px 24px rgba(0, 0, 0, .4);
  --shadow-lift: 0 14px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; font-variant-numeric: lining-nums; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 700; }
ul, ol { padding-left: 1.3em; }
li { margin: .3em 0; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- Navigation ------------------------------------------------------------ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.nav-mark { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 4px; order: 2; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: var(--r-chip);
}
.nav-links a:hover { background: var(--surface-2); }
.nav-links a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.nav-tools { display: flex; align-items: center; gap: 6px; order: 3; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .icon { width: 20px; height: 20px; }
.nav-toggle { display: none; }
.theme-dark-only { display: none; }
:root[data-theme="dark"] .theme-dark-only { display: block; }
:root[data-theme="dark"] .theme-light-only { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-only { display: block; }
  :root:not([data-theme="light"]) .theme-light-only { display: none; }
}

@media (max-width: 860px) {
  .nav-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-grid; }
  .nav-links {
    display: none; order: 4; width: 100%;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 0 10px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 12px; }
}

/* --- Layout -------------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { padding: 80px 0; }
.section-tight { padding: 40px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow {
  display: inline-block; font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 10px;
}
.section-title { margin-bottom: 12px; }
.section-subtitle { color: var(--muted); font-size: 1.08rem; max-width: 46rem; margin-bottom: 36px; }
.rule { width: 64px; height: 4px; border-radius: 4px; background: var(--gold); border: 0; margin: 0 0 22px; }

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px; border-radius: var(--r-chip);
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: #F7B24A; }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn .icon { width: 20px; height: 20px; }

/* "Coming soon to Google Play": a status, not a link */
.soon-badge {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 20px 8px 16px; border-radius: 14px;
  background: var(--navy-ink); color: #fff; border: 1px solid rgba(255, 255, 255, .25);
}
.soon-badge .icon { width: 26px; height: 26px; color: var(--gold); }
.soon-lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.soon-small { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.soon-big { font-size: 1.1rem; font-weight: 700; }

/* --- Hero (navy, like the app's chrome and its store graphic) ------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 80% at 78% 40%, rgba(244, 161, 37, .20), transparent 70%),
    linear-gradient(160deg, #1D2B4F 0%, var(--navy) 45%, var(--navy-ink) 100%);
  color: #F4F1EA;
}
.hero-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 72px 20px 80px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--gold); font-weight: 400; }
.hero .lede { font-size: 1.15rem; color: #DCE2EC; max-width: 36rem; margin-bottom: 28px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .85rem; font-weight: 600; color: var(--gold-soft);
  background: rgba(244, 161, 37, .12); border: 1px solid rgba(244, 161, 37, .35);
  padding: 6px 14px; border-radius: var(--r-chip); margin-bottom: 22px;
}
.hero-badge .icon { width: 16px; height: 16px; color: var(--gold); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero .btn-ghost { color: #fff; }
.hero-note { margin: 22px 0 0; font-size: .92rem; color: #B9C2D2; }
.hero-art { position: relative; justify-self: center; }
.hero-art .icon-big {
  width: min(320px, 70vw); border-radius: 22%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(244, 161, 37, .25);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 56px; gap: 32px; }
  .hero-art { order: -1; justify-self: start; }
  .hero-art .icon-big { width: 112px; border-radius: 24px; }
}

/* --- Stats ------------------------------------------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile);
  padding: 22px 20px; box-shadow: var(--shadow);
}
.stat-number { font-family: var(--serif); font-weight: 700; font-size: 2rem; line-height: 1.1; color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.stat-label { color: var(--muted); font-size: .95rem; margin-top: 6px; }
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* --- Feature cards ------------------------------------------------------------ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.feature-card h3 { margin: 14px 0 10px; }
.feature-card p { color: var(--muted); margin: 0; }
.feature-card ul { color: var(--muted); margin: 0; padding-left: 1.1em; }
.feature-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--badge-bg); color: var(--badge-ink);
}
.feature-icon .icon { width: 24px; height: 24px; }

/* --- Screenshots: a strip that scrolls on its own, never the page ------------ */
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 250px); gap: 18px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 6px 20px 22px; margin: 0 -20px;
  scrollbar-color: var(--gold) transparent;
}
.shots figure { margin: 0; scroll-snap-align: start; }
.shots img { width: 100%; aspect-ratio: 9 / 16; border-radius: 18px; box-shadow: var(--shadow-lift); border: 1px solid var(--border); background: var(--navy); }
.shots figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; }
.shots:focus-visible { outline-offset: -3px; }

/* --- Split panels (open data, translation) ---------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 28px 26px; box-shadow: var(--shadow);
}
.panel h3 { display: flex; align-items: center; gap: 10px; }
.panel h3 .icon { color: var(--eyebrow); }
.panel p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

.caveats { columns: 2 280px; column-gap: 32px; color: var(--muted); padding-left: 1.2em; margin: 0; }
.caveats li { break-inside: avoid; }

/* --- CTA band ---------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-ink) 100%);
  color: #F4F1EA; text-align: center; padding: 64px 20px;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #DCE2EC; max-width: 38rem; margin: 0 auto 26px; }
.cta-band .hero-actions { justify-content: center; }
.cta-band .btn-ghost { color: #fff; }

/* --- Link cards --------------------------------------------------------------- */
.link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.link-card {
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 24px; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease;
}
.link-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.link-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.link-card h3 .icon { color: var(--eyebrow); }
.link-card p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .link-grid { grid-template-columns: 1fr; } }

/* --- Document pages (Help, FAQ, Privacy) ----------------------------------- */
.prose-wrap { max-width: 860px; margin: 0 auto; padding: 48px 20px 80px; }
.page-head { margin-bottom: 28px; }
.page-head .subtitle { color: var(--muted); font-size: 1.1rem; margin: 0; }
.last-updated { color: var(--muted); font-size: .92rem; }

.callout {
  border-radius: var(--r-tile); padding: 18px 20px; margin: 0 0 28px;
  background: var(--badge-bg); color: var(--ink); border: 1px solid var(--border);
  border-left: 5px solid var(--gold);
}
.callout p:last-child { margin-bottom: 0; }

.toc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile);
  padding: 18px 22px; margin-bottom: 36px; box-shadow: var(--shadow);
}
.toc h2 { font-size: 1.1rem; margin-bottom: 8px; }
.toc ol, .toc ul { margin: 0; columns: 2 220px; column-gap: 28px; }
.toc li { break-inside: avoid; }

.section-block { padding-top: 12px; margin-bottom: 30px; }
.section-block h2 { font-size: 1.55rem; display: flex; align-items: center; gap: 12px; }
.section-block h2 .feature-icon { width: 40px; height: 40px; border-radius: 12px; }
.section-block h2 .feature-icon .icon { width: 20px; height: 20px; }
.section-block h3 { font-size: 1.12rem; margin-top: 1.2em; }
.section-block dl { margin: 0 0 1em; }
.section-block dt { font-weight: 700; margin-top: .8em; }
.section-block dd { margin: .2em 0 0; color: var(--ink); }
.ui {
  font-weight: 600; white-space: normal;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0 .4em; border-radius: 6px; font-size: .95em;
}
.tip { color: var(--muted); font-size: .95rem; }

/* FAQ */
.faq-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.search-field { position: relative; flex: 1 1 260px; }
.search-field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-field input {
  width: 100%; min-height: 48px; padding: 10px 14px 10px 42px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-chip);
}
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.chip {
  min-height: 48px; padding: 8px 18px; border-radius: var(--r-chip);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.faq-count { color: var(--muted); font-size: .92rem; min-height: 1.5em; margin: 6px 0 18px; }
.faq-category { margin-bottom: 30px; }
.faq-category-title { font-size: 1.35rem; margin-bottom: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-tile);
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 52px 16px 20px; position: relative;
  font-weight: 700; border-radius: var(--r-tile);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--eyebrow); border-bottom: 2px solid var(--eyebrow);
  transform: rotate(45deg); transition: transform .16s ease;
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-item .answer { padding: 0 20px 16px; color: var(--ink); }
.faq-item .answer p:last-child { margin-bottom: 0; }
.faq-empty { color: var(--muted); }

/* --- Footer ------------------------------------------------------------------ */
.footer { background: var(--navy-ink); color: #C9D1DE; padding: 56px 20px 28px; }
.footer a { color: #F4F1EA; }
.footer-grid {
  max-width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px;
}
.footer .nav-brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { max-width: 26rem; margin: 0; }
.footer h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin: 8px 0; }
.footer-bottom {
  max-width: var(--wrap); margin: 36px auto 0; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .9rem;
}
.footer :focus-visible, .hero :focus-visible, .cta-band :focus-visible { outline-color: var(--gold); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- Back to top -------------------------------------------------------------- */
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--gold); color: var(--navy-deep); box-shadow: var(--shadow-lift);
  display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top .icon { width: 22px; height: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 620px) {
  .section { padding: 56px 0; }
  .prose-wrap { padding: 32px 16px 64px; }
  .wrap { padding: 0 16px; }
  .nav-inner { padding: 10px 16px; }
  .shots { margin: 0 -16px; padding: 6px 16px 22px; grid-auto-columns: 72%; }
  .stat-number { font-size: 1.6rem; }
}
