/* ==========================================================================
   Vedic Research International Institute
   Design system: tokens, theming (light/dark), typography, components, effects
   ========================================================================== */

/* ---------- Tokens: dark (default "cosmic") ---------- */
:root {
  color-scheme: dark;
  --bg: #060a13;
  --bg-2: #0b1121;
  --bg-3: #101a30;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(160, 190, 255, 0.12);
  --line-strong: rgba(160, 190, 255, 0.24);
  --text: #ece7dc;
  --text-soft: #c5c2bb;
  --muted: #8f99ad;
  --gold: #f4b740;
  --saffron: #ff8a3d;
  --cyan: #5fe3ff;
  --cyan-soft: rgba(95, 227, 255, 0.14);
  --gold-soft: rgba(244, 183, 64, 0.14);
  --glow-gold: 0 0 24px rgba(244, 183, 64, 0.35);
  --glow-cyan: 0 0 22px rgba(95, 227, 255, 0.35);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --hud-opacity: 1;
  --grid-color: rgba(95, 227, 255, 0.05);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-deva: "Noto Serif Devanagari", "Tiro Devanagari Sanskrit", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Tokens: light ("parchment") ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f0e4;
  --bg-2: #efe5d2;
  --bg-3: #e7dac2;
  --surface: rgba(255, 252, 245, 0.7);
  --surface-2: rgba(255, 252, 245, 0.95);
  --line: rgba(70, 45, 15, 0.13);
  --line-strong: rgba(70, 45, 15, 0.26);
  --text: #1e1912;
  --text-soft: #3c342a;
  --muted: #6a5f50;
  --gold: #a86b05;
  --saffron: #c24e12;
  --cyan: #0a7486;
  --cyan-soft: rgba(10, 116, 134, 0.1);
  --gold-soft: rgba(168, 107, 5, 0.1);
  --glow-gold: 0 0 0 transparent;
  --glow-cyan: 0 0 0 transparent;
  --shadow: 0 18px 50px -24px rgba(70, 45, 15, 0.35);
  --hud-opacity: 0.85;
  --grid-color: rgba(70, 45, 15, 0.05);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f0e4;
    --bg-2: #efe5d2;
    --bg-3: #e7dac2;
    --surface: rgba(255, 252, 245, 0.7);
    --surface-2: rgba(255, 252, 245, 0.95);
    --line: rgba(70, 45, 15, 0.13);
    --line-strong: rgba(70, 45, 15, 0.26);
    --text: #1e1912;
    --text-soft: #3c342a;
    --muted: #6a5f50;
    --gold: #a86b05;
    --saffron: #c24e12;
    --cyan: #0a7486;
    --cyan-soft: rgba(10, 116, 134, 0.1);
    --gold-soft: rgba(168, 107, 5, 0.1);
    --glow-gold: 0 0 0 transparent;
    --glow-cyan: 0 0 0 transparent;
    --shadow: 0 18px 50px -24px rgba(70, 45, 15, 0.35);
    --hud-opacity: 0.85;
    --grid-color: rgba(70, 45, 15, 0.05);
  }
}

/* ---------- Base ---------- */
*, *::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-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}
::selection { background: var(--gold); color: #1a1205; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--gold); color: #1a1205; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 12px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Background texture: faint HUD grid + vignette */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.9rem); font-weight: 400; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); font-weight: 400; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
em.accent, .accent { font-style: italic; color: var(--gold); }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--text-soft); max-width: 60ch; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: currentColor;
  box-shadow: var(--glow-cyan);
}

.deva { font-family: var(--font-deva); font-weight: 500; }
.iast { font-style: italic; color: var(--text-soft); }
.mono { font-family: var(--font-mono); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; height: 70px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }
.brand-text small { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  font-size: 0.92rem; color: var(--text-soft);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.nav-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }


.menu-btn { display: none; }

@media (max-width: 920px) {
  .nav-links {
    position: fixed; inset: 70px 0 auto 0;
    flex-direction: column; padding: 16px var(--gutter) 24px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform 0.35s var(--ease);
    visibility: hidden;
  }
  .nav-links.open { transform: none; visibility: visible; }
  .nav-links a { padding: 12px 14px; font-size: 1.05rem; }
  .menu-btn { display: grid; }
}



