/* Daily Expense Diary website — shared stylesheet.
   Colour tokens mirror src/constants/theme.ts (Material 3 "Rose"). */

:root {
  --bg: #fffbff;
  --surface: #ffffff;
  --surface-2: #fff0f4;
  --text: #201a1c;
  --muted: #5f5559;
  --primary: #b4266a;
  --on-primary: #ffffff;
  --container: #ffd9e3;
  --on-container: #3e001e;
  --border: #e8d8de;
  --ring: #b4266a;
  --shadow: 0 1px 2px rgb(32 26 28 / 6%), 0 8px 24px rgb(32 26 28 / 8%);
  --radius: 20px;
  --maxw: 1120px;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari",
    "Noto Sans Gujarati", "Nirmala UI", "Mukta", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #201a1c;
    --surface: #2b2326;
    --surface-2: #352a2f;
    --text: #ebe0e2;
    --muted: #cfc3c7;
    --primary: #ffb0cb;
    --on-primary: #5e1137;
    --container: #7a1f4e;
    --on-container: #ffd9e3;
    --border: #4d4044;
    --ring: #ffb0cb;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 28%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #201a1c;
  --surface: #2b2326;
  --surface-2: #352a2f;
  --text: #ebe0e2;
  --muted: #cfc3c7;
  --primary: #ffb0cb;
  --on-primary: #5e1137;
  --container: #7a1f4e;
  --on-container: #ffd9e3;
  --border: #4d4044;
  --ring: #ffb0cb;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 28%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

html[lang="hi"] body, html[lang="mr"] body { line-height: 1.75; }
html[lang="gu"] body { line-height: 1.8; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--on-primary);
  padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.ic { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.05rem; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.menu-btn, .theme-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.menu-btn { display: none; }
.js .menu-btn { display: inline-grid; }
.site-nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; width: 100%; order: 3; padding-bottom: 10px; }
.js .site-nav { display: none; }
.js .site-nav.open { display: flex; }
.site-nav a.nav-link { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 500; }
.site-nav a.nav-link:hover { background: var(--surface-2); }
.site-nav a.nav-link[aria-current="page"] { color: var(--primary); background: var(--surface-2); }
.langs { display: flex; gap: 4px; margin-left: auto; }
.langs a { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); color: var(--text);
  text-decoration: none; font-size: .9rem; line-height: 1.4; }
.langs a[aria-current="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

@media (min-width: 900px) {
  .site-nav, .js .site-nav { display: flex; width: auto; order: 0; padding: 0; margin-right: 8px; }
  .js .menu-btn, .menu-btn { display: none; }
  .langs { margin-left: 0; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 8px; }
.lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 48px; background:
  radial-gradient(1200px 400px at 85% -10%, var(--container), transparent 70%); }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.4rem); margin-bottom: .4em; }
.hero h1 em { font-style: normal; color: var(--primary); }
.pills { list-style: none; padding: 0; margin: 20px 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.pills li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.pills .ic { color: var(--primary); width: 1.1em; height: 1.1em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { display: flex; gap: 14px; justify-content: center; }
.hero-art img { width: min(46%, 260px); border-radius: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.hero-art img:nth-child(2) { margin-top: 36px; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .hero { padding: 72px 0; }
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); }
.card h3 { font-size: 1.1rem; margin: 12px 0 6px; }
.card p { color: var(--muted); margin: 0; }
.card-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--container); color: var(--on-container); }
.card-icon .ic { width: 24px; height: 24px; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 10px; border-radius: 999px; background: var(--container); color: var(--on-container); vertical-align: middle; margin-left: 6px; }

/* ---------- Screenshots ---------- */
.shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px var(--gutter) 20px;
  margin: 0 calc(var(--gutter) * -1); }
.shots figure { margin: 0; flex: 0 0 min(72%, 270px); scroll-snap-align: center; }
.shots img { border-radius: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); width: 100%; }
.shots figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 10px; }
@media (min-width: 1000px) {
  .shots { overflow: visible; justify-content: center; margin: 0; padding: 4px 0; }
  .shots figure { flex: 1 1 0; }
}

/* ---------- Steps ---------- */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-weight: 700; margin-bottom: 12px; }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); }

/* ---------- Privacy promise / CTA ---------- */
.promise { display: grid; gap: 20px; background: var(--container); color: var(--on-container); border-radius: 28px; padding: 32px; }
.promise h2 { margin-bottom: 8px; }
.promise p { margin: 0 0 12px; }
.promise a { color: inherit; font-weight: 600; }
.promise .card-icon { background: var(--bg); color: var(--primary); }
@media (min-width: 760px) { .promise { grid-template-columns: auto 1fr; align-items: start; padding: 40px; } }
.cta { text-align: center; }
.cta .cta-row { justify-content: center; }

/* ---------- Features page ---------- */
.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.feature-group { margin-top: 44px; }
.feature-group > h2 { font-size: 1.3rem; padding-bottom: 8px; border-bottom: 2px solid var(--container); margin-bottom: 20px; }
.feature { scroll-margin-top: 90px; }
.feature ul { margin: 12px 0 0; padding-left: 1.2em; color: var(--muted); }
.feature li { margin-bottom: 4px; }
.chips { list-style: none; padding: 0 !important; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 12px; font-size: .88rem;
  color: var(--text); margin: 0 !important; }
.note { margin-top: 32px; background: var(--surface); border: 1px dashed var(--primary); border-radius: var(--radius); padding: 20px 22px; }
.note h3 { margin-bottom: 6px; }
.note ul { margin: 8px 0 0; padding-left: 1.2em; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; max-width: 800px; }
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 20px; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { color: var(--muted); }
details.faq p:last-child { margin-bottom: 18px; }

/* ---------- Contact ---------- */
.contact-card { max-width: 640px; }
.contact-card .btn { margin: 8px 0 4px; word-break: break-all; }
.tips { max-width: 640px; margin-top: 28px; }
.tips ul { padding-left: 1.2em; color: var(--muted); }

/* ---------- Legal / prose ---------- */
.prose { max-width: 760px; padding-bottom: 72px; }
.prose h2 { font-size: 1.35rem; margin-top: 2.2em; scroll-margin-top: 90px; color: var(--primary); }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: .96rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); }
.updated { color: var(--muted); font-size: .92rem; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; margin: 24px 0; }
.toc strong { display: block; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 1; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 32px; } }
.toc li { margin-bottom: 2px; break-inside: avoid; }
.contact-box { background: var(--container); color: var(--on-container); border-radius: 16px; padding: 16px 20px; }
.contact-box a { color: inherit; font-weight: 600; }
.lang-note { background: var(--surface-2); border-left: 4px solid var(--primary); padding: 10px 16px; border-radius: 8px; font-size: .92rem; color: var(--muted); margin: 16px 0; }

@media (max-width: 639px) {
  .prose table, .prose tbody, .prose tr, .prose td, .prose th { display: block; width: 100%; }
  .prose tr:first-child:has(th) { display: none; }
  .prose tr { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
  .prose td { border: 0; }
  .prose td:first-child { font-weight: 600; background: var(--surface-2); }
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 96px 0; }
.notfound h1 { font-size: clamp(2.4rem, 8vw, 4rem); color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--primary); text-decoration: underline; }
.footer-brand p { color: var(--muted); max-width: 32ch; margin-top: 10px; }
.copyright { margin: 32px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; }

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

@media print {
  .site-header, .site-footer, .skip, .toc { display: none; }
  body { background: #fff; color: #000; }
  .prose { max-width: none; }
  .prose h2 { color: #000; }
}
