/* Numerastra — Design System v2
   Palette: Deep indigo + antique gold + ivory
   Typography: Crimson Text (serif) + DM Sans (sans) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ivory);
  background: var(--indigo);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; transition: color .2s; }
input, select, textarea { font: inherit; color: inherit; background: transparent; border: none; outline: none; }

:root {
  /* ═══════════════════════════════════════════════════════════════
     NUMERASTRA PALETTE — Chandan Cream + Saffron + Gold
     Light, auspicious, readable. Based on Vedic tradition:
     chandan (sandalwood) bg, kumkum (vermilion-brown) text,
     swarna (gold) primary accent, kesariya (saffron) secondary.
     ═══════════════════════════════════════════════════════════════ */

  /* Background surfaces — chandan cream family (was dark indigo) */
  --indigo:     #F7F1E3;  /* chandan cream — main page bg */
  --indigo-2:   #FBF6E7;  /* lighter — hero card, panels */
  --indigo-3:   #EFE7D2;  /* deeper — raised panels, footer */

  /* Text — warm deep brown (was ivory on dark) */
  --ivory:        #2B2319;  /* kumkum brown — primary text */
  --ivory-dim:    #5C4E38;  /* secondary text */
  --ivory-dimmer: #8A7856;  /* tertiary / muted */

  /* Primary accent — swarna gold (slightly deeper for contrast on cream) */
  --gold:        #B8873A;
  --gold-bright: #D4A24A;
  --gold-deep:   #7A5A20;
  --gold-wash:   rgba(184,135,58,0.08);
  --gold-line:   rgba(184,135,58,0.22);

  /* Secondary accent — kesariya saffron (eyebrows, dividers, sparks) */
  --saffron:       #D97830;
  --saffron-bright:#F09045;
  --saffron-deep:  #A85018;
  --saffron-wash:  rgba(217,120,48,0.08);
  --saffron-line:  rgba(217,120,48,0.22);

  /* States — rebalanced for light bg */
  --success: #2D9D82;   /* haritaka — tender green */
  --warning: #C77A0F;   /* amber */
  --danger:  #B4332A;   /* kumkum red */

  /* Typography + spacing (unchanged) */
  --serif: 'Crimson Text', Georgia, serif;
  --sans:  'DM Sans', -apple-system, sans-serif;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --container: 1200px; --container-narrow: 720px; --container-reading: 680px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
  --t-fast: 120ms; --t-base: 220ms; --t-slow: 360ms;
  --ease: cubic-bezier(0.4,0,0.2,1);
  --z-nav: 50; --z-modal: 100;

  /* ── Compatibility aliases (older pages reference these) ─── */
  --ink:      #F7F1E3;   /* was dark — now matches main bg */
  --ink2:     #FBF6E7;   /* lighter card */
  --ink3:     #EFE7D2;   /* deeper panel */
  --text:     #2B2319;   /* text colour (was ivory on dark) */
  --muted:    #5C4E38;
  --muted-2:  #8A7856;
  --gold-l:   #D4A24A;
  --gold-d:   #7A5A20;
  --gold-faint: rgba(184,135,58,0.06);
  --border:   rgba(184,135,58,0.22);
  --border2:  rgba(184,135,58,0.45);
  --coral:    #B4332A;
  --teal:     #2D9D82;
}

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--s-5); }
.container-reading { width: 100%; max-width: var(--container-reading); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-9) 0; }
.section-tight { padding: var(--s-7) 0; }
@media (max-width: 720px) { .section { padding: var(--s-7) 0; } .section-tight { padding: var(--s-6) 0; } }

h1,h2,h3,h4,h5,h6 { font-family: var(--serif); font-weight: 500; line-height: 1.15; color: var(--ivory); letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
em { color: var(--gold); font-style: italic; }

.eyebrow { font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--saffron); }
.lead { font-size: 1.15rem; color: var(--ivory-dim); line-height: 1.6; }
.muted { color: var(--ivory-dimmer); }