/* ---------- Buttons ---------- */
.btn {
  --b: var(--gold);
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.96rem; letter-spacing: 0.01em;
  border: 1px solid var(--b); cursor: pointer; overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, color 0.25s;
}
.btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--gold); color: #1a1205; box-shadow: var(--glow-gold); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(244, 183, 64, 0.5); }
.btn-ghost { --b: var(--line-strong); background: var(--surface); color: var(--text); }
.btn-ghost:hover { --b: var(--cyan); color: var(--cyan); transform: translateY(-2px); }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg); transition: left 0.6s var(--ease);
}
.btn-primary:hover::after { left: 130%; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted);
}
.chip.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: var(--gold-soft); }
.chip.cyan { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, transparent); background: var(--cyan-soft); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: clamp(72px, 10vw, 130px) 0; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

.divider-hud {
  height: 1px; max-width: var(--maxw); margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--line-strong), var(--cyan), var(--line-strong), transparent);
  opacity: 0.6;
}

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: calc(100vh - 70px); min-height: calc(100svh - 70px);
  display: flex; align-items: center; overflow: hidden;
  padding: 60px 0 90px;
}
#starfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: var(--hud-opacity); }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 160px; z-index: -1;
  background: linear-gradient(transparent, var(--bg));
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 4vw, 60px); align-items: center; }
.hero h1 .line { display: block; }
.hero h1 .shine {
  background: linear-gradient(100deg, var(--gold) 0%, var(--saffron) 40%, var(--gold) 60%, var(--cyan) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
  animation: shine 9s ease-in-out infinite alternate;
}
@keyframes shine { to { background-position: 100% 0; } }
.hero .lede { margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-verse {
  margin-top: 44px; padding-left: 18px; border-left: 2px solid var(--gold);
  max-width: 520px;
}
.hero-verse .deva { font-size: 1.3rem; color: var(--gold); display: block; line-height: 1.6; }
.hero-verse small { color: var(--muted); font-size: 0.88rem; display: block; margin-top: 4px; }

.hero-visual { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.yantra { width: 100%; height: 100%; overflow: visible; }
.yantra .spin-slow { transform-origin: 300px 300px; animation: spin 90s linear infinite; }
.yantra .spin-rev  { transform-origin: 300px 300px; animation: spin 60s linear infinite reverse; }
.yantra .spin-med  { transform-origin: 300px 300px; animation: spin 40s linear infinite; }
.yantra .pulse { transform-origin: 300px 300px; animation: pulse 4.5s ease-in-out infinite; }
.yantra .scan { transform-origin: 300px 300px; animation: spin 8s linear infinite; }
.yantra .draw { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 3.2s var(--ease) 0.3s forwards; }
.yantra .y-gold { fill: none; stroke: var(--gold); }
.yantra .y-cyan { fill: none; stroke: var(--cyan); }
.yantra .y-line { fill: none; stroke: var(--line-strong); }
.yantra .y-fill-cyan { fill: var(--cyan); }
.yantra .y-fill-core { fill: var(--bg); stroke: var(--gold); stroke-width: 1.5; }
.yantra .y-stop-gold { stop-color: var(--gold); }
.yantra .y-stop-cyan { stop-color: var(--cyan); }
.yantra .y-petal { stroke-width: 1; opacity: 0.75; }
.yantra .y-petal2 { stroke-width: 1.3; fill: var(--gold-soft); }
.yantra .y-ringtext { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 2.4px; fill: var(--muted); }
.yantra .y-om { font-family: var(--font-deva); font-size: 46px; fill: var(--gold); font-weight: 600; }
.yantra .draw-group { animation: fadeIn 2.4s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.yantra .draw-group { transform-origin: 300px 300px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.55; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1.02); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hud-label {
  position: absolute; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em;
  color: var(--cyan); text-transform: uppercase; white-space: nowrap;
  display: flex; align-items: center; gap: 8px; opacity: 0.85;
}
.hud-label::before { content: ""; width: 34px; height: 1px; background: currentColor; }
.hud-label.l1 { top: -3%; right: 0; }
.hud-label.l2 { bottom: -3%; left: 0; flex-direction: row-reverse; }
.hud-label.l3 { display: none; }
.hud-label b { color: var(--gold); font-weight: 500; }

.scroll-cue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.2em; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue span { width: 1px; height: 36px; background: linear-gradient(var(--cyan), transparent); animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; order: -1; margin-top: -10px; }
  .hud-label { display: none; }
  .hero { min-height: auto; padding-top: 30px; }
  .scroll-cue { display: none; }
}

/* ---------- Stats strip ---------- */
.stats {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, transparent, var(--surface), transparent);
}
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); }
.stat { padding: 26px 18px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .num { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--gold); line-height: 1; }
.stat .lbl { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 820px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:last-child { grid-column: span 2; border-bottom: 0; }
}

