/* =============================================
   TATTVAM — Design System
   A Living Digital Spiritual Ecosystem
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Tiro+Devanagari+Sanskrit:ital@0;1&display=swap');

/* ——— Root Design Tokens ——— */
:root {
  /* Backgrounds */
  --color-cream: #FFF8ED;
  --color-ivory: #F5EAD6;
  --color-linen: #F0E6D4;
  --color-parchment: #F8F0E0;
  --color-warm-white: #FFFCF5;

  /* Accents */
  --color-sandstone: #CBB49D;
  --color-champagne: #E2C9A5;
  --color-gold: #CFA66B;
  --color-bronze: #A67C52;
  --color-saffron: #D4943A;
  --color-terracotta: #C07850;

  /* Text */
  --color-text-primary: #3F3A34;
  --color-text-secondary: #8A6E5A;
  --color-text-dark: #2F2A26;
  --color-text-muted: #A89888;
  --color-text-light: #C4B5A5;

  /* Borders & Separators */
  --color-border-light: #EADCCB;
  --color-border-medium: #E2C9A5;
  --color-border-accent: #CBB49D;

  /* Functional */
  --color-success: #7A9E6A;
  --color-warning: #D4943A;
  --color-error: #C07850;

  /* Typography */
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-sanskrit: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', serif;

  /* Font sizes — fluid scale */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --text-md: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --text-lg: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1.7rem + 1.5vw, 2.8rem);
  --text-3xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);
  --text-4xl: clamp(3rem, 2.5rem + 3vw, 5rem);
  --text-hero: clamp(3.5rem, 3rem + 3.5vw, 6rem);

  /* Spacing — 4px base grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows — warm undertone */
  --shadow-xs: 0 1px 3px rgba(63, 58, 52, 0.04);
  --shadow-sm: 0 2px 8px rgba(63, 58, 52, 0.06);
  --shadow-md: 0 4px 16px rgba(63, 58, 52, 0.08);
  --shadow-lg: 0 8px 32px rgba(63, 58, 52, 0.1);
  --shadow-xl: 0 16px 48px rgba(63, 58, 52, 0.12);
  --shadow-gold: 0 4px 20px rgba(207, 166, 107, 0.2);
  --shadow-inner: inset 0 2px 4px rgba(63, 58, 52, 0.04);
  --shadow-inner-gold: inset 0 0 30px rgba(207, 166, 107, 0.05);

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Transitions */
  --transition-fast: 0.2s var(--ease-out-quart);
  --transition-base: 0.35s var(--ease-out-expo);
  --transition-slow: 0.6s var(--ease-out-expo);
  --transition-glacial: 1s var(--ease-out-expo);

  /* Z-index scale */
  --z-base: 0;
  --z-elevated: 10;
  --z-sticky: 100;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-toast: 1500;

  /* Layout */
  --max-width: 1280px;
  --max-width-narrow: 800px;
  --max-width-wide: 1440px;
  --nav-height: 72px;
}

/* ——— Reset & Base ——— */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text-primary);
  background-color: var(--color-cream);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-bronze);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold);
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background-color: rgba(207, 166, 107, 0.25);
  color: var(--color-text-dark);
}

/* ——— Typography ——— */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-dark);
  line-height: 1.2;
  letter-spacing: 0.02em;
  font-weight: 600;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  max-width: 68ch;
}

.text-inscription {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 300;
  color: var(--color-text-dark);
}

.text-sanskrit {
  font-family: var(--font-sanskrit);
  font-style: italic;
  color: var(--color-text-secondary);
  font-size: 1.15em;
  line-height: 1.8;
}

.text-shloka {
  font-family: var(--font-sanskrit);
  font-size: var(--text-xl);
  line-height: 1.6;
  color: var(--color-text-dark);
  text-align: center;
  letter-spacing: 0.01em;
}

.text-muted {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.text-label {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.text-gold {
  color: var(--color-gold);
}

.text-center { text-align: center; }

/* ——— Layout Utilities ——— */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

.container-wide {
  max-width: var(--max-width-wide);
}

.section {
  padding: var(--space-24) 0;
}

.section-sm {
  padding: var(--space-16) 0;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ——— Scrollbar ——— */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-linen);
}

::-webkit-scrollbar-thumb {
  background: var(--color-sandstone);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-bronze);
}

/* ——— Accessibility ——— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ——— Responsive ——— */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 var(--space-4);
  }

  .section {
    padding: var(--space-16) 0;
  }

  :root {
    --nav-height: 64px;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .section {
    padding: var(--space-12) 0;
  }
}