.site-header {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: rgba(247,241,227,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; color: var(--ivory); }
.brand-mark {
  width: 36px; height: 36px;
  background-image: url('/assets/img/astra-favicon.svg');
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
.nav-links { display: flex; align-items: center; gap: var(--s-6); }
.nav-links a { font-size: 0.9rem; color: var(--ivory-dim); transition: color var(--t-fast); }
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-cta { display: flex; align-items: center; gap: var(--s-3); }
.btn-signin {
  padding: 8px 16px;
  border: 1px solid var(--gold-line); border-radius: var(--r-md);
  color: var(--gold); font-size: 0.85rem; font-weight: 500;
  transition: all var(--t-fast);
}
.btn-signin:hover { border-color: var(--gold); background: var(--gold-wash); }
.nav-mobile-toggle { display: none; width: 40px; height: 40px; color: var(--gold); font-size: 1.5rem; align-items: center; justify-content: center; }
.nav-mobile-menu { display: none; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  .nav-mobile-menu.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--indigo-2); border-bottom: 1px solid var(--gold-line);
    padding: var(--s-5); gap: var(--s-4);
  }
  .nav-mobile-menu a { padding: var(--s-3) 0; border-bottom: 1px solid var(--gold-line); color: var(--ivory-dim); font-size: 1rem; }
  .nav-mobile-menu a:last-child { border-bottom: none; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 14px 28px;
  border-radius: var(--r-md);
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.01em;
  cursor: pointer; transition: all var(--t-base) var(--ease);
  white-space: nowrap; border: 1px solid transparent;
}
.btn-primary { background: var(--gold); color: var(--indigo); }
.btn-primary:hover { background: var(--gold-bright); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--gold); border-color: var(--gold-line); }
.btn-ghost:hover { border-color: var(--gold); background: var(--gold-wash); }
.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.field { margin-bottom: var(--s-5); }
.field-label {
  display: block; font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: var(--s-2); font-weight: 500;
}
.field-input {
  width: 100%; padding: 14px 16px;
  background: var(--gold-wash);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-md);
  color: var(--ivory); font-size: 1.1rem; font-family: var(--serif);
  transition: border var(--t-fast);
}
.field-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-wash); }
.field-input::placeholder { color: var(--ivory-dimmer); }
.field-help { display: block; font-size: 0.8rem; color: var(--ivory-dimmer); margin-top: var(--s-2); }
.field-choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.choice {
  padding: var(--s-4); background: var(--gold-wash);
  border: 1px solid var(--gold-line); border-radius: var(--r-md);
  cursor: pointer; text-align: center; font-size: 0.95rem;
  transition: all var(--t-fast);
}
.choice:hover { border-color: var(--gold); }
.choice.selected { border-color: var(--gold); background: rgba(201,165,90,0.15); color: var(--gold); }

.card { background: var(--indigo-2); border: 1px solid var(--gold-line); border-radius: var(--r-lg); padding: var(--s-5); }
.card-bordered-gold { background: var(--indigo-2); border: 1.5px solid var(--gold); border-radius: var(--r-lg); padding: var(--s-5); position: relative; }
.card-sunk { background: rgba(201,165,90,0.04); border: 1px solid var(--gold-line); border-radius: var(--r-lg); padding: var(--s-5); }

.num-card { text-align: center; padding: var(--s-5); background: var(--indigo-2); border: 1px solid var(--gold-line); border-radius: var(--r-lg); }
.num-card-value { font-family: var(--serif); font-size: 3.5rem; font-weight: 500; color: var(--gold); line-height: 1; margin: var(--s-3) 0; }
.num-card-label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ivory-dim); }
.num-card-meaning { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1rem; margin-top: var(--s-2); }

.pill { display: inline-flex; align-items: center; padding: 4px 10px; background: var(--gold-wash); border-radius: 100px; font-size: 0.75rem; color: var(--gold); letter-spacing: 0.02em; }
.pill-success { background: rgba(62,207,184,0.1); color: var(--success); }
.pill-warning { background: rgba(228,168,98,0.1); color: var(--warning); }