/* ---------- Holo card (shared) ---------- */
.holo {
  --mx: 50%; --my: 50%;
  position: relative; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), border-color 0.35s;
  isolation: isolate;
}
.holo::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: radial-gradient(380px circle at var(--mx) var(--my), var(--cyan), var(--gold) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.35s;
}
.holo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(500px circle at var(--mx) var(--my), var(--cyan-soft), transparent 45%);
  opacity: 0; transition: opacity 0.35s;
}
.holo:hover { transform: translateY(-4px); }
.holo:hover::before, .holo:hover::after { opacity: 1; }

/* HUD corner brackets */
.corners { position: absolute; inset: 10px; pointer-events: none; }
.corners::before, .corners::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--cyan); border-style: solid; opacity: 0.6;
}
.corners::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.corners::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

/* ---------- Verse Lens ---------- */
.lens { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.lens-tabs { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 96px; }
.lens-tab {
  text-align: left; border: 1px solid transparent; background: transparent; color: var(--text-soft);
  padding: 14px 16px; border-radius: 12px; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; gap: 2px; transition: all 0.25s var(--ease);
}
.lens-tab small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.lens-tab span { font-family: var(--font-display); font-size: 1.08rem; }
.lens-tab:hover { background: var(--surface); }
.lens-tab[aria-selected="true"] { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); box-shadow: inset 3px 0 0 var(--gold); }
.lens-tab[aria-selected="true"] small { color: var(--cyan); }

.lens-panel { padding: clamp(24px, 4vw, 48px); overflow: hidden; }
.lens-panel[hidden] { display: none; }
.lens-panel.enter { animation: panelIn 0.6s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.lens-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 24px; }
.shloka { font-family: var(--font-deva); font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.85; color: var(--gold); margin: 0 0 14px; text-shadow: var(--glow-gold); font-weight: 500; }
.shloka .pada { display: block; }
.translit { font-style: italic; color: var(--text-soft); font-size: 1rem; margin-bottom: 22px; line-height: 1.7; }
.translation { font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.5; margin-bottom: 28px; }
.translation::before { content: "“"; color: var(--gold); }
.translation::after { content: "”"; color: var(--gold); }
.lens-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.lens-box { padding: 20px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.lens-box h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; font-weight: 500; }
.lens-box p { font-size: 0.95rem; color: var(--text-soft); margin: 0; }
.lens-box p + p { margin-top: 0.7em; }
.wbw { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wbw span { font-size: 0.84rem; padding: 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.wbw i { color: var(--gold); font-style: italic; }
.deeper { margin-top: 18px; border-top: 1px dashed var(--line-strong); padding-top: 14px; }
.deeper summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 0.92rem; color: var(--cyan); padding: 6px 0;
}
.deeper summary::-webkit-details-marker { display: none; }
.deeper summary::before {
  content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid currentColor; font-family: var(--font-mono); font-size: 0.85rem; transition: transform 0.3s var(--ease);
}
.deeper[open] summary::before { transform: rotate(45deg); }
.deeper summary span { font-weight: 400; font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.04em; }
.deeper-body { margin-top: 12px; animation: panelIn 0.45s var(--ease); }
.source-line { font-size: 0.8rem; color: var(--muted); margin-top: 20px; font-family: var(--font-mono); letter-spacing: 0.02em; }

@media (max-width: 900px) {
  .lens { grid-template-columns: 1fr; }
  .lens-tabs { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .lens-tab { flex: none; }
  .lens-tab[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--gold); }
  .lens-cols { grid-template-columns: 1fr; }
}

/* ---------- Bridge (wisdom <-> research) ---------- */
.bridge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bridge-card { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.bridge-card .from { font-family: var(--font-deva); color: var(--gold); font-size: 1.2rem; line-height: 1.5; }
.bridge-card .from small { display: block; font-family: var(--font-body); font-size: 0.76rem; color: var(--muted); font-style: italic; }
.bridge-link { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.16em; color: var(--cyan); text-transform: uppercase; }
.bridge-link::before, .bridge-link::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan)); }
.bridge-link::after { background: linear-gradient(90deg, var(--cyan), transparent); }
.bridge-card h3 { font-size: 1.22rem; margin: 0; }
.bridge-card p { font-size: 0.94rem; color: var(--text-soft); margin: 0; }
.bridge-card .refs { font-size: 0.78rem; color: var(--muted); border-top: 1px dashed var(--line-strong); padding-top: 12px; margin-top: auto; }
.bridge-card .tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.note-honest { margin-top: 28px; font-size: 0.88rem; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; max-width: 820px; }
.note-honest svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--cyan); }
@media (max-width: 1000px) { .bridge-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .bridge-grid { grid-template-columns: 1fr; } }

