/* The Sanatan — website styles.
   Palette from the app's PanchangPalette (Views/Panchang/PanchangTheme.swift): warm ivory
   and ink by day, night indigo and gold by night; the Panchang follows the theme too. Type colours are the app's
   ContentType.chartColor ramp. System fonts only, so the site loads nothing from third parties. */

:root {
  color-scheme: light;
  --ground: #FBF8F2;
  --panel: #FFFFFF;
  --ink: #201B13;
  --muted: #6F685A;
  --line: #EAE2D2;
  --vow: #F5EFE2;
  --gold: #BF7D1E;
  --gold-ink: #94590C;          /* gold dark enough for small text on ivory */
  --saffron-1: #F8D660;         /* the app icon's ring, top */
  --saffron-2: #F26B1D;         /* the app icon's ring, bottom */
  --on-saffron: #201B13;
  --shadow: 0 1px 2px rgba(32, 27, 19, .05), 0 8px 24px rgba(32, 27, 19, .06);

  /* Panchang: the app's PanchangPalette light values (dark ones below). */
  --pc-band: #FBF8F2;
  --pc-card: #FFFFFF;
  --pc-panel: #FFFFFF;
  --pc-ink: #201B13;
  --pc-muted: #7C7566;
  --pc-line: #EAE2D2;
  --pc-gold: #94590C;           /* PanchangPalette gold #BF7D1E, darkened for small text on white */
  --pc-good: #1F7A55;
  --pc-avoid: #B4472E;

  --story: #2a78d6;
  --verse: #008300;
  --prayer: #eb6834;
  --quote: #e87ba4;
  --snippet: #1baf7a;
  --article: #eda100;
  --quiz: #4a3aa7;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Noto Serif", "Noto Serif Devanagari", Georgia, serif;

  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

/* Dark: chosen in the header switch, or System on a dark device. Keep the two blocks identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0C1024;
  --panel: #141A38;
  --ink: #E9E3F2;
  --muted: #A3ACD6;
  --line: #2A3157;
  --vow: #18203E;
  --gold: #E8C36B;
  --gold-ink: #E8C36B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --pc-band: #060817;     /* a step darker than the dark page, so the band still reads as night */
  --pc-card: #0C1024;
  --pc-panel: #18203E;
  --pc-ink: #E9E3F2;
  --pc-muted: #8B95C4;
  --pc-line: #2A3157;
  --pc-gold: #E8C36B;
  --pc-good: #7FD6A8;
  --pc-avoid: #E58F7A;
  --story: #3987e5;
  --quiz: #9085e9;
  --prayer: #d95926;
  --quote: #d55181;
  --snippet: #199e70;
  --article: #c98500;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0C1024;
    --panel: #141A38;
    --ink: #E9E3F2;
    --muted: #A3ACD6;
    --line: #2A3157;
    --vow: #18203E;
    --gold: #E8C36B;
    --gold-ink: #E8C36B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --pc-band: #060817;     /* a step darker than the dark page, so the band still reads as night */
    --pc-card: #0C1024;
    --pc-panel: #18203E;
    --pc-ink: #E9E3F2;
    --pc-muted: #8B95C4;
    --pc-line: #2A3157;
    --pc-gold: #E8C36B;
    --pc-good: #7FD6A8;
    --pc-avoid: #E58F7A;
    --story: #3987e5;
    --quiz: #9085e9;
    --prayer: #d95926;
    --quote: #d55181;
    --snippet: #199e70;
    --article: #c98500;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 50; background: var(--panel); padding: 8px 12px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; order: 1; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--vow); }
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; margin-left: 8px; order: 2; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--vow); color: var(--ink); }
.theme-switch svg { width: 16px; height: 16px; }
.site-header .brand + .theme-switch:last-child { margin-left: auto; }   /* pages with no nav */
.nav-toggle { display: none; background: none; border: 0; color: var(--ink); width: 44px; height: 44px; border-radius: 10px; cursor: pointer; font-size: 1.5rem; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .theme-switch { margin-left: auto; order: 0; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 8px; border-radius: 10px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-saffron { background: linear-gradient(160deg, var(--saffron-1), var(--saffron-2)); color: var(--on-saffron); box-shadow: 0 6px 18px rgba(242, 107, 29, .28); }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-store { background: var(--ink); color: var(--ground); padding: 0 20px 0 16px; min-height: 54px; border-radius: 14px; text-align: left; }
.btn-store svg { width: 24px; height: 24px; flex: none; }
.btn-store span { display: flex; flex-direction: column; gap: 3px; }
.btn-store small { font-size: .68rem; font-weight: 500; opacity: .75; letter-spacing: .02em; }
.btn-store b { font-size: 1.05rem; font-weight: 600; }
.btn.is-soon { pointer-events: none; opacity: .55; }
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-note { color: var(--muted); font-size: .9rem; margin-top: 14px; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 88px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -20% auto auto; width: 70vw; max-width: 760px; aspect-ratio: 1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--saffron-1) 38%, transparent), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); margin-bottom: 20px; }
.hero h1 em { font-style: normal; background: linear-gradient(160deg, #E9A23B, var(--saffron-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.1rem, 2vw, 1.28rem); color: var(--muted); max-width: 34em; margin-bottom: 30px; }
.lang-note { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; color: var(--muted); font-size: .92rem; margin-top: 20px; }
.lang-note small { flex-basis: 100%; font-size: .85rem; }
.lang-note b { font-family: var(--serif); color: var(--ink); font-weight: 600; }

/* phone mock-up: the feed, drawn in HTML */
.phone {
  width: min(320px, 100%); margin: 0 auto; aspect-ratio: 9 / 18.5; border-radius: 44px; padding: 12px;
  background: linear-gradient(160deg, #2a2620, #0e0c09); box-shadow: 0 30px 60px rgba(32, 27, 19, .25), inset 0 0 0 1.5px #3b352c;
}
.screen { height: 100%; border-radius: 34px; background: var(--ground); overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px 14px; }
.screen-top { display: flex; justify-content: space-between; align-items: center; font: 600 1.15rem var(--serif); padding: 4px 4px 2px; }
.screen-top span { font: 600 .7rem var(--sans); color: var(--gold-ink); background: var(--vow); padding: 5px 9px; border-radius: 999px; }
.mini-panchang { background: var(--pc-card); border: 1px solid var(--pc-line); color: var(--pc-ink); border-radius: 16px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.mini-panchang b { display: block; font: 600 .95rem var(--serif); color: var(--pc-gold); }
.mini-panchang small { font-size: .68rem; color: var(--pc-muted); }
.mini-panchang i { font-style: normal; font-size: 1.4rem; }
.mini-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.mini-card .type { display: inline-flex; align-items: center; gap: 6px; font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.mini-card .type::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.mini-card h4 { font: 600 .92rem/1.3 var(--serif); margin: 6px 0 4px; }
.mini-card p { font-size: .72rem; line-height: 1.45; color: var(--muted); margin: 0; }
.screen-tabs { margin-top: auto; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 10px 4px 2px; font-size: .62rem; font-weight: 600; color: var(--muted); }
.screen-tabs .on { color: var(--gold-ink); }
.mini-card .deva { font-family: var(--serif); color: var(--ink); font-size: .85rem; line-height: 1.5; }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-head { max-width: 640px; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }
.alt { background: var(--vow); }

.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.type-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 20px; box-shadow: var(--shadow); overflow: hidden; }
.type-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c); }
.type-card .deva { font-family: var(--serif); font-size: 1.5rem; color: var(--c); line-height: 1.2; }
.type-card h3 { font-size: 1.15rem; margin: 8px 0 6px; }
.type-card p { color: var(--muted); font-size: .96rem; margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--vow); margin-bottom: 16px; }
.feature h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature p { color: var(--muted); margin: 0; }

/* Panchang band */
.panchang-band {
  background: radial-gradient(60% 80% at 85% 10%, rgba(232, 195, 107, .14), transparent 70%), var(--pc-band);
  color: var(--pc-ink); border-block: 1px solid var(--pc-line);
}
.panchang-band .section-head p { color: var(--pc-muted); }
.panchang-band .eyebrow { color: var(--pc-gold); }
.panchang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 64px); align-items: center; }
.panchang-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.panchang-list li { display: flex; gap: 12px; }
.panchang-list li::before { content: "◆"; color: var(--pc-gold); font-size: .7rem; margin-top: .45em; }
.panchang-sample { margin: 0; }
.panchang-sample figcaption { margin-top: 12px; font-size: .85rem; color: var(--pc-muted); text-align: center; }
.panchang-card { background: var(--pc-panel); border: 1px solid var(--pc-line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.panchang-card .date { font-size: .8rem; color: var(--pc-muted); letter-spacing: .06em; text-transform: uppercase; }
.panchang-card .tithi { font: 600 1.7rem var(--serif); color: var(--pc-gold); margin: 6px 0 2px; }
.panchang-card .masa { color: var(--pc-muted); font-size: .95rem; margin-bottom: 18px; }
.limbs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--pc-line); border-radius: 12px; overflow: hidden; }
.limbs div { background: var(--pc-panel); padding: 12px 14px; }
.limbs small { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--pc-muted); }
.limbs b { font-weight: 600; font-size: .98rem; }
.limbs .good b { color: var(--pc-good); }
.limbs .avoid b { color: var(--pc-avoid); }

