/* ============================================================
   Theodia — single-page informational site
   No framework, no JS. System fonts only.
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f9fafb;
  --text: #1f2937;
  --muted: #6b7280;
  --rule: #e5e7eb;
  --primary: #3b82f6;
  --primary-dark: #1e40af;
  --accent: #f59e0b;
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-text: #f1f5f9;
  --dark-muted: #94a3b8;

  --radius-pill: 999px;
  --radius-card: 18px;

  --max-w: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-pad: clamp(5rem, 10vh, 8rem);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 0 1px rgba(15, 23, 42, 0.08),
    0 8px 24px rgba(15, 23, 42, 0.05);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3, p {
  margin: 0;
}

/* Type scale */
.display {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.display-dark {
  color: var(--dark-text);
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.eyebrow-light {
  color: var(--accent);
}

.lede {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
}

.lede-light {
  color: var(--dark-muted);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ios {
  background: #007aff;
  color: #fff;
}
.btn-ios:hover {
  background: #0051d5;
}

.btn-android {
  background: #34a853;
  color: #fff;
}
.btn-android:hover {
  background: #1e8e3e;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}
.btn-secondary:hover {
  border-color: var(--text);
}

.btn-on-dark {
  margin-top: 1.75rem;
  color: var(--dark-text);
  border-color: rgba(241, 245, 249, 0.25);
  background: transparent;
}

.btn-on-dark:hover {
  border-color: var(--dark-text);
  background: rgba(241, 245, 249, 0.08);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* ----- Nav ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.875rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
  font-size: 0.9375rem;
  color: var(--muted);
}

.nav-links a {
  font-weight: 600;
  transition: color 0.15s ease;
}
.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  margin-left: 0.5rem;
}

/* Hamburger toggle */
.menu-btn {
  display: none;
  margin-left: auto;
  cursor: pointer;
  padding: 0.5rem;
  border: none;
  background: transparent;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* Open state: X shape */
.menu-btn[aria-expanded="true"] .hamburger {
  background: transparent;
}

.menu-btn[aria-expanded="true"] .hamburger::before {
  transform: translateY(7px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .hamburger::after {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 720px) {
  .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 0.5rem 0;
  }

  .nav-links a {
    padding: 0.875rem var(--gutter);
    border-top: 1px solid var(--rule);
  }

  .nav-links a:first-child {
    border-top: none;
  }

  .nav-links.is-open {
    display: flex;
  }
}

/* ----- Hero ----- */
.hero-banner {
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 4vh, 2.5rem) var(--gutter) 0;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-banner .hero-logo {
  margin-top: 0;
}

.hero {
  text-align: center;
  padding: clamp(1rem, 2vh, 1.5rem) var(--gutter) clamp(1rem, 2vh, 1.5rem);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .lede {
  margin-top: 1.5rem;
}

.hero .cta-row {
  justify-content: center;
}

.hero-logo {
  margin-top: 1rem;
  width: clamp(180px, 30vw, 360px);
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(15, 23, 42, 0.08));
}

.features-cta {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}

/* ----- Privacy callout ----- */
.privacy {
  padding: clamp(3rem, 7vh, 5rem) var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}

.privacy-inner {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.privacy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  margin-bottom: 1rem;
}

.privacy-headline {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.875rem;
}

.privacy-lede {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.privacy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--primary);
  transition: color 0.15s ease, gap 0.15s ease;
}

.privacy-link:hover {
  color: var(--primary-dark);
  gap: 0.6rem;
}

/* ----- Features (Z-layout) ----- */
.features {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-pad) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3.5rem);
}

.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.feature-text-left {
  direction: rtl;
  gap: clamp(1rem, 3vw, 2.5rem);
}
.feature-text-left > * {
  direction: ltr;
}

.feature-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--surface) 0%, #eef2ff 100%);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.accent-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--primary);
  z-index: 1;
}

.feature-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Phone-frame treatment for any feature with a screenshot */
.feature-phone {
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
}

/* For text-left variants, push the phone column to the far right
   so the copy sits in the middle-left of the section. */
.feature-phone.feature-text-left {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  column-gap: clamp(0.5rem, 1.5vw, 1.5rem);
  direction: ltr;
}