/* ---------- Canon (scriptures) ---------- */
.canon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.canon-card { padding: 26px 24px 24px; overflow: hidden; display: flex; flex-direction: column; }
.canon-card .script { font-size: 1.75rem; line-height: 1.4; color: var(--gold); margin-bottom: 8px; }
.canon-card h3 { margin-bottom: 4px; font-size: 1.2rem; }
.canon-card .era { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px; }
.canon-card p { font-size: 0.92rem; color: var(--text-soft); margin: 0; }
@media (max-width: 1100px) { .canon-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .canon-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .canon-grid { grid-template-columns: 1fr; } }
.canon-card .glyph-bg {
  position: absolute; right: -10px; top: -16px; font-size: 6rem; line-height: 1; opacity: 0.05; pointer-events: none; font-family: var(--font-deva);
}


/* ---------- Portals ---------- */
.portals { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.portal { padding: clamp(28px, 4vw, 48px); min-height: 360px; display: flex; flex-direction: column; overflow: hidden; }
.portal .portal-mark { font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.4; color: var(--cyan); margin-bottom: 14px; }
.portal .portal-mark.gold { color: var(--gold); }
.portal h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.portal p { color: var(--text-soft); max-width: 46ch; }
.portal ul { list-style: none; padding: 0; margin: 8px 0 28px; display: flex; flex-wrap: wrap; gap: 8px; }
.portal .go { margin-top: auto; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--gold); }
.portal .go svg { width: 20px; height: 20px; transition: transform 0.3s var(--ease); }
.portal:hover .go svg { transform: translateX(6px); }
.portal .ring {
  position: absolute; right: -90px; bottom: -90px; width: 300px; height: 300px; opacity: 0.35; z-index: -1;
  animation: spin 50s linear infinite;
}
@media (max-width: 820px) { .portals { grid-template-columns: 1fr; } .portal { min-height: 0; } }

/* ---------- Featured book ---------- */
.feature-book { display: grid; grid-template-columns: 360px 1fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.book-3d { perspective: 1400px; justify-self: center; width: 100%; max-width: 340px; }
.book-3d .cover {
  position: relative; transform: rotateY(-18deg) rotateX(4deg); transform-style: preserve-3d;
  transition: transform 0.8s var(--ease); border-radius: 4px 12px 12px 4px;
  box-shadow: 30px 30px 60px -20px rgba(0,0,0,0.6), 0 0 60px -10px rgba(244,183,64,0.25);
}
.book-3d:hover .cover { transform: rotateY(-6deg) rotateX(2deg) translateY(-6px); }
.book-3d .cover img, .book-3d .cover svg { border-radius: 4px 12px 12px 4px; width: 100%; height: auto; }
.book-3d .cover::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0.35) 0, rgba(255,255,255,0.12) 3%, transparent 8%, transparent 85%, rgba(255,255,255,0.08));
}
.epigraph { border-left: 2px solid var(--gold); padding: 6px 0 6px 20px; margin: 26px 0; }
.epigraph .deva { color: var(--gold); font-size: 1.15rem; line-height: 1.75; display: block; }
.epigraph .tr { font-family: var(--font-display); font-style: italic; color: var(--text-soft); display: block; margin-top: 8px; }
.epigraph cite { font-style: normal; font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); display: block; margin-top: 8px; }
@media (max-width: 860px) { .feature-book { grid-template-columns: 1fr; } .book-3d { max-width: 260px; } }

