/**
 * Web theme aligned with mobile: expo/constants/theme.ts
 * Calm night field, gold accents, one token set for chat + public pages.
 */

:root {
  /* —— Mobile source (expo/constants/theme.ts) —— */
  --gita-bg: #0b0f2a;
  --gita-bg-deep: #05060d;
  --gita-bg-soft: #12152c;
  --gita-gold: #e8b86d;
  --gita-gold-light: #f5d49a;
  --gita-gold-deep: #b8893e;
  --gita-text: #f5efe0;
  --gita-text-soft: #c8c4d6;
  --gita-text-dim: #8a8aa8;
  --gita-border: rgba(232, 184, 109, 0.18);
  --gita-sea: #173044;
  --gita-saffron: #f08c3a;
  --gita-violet: #6b4e9e;
  --gita-on-gold: #1a1042;
  --gita-glass: rgba(20, 24, 56, 0.65);
  --gita-panel: rgba(14, 18, 44, 0.92);
  --gita-danger: #e07a6a;
  --gita-success: #7fbf8f;
  --gita-radius-sm: 10px;
  --gita-radius-md: 16px;
  --gita-radius-lg: 22px;
  --gita-radius-xl: 28px;
  /* Fine gold rim on glass surfaces (chat / cards) */
  --gita-hairline: rgba(232, 184, 109, 0.2);

  /* —— Chat UI —— */
  --font-body: "Manrope", "Segoe UI", Roboto, Arial, sans-serif;
  /* Display: liturgical / manuscript feel — Cormorant is loaded in templates. */
  --font-sacred: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-display: "Cormorant Garamond", "Sora", "Manrope", Georgia, serif;
  --font-ui: "Sora", "Manrope", sans-serif;
  --bg-a: #05060d;
  --bg-b: #101320;
  --bg-c: #17283a;
  --bg-d: #2a1b10;
  --divine-gold: var(--gita-gold);
  --divine-gold-soft: rgba(232, 184, 109, 0.38);
  --lotus-rose: #9b7ba8;
  --lotus-rose-soft: rgba(107, 78, 158, 0.16);
  --sky-glow: #5ba3c4;
  --surface: var(--gita-glass);
  --surface-strong: rgba(16, 22, 48, 0.88);
  --surface-soft: rgba(255, 255, 255, 0.06);
  --border: var(--gita-border);
  --border-strong: rgba(232, 184, 109, 0.28);
  --text: var(--gita-text);
  --muted: var(--gita-text-soft);
  --text-muted: var(--gita-text-dim);
  --accent: var(--gita-gold-deep);
  --accent-2: #6ba8c4;
  --danger-bg: rgba(224, 122, 106, 0.2);
  --danger-border: rgba(224, 122, 106, 0.45);
  --success-bg: rgba(127, 191, 143, 0.2);
  --success-border: rgba(127, 191, 143, 0.45);
  --shadow: 0 24px 60px rgba(2, 7, 18, 0.48);
  --shadow-soft: 0 14px 36px rgba(2, 7, 18, 0.28);
  --reading-width: 72ch;
  --dark-bg: var(--gita-on-gold);
  --blue: #6ecce3;

  /* —— practice_hub, community, shared answer, SEO —— */
  --bg: var(--gita-bg-deep);
  --panel: var(--gita-panel);
  --radius: 18px;
  --gold: var(--gita-gold);
  --cyan: #5ba3c4;
  --line: var(--gita-border);
  --line-strong: rgba(232, 184, 109, 0.3);
  --bg-1: #05060d;
  --bg-2: #101320;
  --bg-3: #1a1f32;
  --gold-strong: var(--gita-gold-deep);
  --sky: #5ba3c4;
  --rose: #9b7ba8;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --reading: 68ch;
}

/* —— Base polish —— */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(232, 184, 109, 0.22);
  color: #fffef8;
}

:focus-visible {
  outline: 2px solid rgba(232, 184, 109, 0.55);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .aurora-veils,
  .stardust,
  .bg-orb,
  .hero-sanctum > .hero-aurora {
    animation: none !important;
  }
  .hero-glass-card:hover {
    transform: none;
  }
}