.feature-text-left .feature-copy {
  padding-left: clamp(3rem, 10vw, 8rem);
}

.feature-phone .feature-media {
  aspect-ratio: 1206 / 2622;
  background: transparent;
  box-shadow: none;
  border-radius: 28px;
  padding: 10px;
  background: linear-gradient(160deg, #ffffff 0%, #eef2ff 100%);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 24px 60px rgba(15, 23, 42, 0.14),
    0 6px 14px rgba(15, 23, 42, 0.06);
}

.feature-phone .feature-img {
  border-radius: 20px;
  object-fit: contain;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
}

.feature-hero .feature-copy h2 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
}

.feature-copy p {
  color: var(--muted);
  font-size: 1.0625rem;
  max-width: 32rem;
}

.resource-counts {
  margin-top: 1.25rem;
  color: var(--text);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

.resource-counts strong {
  color: var(--primary-dark);
  font-weight: 700;
}

@media (max-width: 800px) {
  .feature,
  .feature-text-left {
    grid-template-columns: minmax(0, 1fr);
    direction: ltr;
  }
  .feature-phone,
  .feature-phone.feature-text-left {
    grid-template-columns: minmax(0, 1fr);
  }
  .feature-text-left > * {
    direction: ltr;
  }
  .feature-media {
    order: -1;
    aspect-ratio: 16 / 10;
    width: 100%;
  }
  .feature-hero,
  .feature-phone {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }
  .feature-hero .feature-media,
  .feature-phone .feature-media {
    max-width: 220px;
    width: 100%;
    margin: 0 auto;
  }
  .feature-hero .feature-copy p,
  .feature-phone .feature-copy p {
    margin-left: auto;
    margin-right: auto;
  }
}

/* ----- Theophilus AI (dark) ----- */
.ai {
  background: var(--dark-bg);
  color: var(--dark-text);
  margin-top: var(--section-pad);
  padding: var(--section-pad) var(--gutter);
}

.ai-inner {
  max-width: 56rem;
  margin: 0 auto;
  text-align: center;
}

.ai-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  text-align: left;
}

.ai-media {
  flex: 0 0 auto;
  width: 154px;
}

.ai-media .ai-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 44px rgba(0, 0, 0, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.25);
}

.ai-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.ai-copy .display,
.ai-copy .lede,
.ai-copy .eyebrow {
  text-align: left;
}

@media (max-width: 640px) {
  .ai-row {
    flex-direction: column;
    text-align: center;
  }
  .ai-media {
    width: 110px;
  }
  .ai-copy .display,
  .ai-copy .lede,
  .ai-copy .eyebrow {
    text-align: center;
  }
}

.plugins-note {
  margin-top: 3rem;
  color: var(--dark-muted);
  font-size: 0.9375rem;
}

.plugins-note code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--dark-surface);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  color: var(--dark-text);
}

/* ----- Chip buttons (repo links) ----- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease;
}

.chip:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text);
  transform: translateY(-1px);
}

/* ----- CTA band ----- */
.get {
  text-align: center;
  padding: var(--section-pad) var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
}

.get .display {
  margin-bottom: 0.5rem;
}

.get .cta-row {
  justify-content: center;
}

.footnote {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ----- Footer ----- */
.footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 2rem var(--gutter);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

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

@media (max-width: 720px) {
  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

/* ----- Legal pages (privacy, terms) ----- */
.legal {
  background: var(--bg);
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.legal-inner {
  max-width: 48rem;
  margin: 0 auto;
}

.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.legal-header .eyebrow {
  margin-bottom: 0.75rem;
}

.legal-header .display {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  text-align: left;
}

.legal-updated {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.legal-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: none;
}

.legal-section {
  margin-top: 2.5rem;
  scroll-margin-top: 7rem;
}

.legal-section h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 0.875rem;
  scroll-margin-top: 6.5rem;
}

.legal-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.625rem;
  color: var(--text);
}

.legal-section p,
.legal-section li {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

.legal-section ul,
.legal-section ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.5rem;
}

.legal-section li {
  margin-bottom: 0.5rem;
}

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

.legal-section code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--surface);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--text);
  border: 1px solid var(--rule);
}

.table-wrap {
  margin: 1.25rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
}

