:root {
  --bg: #0b0c0f;
  --bg-subtle: #121318;
  --surface: #171920;
  --surface-tint: #1f1b15;
  --text: #f5f1e8;
  --text-secondary: #a8a39a;
  --text-muted: #75716a;
  --border: rgba(245, 241, 232, 0.09);
  --border-strong: rgba(223, 190, 132, 0.28);
  --accent: #dfbe84;
  --accent-contrast: #0b0c0f;
  --shadow-soft: 0 20px 48px rgba(0, 0, 0, 0.48);
  --radius-card: 20px;
  --radius-pill: 999px;
  --font-sans: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
}

:root[data-theme="light"] {
  --bg: #f4f2ed;
  --bg-subtle: #eae7e0;
  --surface: #fbfaf7;
  --surface-tint: #efeae0;
  --text: #161615;
  --text-secondary: #575551;
  --text-muted: #85827c;
  --border: rgba(22, 22, 21, 0.09);
  --border-strong: rgba(22, 22, 21, 0.18);
  --accent: #181817;
  --accent-contrast: #fbfaf7;
  --shadow-soft: 0 16px 42px rgba(22, 20, 16, 0.06);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Sticky Navigation (height <= 72px, single line) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
  }
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.nav-links a {
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.icon-pill {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, color 0.2s ease;
}

.icon-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-pill:active,
.btn:active {
  transform: scale(0.98);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, border-color 0.2s ease;
}

.btn-sm {
  height: 38px;
  padding: 0 18px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(180deg, #f0ca82 0%, #dfbe84 55%, #c5964c 100%);
  color: var(--accent-contrast);
  box-shadow: 0 10px 28px rgba(223, 190, 132, 0.24);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

/* Hero: Compact Sanctuary Split */
.hero {
  padding: 52px 0 64px;
  background: radial-gradient(ellipse 70% 55% at 65% 15%, rgba(223, 190, 132, 0.08), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 4vw, 3.65rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  padding-bottom: 4px;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 48ch;
  margin: 0 0 32px;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
  background: var(--bg-subtle);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11, 12, 15, 0.68) 100%);
  pointer-events: none;
}

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  max-width: 58ch;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 3.6vw, 3.1rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.section-subtitle {
  font-size: 1.02rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 58ch;
}

/* Section 2: Interactive Tradition Stage */
.tradition-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.tradition-pill {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tradition-pill[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.dialogue-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: start;
}

.dialogue-question {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
}

.dialogue-role {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.dialogue-question p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text);
}

.dialogue-answer {
  padding: 6px 4px;
}

.dialogue-answer p {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  line-height: 1.55;
  margin: 0 0 14px;
  color: var(--text);
}

.dialogue-note {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Live D1 Scripture Showcase */
.live-scripture-card {
  margin-top: 22px;
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--border));
}
.live-scripture-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.live-scripture-title {
  margin: 4px 0 0;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text);
}
.live-scripture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.live-scripture-verses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.live-scripture-verses strong {
  color: var(--gold);
  margin-right: 6px;
}

/* Section 3: 4-cell Asymmetric Bento Grid (exact 4 items = 4 cells, diverse backgrounds) */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.bento-cell {
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-graph {
  grid-column: span 7;
  background: var(--surface);
  padding: 28px;
  min-height: 410px;
}

.bento-photo {
  grid-column: span 5;
  background: var(--bg-subtle);
  min-height: 410px;
}

.bento-photo-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.bento-photo-copy {
  padding: 24px 28px 28px;
}

.bento-prayers {
  grid-column: span 5;
  background: var(--surface-tint);
  padding: 28px;
}

.bento-offline {
  grid-column: span 7;
  background: var(--bg-subtle);
  padding: 28px;
}

.bento-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.2;
}

.bento-body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 52ch;
}

.themes-explorer {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-chip {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-chip[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.theme-detail {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 2.5px solid var(--accent);
}

.theme-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.theme-ref {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-count {
  color: var(--text-muted);
}

.theme-quote {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
}

.theme-related {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 44px;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.faq-item h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.faq-item p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Section 4: 2-Column Care & Architecture */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 56px;
}

.principle-item {
  padding-top: 20px;
  border-top: 1px solid var(--border-strong);
}

.principle-item h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  margin: 0 0 8px;
}

.principle-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.96rem;
  max-width: 50ch;
}

/* Section 5: Centered Membership Block */
.membership-panel {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 48px 36px;
  box-shadow: var(--shadow-soft);
}

.membership-price {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 600;
  margin: 16px 0 8px;
}

.membership-meta {
  color: var(--text-secondary);
  font-size: 0.96rem;
  margin: 0 auto 24px;
  max-width: 48ch;
}

.tester-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.tester-input {
  flex: 1 1 250px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tester-input::placeholder {
  color: var(--text-muted);
}

.tester-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(223, 190, 132, 0.16);
}

.tester-status {
  min-height: 22px;
  margin: 14px auto 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.tester-status.is-error {
  color: #e07a7a;
}

.membership-note {
  margin-top: 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Legal pages layout */
.legal-main {
  padding: 64px 0 96px;
}

.legal-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 44px;
  box-shadow: var(--shadow-soft);
}

.legal-card h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  margin: 0 0 12px;
  line-height: 1.15;
}

.legal-card h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 28px 0 10px;
}

.legal-card p,
.legal-card li {
  color: var(--text-secondary);
  font-size: 0.97rem;
}

.legal-card code {
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--text);
}

/* Reveal animation gated by reduced-motion */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Explicit Mobile Collapse (< 768px) */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
  .hero {
    min-height: auto;
    padding: 36px 0 56px;
  }
  .hero-grid,
  .dialogue-stage,
  .principles-grid,
  .faq-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .bento-graph,
  .bento-photo,
  .bento-prayers,
  .bento-offline {
    grid-column: span 12;
    min-height: auto;
  }
  .section {
    padding: 64px 0;
  }
  .legal-card {
    padding: 28px 20px;
  }
}
