:root {
  --bg: #181818;
  --bg-raised: #1f1f1f;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --accent: #f2d470;
  --accent-soft: rgba(242,212,112,0.18);
  --accent-dim: rgba(242,212,112,0.45);
  --accent-glow: rgba(242,212,112,0.06);
  --accent-border: rgba(242,212,112,0.12);
  --accent-border-hover: rgba(242,212,112,0.28);
  --text: rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.55);
  --text-dim: rgba(255,255,255,0.32);
  --border: rgba(255,255,255,0.06);
  --font: 'Roboto', system-ui, -apple-system, sans-serif;
  /* Mantra card reading: scales slightly on large displays; tighter leading */
  /* Story / modern lead: larger + thin (match nav brand 300) */
  --card-title-fs: clamp(17px, 0.65vw + 14.5px, 21px);
  --card-body-fs: clamp(15px, 0.4vw + 14px, 17px);
  --card-latin-fs: clamp(13px, 0.35vw + 11.5px, 15px);
  --card-reading-lh: 1.52;
  --card-title-lh: 1.32;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 24px; height: 64px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  letter-spacing: -0.2px;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* Real <a> on privacy.html: kill default link underline / visited purple on title */
a.nav-brand,
a.nav-brand:any-link,
a.nav-brand:visited,
a.nav-brand:hover {
  text-decoration: none;
  color: inherit;
}
a.nav-brand:visited .brand-accent,
a.nav-brand:hover .brand-accent {
  color: var(--accent);
}
a.nav-brand:visited .brand-main,
a.nav-brand:hover .brand-main {
  color: var(--text);
}
.brand-accent{ color: var(--accent); }
.brand-main{ color: var(--text); }
.nav-links { display: flex; gap: 8px; list-style: none; }
.nav-link {
  padding: 8px 12px;
  border: none;
  border-radius: 0;
  background: none;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.2s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.nav-link:visited { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.nav-link:hover:not(.active) {
  color: var(--text);
  background: none;
}
.nav-link.active,
.nav-link.active:visited {
  color: var(--accent);
  background: none;
  border: none;
  text-decoration: none;
}
.nav-link:focus { outline: none; }
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.nav-mobile-toggle {
  display: none; background: none; border: none;
  color: var(--accent); font-size: 20px; cursor: pointer; padding: 4px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.nav-mobile-toggle:focus { outline: none; }
.nav-mobile-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* LAYOUT */
#app { position: relative; min-height: 100vh; padding-top: 64px; }
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* HOME */
.home-hero {
  min-height: 72vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 48px 24px;
}
.home-hero-inner { max-width: 560px; }
/* App page: same two CTAs as home hero, after scrolling features */
.home-hero.home-hero--app-end {
  min-height: 0;
  padding: 40px 0 56px;
  margin-top: 0;
  border-top: none;
}
.home-script {
  font-size: 78px;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 18px;
  letter-spacing: 0.15em;
  animation: fadeIn 1.2s ease;
}
.home-hero h1 {
  font-size: 34px; font-weight: 300;
  line-height: 1.2; margin-bottom: 12px;
  letter-spacing: -0.3px;
  animation: fadeUp 0.8s 0.15s ease both;
}
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-subtitle {
  font-size: 15px;
  font-weight: 300;
  line-height: var(--card-reading-lh);
  color: var(--text-secondary);
  margin-bottom: 36px;
  animation: fadeUp 0.8s 0.3s ease both;
}
.enter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; background: none;
  color: var(--accent);
  border: 1px solid var(--accent-border-hover);
  font-family: var(--font); font-weight: 500;
  font-size: 13px; letter-spacing: 0.3px;
  border-radius: 22px; cursor: pointer; transition: all 0.25s;
  animation: fadeUp 0.8s 0.45s ease both;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.enter-btn:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.enter-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 28px; background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  font-family: var(--font); font-weight: 600;
  font-size: 14px; letter-spacing: 0.3px;
  border-radius: 22px; cursor: pointer; transition: all 0.25s;
  animation: fadeUp 0.8s 0.45s ease both;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.enter-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(242,212,112,0.25); }
.hero-btns {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  animation: fadeUp 0.8s 0.45s ease both;
}

/* Two-line "toggle" buttons in the hero */
.hero-btn-two-line{
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  line-height: 1.1;
}
.hero-btn-line1{ display:block; }
.hero-btn-line2{
  display:block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.65;
}
.hero-btn-line2--plain{
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  opacity: 1;
}
.home-section { padding: 48px 0; border-top: 1px solid var(--border); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.home-section h2 {
  font-size: clamp(22px, 1.2vw + 16px, 26px);
  font-weight: 300;
  letter-spacing: -0.15px;
  line-height: 1.2;
  color: var(--accent);
  margin-bottom: 16px;
}
.home-section p {
  color: var(--text-secondary);
  font-size: var(--card-body-fs);
  font-weight: 400;
  margin-bottom: 12px;
  line-height: var(--card-reading-lh);
}
.home-section p strong { color: var(--accent); font-weight: 400; }
.featured-title { font-size: 13px; font-weight: 300; color: var(--text-dim); text-align: center; margin-bottom: 20px; letter-spacing: 0.4px; }
.featured-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* LIBRARY */
.lib-header { padding: 32px 0 16px; text-align: center; }
.lib-header h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.15px;
  line-height: 1.25;
  margin-bottom: 6px;
}
.lib-header h1 em { font-style: normal; color: var(--accent); }
.lib-header p { color: var(--text-secondary); font-size: 15px; font-weight: 300; line-height: var(--card-reading-lh); }

.lib-app-cta{
  margin: 6px auto 18px;
  max-width: 820px;
  padding: 8px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.lib-app-cta-title{
  font-size: 15px;
  font-weight: 300;
  color: var(--text);
  line-height: var(--card-reading-lh);
  letter-spacing: -0.05px;
}
.lib-app-cta-sub{
  margin-top: 4px;
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: var(--card-reading-lh);
}
.lib-app-cta-btn{
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

.lib-story-section {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 32px 0 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.lib-story-section-title {
  font-size: clamp(22px, 1.2vw + 16px, 26px);
  font-weight: 300;
  letter-spacing: -0.15px;
  line-height: 1.2;
  margin: 0;
  color: var(--accent);
}

.filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; padding: 8px 0 24px;
}
.filter-chip {
  padding: 6px 16px; border-radius: 18px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--accent-border);
  color: var(--text-dim);
  font-family: var(--font); font-size: 13px;
  font-weight: 400; cursor: pointer; transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.filter-chip:focus { outline: none; }
.filter-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.filter-chip:hover { border-color: var(--accent-border-hover); color: var(--text-secondary); }
.filter-chip:active {
  background: rgba(0,0,0,0.38);
  color: var(--text-secondary);
}
.filter-chip.active { background: var(--accent-soft); border-color: var(--accent-border-hover); color: var(--accent); font-weight: 500; }
.filter-chip.active:active {
  background: rgba(242,212,112,0.22);
  color: var(--accent);
}

/* MANTRA GRID */
.mantra-list {
  display: flex; flex-direction: column; gap: 8px;
  padding-bottom: 64px;
}

/* MANTRA CARD (collapsed) */
.m-card {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  overflow: hidden;
  /* Mobile: prevent the blue text-selection/copy highlight on tap */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
.m-card:hover { background: rgba(0,0,0,0.32); border-color: var(--accent-border); }
.m-card.expanded { border-color: var(--accent-border-hover); background: rgba(0,0,0,0.3); }

.m-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 22px; gap: 18px;
}
.m-card-left{ flex: 1; min-width: 0; }
.m-card-script-small {
  font-size: 26px; color: var(--accent);
  opacity: 0.8;
  line-height: 1.15;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.m-card-name {
  font-size: clamp(17px, 0.5vw + 15px, 20px);
  font-weight: 300;
  letter-spacing: -0.15px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.25;
}
.m-card-open-chip{
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 18px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--accent-border);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  user-select: none;
  margin-top: 2px; /* visually aligns to the Sanskrit line */
  white-space: nowrap;
}
.m-card-actions{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px; /* aligns with Devanagari line */
}

/* Share lead: same typography as card .story-title (“This is for…”) */
.share-inline-label{
  margin: 18px 0 0;
  font-size: var(--card-title-fs);
  font-weight: 300;
  letter-spacing: -0.15px;
  color: var(--text);
  line-height: var(--card-title-lh);
  text-align: left;
}
.share-strip{
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.share-btn{
  padding: 6px 16px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border-hover);
  color: var(--accent);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}
.share-btn:hover{
  border-color: var(--accent);
  background: rgba(242,212,112,0.26);
  color: var(--accent);
}
/* “More channels” — same chip language, dashed border reads as secondary */
.share-btn-others{
  border-style: dashed;
  font-weight: 500;
}
.share-btn-others:hover{
  font-weight: 500;
}
/* Minimal toast */
.ss-toast{
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 9999;
}
.ss-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.m-card:hover .m-card-open-chip{
  border-color: var(--accent-border-hover);
  color: var(--text-secondary);
}
.m-card.expanded .m-card-open-chip{
  background: var(--accent-soft);
  border-color: var(--accent-border-hover);
  color: var(--accent);
}

/* Tag colors */
.m-tag { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase; }
.t-peace { background: rgba(120,160,220,0.12); color: rgba(120,160,220,0.8); }
.t-focus { background: rgba(80,190,170,0.12); color: rgba(80,190,170,0.8); }
.t-healing { background: rgba(100,170,210,0.12); color: rgba(100,170,210,0.8); }
.t-discovery { background: rgba(200,120,140,0.12); color: rgba(200,120,140,0.8); }
.t-strength { background: rgba(210,140,80,0.12); color: rgba(210,140,80,0.8); }
.t-uplifting { background: rgba(242,212,112,0.12); color: rgba(242,212,112,0.8); }
.t-connection { background: rgba(80,190,170,0.12); color: rgba(80,190,170,0.8); }
.t-transform { background: rgba(180,110,150,0.12); color: rgba(180,110,150,0.8); }
.t-grounding { background: rgba(190,150,90,0.12); color: rgba(190,150,90,0.8); }
.t-depth { background: rgba(140,110,190,0.12); color: rgba(140,110,190,0.8); }
.t-protection { background: rgba(210,140,80,0.12); color: rgba(210,140,80,0.8); }
.t-release { background: rgba(120,160,220,0.12); color: rgba(120,160,220,0.8); }

/* CARD BODY (expandable) */
.m-card-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1);
}
.m-card.expanded .m-card-body { max-height: 3000px; }

.m-card-inner {
  border-top: 1px solid var(--border);
  padding: 0 22px 24px;
}

/* TABS inside card */
.card-tabs {
  display: flex; gap: 6px;
  padding: 18px 0 26px;
}
.card-tab {
  padding: 6px 16px; border-radius: 16px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--accent-border);
  color: var(--text-dim);
  font-family: var(--font); font-size: 12px;
  font-weight: 300;
  cursor: pointer; transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.card-tab:focus { outline: none; }
.card-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card-tab:hover { border-color: var(--accent-border-hover); color: var(--text-secondary); }
.card-tab.active { background: var(--accent-soft); border-color: var(--accent-border-hover); color: var(--accent); font-weight: 500; }

/* TAB PANELS */
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

/* Meaning section */
.meaning-text {
  color: var(--text-secondary); font-size: var(--card-body-fs); font-weight: 400;
  line-height: var(--card-reading-lh); margin-bottom: 20px;
}
.meaning-header {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px;
}
.meaning-script {
  font-size: 28px; color: var(--accent); opacity: 0.8; letter-spacing: 0.06em;
}
.meaning-tl {
  font-size: var(--card-latin-fs);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.dim-section-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 20px 0 10px;
  opacity: 0.75;
}
.dim-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.dim-row { display: flex; align-items: center; gap: 8px; }
.dim-label { font-size: 11px; color: var(--text-dim); text-transform: capitalize; width: 76px; flex-shrink: 0; }
.dim-track { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.04); overflow: hidden; }
.dim-fill { height: 100%; border-radius: 2px; background: var(--accent); opacity: 0.6; transition: width 0.7s ease; }
.dim-val { font-size: 11px; color: var(--text-dim); width: 18px; text-align: right; }

/* App link inline */
.practice-nudge {
  margin-top: 22px; padding: 14px 18px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.practice-nudge p {
  font-size: var(--card-body-fs);
  font-weight: 400;
  line-height: var(--card-reading-lh);
  color: var(--text-secondary);
}
.practice-nudge p strong { color: var(--accent); font-weight: 400; }
.app-btn {
  padding: 7px 16px; background: var(--accent);
  color: var(--bg); font-family: var(--font); font-weight: 600;
  font-size: 12px; letter-spacing: 0.3px;
  border: none; border-radius: 16px; cursor: pointer;
  transition: all 0.2s; text-decoration: none; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.app-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(242,212,112,0.2); }

/* Story section */
.story-deity {
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 4px;
  opacity: 0.75;
}
.story-deity-name {
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.05px;
}
.story-deity-role {
  font-size: 13px; color: var(--text-secondary);
  font-style: italic; line-height: var(--card-reading-lh);
  margin-bottom: 22px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.story-title {
  font-size: var(--card-title-fs);
  font-weight: 300;
  letter-spacing: -0.15px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: var(--card-title-lh);
}
/* Modern Times: title sits directly above body — extra gap matches title → vedic line rhythm */
.story-title:has(+ .story-body) {
  margin-bottom: 12px;
}
.story-source {
  font-size: 11px; color: var(--text-dim);
  font-style: italic; line-height: 1.45;
  margin-bottom: 12px;
}
.story-body {
  font-size: var(--card-body-fs);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: var(--card-reading-lh);
  margin-bottom: 18px;
}
.story-body p + p {
  margin-top: 0.65em;
}
.story-angle {
  font-size: 13px; color: var(--text-dim);
  font-style: italic; line-height: var(--card-reading-lh);
  border-left: 2px solid var(--accent-border);
  padding-left: 14px; margin-top: 14px;
}

/* Share section */
.share-intro {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.8; margin-bottom: 20px;
}
.share-examples { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.share-example {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.share-example p {
  font-size: 13px; color: var(--text-secondary);
  font-style: italic; line-height: 1.7;
}
.share-example .share-meta { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.share-coming {
  background: rgba(0,0,0,0.25); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px; text-align: center;
}
.share-coming p { font-size: 13px; color: var(--text-dim); font-style: italic; line-height: 1.65; }

/* CONTENT PAGES */
.content-page { max-width: 640px; margin: 0 auto; padding: 32px 24px 64px; }
.content-page.app-page { max-width: 1100px; }
.content-page h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.15px;
  margin-bottom: 8px;
  line-height: 1.25;
}
.content-page h1 em { font-style: normal; color: var(--accent); }
.content-page .page-sub {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 300;
  line-height: var(--card-reading-lh);
  margin-bottom: 28px;
}
.content-page p {
  color: var(--text-secondary);
  font-size: var(--card-body-fs);
  font-weight: 400;
  line-height: var(--card-reading-lh);
  margin-bottom: 14px;
}
.content-page p strong { color: var(--accent); font-weight: 400; }
.d-section { margin-bottom: 28px; }
.d-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
  opacity: 0.75;
}

/* Topic cards — Sanskrit page accordion (same rhythm as mantra library cards) */
.topic-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0 8px;
}
.topic-card {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
.topic-card:hover { border-color: var(--accent-border); background: rgba(0,0,0,0.28); }
.topic-card.expanded {
  border-color: var(--accent-border-hover);
  background: rgba(0,0,0,0.3);
}
.topic-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  cursor: pointer;
}
.topic-card-head-left { flex: 1; min-width: 0; }
.topic-card-head h3 {
  font-size: clamp(17px, 0.5vw + 15px, 20px);
  font-weight: 300;
  letter-spacing: -0.15px;
  line-height: 1.25;
  color: var(--accent);
  margin: 0;
}
.topic-card-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 2px;
}
.topic-card:not(.expanded):hover .m-card-open-chip {
  border-color: var(--accent-border-hover);
  color: var(--text-secondary);
}
.topic-card.expanded .m-card-open-chip {
  background: var(--accent-soft);
  border-color: var(--accent-border-hover);
  color: var(--accent);
}
.topic-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.topic-card.expanded .topic-card-body { max-height: 3200px; }
.topic-card-inner {
  border-top: 1px solid var(--border);
  padding: 18px 22px 22px;
}
/* Same typography as intro / .content-page paragraphs */
.content-page .topic-card-inner p {
  color: var(--text-secondary);
  font-size: var(--card-body-fs);
  font-weight: 400;
  line-height: var(--card-reading-lh);
  margin: 0 0 14px;
}
.content-page .topic-card-inner p:last-child { margin-bottom: 0; }
.content-page .topic-card-inner p strong { color: var(--accent); font-weight: 400; }
.topic-status { display: inline-block; margin-top: 8px; font-size: 10px; color: var(--accent-dim); text-transform: uppercase; letter-spacing: 0.5px; }

/* App page — no card frames; spacing only */
.content-page.app-page .app-feature {
  display: flex; align-items: center; gap: 40px;
  padding: 36px 0;
  border: none;
}
.content-page.app-page .app-feature.reverse { flex-direction: row-reverse; }
.app-feature-mock {
  /* Invisible breathing room around the screenshot (no visible frame). */
  flex-shrink: 0;
  /*
    Responsive screenshot "slot"
    - Keeps the image from taking full width on large screens
    - Still grows a bit on medium screens
  */
  width: clamp(280px, 34vw, 420px);
  padding: clamp(10px, 1.4vw, 18px);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 12px;
  letter-spacing: 0.5px; text-transform: uppercase;
  overflow: hidden;
}
.app-feature-mock img {
  max-width: 100%;
  height: auto;
  /*
    Cap visual size dynamically so tall screenshots don't dominate.
    978x2100px will still look crisp; this only changes *displayed* size.
  */
  max-height: clamp(360px, 56vh, 620px);
  object-fit: contain;
  border-radius: 0;
}
.app-feature-text { flex: 1; }
.app-feature-text h3 {
  font-size: clamp(19px, 0.9vw + 14px, 22px);
  font-weight: 300;
  letter-spacing: -0.12px;
  line-height: 1.25;
  color: var(--accent);
  margin-bottom: 12px;
}
.app-feature-text p {
  font-size: var(--card-body-fs);
  font-weight: 400;
  color: var(--text-secondary);
  line-height: var(--card-reading-lh);
  margin-bottom: 10px;
}
@media (max-width: 768px) {
  .content-page.app-page .app-feature,
  .content-page.app-page .app-feature.reverse { flex-direction: column; gap: 24px; }
  .content-page.app-page .app-feature-mock { width: min(92vw, 420px); padding: 12px; }
  .content-page.app-page .app-feature-mock img { max-height: min(62vh, 520px); }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 300;
  line-height: var(--card-reading-lh);
  color: var(--text-dim);
}
.site-footer a {
  color: var(--accent-dim);
  text-decoration: none;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.site-footer a:hover { color: var(--accent); }

/* Privacy (standalone page — matches library typography) */
.privacy-wrap { padding-top: 64px; min-height: 100vh; }
.policy-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.policy-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.policy-header h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.15px;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.policy-header h1 em { font-style: normal; color: var(--accent); }
.policy-header .effective {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: var(--card-reading-lh);
}
.policy-intro {
  font-size: var(--card-body-fs);
  font-weight: 400;
  line-height: var(--card-reading-lh);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.policy-intro strong { color: var(--accent); font-weight: 400; }
.policy-section { margin-bottom: 2rem; }
.policy-section h2 {
  font-size: clamp(18px, 0.85vw + 14px, 20px);
  font-weight: 300;
  letter-spacing: -0.1px;
  line-height: 1.3;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.policy-section p,
.policy-section li {
  font-size: var(--card-body-fs);
  font-weight: 400;
  line-height: var(--card-reading-lh);
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}
.policy-section ul { margin: 0.5rem 0 1rem 1.25rem; }
.policy-section a {
  color: var(--accent-dim);
  text-decoration: none;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.policy-section a:hover { color: var(--accent); }
.policy-section em { color: var(--text); font-style: italic; }
.policy-section p strong { color: var(--accent); font-weight: 400; }
.highlight-box {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
}
.highlight-box p {
  font-size: var(--card-body-fs);
  line-height: var(--card-reading-lh);
  color: var(--text-secondary);
  margin: 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(13px, 0.3vw + 12px, 14px);
  margin: 1rem 0 1.25rem;
}
.data-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--accent);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.65rem 0.75rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: var(--card-reading-lh);
}
.data-table tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.badge-none { background: rgba(80,190,170,0.12); color: rgba(120,200,180,0.9); }
.badge-firebase { background: var(--accent-soft); color: var(--accent); }
.badge-minimal { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* 404 */
.error-404 { padding-top: 48px; text-align: center; }
.error-404-code {
  font-size: 13px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.error-404 h1 {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -0.15px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.25;
}
.error-404-msg {
  font-size: var(--card-body-fs);
  font-weight: 400;
  line-height: var(--card-reading-lh);
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 28px;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fi { animation: fadeIn 0.5s ease both; }
.fu { animation: fadeUp 0.5s ease both; }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); padding: 16px 24px; gap: 4px;
    border-bottom: 1px solid var(--border);
  }
  .nav-mobile-toggle { display: block; }
  .home-grid { grid-template-columns: 1fr; gap: 24px; }
  .featured-row { grid-template-columns: 1fr; }
  .dim-bars { grid-template-columns: 1fr; }
  .m-card-head { gap: 12px; padding: 16px 16px; }
  .topic-card-head { gap: 12px; padding: 16px 16px; }
  .topic-card-inner { padding-left: 16px; padding-right: 16px; padding-bottom: 18px; }
  .card-tabs { flex-wrap: wrap; }
  .practice-nudge { flex-direction: column; text-align: center; }
  .lib-app-cta{ flex-direction: column; text-align: center; align-items: center; }

  /* Mantra list card header: prevent long Devanagari from breaking mobile layout */
  .m-card-script-small{
    font-size: 20px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
