/* AskVeda — askveda.org
   Design tokens mirror the app exactly (constants/theme.ts):
   three themes (Manuscript dark / Parchment light / Twilight dusk),
   Space Grotesk for display, Outfit for body, Space Mono for eyebrows. */

/* ---------- Theme tokens (constants/theme.ts) ---------- */
:root,
:root[data-theme='dark'] {
  --bg: #0A0E2A;
  --surface: #131838;
  --elevated: #1C2348;
  --border: rgba(212, 175, 95, 0.16);
  --border-hi: rgba(212, 175, 95, 0.38);
  --fg: #EDE6D0;
  --secondary: #9A9ABA;
  --tertiary: #4A4D70;
  --accent: #E8A24C;
  --accent-low: rgba(232, 162, 76, 0.14);
  --accent-fg: #fff;
  --sun: #F5C86A; --moon: #D8E2F5; --mars: #E86A42; --mercury: #7ADCB6;
  --jupiter: #F0C070; --venus: #F4B8C8; --saturn: #8798C0;
  --rahu: #A88CD0; --ketu: #C89A70;
  --body-grad: var(--bg);
}

:root[data-theme='light'] {
  --bg: #F7F0DE;
  --surface: #F0E5CB;
  --elevated: #E8DAB4;
  --border: rgba(110, 30, 30, 0.12);
  --border-hi: rgba(178, 34, 52, 0.40);
  --fg: #2A1010;
  --secondary: #6A3030;
  --tertiary: #A48A60;
  --accent: #B22234;
  --accent-low: rgba(178, 34, 52, 0.10);
  --accent-fg: #fff;
  --sun: #B8860B; --moon: #5A4A70; --mars: #A8351A; --mercury: #3F7A5E;
  --jupiter: #8A6220; --venus: #A8486A; --saturn: #4A4560;
  --rahu: #6A3A70; --ketu: #8A5A2A;
  --body-grad: var(--bg);
}

:root[data-theme='twilight'] {
  --bg: #1A1430;
  --surface: #2C1F39;
  --elevated: #3A2945;
  --border: rgba(232, 165, 115, 0.15);
  --border-hi: rgba(232, 165, 115, 0.40);
  --fg: #F2E8E0;
  --secondary: #A89BB0;
  --tertiary: #6F607A;
  --accent: #E89560;
  --accent-low: rgba(232, 149, 96, 0.14);
  --accent-fg: #fff;
  --sun: #F0B068; --moon: #C8B8E0; --mars: #E87850; --mercury: #8ACFB0;
  --jupiter: #E8B878; --venus: #F0C0C8; --saturn: #9AA0C0;
  --rahu: #B090D8; --ketu: #C89A70;
  /* TWILIGHT_GRAD from the app's ScreenBackground */
  --body-grad: linear-gradient(180deg, #1A1430 0%, #2B1F3D 36%, #4A2E42 70%, #6B3A38 100%);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--body-grad);
  background-attachment: fixed;
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
}

::selection { background: var(--accent-low); }

h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Mono eyebrow — the app's section-label idiom */
.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--secondary);
}