.site-footer { margin-top: var(--s-9); padding: var(--s-7) 0 var(--s-5); border-top: 1px solid var(--gold-line); background: var(--indigo-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-6); margin-bottom: var(--s-6); }
.footer-col h4 { font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: var(--s-4); font-weight: 500; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: var(--s-3); }
.footer-col a { color: var(--ivory-dim); font-size: 0.9rem; transition: color var(--t-fast); }
.footer-col a:hover { color: var(--gold); }
.footer-brand-text { font-family: var(--serif); color: var(--ivory); font-size: 1.15rem; margin-bottom: var(--s-3); }
.footer-bottom { padding-top: var(--s-5); border-top: 1px solid var(--gold-line); display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--ivory-dimmer); flex-wrap: wrap; gap: var(--s-3); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--s-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--s-4); }
@media (max-width: 720px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

.divider-ornament { display: flex; align-items: center; justify-content: center; gap: var(--s-3); margin: var(--s-6) 0; }
.divider-ornament::before, .divider-ornament::after { content: ''; flex: 1; height: 1px; background: var(--gold-line); max-width: 120px; }
.divider-ornament-dot { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }

.fade-in { animation: fadeIn var(--t-slow) var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.progress { display: flex; gap: var(--s-2); align-items: center; justify-content: center; margin-bottom: var(--s-5); }
.progress-dot { width: 32px; height: 2px; background: var(--gold-line); border-radius: 1px; transition: background var(--t-base); }
.progress-dot.done { background: var(--gold); }
.progress-dot.current { background: var(--gold-bright); }

.step { display: none; }
.step.active { display: block; animation: slideIn var(--t-base) var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(43,35,25,0.55); backdrop-filter: blur(4px); z-index: var(--z-modal); display: none; align-items: center; justify-content: center; padding: var(--s-5); }
.modal-backdrop.open { display: flex; }
.modal { background: var(--indigo-2); border: 1px solid var(--gold-line); border-radius: var(--r-xl); padding: var(--s-6); max-width: 480px; width: 100%; animation: fadeIn var(--t-base) var(--ease) both; }

.prose h2 { margin: var(--s-7) 0 var(--s-4); }
.prose h3 { margin: var(--s-6) 0 var(--s-3); color: var(--gold); }
.prose p { margin-bottom: var(--s-4); line-height: 1.75; color: var(--ivory-dim); }
.prose ul, .prose ol { margin: 0 0 var(--s-4) var(--s-5); color: var(--ivory-dim); }
.prose li { margin-bottom: var(--s-2); line-height: 1.7; }
.prose blockquote { border-left: 2px solid var(--gold); padding: var(--s-3) var(--s-5); margin: var(--s-5) 0; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ivory); }
.prose a { color: var(--gold); border-bottom: 1px solid var(--gold-line); }
.prose a:hover { border-color: var(--gold); }
.prose strong { color: var(--ivory); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════
   COMPATIBILITY LAYER — classes used by earlier built pages
   Maps old selectors onto the new design system
   ═══════════════════════════════════════════════════════════════════ */

/* Older header pattern: .site-header > .logo + .site-nav + .header-cta */
.site-header > .logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 500;
  color: var(--ivory); padding: 0 var(--s-5);
}
.site-header > .logo .logo-mark {
  width: 36px; height: 36px;
  background-image: url('/assets/img/astra-favicon.svg');
  background-size: contain; background-repeat: no-repeat; background-position: center;
  font-size: 0;  /* hide any text content like the placeholder "N" */
}
.site-header > .logo .logo-text { color: var(--ivory); }
.site-header > .logo .logo-text span { color: var(--gold); }

.site-header .site-nav {
  display: flex; align-items: center; gap: var(--s-6);
  flex: 1; justify-content: center;
}
.site-header .site-nav a {
  font-size: 0.9rem; color: var(--ivory-dim); transition: color var(--t-fast);
}
.site-header .site-nav a:hover,
.site-header .site-nav a.active { color: var(--gold); }

.site-header .header-cta {
  padding: 8px 16px; margin-right: var(--s-5);
  border: 1px solid var(--gold-line); border-radius: var(--r-md);
  color: var(--gold); font-size: 0.85rem; font-weight: 500;
  transition: all var(--t-fast);
}
.site-header .header-cta:hover { border-color: var(--gold); background: var(--gold-wash); }

/* Older pages use .site-header without inner .container — make it flex directly */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
}
/* But when it contains a .container (new pages), let the container handle it */
.site-header:has(> .container) { display: block; padding: 0; }

