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

:root {
  --bg: #FCFAF8;
  --surface: #FFFFFF;
  --surface-hover: #F6F1EC;
  --text: #241A14;
  --text-soft: #7A6A60;
  /* Alias — several rules read --muted; keep it defined so nothing renders
     with an unresolved colour. */
  --muted: #7A6A60;
  --accent: #EA580C;
  --accent-hover: #C2410C;
  --accent-light: #FFF3E9;
  --border: #EDE4DC;
  --gold: #B45309;
  --gold-light: #FEF3C7;
  --saffron: #F59E0B;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --max-w: 800px;
  --shadow-sm: 0 1px 2px 0 rgba(60, 30, 10, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(60, 30, 10, 0.10), 0 2px 4px -1px rgba(60, 30, 10, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(60, 30, 10, 0.10), 0 4px 6px -2px rgba(60, 30, 10, 0.05);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-deva: 'Noto Serif Devanagari', 'Nirmala UI', 'Mangal', serif;
}

:root[data-theme="dark"] {
  --bg: #14100D;
  --surface: #201A16;
  --surface-hover: #2D2520;
  --text: #FAF7F5;
  --text-soft: #A69488;
  --muted: #A69488;
  --accent: #FB923C;
  --accent-hover: #FDBA74;
  --accent-light: rgba(234, 88, 12, 0.16);
  --border: #332A24;
  --gold: #FCD34D;
  --gold-light: rgba(180, 83, 9, 0.14);
  --saffron: #FBBF24;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100D;
    --surface: #201A16;
    --surface-hover: #2D2520;
    --text: #FAF7F5;
    --text-soft: #A69488;
    --muted: #A69488;
    --accent: #FB923C;
    --accent-hover: #FDBA74;
    --accent-light: rgba(234, 88, 12, 0.16);
    --border: #332A24;
    --gold: #FCD34D;
    --gold-light: rgba(180, 83, 9, 0.14);
    --saffron: #FBBF24;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.5);
  }
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: radial-gradient(circle at 100% 0%, var(--accent-light) 0%, transparent 600px);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

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

/* Header */
header {
  padding: 24px 0;
  margin-bottom: 40px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--saffron), var(--accent-hover));
  border-radius: 10px;
  flex-shrink: 0;
}
.logo .logo-icon svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
.logo .logo-text { -webkit-text-fill-color: var(--text); }
.logo .logo-mark {
  background: linear-gradient(135deg, var(--saffron), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
header nav { font-family: var(--font-sans); font-size: 15px; font-weight: 500; display: flex; align-items: center; }

.lang-select {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-left: 8px;
  max-width: 160px;
}
.lang-select:hover { border-color: var(--accent); color: var(--accent); }
.lang-select option { background: var(--surface); color: var(--text); }

.theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  cursor: pointer;
  margin-left: 20px;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { color: var(--accent); background: var(--surface-hover); }
[data-theme="dark"] .moon-icon { display: none; }
:root:not([data-theme="dark"]) .sun-icon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .moon-icon { display: none; }
  :root:not([data-theme="light"]) .sun-icon { display: block; }
}

/* Breadcrumbs */
.breadcrumb {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 24px;
  font-weight: 500;
  display: flex; flex-wrap: wrap; align-items: center;
}
.breadcrumb a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
.breadcrumb a:hover { opacity: 0.8; }
.breadcrumb .sep { margin: 0 8px; opacity: 0.4; }

/* Typography */
h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 48px 0 24px;
  letter-spacing: -0.01em;
}
.subtitle { font-size: 1.125rem; color: var(--text-soft); margin-bottom: 0; }
.chapter-sanskrit-name {
  font-family: var(--font-deva);
  font-size: 1.35rem;
  color: var(--accent);
  margin-top: 4px;
  line-height: 1.9;
}

/* Sanskrit shloka card — the source text, on every verse page */
.shloka-card {
  background: linear-gradient(160deg, var(--gold-light) 0%, var(--surface) 62%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--saffron);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin: 32px 0;
  box-shadow: var(--shadow-sm);
}
.shloka-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin-bottom: 8px;
}
.shloka-sanskrit {
  font-family: var(--font-deva);
  font-size: 1.4rem;
  line-height: 2.1;
  color: var(--text);
  white-space: pre-line;
  margin-bottom: 22px;
}
.shloka-translit {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text-soft);
  white-space: pre-line;
}
.shloka-card p:last-child { margin-bottom: 0; }

