/* ============================================
   SUTRA Dual-Theme CSS — djyotish.ru
   ASTRA (dark, default) + Almanac (light)
   v5.0 — official brand match
   ============================================ */

/* === 1. ASTRA Dark (default) === */
:root {
  --void: #08060A;
  --surface: #13101A;
  --raised: #1C1825;
  --gold: #C9A96E;
  --gold-b: #E8C98A;
  --gold-d: rgba(201,169,110,0.10);
  --mint: #6A9E91;
  --mint-p: #A8C8BF;
  --mint-d: rgba(106,158,145,0.10);
  --text: #F0E8D8;
  --text-m: #B8A890;
  --text-d: #6E5E4A;
  --border: rgba(201,169,110,0.15);
  --border-s: rgba(201,169,110,0.07);
  --bg-base: #08060A;
  --bg-surface: #13101A;
  --bg-raised: #1C1825;
  --text-primary: #F0E8D8;
  --text-mid: #B8A890;
  --text-dim: #6E5E4A;
  --scroll-bg: transparent;
  --sky-display: block;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 24px var(--gold-d);
  --btn-text: var(--void);
  --radius: 2px;
  /* Widget compat aliases */
  --ink: #F0E8D8;
  --ink-mid: #B8A890;
  --ink-dim: #6E5E4A;
  --brass: #C9A96E;
  --brass-light: #E8C98A;
  --brass-glow: rgba(201,169,110,0.35);
  --glass-border: rgba(201,169,110,0.15);
  --glass-border-hover: rgba(201,169,110,0.35);
  --accent-gold: #C9A96E;
  --vermillion: #C97070;
  --status-good: #6A9E91;
  --status-warn: #C9A96E;
  --status-bad: #C97070;
}