.eyebrow.accent { color: var(--accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  max-width: 1080px;
  margin: 0 auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.wordmark svg { width: 18px; height: 18px; flex: none; }

/* Brand lockup — mirrors the homepage nav (assets/shared.css) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.5px;
  color: var(--fg);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; color: var(--accent); }
.brand svg { width: 22px; height: 22px; flex: none; }

.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--secondary); font-size: 14px; }
.nav-links a:hover { color: var(--fg); text-decoration: none; }

/* ---------- Theme switcher (mirrors the app's ThemeSwitcher) ---------- */
.theme-switch { display: flex; gap: 6px; }

.theme-btn {
  width: 30px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 0;
}
.theme-btn[aria-pressed='true'] { border: 2px solid var(--accent); }
.theme-btn .dot {
  position: absolute; top: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 3px;
}
.theme-btn .strip {
  position: absolute; bottom: 3px; left: 3px; right: 3px;
  height: 6px; border-radius: 2px;
}
.theme-btn.t-dark { background: #0A0E2A; }
.theme-btn.t-dark .dot { background: #E8A24C; }
.theme-btn.t-dark .strip { background: #131838; }
.theme-btn.t-light { background: #F7F0DE; }
.theme-btn.t-light .dot { background: #B22234; }
.theme-btn.t-light .strip { background: #F0E5CB; }
.theme-btn.t-twilight { background: #1A1430; }
.theme-btn.t-twilight .dot { background: #E89560; }
.theme-btn.t-twilight .strip { background: #2C1F39; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.07); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent-low); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0 64px;
}

.hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.12;
  margin: 14px 0 18px;
}
.hero h1 .accent { color: var(--accent); }

.hero .lede {
  font-size: 17px;
  color: var(--secondary);
  max-width: 460px;
  margin-bottom: 28px;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.hero-note {
  margin-top: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--tertiary);
}

/* ---------- Phone mockup ---------- */
.phone {
  width: min(340px, 86vw);
  margin: 0 auto;
  border-radius: 36px;
  border: 1px solid var(--border-hi);
  background: var(--bg);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.phone-top {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.phone-top .glyph { font-size: 17px; color: var(--venus); }
.phone-top .title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 15px;
}
.phone-top .thread {
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 1px;
  color: var(--accent);
}

.phone-chat { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 380px; }

.bubble {
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 88%;
  opacity: 0;
  transform: translateY(8px);
  animation: bubble-in 0.45s ease forwards;
}
.bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-fg);
  border-bottom-right-radius: 4px;
}
.bubble.model {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble.evidence {
  align-self: flex-start;
  background: var(--accent-low);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
}
.bubble.evidence .factor {
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.bubble.window {
  align-self: flex-start;
  background: var(--surface);
  border: 1px dashed var(--border-hi);
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
}
.bubble.window .span {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 1px;
  color: var(--jupiter);
  margin-bottom: 3px;
}
.bubble.question {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--secondary);
  font-style: italic;
}
.bubble .report {
  display: block;
  margin-top: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--tertiary);
}

@keyframes bubble-in { to { opacity: 1; transform: translateY(0); } }

/* ---------- Sections ---------- */
section { padding: 64px 0; }

.section-head { max-width: 560px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 10px 0 12px; }
.section-head p { color: var(--secondary); font-size: 16px; }

/* How it works steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.step .num {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 2px;
  color: var(--accent);
}
.step h3 { font-size: 18px; margin: 10px 0 8px; }
.step p { font-size: 14px; color: var(--secondary); }

/* Topic tiles — mirrors the home screen's six life-category tiles */
.topics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.topic:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.topic .glyph { font-size: 22px; }
.topic h3 { font-size: 16px; margin: 8px 0 4px; }
.topic p { font-size: 13px; color: var(--secondary); }
.topic .ask {
  display: block;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
}

/* Chart + engine section */
.engine { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: center; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-card .caption {
  margin-top: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--tertiary);
  text-align: center;
}

.engine-list { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.engine-list li {
  display: flex; gap: 12px; align-items: baseline;
  font-size: 15px; color: var(--secondary);
}
.engine-list li::before { content: '✦'; color: var(--accent); font-size: 12px; }
.engine-list b { color: var(--fg); font-weight: 600; }

/* Dasha strip */
.dasha-strip {
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 28px;
}
.dasha-seg {
  padding: 12px 0 10px;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--bg);
  opacity: 0.92;
}
.dasha-seg small { display: block; font-size: 8px; opacity: 0.8; }

/* Safety */
.safety { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.safety .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.safety .card h3 { font-size: 16px; margin-bottom: 6px; }
.safety .card p { font-size: 13.5px; color: var(--secondary); }

/* CTA band */
.cta-band {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  padding: 56px 28px;
}
.cta-band h2 { font-size: clamp(24px, 3vw, 32px); margin: 10px 0 18px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 48px;
  margin-top: 48px;
}
.foot-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { color: var(--secondary); font-size: 13.5px; }
.disclaimer {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--tertiary);
  max-width: 640px;
  line-height: 1.55;
}

/* ---------- Legal pages ---------- */
.legal { max-width: 720px; margin: 0 auto; padding: 48px 24px 72px; }
.legal h1 { font-size: 30px; margin: 8px 0 6px; }
.legal h2 { font-size: 19px; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--secondary); font-size: 15px; }
.legal b { color: var(--fg); }
.legal ul, .legal ol { padding-left: 22px; margin: 8px 0; }
.legal li { margin: 5px 0; }
.legal .updated {
  font-family: 'Space Mono', monospace;
  font-size: 11px; letter-spacing: 1px;
  color: var(--tertiary);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 44px; gap: 40px; }
  .engine { grid-template-columns: 1fr; }
  .steps, .topics, .safety { grid-template-columns: 1fr; }
  .nav-links a.hide-sm { display: none; }
}