/* Verse list (chapter page) */
.verses {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.verse-block {
  padding: 18px 0;
  margin: 4px 0;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}
.verse-block:last-child { border-bottom: none; }
.verse-block:hover { background: var(--surface-hover); }
.verse-link { color: inherit; text-decoration: none; display: block; padding: 0 12px; }
.vn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.68em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  user-select: none;
  letter-spacing: 0.04em;
}
.verse-sanskrit {
  display: block;
  font-family: var(--font-deva);
  font-size: 1.12rem;
  line-height: 2;
  color: var(--text);
  white-space: pre-line;
  margin-bottom: 8px;
}
.verse-text { display: block; font-size: 1rem; line-height: 1.7; color: var(--text-soft); }

/* Shloka of the day */
.votd-section { margin: 32px 0; }
.votd-card {
  display: block; text-decoration: none; color: inherit;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.votd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.votd-image { width: 100%; height: auto; display: block; aspect-ratio: 1200 / 630; object-fit: cover; background: #1a1a1a; }
.votd-body { padding: 22px 26px 24px; }
.votd-ref { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent); letter-spacing: 0.02em; }
.votd-sanskrit { font-family: var(--font-deva); font-size: 1.1rem; line-height: 2; white-space: pre-line; margin-top: 10px; }
.votd-text { font-size: 1rem; line-height: 1.7; margin-top: 10px; font-style: italic; }
.votd-explanation { font-size: 15px; color: var(--text-soft); line-height: 1.6; margin-top: 10px; }
.votd-cta { display: inline-block; margin-top: 14px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--accent); }
.votd-card:hover .votd-cta { text-decoration: underline; }

.verse-hero { margin: 24px 0 32px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.verse-hero img { width: 100%; height: auto; display: block; aspect-ratio: 1200 / 630; object-fit: cover; background: #1a1a1a; }
.verse-hero figcaption { padding: 12px 16px; font-size: 0.9rem; color: var(--muted); text-align: center; background: var(--surface); border-top: 1px solid var(--border); }
.translation-status { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Chapter grid (homepage, translation index) */
.chapter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 24px 0 48px; }
.chapter-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--text);
  transition: all 0.2s ease;
}
.chapter-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.chapter-card-num {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: var(--accent); background: var(--accent-light);
  border-radius: 10px;
}
.chapter-card-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chapter-card-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.3; }
.chapter-card-en { font-size: 12.5px; color: var(--text-soft); line-height: 1.4; }
.chapter-card-count {
  flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--text-soft);
  background: var(--bg); padding: 2px 8px; border-radius: 999px;
}
@media (max-width: 640px) { .chapter-grid { grid-template-columns: 1fr; } }

/* Featured verse (the translation, verse page) */
.featured-verse {
  font-size: 1.4rem;
  line-height: 1.7;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 32px 0;
  position: relative;
  border: 1px solid var(--border);
}
.featured-verse::before {
  content: '"';
  position: absolute;
  top: -20px; left: 20px;
  font-family: var(--font-display);
  font-size: 80px;
  color: var(--saffron);
  opacity: 0.25;
  line-height: 1;
}