@media (max-width: 900px) {
  .site-header > .site-nav { display: none; }
}

/* Older footer pattern: .site-footer > .footer-grid + .footer-bottom directly */
.site-footer > .footer-grid {
  max-width: var(--container); margin: 0 auto var(--s-6);
  padding: 0 var(--s-5);
}
.site-footer > .footer-bottom {
  max-width: var(--container); margin: 0 auto;
  padding: var(--s-5) var(--s-5) 0;
}
.footer-brand a.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.15rem; color: var(--ivory);
  margin-bottom: var(--s-3);
}
.footer-brand a.logo .logo-mark {
  width: 32px; height: 32px;
  background-image: url('/assets/img/astra-favicon.svg');
  background-size: contain; background-repeat: no-repeat; background-position: center;
  font-size: 0;
}
.footer-brand a.logo .logo-text span { color: var(--gold); }
.footer-brand p { color: var(--ivory-dimmer); font-size: 0.85rem; max-width: 280px; }

/* Generic .eye for eyebrow text used in older pages */
.eye {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--saffron);
}

/* Numerology pages: .breadcrumb, .lp-num-big etc use var(--gold) so they work */

/* ── Additional compatibility shims ─────────────────────────────────── */
.btn-secondary {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold-line); padding: 10px 20px;
  border-radius: var(--r-md); font-size: 0.9rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all var(--t-fast);
}
.btn-secondary:hover { background: var(--gold-wash); border-color: var(--gold); }

/* Coral accent for "challenges" side of sc-box in life-path pages */
.sc-box.coral { border-color: rgba(232,132,122,0.3); }
.sc-box.coral h3 { color: var(--coral); }
.sc-box.coral li::before { color: var(--coral); }

/* Section dividers used in hub pages */
.section-divider {
  text-align: center; margin: var(--s-6) auto var(--s-5);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); position: relative; max-width: 400px;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE NAV FALLBACK — for older pages that use
   <header class="site-header"><a.logo><nav.site-nav>...</nav><a.header-cta></header>
   Builds a hamburger menu dynamically so these pages work on mobile too.
   ═══════════════════════════════════════════════════════════════════ */

/* Hide the injected mobile-nav elements everywhere by default.
   They become visible only inside the mobile media query below. */
.site-header-mobile-toggle { display: none; }
.site-header-mobile-dropdown { display: none; }

@media (max-width: 900px) {
  .site-header > .site-nav { display: none; }
  .site-header-mobile-toggle {
    width: 40px; height: 40px;
    color: var(--gold); font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    margin-right: var(--s-3);
  }
  .site-header-mobile-dropdown {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--indigo-2);
    border-bottom: 1px solid var(--gold-line);
    padding: var(--s-5);
    flex-direction: column;
    gap: var(--s-4);
    z-index: 60;
  }
  .site-header-mobile-dropdown.open { display: flex; }
  .site-header-mobile-dropdown a {
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--gold-line);
    color: var(--ivory-dim); font-size: 1rem;
  }
  .site-header-mobile-dropdown a:last-child { border-bottom: none; }
  .site-header { position: relative; }
}

/* Hero band with saffron-minimal photo as soft background */
.hero-band-saffron {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--gold-line);
}
.hero-band-saffron::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(135deg, rgba(247,241,227,0.95), rgba(247,241,227,0.92) 50%, rgba(247,241,227,0.99)),
    url('/assets/img/photos/hero-saffron-minimal.jpg');
  background-size: cover; background-position: center;
  z-index: 0;
}
.hero-band-saffron > * { position: relative; z-index: 1; }

/* Blog post pages — soft cream-paper texture background */
body.blog-page {
  background-image:
    linear-gradient(rgba(247,241,227,0.86), rgba(247,241,227,0.93)),
    url('/assets/img/textures/cream-paper.jpg');
  background-size: cover;
  background-attachment: fixed;
}
/* Article body cards stay readable on the texture */
body.blog-page .toc,
body.blog-page .calc-example,
body.blog-page .number-card,
body.blog-page .cta-inline {
  background-color: rgba(251, 246, 231, 0.9); /* slightly more opaque against texture */
  backdrop-filter: blur(2px);
}
