/* ============================================================
   GITAGYAAN — Spiritual Scripture Library
   Premium Design System & Meditative Animations
   ============================================================ */

@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,600&family=Lato:wght@300;400;700&display=swap');

:root {
  --bg:        #faf5ee;
  --bg-2:      #ffffff;
  --bg-3:      #f5eadc;
  --surface:   #fffbf5;
  --border:    rgba(212, 150, 42, 0.2);
  --text:      #2b1810;
  --text-2:    #5c3d2e;
  --text-3:    #8b6651;
  --saffron:   #d95b00;
  --gold:      #cc8a18;
  --radius:    12px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow:    0 8px 30px rgba(180,140,100,0.12);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Lato', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 40px; }

/* ─── Navbar ─── */
.navbar {
  height: 90px; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center;
}
.navbar-inner {
  width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.logo-mark {
  width: 44px; height: 44px; background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.logo-text { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 700; line-height: 1; }
.logo-sub { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }

.navbar-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: 0; }
.nav-scripture-links { display: flex; gap: 8px; }
.nav-scr {
  padding: 10px 20px; border-radius: 30px; border: 1px solid transparent;
  background: none; font-size: 0.85rem; font-weight: 700; color: var(--text-2);
  text-decoration: none;
  cursor: pointer; transition: var(--transition);
}
.nav-scr:hover { color: var(--saffron); background: var(--surface); }
.nav-scr.active { background: var(--text); color: white; }

/* ─── Hero Section ─── */
.hero {
  height: 100vh; position: relative; overflow: hidden;
  background: black; display: flex; align-items: center; justify-content: center;
}
.hero-video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; pointer-events: none;
}
.hero-video-overlay {
  position: absolute; top:0; left:0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, 
    rgba(0,0,0,0.5) 0%, 
    transparent 40%, 
    transparent 70%, 
    var(--bg) 100%);
  z-index: 2;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 20px;
  background: white; border: 1px solid var(--border); border-radius: 40px;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 32px;
}
.hero-title { 
  font-size: clamp(4rem, 12vw, 8rem); font-family: 'Cormorant Garamond', serif; 
  line-height: 1; margin-bottom: 24px; letter-spacing: -0.02em;
}
.grad-text { 
  background: linear-gradient(135deg, var(--saffron), var(--gold)); 
  -webkit-background-clip: text; 
  background-clip: text;
  -webkit-text-fill-color: transparent; 
}
.hero-sub-title { font-size: 1.5rem; color: var(--text-3); font-family: 'Cormorant Garamond', serif; font-style: italic; margin-bottom: 48px; }

.hero-shloka {
  max-width: 700px; margin: 0 auto 60px; font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem; color: var(--text-2); font-style: italic; line-height: 1.7; position: relative;
}
.hero-shloka-attr { font-size: 0.9rem; font-style: normal; font-family: 'Lato', sans-serif; font-weight: 700; color: var(--saffron); margin-top: 15px; }

.btn {
  padding: 18px 40px; border-radius: 40px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; cursor: pointer; transition: var(--transition); border: none; font-size: 0.9rem;
}
.btn-primary { background: var(--text); color: white; margin-right: 16px; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(0,0,0,0.15); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); }

.hero-stats {
  display: flex; justify-content: center; gap: 60px; margin-top: 100px;
}
.stat-num { font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-3); }

/* ─── Cards System ─── */
.section-header { text-align: left; margin-bottom: 60px; }
.section-header .subtitle { 
  font-size: 0.9rem; font-weight: 800; text-transform: uppercase; 
  letter-spacing: 0.4em; color: var(--saffron); margin-bottom: 12px; opacity: 0.8;
}
.section-header h2 { 
  font-family: 'Cormorant Garamond', serif; font-size: clamp(3rem, 8vw, 5rem); 
  line-height: 1; font-weight: 700; color: var(--text); letter-spacing: -0.02em;
}
.section-sub { 
  font-size: 1.1rem; color: var(--text-3); font-style: italic; 
  margin-top: 15px; max-width: 600px; line-height: 1.6;
}

.scripture-grid, .chapters-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 40px;
}

.sacred-card, .chapter-card {
  width: 100%; height: 520px; perspective: 1500px; cursor: pointer;
  position: relative;
}