/* AI content cards */
.insight-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  margin: 24px 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.insight-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.insight-card h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.insight-card h3::before {
  content: '';
  display: block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.insight-card p { font-size: 1.05rem; line-height: 1.8; color: var(--text-soft); }

.meditation-card { border-left: 4px solid var(--gold); }
.meditation-text { font-style: italic; }
.reflection-card { border-left: 4px solid var(--accent); }
.philosophy-card { border-left: 4px solid var(--saffron); }

.teachings-list, .reading-plan { padding-left: 20px; }
.teachings-list li { margin-bottom: 16px; line-height: 1.7; color: var(--text-soft); font-size: 1.05rem; }
.teachings-list strong { color: var(--text); font-family: var(--font-display); }
.reading-plan li { margin-bottom: 12px; line-height: 1.6; color: var(--text-soft); font-size: 1rem; }
.reading-plan a { color: var(--accent); text-decoration: none; font-weight: 600; }
.reading-plan a:hover { text-decoration: underline; }

/* Source details (word-by-word, classical commentary) */
.source-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
  background: var(--surface);
  overflow: hidden;
  transition: all 0.2s ease;
}
.source-details[open] { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.source-details summary {
  padding: 18px 24px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.source-details summary::-webkit-details-marker { display: none; }
.source-details summary::after { content: '+'; font-size: 20px; color: var(--text-soft); transition: transform 0.2s; }
.source-details[open] summary::after { transform: rotate(45deg); }
.word-meaning { font-family: var(--font-deva); font-size: 1rem; line-height: 2.1; }
.commentary-text { font-size: 0.98rem; line-height: 1.85; }

/* Share card */
.social-caption { font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; }
.copy-btn {
  font-family: var(--font-sans);
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.copy-btn:hover { background: var(--accent-hover); }

/* Topics */
.topics { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.tag {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--accent);
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--accent-light);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

/* FAQ */
.faq { margin: 32px 0; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: all 0.2s ease;
}
.faq details[open] { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.faq summary {
  padding: 20px 24px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 20px; color: var(--text-soft); transition: transform 0.2s; flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(45deg); }
.answer { padding: 0 24px 24px; font-size: 16px; line-height: 1.7; color: var(--text-soft); }

/* Cross references */
.cross-refs { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.cross-refs a {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}
.cross-refs a:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); }

/* Chapter navigation */
.chapter-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 32px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-weight: 600;
}
.chapter-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.chapter-nav a:hover { background: var(--surface-hover); color: var(--accent); border-color: var(--accent-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.chapter-nav-top { margin-top: 24px; padding: 16px 0; border-top: none; border-bottom: 1px solid var(--border); }
.chapter-jumper { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); font-weight: 500; min-width: 0; }
.chapter-jumper select {
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 34px 10px 16px; cursor: pointer; box-shadow: var(--shadow-sm);
  appearance: none; -webkit-appearance: none;
  max-width: 260px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chapter-jumper select:hover, .chapter-jumper select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-light); }

/* SEO-crawlable chapter index */
.chapter-index { margin: 32px 0 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.chapter-index-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.chapter-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.chapter-index-link {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 10px;
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 600;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.chapter-index-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); }
.chapter-index-link.is-current { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-sm); }

/* Verse navigation */
.verse-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 32px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.verse-nav a { flex: 1; padding: 10px 14px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.95rem; border-radius: var(--radius-sm); transition: background 0.15s, color 0.15s, transform 0.15s; text-align: center; }
.verse-nav a:hover { background: var(--surface-hover); color: var(--accent); transform: translateY(-1px); }
.verse-nav-prev { text-align: left !important; }
.verse-nav-next { text-align: right !important; }
.verse-nav-chapter { color: var(--muted) !important; font-weight: 500 !important; font-size: 0.85rem !important; white-space: nowrap; flex: 0 1 auto !important; }
.verse-nav-placeholder { flex: 1; }

/* Floating share rail */
.share-rail { position: fixed; left: 50%; top: 50%; margin-left: calc(var(--max-w) / 2 + 16px); transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 8px 24px rgba(60,30,10,0.14); }
.share-rail-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; color: var(--text-soft); cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s, transform 0.15s; }
.share-rail-btn:hover { transform: scale(1.08); }
.share-rail-btn svg { display: block; }
.share-rail-wa:hover { background: #25d366; color: #fff; }
.share-rail-x:hover { background: #000; color: #fff; }
.share-rail-copy:hover, .share-rail-download:hover { background: var(--accent); color: #fff; }
.share-rail-btn .icon-check { display: none; }
.share-rail-copy.copied { background: #16a34a; color: #fff; }
.share-rail-copy.copied .icon-link { display: none; }
.share-rail-copy.copied .icon-check { display: block; }
.share-rail-btn[data-tip]::after { content: attr(data-tip); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 5px 9px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 500; white-space: nowrap; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.share-rail-btn:hover[data-tip]::after { opacity: 0.95; }
@media (max-width: 1000px) {
  .share-rail { top: auto; bottom: 16px; left: 50%; margin-left: 0; transform: translateX(-50%); flex-direction: row; }
  .share-rail-btn[data-tip]::after { right: auto; bottom: calc(100% + 8px); top: auto; left: 50%; transform: translateX(-50%); }
}

/* Share dialog */
.share-dialog { border: none; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); max-width: 720px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,0.25); }
.share-dialog::backdrop { background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.share-dialog[open] { animation: share-pop 0.18s ease-out; }
@keyframes share-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.share-dialog-inner { padding: 24px; margin: 0; }
.share-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-dialog-head h2 { margin: 0; font-size: 1.25rem; }
.share-close { background: transparent; border: none; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); }
.share-close:hover { color: var(--text); background: var(--surface-hover); }
.share-sub { margin: 4px 0 20px; color: var(--muted); font-size: 0.95rem; }
.share-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.share-downloads-label { font-size: 0.85rem; color: var(--muted); margin-right: 4px; }
.share-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 0.82rem; font-weight: 600; color: var(--accent); background: var(--accent-light); border: 1px solid var(--border); border-radius: 999px; text-decoration: none; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.share-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-1px); }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.share-item { display: flex; flex-direction: column; text-decoration: none; color: inherit; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.share-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.share-thumb { background-size: cover; background-position: center; background-color: #1a1a1a; border-radius: var(--radius-sm); margin-bottom: 10px; }
.share-thumb-landscape { aspect-ratio: 1200 / 630; }
.share-thumb-portrait { aspect-ratio: 4 / 5; }
.share-thumb-story { aspect-ratio: 9 / 16; }
.share-label { font-weight: 600; font-size: 0.9rem; text-align: center; }
.share-size { font-size: 0.78rem; color: var(--muted); text-align: center; margin-top: 2px; }

/* Compare list */
.compare-list { display: grid; gap: 14px; margin: 24px 0; }
.compare-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.compare-card:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.compare-card-name { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--accent); margin-bottom: 8px; }
.compare-card-text { font-size: 17px; line-height: 1.65; color: var(--text); }

/* Cards grid (languages, editions) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 24px 0 48px; }
.card-grid a {
  display: flex; align-items: center;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.card-grid a:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-3px); color: var(--accent); }
.card-grid small { color: var(--text-soft); margin-left: auto; font-weight: 500; font-size: 13px; background: var(--bg); padding: 2px 8px; border-radius: 999px; }

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 16px; font-weight: 600;
  color: #fff; background: var(--accent);
  padding: 14px 28px; border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px 0 rgba(234, 88, 12, 0.35);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(234, 88, 12, 0.4); }

/* Compare CTA */
.compare-cta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  margin-top: 32px;
  padding: 18px 24px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 16px; font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
}
.compare-cta:hover { background: var(--accent-light); border-color: var(--accent); border-style: solid; }

/* Amazon contextual links */
.amazon-section { margin: 36px 0; }
.amazon-heading { font-family: var(--font-display); font-weight: 700; color: var(--text-soft); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; }
.amazon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.amazon-card {
  display: flex; flex-direction: column;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}
.amazon-card:hover { border-color: var(--gold); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.amazon-card-label { font-family: var(--font-sans); font-size: 11px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.amazon-card-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.3; }
.amazon-card-arrow { position: absolute; top: 16px; right: 16px; color: var(--gold); font-size: 18px; opacity: 0; transition: opacity 0.2s; }
.amazon-card:hover .amazon-card-arrow { opacity: 1; }
.amazon-disclosure { font-family: var(--font-sans); font-size: 11px; color: var(--text-soft); margin-top: 10px; opacity: 0.7; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 48px 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
}
footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
footer a:hover { text-decoration: underline; }
footer p { margin: 8px 0; }
.footer-links { margin-top: 16px; }

/* Legal pages */
.legal { font-family: var(--font-sans); font-size: 16px; line-height: 1.7; color: var(--text); max-width: 68ch; }
.legal h2 { font-family: var(--font-display); font-size: 1.15em; font-weight: 600; margin: 40px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); }
.legal h2:first-of-type { border-top: none; padding-top: 0; margin-top: 28px; }
.legal p { margin: 0 0 16px; }
.legal ul { margin: 0 0 16px; padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--accent-hover); }
.legal strong { font-weight: 600; }