/* === 2. Almanac Light === */
html[data-theme="almanac"] {
  --void: #FEFCF7;
  --surface: #FBF8F1;
  --raised: #F5EFE0;
  --gold: #C9A96E;
  --gold-b: #E8D5B0;
  --gold-d: rgba(201,169,110,0.08);
  --mint: #6A9E91;
  --mint-soft: #C8DDD4;
  --mint-mid: #9BBFB3;
  --text: #2C2820;
  --text-m: #5C5043;
  --text-d: #9E8E7A;
  --border: rgba(201,169,110,0.25);
  --border-s: rgba(201,169,110,0.12);
  --bg-base: #FEFCF7;
  --bg-surface: #FBF8F1;
  --bg-raised: #F5EFE0;
  --text-primary: #2C2820;
  --text-mid: #5C5043;
  --text-dim: #9E8E7A;
  --scroll-bg: var(--bg-base);
  --sky-display: none;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 16px rgba(106,158,145,0.15);
  --ink: #2C2820;
  --ink-mid: #5C5043;
  --ink-dim: #9E8E7A;
  --glass-border: rgba(201,169,110,0.2);
  --glass-border-hover: rgba(106,158,145,0.35);
  --brass-glow: rgba(106,158,145,0.15);
  /* Widget variable overrides for light theme */
  --sc-bg: #FBF8F1;
  --sc-text: #2C2820;
  --sc-text-dim: #9E8E7A;
  --sc-text-mid: #5C5043;
  --sc-gold: #C9A96E;
  --sc-border: rgba(201,169,110,0.25);
  --sc-mars: #C97070;
  --sc-mint: #6A9E91;
  --sw-bg: #FBF8F1;
  --sw-text: #2C2820;
  --sw-text-dim: #9E8E7A;
  --sw-brass: #C9A96E;
  --sw-border: rgba(201,169,110,0.25);
}
/* Force light backgrounds on widget containers in almanac mode */
html[data-theme="almanac"] .sc-card,
html[data-theme="almanac"] .sc-card-premium,
html[data-theme="almanac"] .sc-table th,
html[data-theme="almanac"] .sc-table td,
html[data-theme="almanac"] [class*="sc-"] {
  color: #2C2820;
}
html[data-theme="almanac"] .sc-card,
html[data-theme="almanac"] .sc-card-premium {
  background: #FBF8F1;
  border-color: rgba(201,169,110,0.25);
}
html[data-theme="almanac"] .sc-table th {
  background: #F5EFE0;
  color: #5C5043;
}
html[data-theme="almanac"] #site-header > * {
  background: rgba(254,252,247,.95) !important;
  border-bottom-color: rgba(201,169,110,0.15) !important;
  color: #2C2820 !important;
}
html[data-theme="almanac"] #panchang-bar {
  background: #F5EFE0 !important;
  color: #5C5043 !important;
  border-bottom-color: rgba(201,169,110,0.15) !important;
}
/* Form inputs in almanac */
html[data-theme="almanac"] input[type="text"],
html[data-theme="almanac"] input[type="email"],
html[data-theme="almanac"] select {
  background: #FBF8F1 !important;
  color: #2C2820 !important;
  border-color: rgba(201,169,110,0.3) !important;
}
html[data-theme="almanac"] input::placeholder {
  color: #9E8E7A !important;
}
/* All widget containers in almanac */
html[data-theme="almanac"] [id$="-container"],
html[data-theme="almanac"] #shadbala {
  color: #2C2820;
}
/* SVG chart background in almanac */
html[data-theme="almanac"] svg {
  background: transparent !important;
}
/* Hero label — mint accent in almanac */
html[data-theme="almanac"] .hero-label {
  color: var(--mint) !important;
}
/* Gold foil → solid dark text in almanac (gradient invisible on cream) */
html[data-theme="almanac"] .gold-foil {
  background: none !important;
  -webkit-text-fill-color: #2C2820 !important;
  color: #2C2820 !important;
  filter: none !important;
}
html[data-theme="almanac"] em {
  color: var(--mint) !important;
}
/* Card borders — mint glow on hover */
html[data-theme="almanac"] .card:hover {
  border-color: var(--mint) !important;
  box-shadow: 0 0 20px rgba(106,158,145,0.12) !important;
}
/* Scroll container — white bg in almanac */
html[data-theme="almanac"] .scroll {
  background: var(--bg-base);
}
html[data-theme="almanac"] body {
  background: #F5EFE0;
}
/* Features table — override inline styles for theme switching */
html[data-theme="almanac"] .scr-feat-col {
  background: #FBF8F1 !important;
  border-color: rgba(201,169,110,0.25) !important;
}
html[data-theme="almanac"] .scr-feat-item {
  color: #5C5043 !important;
}
html[data-theme="almanac"] .scr-feat-head {
  color: #6A9E91 !important;
}
/* Dark theme: force dark features */
.scr-feat-col {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}
.scr-feat-item {
  color: var(--text-m) !important;
}
.scr-feat-head {
  color: var(--gold) !important;
}
/* Natal chart in almanac — minimal overrides, don't break SVG animations */
html[data-theme="almanac"] #vedichart-animated-container > div {
  background: transparent !important;
  color: #2C2820 !important;
}
html[data-theme="almanac"] #vedichart-animated-container > div > div {
  color: #2C2820 !important;
}
html[data-theme="almanac"] #vedichart-animated-container button {
  background: #F5EFE0 !important;
  color: #2C2820 !important;
  border-color: rgba(201,169,110,0.3) !important;
}
/* SVG background rect — the widget draws it with dark fill inline */
html[data-theme="almanac"] #vedichart-animated-container svg rect {
  fill: #FBF8F1 !important;
  stroke: rgba(201,169,110,0.3) !important;
}
/* Chart frame lines (not planet circles) */
html[data-theme="almanac"] #vedichart-animated-container svg > line {
  stroke: rgba(44,40,32,0.2) !important;
}
/* House number text */
html[data-theme="almanac"] #vedichart-animated-container svg > text {
  fill: #5C5043 !important;
}
/* Planet labels remain colored — don't override [data-planet] */
/* City dropdown in almanac */
html[data-theme="almanac"] .sc-autocomplete-list {
  background: #FBF8F1 !important;
  border-color: rgba(201,169,110,0.3) !important;
}
html[data-theme="almanac"] .sc-autocomplete-list div {
  color: #2C2820 !important;
}
html[data-theme="almanac"] .sc-autocomplete-list div:hover {
  background: #F5EFE0 !important;
}
/* All dark-bg widgets override in almanac */
html[data-theme="almanac"] #time-machine-container,
html[data-theme="almanac"] #current-dasha-container,
html[data-theme="almanac"] #chart-summary-container,
html[data-theme="almanac"] #shadbala,
html[data-theme="almanac"] #moon-phase-container,
html[data-theme="almanac"] #nakshatra-wheel-container,
html[data-theme="almanac"] #navagraha-grid-container {
  background: transparent !important;
  color: #2C2820 !important;
}