.sacred-card-inner, .chapter-card-inner {
  position: relative; width: 100%; height: 100%; transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.sacred-card:hover .sacred-card-inner, 
.chapter-card:hover .chapter-card-inner,
.sacred-card.touch-flipped .sacred-card-inner,
.chapter-card.touch-flipped .chapter-card-inner { 
  transform: rotateY(180deg); 
}

.sacred-card-front, .sacred-card-back, .chapter-card-front, .chapter-card-back {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateZ(0);
}

.sacred-card-front, .chapter-card-front { 
  padding: 40px; background: white; position: relative; overflow: hidden;
  display: flex; flex-direction: column; height: 100%; 
}
.sacred-card-back, .chapter-card-back { 
  transform: rotateY(180deg) translateZ(1px); background: var(--surface); 
  display: flex; flex-direction: column; padding: 40px; border: 4px solid var(--border); 
  height: 100%;
}

/* Scripture Card Utilities */
.sacred-card .card-stats {
  display: flex; gap: 20px; padding-top: 15px; margin-top: 15px;
  border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-2);
}
.sacred-card .card-stats span { font-weight: 500; }
.sacred-card .card-stats strong { color: var(--saffron); }
.sacred-card .card-eyebrow { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 8px; }

.sacred-cta {
  background: var(--text); color: white; border: none; padding: 12px 28px;
  border-radius: 30px; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: var(--transition);
}
.sacred-cta:hover { background: var(--saffron); transform: scale(1.05); }

/* Scrollbar Refining */
.back-teaching::-webkit-scrollbar { width: 5px; }
.back-teaching::-webkit-scrollbar-track { background: transparent; }
.back-teaching::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.back-teaching::-webkit-scrollbar-thumb:hover { background: var(--saffron); }

/* Chapter Card Specifics */
.chapter-card-front { 
  padding: 40px; background: white; position: relative; overflow: hidden;
}