/* Hero */
.hero { text-align: center; padding: 64px 0 32px; }
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}
.hero p { font-size: 1.2rem; color: var(--text-soft); max-width: 620px; margin: 0 auto 40px; line-height: 1.65; }

/* RTL */
[dir="rtl"] body { font-family: 'Noto Sans Arabic', var(--font-sans); }
[dir="rtl"] .breadcrumb .sep { transform: scaleX(-1); display: inline-block; }
[dir="rtl"] .featured-verse::before { left: auto; right: 20px; }
[dir="rtl"] .chapter-nav { flex-direction: row-reverse; }
[dir="rtl"] .card-grid small { margin-left: 0; margin-right: auto; }
[dir="rtl"] .verse-nav-prev { text-align: right !important; }
[dir="rtl"] .verse-nav-next { text-align: left !important; }
[dir="rtl"] .shloka-card { border-left: 1px solid var(--border); border-right: 4px solid var(--saffron); }
/* Sanskrit and IAST stay LTR even on an RTL page. */
[dir="rtl"] .shloka-sanskrit, [dir="rtl"] .shloka-translit, [dir="rtl"] .word-meaning { direction: ltr; text-align: left; }

/* Unicode rendering */
.verse-link, .verse-block, .featured-verse, .compare-card-text, .shloka-sanskrit {
  unicode-bidi: plaintext;
  text-rendering: optimizeLegibility;
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 20px; }
  .hero h1 { font-size: 2.4rem; }
  h1 { font-size: 1.75rem; }
  .featured-verse { font-size: 1.2rem; padding: 24px; margin: 24px 0; }
  .shloka-card { padding: 20px; }
  .shloka-sanskrit { font-size: 1.2rem; }
  .verses { padding: 16px; }
  .insight-card { padding: 22px; }
  .card-grid { grid-template-columns: 1fr; }
  .chapter-nav { flex-direction: column; gap: 12px; }
  .chapter-nav a { width: 100%; justify-content: center; }
  .chapter-jumper { width: 100%; justify-content: center; }
  .chapter-jumper select { width: 100%; max-width: none; }
}