/* === 3. Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--void);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === 4. Scroll container === */
.scroll {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--scroll-bg);
}

/* === 5. Starfield === */
#sutra-sky { display: var(--sky-display); }

/* === 6. Z-index layers === */
section, .header, #panchang-bar, #sutra-footer, #footer-container, .cookie-banner,
.modal-backdrop, .loading-overlay, .ink-divider {
  position: relative;
  z-index: 1;
}
/* Header from CDN widget — must be sticky and above canvas */
#site-header > * {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background: rgba(8,6,10,.88) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--border-s) !important;
}
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* === 7. Typography === */
h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  line-height: 1.15;
  color: var(--text);
}
h1 { font-size: clamp(44px, 5vw, 72px); line-height: 1.1; }
h2 { font-size: clamp(32px, 4vw, 52px); }
h3 { font-size: 22px; }
em { font-style: italic; color: var(--gold-b); }
a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-b); }

/* === 8. Gold foil shimmer === */
.gold-foil {
  background: linear-gradient(135deg, #A8841A 0%, #D4AD30 20%, #F0D060 42%, #FAEAB0 50%, #F0D060 58%, #D4AD30 80%, #A8841A 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: foilShimmer 5s ease-in-out infinite;
  filter: drop-shadow(0 2px 10px rgba(201,169,110,0.6));
}
@keyframes foilShimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* === 9. Hero === */
.hero {
  position: relative;
  padding: 48px 20px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 10%; right: -5%;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106,158,145,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,.05) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 680px; }
.hero-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.hero-label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--gold);
}
.hero h1 { margin-bottom: 24px; }
.hero-subtitle {
  font-size: 15px;
  color: var(--text-m);
  font-weight: 300;
  max-width: 440px;
  margin: 0 auto 40px;
  line-height: 1.9;
}
.hero-ornament {
  font-size: 2.6rem;
  color: var(--gold);
  opacity: 0.5;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 8px rgba(201,169,110,0.3));
}
.hero-form { margin: 24px auto 0; max-width: 520px; }
.hero-trust {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-d);
  letter-spacing: 0.1em;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-counter { color: var(--gold); }

/* === 10. Buttons === */
.btn-primary {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--gold), #B8935A);
  color: var(--void);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-primary:hover {
  box-shadow: 0 0 40px rgba(201,169,110,.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* === 11. Cards === */
.card, .trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card::after, .trust-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform 0.5s;
}
.card:hover, .trust-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px var(--gold-d);
}
.card:hover::after, .trust-card:hover::after { transform: scaleX(1); }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.trust-icon { font-size: 26px; color: var(--gold); margin-bottom: 20px; }
.trust-card h3 { font-size: 18px; margin-bottom: 12px; }
.trust-card p { font-size: 13px; color: var(--text-m); line-height: 1.9; }