.legal-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 32rem;
}

.legal-section th,
.legal-section td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.legal-section th {
  background: rgba(15, 23, 42, 0.04);
  font-weight: 600;
  color: var(--text);
}

.legal-section tbody tr:last-child td {
  border-bottom: none;
}

.legal-contact {
  font-size: 1rem;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .legal {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .legal-header .display {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }
}

/* ----- Features page (long-form overview) ----- */
.features-page {
  background: var(--bg);
}

.features-page-inner {
  max-width: 50rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.features-page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--rule);
}

.features-page-header .eyebrow {
  margin-bottom: 0.75rem;
}

.features-page-header .display {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  text-align: left;
}

.features-page-header .lede {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.features-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  font-size: 0.875rem;
}

.features-toc a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  border: 1px solid var(--rule);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.features-toc a:hover {
  color: var(--text);
  border-color: var(--text);
}

.features-page-section {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 7rem;
}

.features-page-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.features-page-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  scroll-margin-top: 6.5rem;
}

.features-page-section p {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.features-page-section ul {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.5rem;
}

.features-page-section li {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.features-page-section li::marker {
  color: var(--muted);
}

.features-page-section li > ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.features-page-section li > ul li {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.features-page-section strong {
  color: var(--text);
  font-weight: 600;
}

.features-page-section code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--surface);
  padding: 0.1em 0.4em;
  border-radius: 5px;
  color: var(--text);
  border: 1px solid var(--rule);
}

.features-page-section a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.features-page-section a:hover {
  color: var(--primary-dark);
}

@media (max-width: 720px) {
  .features-page-inner {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  .features-page-header .display {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }
  .features-toc {
    font-size: 0.8125rem;
  }
  .features-toc a {
    padding: 0.35rem 0.7rem;
  }
}

/* ----- Theophilus page ----- */
.theo-page {
  background: var(--bg);
}

.theo-hero {
  background: var(--dark-bg);
  color: var(--dark-text);
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) clamp(3rem, 7vh, 4.5rem);
}

.theo-hero-inner {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.theo-hero-inner .eyebrow {
  margin-bottom: 1rem;
}

.theo-hero-inner .display {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 1.25rem;
  text-align: center;
}

.theo-hero-inner .lede {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.theo-content {
  max-width: 50rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

.theo-section {
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 7rem;
}

.theo-section:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.theo-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
  scroll-margin-top: 6.5rem;
}

.theo-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.theo-section-intro {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.25rem;
}

.theo-section p {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.theo-section ul {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.5rem;
}

.theo-section li {
  color: var(--text);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

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

.theo-section li > ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.theo-section li > ul li {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.theo-section strong {
  color: var(--text);
  font-weight: 600;
}

.theo-section a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.theo-section a:hover {
  color: var(--primary-dark);
}

/* ----- FAQ page ----- */
.faq-page {
  background: var(--bg);
}

.faq-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(3rem, 8vh, 6rem);
}

/* ----- FAQ hero ----- */
.faq-hero {
  background: #1e3a2f;
  color: var(--dark-text);
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) clamp(3rem, 7vh, 4.5rem);
}

.faq-hero-inner {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.faq-hero-inner .display {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 1.25rem;
  text-align: center;
}

.faq-hero-inner .lede {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ----- Features hero ----- */
.features-hero {
  background: #1e2a4a;
  color: var(--dark-text);
  padding: clamp(3rem, 8vh, 5.5rem) var(--gutter) clamp(3rem, 7vh, 4.5rem);
}

.features-hero-inner {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.features-hero-inner .display {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 1.25rem;
  text-align: center;
}

.features-hero-inner .lede {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

@media (max-width: 720px) {
  .theo-hero-inner .display,
  .faq-hero-inner .display,
  .features-hero-inner .display {
    font-size: clamp(2rem, 9vw, 2.75rem);
  }
  .faq-content {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
}

/* ----- Back to top ----- */
.back-to-top {
  position: fixed;
  bottom: 4rem;
  right: 1.5rem;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid var(--rule);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  box-shadow: var(--shadow-soft);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--primary);
  border-color: var(--primary);
}

@media (max-width: 720px) {
  .back-to-top {
    bottom: 3.5rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