/* ---------- Method ---------- */
.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.method-step { padding: 30px 26px; border-right: 1px solid var(--line); position: relative; }
.method-step:last-child { border-right: 0; }
.method-step .n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--cyan); letter-spacing: 0.16em; }
.method-step h3 { font-size: 1.15rem; margin: 14px 0 8px; }
.method-step p { font-size: 0.9rem; color: var(--text-soft); margin: 0; }
.method-step .bar { position: absolute; left: 0; top: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--gold), var(--cyan)); transition: width 1.2s var(--ease); }
.method-grid.in .method-step .bar { width: 100%; }
.method-grid.in .method-step:nth-child(2) .bar { transition-delay: 0.2s; }
.method-grid.in .method-step:nth-child(3) .bar { transition-delay: 0.4s; }
.method-grid.in .method-step:nth-child(4) .bar { transition-delay: 0.6s; }
@media (max-width: 900px) {
  .method-grid { grid-template-columns: 1fr 1fr; }
  .method-step:nth-child(2) { border-right: 0; }
  .method-step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .method-grid { grid-template-columns: 1fr; }
  .method-step { border-right: 0; border-bottom: 1px solid var(--line); }
  .method-step:last-child { border-bottom: 0; }
}

/* ---------- CTA band ---------- */
.cta-band { text-align: center; padding: clamp(60px, 8vw, 100px) var(--gutter); border-radius: 28px; overflow: hidden; }
.cta-band .deva { font-size: clamp(1.6rem, 3.6vw, 2.6rem); color: var(--gold); text-shadow: var(--glow-gold); line-height: 1.6; }
.cta-band p { color: var(--text-soft); max-width: 56ch; margin: 12px auto 28px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 36px; margin-top: 40px; font-size: 0.9rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-soft); margin-bottom: 14px; font-weight: 500; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a:hover { color: var(--gold); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 0.8rem; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Sub-page hero ---------- */
.page-hero { padding: clamp(60px, 9vw, 110px) 0 clamp(40px, 6vw, 70px); position: relative; overflow: hidden; }
.page-hero .path-crumb { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); margin-bottom: 22px; display: flex; gap: 6px; flex-wrap: wrap; }
.page-hero .path-crumb a { color: var(--cyan); }
.page-hero .path-crumb a:hover { text-decoration: underline; }
.page-hero-ring { position: absolute; right: -120px; top: -60px; width: 520px; height: 520px; opacity: 0.4; z-index: -1; pointer-events: none; animation: spin 120s linear infinite; }
@media (max-width: 700px) { .page-hero-ring { width: 340px; height: 340px; right: -140px; } }

/* Research tracks & listings */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.track { padding: 26px; }
.track .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--cyan-soft); color: var(--cyan); margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent); }
.track .ico svg { width: 22px; height: 22px; }
.track h3 { font-size: 1.15rem; margin-bottom: 6px; }
.track p { font-size: 0.92rem; color: var(--text-soft); margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filter-btn { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-soft); padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 0.86rem; transition: all 0.2s; }
.filter-btn:hover { border-color: var(--cyan); color: var(--text); }
.filter-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.entries { display: grid; gap: 14px; }
.entry { display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; padding: 24px 26px; align-items: start; }
.entry .kind { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cyan); padding-top: 4px; }
.entry h3 { font-size: 1.2rem; margin-bottom: 6px; }
.entry p { font-size: 0.93rem; color: var(--text-soft); margin: 0; }
.entry .src { font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.entry[hidden] { display: none; }
@media (max-width: 720px) { .entry { grid-template-columns: 1fr; gap: 10px; } }

/* Books */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px; }
.book-card { padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 12px; }
.book-card .thumb { border-radius: 4px 10px 10px 4px; overflow: hidden; aspect-ratio: 2 / 3; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; }
.book-card .thumb svg, .book-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.book-card .placeholder { color: var(--muted); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; text-align: center; padding: 20px; }
.book-card h3 { font-size: 1.3rem; margin: 4px 0 0; }
.book-card p { font-size: 0.9rem; color: var(--text-soft); margin: 0; }

