/* ============================================================
   Vidyamrit — style.css
   Root design tokens, reset, base typography, utilities,
   buttons, and shared components used across every page.
   Load this FIRST on every page.
   ============================================================ */

/* ---- 1. Design tokens ------------------------------------ */
:root {
  /* Brand — Royal Blue */
  --royal-900: #0d1f52;
  --royal-800: #12296b;
  --royal-700: #1a3a8f;   /* primary royal blue */
  --royal-600: #2a4fb0;
  --royal-050: #eef2fb;

  /* Brand — Golden accent */
  --gold-600: #a9821f;
  --gold-500: #c9a227;    /* primary gold */
  --gold-400: #e0bd5e;
  --gold-050: #faf4df;

  /* Neutrals */
  --ink:   #0e1533;       /* headings */
  --slate: #545b78;       /* body copy */
  --muted: #8a90a8;       /* captions, glosses */
  --mist:  #f6f8fd;       /* soft section background */
  --line:  #e7eaf5;       /* hairline borders */
  --white: #ffffff;

  /* Typography */
  --font-sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-sanskrit: 'Noto Serif Devanagari', 'Poppins', Georgia, serif;

  /* Type scale (fluid) */
  --fs-display: clamp(2.4rem, 1.4rem + 3.6vw, 4rem);
  --fs-h1: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --fs-h2: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  --fs-h3: clamp(1.2rem, 1.05rem + 0.7vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Spacing */
  --space-section: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --container: 1200px;
  --gutter: clamp(1.1rem, 0.6rem + 2vw, 2rem);

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(13, 31, 82, 0.06);
  --shadow-md: 0 12px 30px rgba(13, 31, 82, 0.10);
  --shadow-lg: 0 26px 60px rgba(13, 31, 82, 0.16);
  --shadow-gold: 0 14px 34px rgba(201, 162, 39, 0.28);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.18s;
  --t-med: 0.35s;
  --t-slow: 0.6s;
}

/* ---- 2. Reset -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--slate);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; border-radius: 4px; }

/* ---- 3. Base typography ---------------------------------- */
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.18; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p  { color: var(--slate); }
strong { color: var(--ink); font-weight: 600; }
.lead { font-size: var(--fs-lead); color: var(--slate); }

/* ---- 4. Layout utilities --------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--space-section); }
.section--mist { background: var(--mist); }
.section--royal {
  background:
    radial-gradient(120% 120% at 85% -10%, rgba(201,162,39,0.16), transparent 55%),
    linear-gradient(160deg, var(--royal-800), var(--royal-900));
  color: #d9e0f5;
}
.section--tight { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }

.grid { display: grid; gap: clamp(1.1rem, 0.6rem + 1.6vw, 2rem); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.text-center { text-align: center; }

/* ---- 5. Section header pattern --------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--gold-500), transparent);
}
.section--royal .eyebrow { color: var(--gold-400); }

.section-head { max-width: 640px; margin-inline: auto; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem); }
.section-head.is-left { margin-inline: 0; }
.section-title { font-size: var(--fs-h2); margin-top: 0.7rem; }
.section-sub { margin-top: 0.9rem; font-size: var(--fs-lead); color: var(--slate); }
.section--royal .section-title { color: #fff; }
.section--royal .section-sub { color: #c3cbe6; }

/* ---- 6. Signature: gold lotus-bud divider ---------------- */
/* Recurring ornament tying the brand to a traditional register. */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.1rem 0;
}
.divider::before, .divider::after {
  content: "";
  height: 1px; width: 46px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}
.divider::after { transform: scaleX(-1); }
.divider span {
  width: 12px; height: 12px;
  background: var(--gold-500);
  transform: rotate(45deg);
  border-radius: 3px;
  box-shadow: 0 0 0 4px rgba(201,162,39,0.14);
}
.divider.is-light::before, .divider.is-light::after { background: linear-gradient(90deg, transparent, var(--gold-400)); }

/* ---- 7. Signature: Sanskrit shloka block ----------------- */
.shloka {
  font-family: var(--font-sanskrit);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.6rem);
  line-height: 1.9;
  color: var(--royal-700);
  font-weight: 500;
}
.shloka .shloka__gloss {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}
.section--royal .shloka { color: var(--gold-400); }
.section--royal .shloka .shloka__gloss { color: #aab4d6; }

/* ---- 8. Buttons ------------------------------------------ */
.btn {
  --btn-bg: var(--royal-700);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-med) var(--ease),
              background var(--t-med) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }

.btn--primary { --btn-bg: var(--royal-700); }
.btn--primary:hover { background: var(--royal-800); }

.btn--gold {
  --btn-bg: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  --btn-fg: var(--royal-900);
}
.btn--gold:hover { box-shadow: var(--shadow-gold); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--royal-700);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--royal-600); background: var(--royal-050); box-shadow: none; }

.btn--light {
  --btn-bg: rgba(255,255,255,0.10);
  --btn-fg: #fff;
  border-color: rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
}
.btn--light:hover { background: rgba(255,255,255,0.18); }

.btn--lg { padding: 1rem 2rem; font-size: 1rem; }
.btn--block { width: 100%; }

/* JS ripple element injected by script.js */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,0.45);
  pointer-events: none;
  animation: ripple 0.6s var(--ease);
}
.btn--gold .ripple, .btn--ghost .ripple { background: rgba(13,31,82,0.18); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---- 9. Small components --------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  font-size: var(--fs-small); font-weight: 500;
  color: var(--royal-700);
  background: var(--royal-050);
  border-radius: var(--r-pill);
}
.chip--gold { color: var(--gold-600); background: var(--gold-050); }

.tag {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold-600);
}

/* ---- 10. Reveal-on-scroll base --------------------------- */
/* animations.js toggles .is-visible; supports optional stagger via --d */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.from-left  { transform: translateX(-34px); }
.reveal.from-right { transform: translateX(34px); }
.reveal.zoom       { transform: scale(0.94); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---- 11. Helpers ----------------------------------------- */
.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;
}
.skip-link {
  position: absolute; left: 1rem; top: -60px;
  z-index: 1200; padding: 0.7rem 1.1rem;
  background: var(--royal-700); color: #fff; border-radius: var(--r-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

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