.promise { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 18px; }
.promise div { border-top: 2px solid var(--gold); padding-top: 16px; }
.promise h3 { font-size: 1.1rem; margin-bottom: 6px; }
.promise p { color: var(--muted); font-size: .96rem; margin: 0; }

.cta { text-align: center; }
.cta .section-head { margin-left: auto; margin-right: auto; }
.cta .store-row { justify-content: center; }
.cta img { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 24px; box-shadow: var(--shadow); }

@media (max-width: 860px) {
  .hero .wrap, .panchang-grid { grid-template-columns: 1fr; }
  .hero-visual { order: 2; }
}

/* ---------- legal pages ---------- */
.legal-hero { padding: clamp(40px, 7vw, 72px) 0 28px; border-bottom: 1px solid var(--line); }
.legal-hero h1 { font-size: clamp(2.1rem, 5vw, 3rem); margin-bottom: 10px; }
.legal-hero p { color: var(--muted); margin: 0; max-width: 46em; }
.legal-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); padding: 40px 0 96px; }
.toc { position: sticky; top: 88px; align-self: start; font-size: .9rem; }
.toc p { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); background: var(--vow); }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.55rem; margin: 2.4em 0 .7em; scroll-margin-top: 88px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 650; margin: 1.6em 0 .5em; letter-spacing: 0; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 0 0 1.2em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.summary { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 2em; box-shadow: var(--shadow); }
.summary h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.summary ul { margin: 0; }
.caps { text-transform: uppercase; font-size: .95rem; letter-spacing: .01em; }

@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; }
  .toc { position: static; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
}

/* ---------- small pages (404, email verified) ---------- */
.notice { min-height: calc(100vh - 64px - 140px); display: grid; place-items: center; text-align: center; padding: 56px var(--gutter); }
.notice-inner { max-width: 26rem; }
.notice img { width: 80px; height: 80px; border-radius: 20px; margin: 0 auto 24px; box-shadow: var(--shadow); }
.notice h1 { font-size: 2rem; margin-bottom: 12px; }
.notice p { color: var(--muted); margin-bottom: 28px; }
.notice .actions { display: grid; gap: 12px; }
.notice .mobile-only { display: none; }
@media (max-width: 720px) { .notice .mobile-only { display: grid; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- mobile "get the app" banner ---------- */
.app-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30; display: none;
  align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(32, 27, 19, .18);
}
.app-banner.visible { display: flex; }
.app-banner.hidden { display: none; }
.app-banner img { width: 40px; height: 40px; border-radius: 10px; }
.app-banner p { margin: 0; flex: 1; font-weight: 600; font-size: .95rem; line-height: 1.25; }
.app-banner p small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.app-banner .btn { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.app-banner button.close { background: none; border: 0; color: var(--muted); font-size: 1.4rem; width: 36px; height: 36px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