.toc { list-style: none; padding: 0; margin: 0; counter-reset: ch; display: grid; gap: 10px; }
.toc li { counter-increment: ch; display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 18px 22px; }
.toc li::before { content: counter(ch, decimal-leading-zero); font-family: var(--font-mono); color: var(--cyan); font-size: 0.85rem; }
.toc h4 { margin: 0; font-size: 1.08rem; font-family: var(--font-display); font-weight: 500; }
.toc p { margin: 2px 0 0; font-size: 0.86rem; color: var(--muted); }

.prose { max-width: 70ch; }
.prose p { color: var(--text-soft); }
.draft-note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--gold) 50%, transparent); background: var(--gold-soft); font-size: 0.88rem; color: var(--text-soft); margin-bottom: 26px; }
.draft-note b { color: var(--gold); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; } .reveal-d2 { transition-delay: 0.2s; } .reveal-d3 { transition-delay: 0.3s; }

/* HUD scan-line heading reveal */
.scan-in { position: relative; }
.scan-in::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: var(--glow-cyan); opacity: 0;
}
.scan-in.in::after { animation: scanline 1.1s var(--ease) 0.15s; }
@keyframes scanline { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .yantra .draw { stroke-dashoffset: 0; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, #starfield, .bg-grid, .hero-visual, .scroll-cue { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Book covers ---------- */
.cover-img { display: block; width: 100%; height: auto; }
.book-card .thumb .cover-img { height: 100%; object-fit: cover; }
.book-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.book-sub { font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.45rem); color: var(--text); margin: 6px 0 4px; }
.book-tag { font-style: italic; color: var(--text-soft); margin: 0; }
.byline { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-top: 14px; }

/* ---------- Founder / About ---------- */
.founder { display: grid; grid-template-columns: 260px 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; padding: clamp(26px, 4vw, 48px); }
.founder-mark { position: relative; width: 100%; max-width: 260px; aspect-ratio: 1; justify-self: center; }
.founder-mark svg { width: 100%; height: 100%; overflow: visible; }
.founder-mark .ring-a { transform-origin: 100px 100px; animation: spin 60s linear infinite; }
.founder-mark .ring-b { transform-origin: 100px 100px; animation: spin 40s linear infinite reverse; }
.founder-photo { position: absolute; top: 14%; left: 14%; width: 72%; height: 72%; border-radius: 50%; object-fit: cover; object-position: 50% 15%; }
.founder-mark::after { content: ""; position: absolute; top: 14%; left: 14%; width: 72%; height: 72%; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong), 0 0 40px -6px color-mix(in srgb, var(--gold) 45%, transparent); pointer-events: none; }
.founder h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 4px; }
.founder .role { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); margin-bottom: 16px; }
.founder p { color: var(--text-soft); }
.founder .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.founder .links a { font-size: 0.86rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .2s, color .2s; }
.founder .links a:hover { border-color: var(--cyan); color: var(--cyan); }
@media (max-width: 760px) { .founder { grid-template-columns: 1fr; text-align: left; } .founder-mark { max-width: 220px; } }

.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fact { padding: 24px; }
.fact .k { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.fact h3 { font-size: 1.15rem; margin: 10px 0 6px; }
.fact p { font-size: 0.92rem; color: var(--text-soft); margin: 0; }
@media (max-width: 900px) { .facts-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .facts-grid { grid-template-columns: 1fr; } }

.author-books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.author-book { padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.author-book h3 { font-size: 1.2rem; margin: 0; }
.author-book .sub { font-size: 0.9rem; color: var(--text-soft); font-style: italic; }
.author-book .go { margin-top: auto; padding-top: 14px; font-size: 0.86rem; font-weight: 600; color: var(--gold); }
@media (max-width: 900px) { .author-books { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .author-books { grid-template-columns: 1fr; } }

/* ---------- Books shelf: three across, title cards for books without a cover file ---------- */
.shelf { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .shelf { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .shelf { grid-template-columns: 1fr; } }
.book-card .book-card-sub { font-style: italic; color: var(--text); font-size: 0.95rem; margin-top: -4px; }
.book-card .book-links { display: flex; gap: 16px; margin-top: auto; padding-top: 8px; font-size: 0.88rem; font-weight: 600; color: var(--gold); }
.book-card .book-links a:hover { text-decoration: underline; }
