/* Prarthana — shared styles for the landing page and the web app.
   Mobile-first; breakpoints at 640 / 900 / 1140. Palette mirrors the mobile app. */

:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-alt: #f3ece1;
  --border: #e5dacaa8;
  --border-solid: #e5daca;
  --text: #241e1a;
  --muted: #7a6e63;
  --accent: #6b2737;
  --accent-soft: #f5e7ea;
  --gold: #b98a2e;
  --success: #2f7a55;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(36, 30, 26, .04), 0 8px 24px rgba(36, 30, 26, .06);
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1140px;
  --ml-lh: 1.95;
}

[data-theme="dark"] {
  --bg: #14100e;
  --surface: #1e1815;
  --surface-alt: #282018;
  --border: #382e26;
  --border-solid: #382e26;
  --text: #f2eae0;
  --muted: #a29485;
  --accent: #c4707f;
  --accent-soft: #33222a;
  --gold: #d9ae55;
  --success: #63b58c;
  --on-accent: #1a1310;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100e; --surface: #1e1815; --surface-alt: #282018;
    --border: #382e26; --border-solid: #382e26;
    --text: #f2eae0; --muted: #a29485; --accent: #c4707f;
    --accent-soft: #33222a; --gold: #d9ae55; --success: #63b58c;
    --on-accent: #1a1310;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Malayalam glyphs are tall — they need noticeably more leading than Latin. */
.ml, [lang="ml"] { line-height: var(--ml-lh); }

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 14px;
  min-height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span { font-size: 17px; letter-spacing: -.01em; }
.spacer { flex: 1; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--muted); font-size: 14.5px; font-weight: 600;
  padding: 8px 11px; border-radius: 999px;
}
.nav a:hover, .nav a.on { color: var(--text); background: var(--surface-alt); text-decoration: none; }
@media (max-width: 700px) { .nav .hide-sm { display: none; } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; background: var(--accent);
  color: var(--on-accent); transition: transform .08s ease, opacity .15s ease;
  font-family: inherit; text-align: center;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-solid); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-solid); }
.btn.sm { padding: 8px 15px; font-size: 14px; }
.btn.block { width: 100%; }

.seg { display: inline-flex; background: var(--surface-alt); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font: 600 13.5px/1 inherit; padding: 8px 13px; border-radius: 999px;
  font-family: inherit;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card.alt { background: var(--surface-alt); box-shadow: none; }
.card.accent { background: var(--accent-soft); border-color: transparent; box-shadow: none; }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 10px;
}
.muted { color: var(--muted); }
.tiny { font-size: 13.5px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); }
h2 { font-size: clamp(1.45rem, 3.2vw, 2.05rem); }
h3 { font-size: 1.12rem; letter-spacing: -.01em; }

/* -------------------------------------------------------------------- hero */
.hero { padding: clamp(48px, 9vw, 104px) 0 clamp(36px, 6vw, 72px); }
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 64px; } }
.hero p.lede { font-size: clamp(1.02rem, 1.9vw, 1.2rem); color: var(--muted); margin: 0 0 28px; max-width: 34em; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .note { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}

/* Bilingual prayer sample shown in the hero. */
.sample { padding: 26px; }
.sample .ml { font-size: 17.5px; margin: 0 0 16px; }
.sample .en { color: var(--muted); font-size: 15px; margin: 0; }
.sample hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ------------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 30px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; padding: 18px 10px; }
.stat b { display: block; font-size: 1.7rem; color: var(--gold); letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- sections */
section.band { padding: clamp(44px, 7vw, 88px) 0; }
section.band.tint { background: var(--surface-alt); }
.section-head { max-width: 42em; margin-bottom: 34px; }
.section-head p { color: var(--muted); margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr; }
.grid.three { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } }
@media (min-width: 700px) { .grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

.feature h3 { margin-bottom: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }
.feature .ico { font-size: 26px; margin-bottom: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border-solid);
  border-radius: 999px; padding: 9px 15px; font-size: 14.5px; font-weight: 600;
  color: var(--text); cursor: pointer; font-family: inherit; line-height: 1.35;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip[aria-pressed="true"], .chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--border); padding: 44px 0 60px; margin-top: 20px; }
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.site-footer a { color: var(--text); font-size: 14.5px; }
.legal { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

/* ==================================================================== app */
.app-shell { display: grid; gap: 0; min-height: calc(100vh - 62px); }
@media (min-width: 900px) { .app-shell { grid-template-columns: 288px 1fr; } }

.sidebar {
  border-right: 1px solid var(--border); padding: 22px 18px 40px;
  background: var(--surface-alt);
}
@media (min-width: 900px) { .sidebar { position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; } }
.sidebar h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 9px; }
.sidebar h4:first-child { margin-top: 0; }
.side-link {
  display: block; padding: 9px 12px; border-radius: 10px;
  color: var(--text); font-size: 14.5px; font-weight: 600;
}
.side-link:hover { background: var(--surface); text-decoration: none; }
.side-link.on { background: var(--accent); color: var(--on-accent); }
.side-link .n { float: right; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.side-link.on .n { color: var(--on-accent); opacity: .75; }

.content { padding: 26px 20px 72px; max-width: 860px; }
@media (min-width: 900px) { .content { padding: 34px 40px 96px; } }

.search {
  width: 100%; padding: 13px 18px; border-radius: 999px; font-size: 15.5px;
  border: 1px solid var(--border-solid); background: var(--surface);
  color: var(--text); font-family: inherit; margin-bottom: 20px;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.list { display: grid; gap: 9px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 18px; color: var(--text); cursor: pointer;
  text-align: left; width: 100%; font-family: inherit; font-size: inherit;
}
.row:hover { border-color: var(--accent); text-decoration: none; }
.row .t { font-weight: 600; font-size: 15.5px; }
.row .s { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.row .chev { color: var(--muted); flex: none; }

.prayer-body { font-size: 17px; }
.prayer-body p { margin: 0 0 1.05em; white-space: pre-wrap; }
.prayer-body .ml-block p { font-size: 17.5px; line-height: var(--ml-lh); }
.prayer-body .en-block { color: var(--muted); }
.prayer-body hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.rubric { background: var(--surface-alt); border-radius: var(--radius); padding: 14px 18px; font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.rubric p { margin: 0 0 .5em; }
.rubric p:last-child { margin: 0; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 18px; background: none; border: 0; cursor: pointer; padding: 0; font-family: inherit; }
.back:hover { color: var(--accent); }

.steps { display: grid; gap: 0; }
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.step:first-child { border-top: 0; }
.step .num { color: var(--gold); font-weight: 700; font-size: 13.5px; width: 20px; flex: none; padding-top: 2px; }

.dots { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.dot {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-solid);
  background: transparent; color: var(--muted); font: 600 12px/1 inherit; cursor: pointer;
  display: grid; place-items: center; font-family: inherit;
}
.dot.done { background: var(--gold); border-color: var(--gold); color: var(--on-accent); }

.bar { height: 8px; border-radius: 4px; background: var(--surface-alt); overflow: hidden; margin: 14px 0; }
.bar i { display: block; height: 100%; background: var(--gold); }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

.verse-quote { font-size: 18px; margin: 0 0 14px; }
.verse-ref { color: var(--accent); font-weight: 600; font-size: 14px; }

.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--accent);
  color: var(--on-accent); padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

@media print {
  .site-header, .sidebar, .site-footer, .btn, .seg { display: none !important; }
  body { background: #fff; color: #000; }
}