/* === 12. Ink divider === */
.ink-divider {
  text-align: center;
  margin: 32px auto;
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.6em;
  position: relative;
  padding: 8px 0;
}
.ink-divider::before, .ink-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 0;
  border-top: 1px solid var(--border-s);
}
.ink-divider::before { right: calc(50% + 56px); width: 140px; }
.ink-divider::after { left: calc(50% + 56px); width: 140px; }

/* === 13. Features table === */
.features-table { max-width: 600px; margin: 24px auto 0; }
.features-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-s);
  font-size: 13px;
  color: var(--text-m);
}
.features-row:nth-child(odd) { background: var(--surface); }

/* === 14. FAQ === */
.faq-section { max-width: 700px; margin: 0 auto; padding: 0 20px; }
.faq-item { border-bottom: 1px solid var(--border-s); padding: 16px 0; }
.faq-item summary, .faq-q {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.faq-item p, .faq-a {
  font-size: 13px;
  color: var(--text-m);
  margin-top: 8px;
  line-height: 1.9;
}

/* === 15. Bridge (cross-sell) === */
.bridge-section { text-align: center; padding: 40px 20px; }
.bridge-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}
.bridge-links a {
  font-size: 12px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-d);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.bridge-links a:hover {
  background: var(--gold-d);
  border-color: var(--gold);
  color: var(--gold);
}

/* === 16. Article / SEO === */
.article-section {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 14px;
  color: var(--text-m);
  line-height: 1.9;
}
.article-section h2 { margin-bottom: 16px; }
.article-section p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.2rem;
  float: left;
  line-height: 1;
  margin-right: 8px;
  color: var(--gold);
}

/* === 17. Paywall === */
.paywall-blurred {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  opacity: 0.5;
}
.paywall-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  text-align: center;
  padding: 40px;
}
.paywall-label {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.paywall-desc {
  font-size: 14px;
  color: var(--text-m);
  margin-bottom: 20px;
  max-width: 400px;
}

/* === 18. Layout === */
.container { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
section { padding: 44px 20px; }
.chart-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* === 19. Keyframes === */
@keyframes sutra-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes sutra-fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes sutra-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sutra-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes sutra-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* === 20. Responsive === */
@media (max-width: 768px) {
  .chart-table-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .hero { padding: 32px 16px 28px; }
  h1 { font-size: clamp(28px, 6vw, 44px); }
  .ink-divider::before, .ink-divider::after { width: 60px; }
  .ink-divider::before { right: calc(50% + 40px); }
  .ink-divider::after { left: calc(50% + 40px); }
}
@media (max-width: 520px) {
  body { font-size: 14px; }
  section { padding: 28px 12px; }
  .container { padding: 0 12px; }
  .hero-trust { font-size: 10px; }
  .btn-primary { padding: 12px 28px; font-size: 10px; }
}

/* ============================================
   ASTRA EFFECTS (from brand passport)
   ============================================ */

/* Grain overlay — analogue film noise */
#sutra-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.90' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  mix-blend-mode: overlay;
}
html[data-theme="almanac"] #sutra-noise {
  opacity: 0.18;
  mix-blend-mode: multiply;
}

/* Glow orbs — floating ambient light */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.18;
  z-index: 1;
  animation: orb-drift 12s ease-in-out infinite alternate;
}
.glow-orb--gold {
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, #C9A96E 0%, transparent 70%);
}
.glow-orb--mint {
  width: 500px; height: 350px;
  background: radial-gradient(ellipse, #7AADA0 0%, transparent 70%);
  opacity: 0.12;
}
.glow-orb--top-right { top: -100px; right: -150px; }
.glow-orb--bottom-left { bottom: -80px; left: -120px; animation-delay: -5s; }
@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 15px) scale(0.96); }
  100% { transform: translate(15px, 25px) scale(1.02); }
}
html[data-theme="almanac"] .glow-orb { display: none; }
