/* ============================================================
   PADMANABH AYURVEDICS — BASE CSS
   Design tokens · Reset · Typography · Loader · Utilities
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,700&family=Inter:wght@300;400;500;600&family=Mukta:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --bg-primary:     #0a0a0a;
  --bg-surface:     #141414;
  --bg-elevated:    #1c1c1c;
  --bg-card:        #181818;
  --bg-glass:       rgba(20, 20, 20, 0.85);

  --gold:           #64a435;
  --gold-light:     #7cc04a;
  --gold-dark:      #336d4d;
  --gold-muted:     rgba(100, 164, 53, 0.15);

  --text-primary:   #f5f0e8;
  --text-secondary: #b0a898;
  --text-muted:     #6b6560;
  --text-inverse:   #0a0a0a;

  --border:         rgba(255,255,255,0.07);
  --border-gold:    rgba(100, 164, 53, 0.3);

  --success:        #4caf7d;
  --error:          #e05c5c;
  --warning:        #e0a44c;
  --info:           #4c8ce0;

  --font-serif:     'Playfair Display', Georgia, serif;
  --font-sans:      'Inter', system-ui, sans-serif;
  --font-deva:      'Mukta', sans-serif;

  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:      0 24px 64px rgba(0,0,0,0.6);
  --shadow-gold:    0 0 32px rgba(100,164,53,0.2);

  --transition:     all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h:          72px;
  --sidebar-w:      240px;
  --max-w:          1280px;
  --max-w-narrow:   860px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lang-hi, body.lang-mr {
  font-family: var(--font-deva);
  font-size: 0.95rem;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol { list-style: none; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Typography Scale ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
h4 { font-size: clamp(1rem, 2vw, 1.3rem); }

p { color: var(--text-secondary); line-height: 1.8; }

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-serif { font-family: var(--font-serif); }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.italic { font-style: italic; }
.fw-300 { font-weight: 300; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ── Page Loader ───────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#page-loader.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-monogram {
  font-family: var(--font-deva);
  font-size: 5rem;
  font-weight: 700;
  color: var(--gold);
  animation: loader-pulse 2s ease-in-out infinite;
  letter-spacing: 0.05em;
  text-shadow: 0 0 60px rgba(100,164,53,0.4);
}

.loader-brand {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: loader-fade 2s ease-in-out infinite;
}

.loader-bar {
  width: 120px;
  height: 1px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.loader-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: loader-sweep 1.8s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.7; }
}

@keyframes loader-fade {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes loader-sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Language Splash ───────────────────────────────────────── */
#lang-splash {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#lang-splash.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  animation: fadeInUp 0.8s ease 0.2s both;
}

.splash-lang-btn {
  padding: 12px 24px;
  font-size: 1.1rem;
  min-width: 120px;
  border-color: var(--border);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.splash-lang-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

/* ── Layout Utilities ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  width: 100%;
  max-width: var(--max-w-narrow);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-lg {
  padding: 120px 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.gap-48 { gap: 48px; }

.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); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--border); }
.border-gold { border: 1px solid var(--border-gold); }

.bg-surface { background: var(--bg-surface); }
.bg-card { background: var(--bg-card); }
.bg-elevated { background: var(--bg-elevated); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.divider-gold {
  border-top-color: var(--border-gold);
}

/* ── Gold Accent Line ──────────────────────────────────────── */
.accent-line {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 16px 0;
}

.accent-line.centered { margin: 16px auto; }

/* ── Section Heading ───────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

/* ── Fade-in Animations ────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade {
  animation: fadeIn 0.5s ease forwards;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.12s; }
.stagger > *:nth-child(3) { animation-delay: 0.19s; }
.stagger > *:nth-child(4) { animation-delay: 0.26s; }
.stagger > *:nth-child(5) { animation-delay: 0.33s; }
.stagger > *:nth-child(6) { animation-delay: 0.40s; }

/* ── Skeleton Loader ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-elevated) 25%,
    var(--bg-card) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ── Toast Notification ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  color: var(--text-primary);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease;
  pointer-events: all;
  max-width: 320px;
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Page Transition ───────────────────────────────────────── */
#app {
  animation: fadeIn 0.35s ease;
}

#app.transitioning {
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .section-lg { padding: 80px 0; }
  .container, .container-narrow { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
}