/* —— Public pages: ambient shell (practice, community, shared, SEO) —— */
body.gita-ambient {
  position: relative;
  isolation: isolate;
}

body.gita-ambient::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% -12%, rgba(232, 184, 109, 0.1), transparent 52%),
    radial-gradient(ellipse 50% 45% at 100% 100%, rgba(23, 48, 68, 0.45), transparent 50%),
    linear-gradient(180deg, rgba(5, 6, 13, 0) 0%, rgba(3, 5, 12, 0.5) 100%);
}

body.gita-ambient::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 55% at 50% 32%, black 0%, transparent 100%);
}

body.gita-ambient .page,
body.gita-ambient .wrap,
body.gita-ambient > header,
body.gita-ambient > main {
  position: relative;
  z-index: 1;
}

body.gita-ambient header h1 {
  font-family: var(--font-sacred);
  font-weight: 500;
  font-size: clamp(24px, 3.5vw, 34px);
  letter-spacing: 0.03em;
  color: var(--gita-text);
  text-shadow: 0 0 50px rgba(232, 184, 109, 0.12);
}

body.gita-ambient h1,
body.gita-ambient .hero h1,
body.gita-ambient .article-title {
  font-family: var(--font-sacred);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Glass panels on sadhana + similar */
body.gita-ambient .panel,
body.gita-ambient .topbar,
body.gita-ambient .composer,
body.gita-ambient .hero,
body.gita-ambient .hero-side {
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

/* ═══ Sanctum hero (reference: layered glow + glass stats; Gita gold / sea / violet) ═══ */

.hero-sanctum {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-sanctum > .hero-aurora {
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: -48%;
  height: 92%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
  border-radius: 50%;
  transform-origin: 50% 100%;
  background:
    radial-gradient(ellipse 52% 36% at 50% 100%, rgba(232, 184, 109, 0.45), transparent 58%),
    radial-gradient(ellipse 38% 32% at 18% 88%, rgba(23, 48, 68, 0.9), transparent 54%),
    radial-gradient(ellipse 42% 34% at 82% 90%, rgba(107, 78, 158, 0.32), transparent 52%),
    radial-gradient(ellipse 68% 48% at 50% 115%, rgba(5, 6, 13, 0.98), transparent 48%);
  animation: sanctumAuroraBreath 16s ease-in-out infinite alternate;
}

@keyframes sanctumAuroraBreath {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-10px) scale(1.035);
    opacity: 1;
  }
}

.hero-sanctum .hero-grid,
.hero-sanctum .hero-top-split,
.hero-sanctum .hero-split-row {
  position: relative;
  z-index: 1;
}

.hero-sanctum .hero-glass-deck {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-top: 20px;
}

@media (min-width: 900px) {
  .hero-sanctum .hero-glass-deck {
    margin-top: 8px;
  }
}

@media (max-width: 720px) {
  .hero-sanctum .hero-glass-deck {
    grid-template-columns: 1fr;
  }
}

.hero-glass-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), rgba(6, 10, 22, 0.72));
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 20px 48px rgba(2, 4, 12, 0.4);
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
}

.hero-glass-card:hover {
  border-color: rgba(232, 184, 109, 0.32);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 24px 56px rgba(2, 4, 12, 0.48),
    0 0 40px rgba(232, 184, 109, 0.06);
  transform: translateY(-2px);
}

.hero-glass-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 184, 109, 0.38);
  background: rgba(232, 184, 109, 0.09);
  color: #f5d49a;
}

.hero-glass-card-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-glass-card-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 184, 109, 0.88);
  margin-bottom: 6px;
  font-family: var(--font-ui);
}

.hero-glass-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  font-family: var(--font-body);
}

.hero-glass-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 5px;
}

.hero-glass-card-meter {
  margin-top: 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hero-glass-card-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8893e, #e8b86d, #f5d49a);
  box-shadow: 0 0 14px rgba(232, 184, 109, 0.35);
}

.hero-glass-card-meter--full > span {
  width: 100%;
}

.hero-glass-card-meter--high > span {
  width: 92%;
}