/* Spiritual Aura Background */
.chapter-card-front::before {
  content: ''; position: absolute; top: -50px; right: -50px; width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(217, 91, 0, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%; z-index: 0; pointer-events: none;
}

.card-chapter-num {
  font-family: 'Cormorant Garamond', serif; font-size: 8rem; font-weight: 700;
  color: var(--saffron); position: absolute; top: -20px; right: 10px; 
  z-index: 0; opacity: 0.04; pointer-events: none;
}

.chapter-card .card-body { 
  position: relative; z-index: 1; height: 100%; 
  display: flex; flex-direction: column; 
}

.chapter-card .card-subtitle { 
  font-size: 0.8rem; color: var(--saffron); font-weight: 800; 
  text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 12px; 
}

.chapter-card .card-title { 
  font-size: 2.4rem; line-height: 1.1; font-weight: 700; margin-bottom: 16px; 
  letter-spacing: -0.02em; color: var(--text);
}

.card-translation { 
  font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-style: italic; 
  color: var(--saffron); margin-bottom: 24px; opacity: 0.9;
}

.card-essence {
  font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; line-height: 1.6;
  color: var(--text-2); flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden; font-style: italic; opacity: 0.85;
}

.card-footer-meta { 
  display: flex; justify-content: space-between; align-items: flex-end; 
  padding-top: 24px; border-top: 1px solid var(--border); margin-top: 20px;
}

.card-shlokas { font-size: 0.85rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.card-flip-hint { 
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; 
  letter-spacing: 0.12em; color: var(--text-3); 
}

.back-chapter-label { font-size: 0.8rem; color: var(--saffron); font-weight: 700; text-transform: uppercase; margin-bottom: 8px; }
.back-chapter-title { font-size: 1.4rem; font-family: 'Cormorant Garamond', serif; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.back-cta {
  margin-top: 20px; background: var(--text); color: white; border: none; padding: 12px 24px;
  border-radius: 30px; font-weight: 700; text-transform: uppercase; cursor: pointer; transition: var(--transition);
}
.back-cta:hover { background: var(--saffron); transform: scale(1.05); }

.card-emoji-bg { 
  height: 60%; display: flex; align-items: center; justify-content: center; 
  font-size: 5rem; background: var(--bg-3); border-bottom: 1px solid var(--border);
}
.card-content { padding: 30px; flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* ─── Scripture Banner ─── */
.scripture-header { padding: 80px 0 40px; }
.scripture-header-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.scripture-info-tag { font-size: 0.8rem; color: var(--saffron); font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 12px; }
.scripture-name { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; color: var(--text); margin-bottom: 6px; }
.scripture-subtitle { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-style: italic; color: var(--text-3); }
.scripture-meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 24px; }
.meta-pill { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.meta-pill strong { color: var(--text); }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px);
  z-index: 2000; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-container {
  background: white; width: 100%; max-width: 800px; max-height: 90vh;
  border-radius: 24px; position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.modal-close {
  position: absolute; top: 20px; right: 20px; width: 40px; height: 40px;
  background: var(--bg-2); border: none; border-radius: 50%; font-size: 1.5rem;
  cursor: pointer; z-index: 10;
}
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.modal-tab {
  flex: 1; padding: 16px; border: none; background: none; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; cursor: pointer; color: var(--text-3);
}
.modal-tab.active { color: var(--saffron); border-bottom: 2px solid var(--saffron); }

.modal-header { padding: 40px; background: white; border-bottom: 1px solid var(--border); }
.modal-eyebrow { font-size: 0.8rem; color: var(--saffron); font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 12px; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 2.8rem; line-height: 1.1; margin-bottom: 8px; }
.modal-subtitle { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-style: italic; color: var(--text-3); }

.modal-body { padding: 40px; overflow-y: auto; flex: 1; }
.summary-text { font-size: 1.1rem; line-height: 1.7; color: var(--text-2); }
.big-teaching-label { font-size: 0.85rem; font-weight: 800; text-transform: uppercase; color: var(--saffron); margin-bottom: 16px; }
.big-teaching-text { font-size: 1.2rem; line-height: 1.6; font-style: italic; color: var(--text); }

.verse-card { background: var(--bg-2); padding: 40px; border-radius: 20px; text-align: center; }
.verse-mark { font-size: 2.5rem; color: var(--saffron); margin-bottom: 20px; }
.verse-text { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; line-height: 1.4; color: var(--text); margin-bottom: 20px; }
.verse-label { font-size: 0.8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

/* ─── Footer ─── */
.chapters-section { padding-bottom: 120px; }
.footer { padding: 100px 0 60px; background: white; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 80px; margin-bottom: 80px; }

.footer-brand .logo-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.footer-brand .brand-name { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 700; color: var(--text); }
.footer-brand p { font-size: 0.95rem; color: var(--text-2); line-height: 1.7; max-width: 440px; }

.footer-col h4 { 
  font-size: 0.85rem; font-weight: 800; text-transform: uppercase; 
  letter-spacing: 0.15em; color: var(--saffron); margin-bottom: 24px; 
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 14px; }
.footer-col button {
  background: none; border: none; padding: 0; font-family: 'Lato', sans-serif;
  font-size: 0.9rem; color: var(--text-2); cursor: pointer; transition: var(--transition);
}
.footer-col button:hover { color: var(--saffron); transform: translateX(5px); }

.footer-bottom { 
  padding-top: 40px; border-top: 1px solid var(--border); 
  display: flex; justify-content: space-between; align-items: center;
}
.footer-bottom p { font-size: 0.85rem; color: var(--text-3); font-weight: 500; }
.footer-om { color: var(--saffron); font-weight: 700; margin: 0 4px; }

/* ─── Others ─── */
.active-scripture-title { font-size: 4rem; text-align: center; margin: 60px 0 20px; }

@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* ─── Responsive & Touch Optimizations ─── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; width: 100% !important; margin: 0 !important; padding: 0 !important; position: relative; }
  
  .hero { display: none !important; } /* Hide empty hero on mobile to reclaim space */
  .hero-video { display: none !important; }
  .hero-video-overlay { display: none; }
  
  .scripture-selection-section { padding-top: 5px !important; margin-top: 0 !important; } /* Move section to top below navbar */
  
  .container { width: 100% !important; max-width: 100% !important; padding: 0 16px !important; margin: 0 auto !important; box-sizing: border-box; overflow: hidden; }
  .navbar { height: 70px; width: 100% !important; position: sticky; top: 0; left: 0; }
  .navbar-inner { padding: 0 16px; width: 100% !important; max-width: 100% !important; box-sizing: border-box; }
  .navbar-logo { gap: 10px; }
  .logo-text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
  .logo-sub { font-size: 0.55rem; letter-spacing: 0.15em; white-space: nowrap; display: block; margin-top: 2px; }
  .logo-mark { width: 34px; height: 34px; font-size: 1.1rem; }
  .nav-scripture-links { display: none; } /* Handled by bottom nav */
  
  .hero-title { font-size: 2.8rem; text-align: center; width: 100%; letter-spacing: -0.02em; }
  .hero-sub-title { font-size: 1rem; margin-bottom: 20px; text-align: center; width: 100%; }
  .hero-shloka { font-size: 1rem; padding: 0 10px; text-align: center; width: 100%; }
  .hero-stats { gap: 20px; margin-top: 30px; justify-content: center; width: 100%; }
  .stat-num { font-size: 1.6rem; }
  
  .mobile-bottom-nav { display: flex; width: 100% !important; left: 0; right: 0; }
  body { padding-bottom: 90px; } /* Space for bottom nav */

  .scripture-grid, .chapters-grid { 
    display: flex !important; flex-direction: column !important; align-items: center !important; 
    gap: 24px !important; width: 100% !important; margin: 0 !important; padding: 0 !important; 
  }
  .sacred-card, .chapter-card { 
    height: 480px; width: 100% !important; max-width: 100% !important; 
    margin: 0 0 10px 0 !important; 
  }
  
  .section-header { text-align: center; padding: 0; width: 100% !important; }
  .section-header h2 { font-size: 2.5rem; letter-spacing: -0.02em; }
  .section-sub { margin: 10px auto 30px; font-size: 0.95rem; line-height: 1.5; }
  
  /* Touch Feedback */
  .sacred-card:active, .chapter-card:active, .btn:active {
    transform: scale(0.98);
  }
}
