:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-strong: #eceef2;
  --text: #16181d;
  --muted: #565f6d;
  --border: #dfe3e9;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --focus: #b45309;
  --shadow: 0 1px 2px rgb(16 24 40 / 8%), 0 8px 24px rgb(16 24 40 / 6%);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-deva: "Noto Sans Devanagari", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101318;
    --surface: #171b22;
    --surface-strong: #1f242d;
    --text: #f2f4f7;
    --muted: #aab3c0;
    --border: #2b323c;
    --accent: #8ab4ff;
    --accent-text: #0b1220;
    --focus: #fbbf24;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2.5rem, 68rem);
  margin-inline: auto;
}

main {
  flex: 1;
  padding-block: 2.5rem 4rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1rem;
}

.brand {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.app-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-nav a {
  display: inline-block;
  padding-block: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.app-nav a:hover,
.app-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

.hero {
  max-width: 44rem;
  padding-block: 1rem 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 6vw, 3rem);
}

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
}

h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1rem;
}

p {
  margin: 0 0 1rem;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
}

.muted,
.meta {
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.button:hover {
  filter: brightness(1.08);
}

.coming-soon {
  display: inline-block;
  margin: 0;
  padding: 0.75rem 1.1rem;
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

.app-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-block: 1rem 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.card h2 a {
  color: var(--text);
  text-decoration: none;
}

.card h2 a:hover {
  text-decoration: underline;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card-link {
  margin-top: auto;
  padding-top: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.prose {
  max-width: 44rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li::marker {
  color: var(--muted);
}

.prose h2 + p,
.prose h3 + p {
  margin-top: 0;
}

.prose hr {
  margin-block: 2rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.cta {
  max-width: 44rem;
  margin-top: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.cta p:last-child {
  margin-bottom: 0;
}

.chapters {
  max-width: 44rem;
  margin-top: 2.5rem;
}

.chapter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.chapter-grid a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  height: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
}

.chapter-grid a:hover {
  background: var(--surface);
}

.chapter-number {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.crumbs a {
  color: var(--muted);
}

.verse,
.chapter {
  max-width: 44rem;
}

.verse-deva {
  margin: 0 0 0.75rem;
  padding: 1rem 0 1rem 1.1rem;
  border-left: 4px solid var(--accent);
  font-family: var(--font-deva);
  font-size: clamp(1.3rem, 4.5vw, 1.75rem);
  line-height: 1.75;
}

.verse-deva p {
  margin: 0;
}

.verse-iast {
  color: var(--muted);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.7;
}

.verse-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.verse-section h2 {
  margin-top: 0;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.verse-body {
  white-space: pre-line;
}

.attribution {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.pager a {
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
}

.pager-chapter {
  color: var(--muted);
}

.chapter-sanskrit {
  margin: -0.5rem 0 0.25rem;
  font-family: var(--font-deva);
  font-size: 1.5rem;
}

.chapter-iast {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-style: italic;
}

.verse-list {
  padding: 0;
  list-style: none;
}

.verse-list li {
  border-bottom: 1px solid var(--border);
}

.verse-list a {
  display: block;
  padding: 0.7rem 0;
  color: var(--text);
  text-decoration: none;
}

.verse-list a:hover {
  color: var(--accent);
}

.verse-ref {
  display: inline-block;
  min-width: 3.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer .wrap {
  padding-block: 1.5rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

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

@media (min-width: 40rem) {
  .app-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 62rem) {
  .app-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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