:root {
  --theme-bg: #0c0b1a;
  --theme-bg-deep: #070611;
  --theme-panel: #151423;
  --theme-panel-raised: #1a182c;
  --theme-panel-code: #090815;
  --theme-ink: #fafafc;
  --theme-text: #e8e4ef;
  --theme-text-muted: #aaa4b7;
  --theme-text-quiet: #777184;
  --theme-purple-300: #bf92ff;
  --theme-purple-500: #9c5eef;
  --theme-purple-600: #7d24d3;
  --theme-purple-800: #4f0090;
  --theme-purple-muted: #ae96da;
  --theme-pink: #e24bc0;
  --theme-line: rgba(191, 146, 255, 0.18);
  --theme-line-strong: rgba(191, 146, 255, 0.34);
  --theme-shadow: 0 20px 55px rgba(3, 3, 7, 0.28);
}

html[data-theme="light"] {
  --theme-bg: #f8f6fb;
  --theme-bg-deep: #eee9f4;
  --theme-panel: #ffffff;
  --theme-panel-raised: #f3eef8;
  --theme-panel-code: #fbf9fd;
  --theme-ink: #21162c;
  --theme-text: #372e40;
  --theme-text-muted: #665c70;
  --theme-text-quiet: #7d7288;
  --theme-purple-300: #8a45d1;
  --theme-purple-500: #7d24d3;
  --theme-purple-600: #6816ae;
  --theme-purple-800: #4f0090;
  --theme-purple-muted: #6f458f;
  --theme-pink: #b52690;
  --theme-line: rgba(79, 0, 144, 0.14);
  --theme-line-strong: rgba(79, 0, 144, 0.27);
  --theme-shadow: 0 18px 45px rgba(54, 34, 71, 0.11);

  --bg: var(--theme-bg);
  --bg-deep: var(--theme-bg-deep);
  --surface: var(--theme-panel);
  --surface-2: var(--theme-panel-raised);
  --ink: var(--theme-ink);
  --muted: var(--theme-text-muted);
  --faint: var(--theme-text-quiet);
  --panel: var(--theme-panel);
  --line: var(--theme-line);
  --lilac: var(--theme-purple-300);
  --violet: var(--theme-purple-500);
  --pink: var(--theme-pink);
  --purple-300: var(--theme-purple-300);
  --purple-500: var(--theme-purple-500);
  --purple-600: var(--theme-purple-600);
  --purple-800: var(--theme-purple-800);
}

.theme-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #d9c6f5;
  border: 1px solid rgba(191, 146, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
  color: #fff;
  border-color: rgba(191, 146, 255, 0.46);
  background: rgba(191, 146, 255, 0.13);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid #bf92ff;
  outline-offset: 3px;
}

.theme-toggle__icon {
  font: 400 19px/1 system-ui, sans-serif;
  transform: translateY(-0.5px);
}

.header-controls,
.contact-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Shared docs palette */

html[data-theme="light"] {
  scrollbar-color: rgba(79, 0, 144, 0.25) var(--theme-bg-deep);
  background: var(--theme-bg);
}

html[data-theme="light"] body {
  color: var(--theme-ink);
  background-color: var(--theme-bg);
}

html[data-theme="light"] ::selection {
  color: #fff;
  background: var(--theme-purple-500);
}

html[data-theme="light"] :focus-visible {
  outline-color: var(--theme-purple-300);
}

/* Journal, article and error pages */

html[data-theme="light"] body:not(.site-home):not(.site-hosanna):not(.site-contact) {
  background:
    radial-gradient(circle at 65% -20%, rgba(125, 36, 211, 0.09), transparent 36rem),
    var(--theme-bg);
}

html[data-theme="light"] .site-header,
html[data-theme="light"] .site-header.is-scrolled {
  border-bottom-color: rgba(191, 146, 255, 0.16);
  background: rgba(12, 11, 26, 0.96);
}

html[data-theme="light"] .site-header .company-logo,
html[data-theme="light"] .site-nav > a,
html[data-theme="light"] .menu-toggle {
  color: #f8f6ff;
}

html[data-theme="light"] .site-nav .nav-cta {
  color: #fff;
}

html[data-theme="light"] .blog-row:hover,
html[data-theme="light"] .post-card:hover {
  border-color: var(--theme-line-strong);
  background: rgba(125, 36, 211, 0.045);
}

html[data-theme="light"] .article-deck,
html[data-theme="light"] .prose > p:first-child,
html[data-theme="light"] .prose p,
html[data-theme="light"] .prose li,
html[data-theme="light"] .prose blockquote {
  color: var(--theme-text);
}

html[data-theme="light"] .prose code {
  color: #641ca8;
  background: rgba(79, 0, 144, 0.075);
}

html[data-theme="light"] .prose pre {
  color: var(--theme-text);
  background: var(--theme-panel-code);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .contact-section {
  border-color: var(--theme-line);
  background:
    radial-gradient(circle at 86% 28%, rgba(125, 36, 211, 0.13), transparent 30%),
    linear-gradient(135deg, #eee9f4, #ffffff 70%);
  box-shadow: var(--theme-shadow);
}

html[data-theme="light"] .contact-section > div:nth-child(2) > p {
  color: var(--theme-text-muted);
}

html[data-theme="light"] .contact-section .button-light {
  color: #fff;
  background: var(--theme-purple-500);
}

html[data-theme="light"] .site-footer {
  background: var(--theme-bg-deep);
}

html[data-theme="light"] .footer-links a {
  color: #574b61;
}

html[data-theme="light"] .footer-base {
  color: var(--theme-text-quiet);
  box-shadow: 0 45px 110px rgba(54, 34, 71, 0.08);
}

/* Main marketing page */

html[data-theme="light"] .site-home {
  color: var(--theme-ink);
  background: var(--theme-bg);
}

html[data-theme="light"] .site-home [data-nav] {
  border-bottom-color: rgba(191, 146, 255, 0.16) !important;
  background: rgba(12, 11, 26, 0.96) !important;
}

html[data-theme="light"] .site-home [data-nav] .nav-company-wordmark {
  color: #fafafc;
}

html[data-theme="light"] .site-home [data-nav] .nav-company-byline {
  color: #777184;
}

html[data-theme="light"] .site-home [style*="color:#AE96DA"],
html[data-theme="light"] .site-home .team-tenure,
html[data-theme="light"] .site-home .partner-company,
html[data-theme="light"] .site-home .hosanna-copy-link {
  color: var(--theme-purple-muted) !important;
}

html[data-theme="light"] .site-home [style*="color:#71707D"],
html[data-theme="light"] .site-home [style*="color:#625D6C"],
html[data-theme="light"] .site-home [style*="color:#555361"],
html[data-theme="light"] .site-home [style*="color:#4F4D5B"] {
  color: var(--theme-text-quiet) !important;
}

html[data-theme="light"] .site-home [style*="color:#BF92FF"],
html[data-theme="light"] .site-home .case-study-trigger {
  color: var(--theme-purple-300) !important;
}

html[data-theme="light"] .site-home [style*="color:#E24BC0"] {
  color: var(--theme-pink) !important;
}

html[data-theme="light"] .site-home [style*="background:#151423"],
html[data-theme="light"] .site-home .theme-surface,
html[data-theme="light"] .site-home .in-progress-card {
  color: var(--theme-ink) !important;
  background: var(--theme-panel) !important;
}

html[data-theme="light"] .site-home .theme-surface {
  border-color: var(--theme-line) !important;
  box-shadow: 0 14px 36px rgba(54, 34, 71, 0.075);
}

html[data-theme="light"] .site-home .theme-surface:hover {
  border-color: var(--theme-line-strong) !important;
  box-shadow: 0 20px 46px rgba(54, 34, 71, 0.13);
}

html[data-theme="light"] .site-home .team-card a:not(.partner-company) {
  color: var(--theme-purple-600);
}

html[data-theme="light"] .site-home [style*="border:1px solid rgba(191,146,255"],
html[data-theme="light"] .site-home [style*="border-top:1px solid rgba(191,146,255"],
html[data-theme="light"] .site-home [style*="border-bottom:1px solid rgba(191,146,255"] {
  border-color: var(--theme-line) !important;
}

html[data-theme="light"] .site-home #hosanna {
  background: radial-gradient(ellipse 800px 500px at 85% 0%, rgba(125, 36, 211, 0.11), transparent 65%) !important;
}

html[data-theme="light"] .site-home #contact {
  background: radial-gradient(ellipse 700px 420px at 20% 100%, rgba(125, 36, 211, 0.12), transparent 65%) !important;
}

html[data-theme="light"] .site-home [data-wall] {
  opacity: 0.09 !important;
}

html[data-theme="light"] .site-home #hosanna pre {
  color: var(--theme-text-muted) !important;
  background: var(--theme-panel-code);
}

html[data-theme="light"] .site-home blockquote {
  color: var(--theme-text-muted) !important;
  background: var(--theme-panel-raised) !important;
}

html[data-theme="light"] .site-home .case-study-dialog {
  color: var(--theme-ink);
  background: rgba(238, 233, 244, 0.88);
}

html[data-theme="light"] .site-home .case-study-dialog::backdrop {
  background: rgba(33, 22, 44, 0.42);
}

html[data-theme="light"] .site-home .case-study-modal,
html[data-theme="light"] .site-home .case-study-section,
html[data-theme="light"] .site-home .case-study-media figure,
html[data-theme="light"] .site-home .case-study-placeholder {
  color: var(--theme-ink);
  background: var(--theme-panel);
}

html[data-theme="light"] .site-home .case-study-hero {
  background:
    radial-gradient(circle at 92% 0%, rgba(125, 36, 211, 0.12), transparent 38%),
    linear-gradient(145deg, #f3eef8, #ffffff 68%);
}

html[data-theme="light"] .site-home .case-study-lede,
html[data-theme="light"] .site-home .case-study-features span,
html[data-theme="light"] .site-home .case-study-callout p,
html[data-theme="light"] .site-home .case-study-quote p {
  color: var(--theme-text-muted);
}

html[data-theme="light"] .site-home .case-study-facts dd {
  color: var(--theme-text);
}

html[data-theme="light"] .site-home .case-study-quote,
html[data-theme="light"] .site-home .case-study-callout {
  color: var(--theme-ink);
  border-color: var(--theme-line);
  background: var(--theme-panel-raised);
}

html[data-theme="light"] .site-home .case-study-close {
  color: #fff;
  background: rgba(12, 11, 26, 0.92);
}

html[data-theme="light"] .site-home [style*="background:#9C5EEF"][style*="color:#FAFAFC"],
html[data-theme="light"] .site-home .nav-icon-link {
  color: #fff !important;
}

html[data-theme="light"] .site-home > footer {
  color: var(--theme-text-quiet) !important;
  background: var(--theme-bg-deep);
}

/* Hosanna product and features pages */

html[data-theme="light"] .site-hosanna {
  color: var(--theme-ink);
  background: var(--theme-bg);
}

html[data-theme="light"] .site-hosanna [data-nav] {
  --ink: #fafafc;
  --muted: #ae96da;
  --quiet: #777184;
  --panel: #151423;
  --line: rgba(191, 146, 255, 0.2);
  --lilac: #bf92ff;
  --violet: #9c5eef;
  --pink: #e24bc0;
  border-bottom-color: rgba(191, 146, 255, 0.16);
  background: rgba(12, 11, 26, 0.96);
}

html[data-theme="light"] .site-hosanna .copy-study-name,
html[data-theme="light"] .site-hosanna .copy-point,
html[data-theme="light"] .site-hosanna .feature-card,
html[data-theme="light"] .site-hosanna .video-frame,
html[data-theme="light"] .site-hosanna .code-window {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .site-hosanna .section-glow-left {
  background: radial-gradient(ellipse 800px 500px at 10% 0%, rgba(125, 36, 211, 0.09), transparent 65%);
}

html[data-theme="light"] .site-hosanna .section-glow-right {
  background: radial-gradient(ellipse 800px 500px at 90% 20%, rgba(125, 36, 211, 0.09), transparent 65%);
}

html[data-theme="light"] .site-hosanna .support-section {
  background:
    radial-gradient(ellipse 850px 520px at 88% 20%, rgba(181, 38, 144, 0.08), transparent 66%),
    radial-gradient(ellipse 760px 480px at 8% 90%, rgba(125, 36, 211, 0.09), transparent 68%);
}

html[data-theme="light"] .site-hosanna .support-metric {
  background: linear-gradient(150deg, #ffffff, #f3eef8);
  box-shadow: var(--theme-shadow), inset 0 1px #fff;
}

html[data-theme="light"] .site-hosanna .video-placeholder {
  background:
    linear-gradient(rgba(251, 249, 253, 0.9), rgba(243, 238, 248, 0.94)),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(79, 0, 144, 0.08) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(79, 0, 144, 0.08) 40px);
}

html[data-theme="light"] .site-hosanna .hosanna-cta,
html[data-theme="light"] .site-hosanna .feature-filter-results {
  background: radial-gradient(ellipse 800px 520px at 80% 100%, rgba(125, 36, 211, 0.1), transparent 67%);
}

html[data-theme="light"] .site-hosanna .feature-filter-strip {
  border-color: var(--theme-line);
  background: rgba(248, 246, 251, 0.94);
}

html[data-theme="light"] .site-hosanna .feature-filter-button {
  border-color: var(--theme-line);
  color: var(--theme-text-muted);
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .site-hosanna .feature-filter-button[aria-pressed="true"],
html[data-theme="light"] .site-hosanna .primary-action {
  color: #fff;
  background: var(--theme-purple-500);
}

html[data-theme="light"] .site-hosanna .code-window pre {
  color: var(--theme-text-muted);
  background: var(--theme-panel-code);
}

html[data-theme="light"] .site-hosanna footer {
  color: var(--theme-text-quiet);
  background: var(--theme-bg-deep);
}

/* Contact choice page */

html[data-theme="light"] .site-contact {
  color: var(--theme-ink);
  background: var(--theme-bg);
}

html[data-theme="light"] .site-contact .page-grid::before {
  background:
    radial-gradient(circle at 18% 12%, rgba(125, 36, 211, 0.12), transparent 32%),
    radial-gradient(circle at 84% 74%, rgba(181, 38, 144, 0.08), transparent 28%);
}

html[data-theme="light"] .site-contact .page-grid::after {
  background-image:
    linear-gradient(rgba(79, 0, 144, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 0, 144, 0.04) 1px, transparent 1px);
}

html[data-theme="light"] .site-contact .contact-nav {
  --ink: #fafafc;
  --muted: #ae96da;
  --quiet: #777184;
  --line: rgba(191, 146, 255, 0.2);
  --lilac: #bf92ff;
  --pink: #e24bc0;
  padding-inline: 18px;
  border-radius: 0 0 12px 12px;
  background: rgba(12, 11, 26, 0.96);
}

html[data-theme="light"] .site-contact .choice-card,
html[data-theme="light"] .site-contact .choice-card--hosanna {
  border-color: var(--theme-line);
  background:
    radial-gradient(circle at 88% 10%, rgba(125, 36, 211, 0.08), transparent 36%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.97), rgba(243, 238, 248, 0.99));
  box-shadow: var(--theme-shadow);
}

html[data-theme="light"] .site-contact .choice-card:hover {
  border-color: var(--theme-line-strong);
  box-shadow: 0 28px 70px rgba(54, 34, 71, 0.15);
}

@media (max-width: 920px) {
  .header-controls {
    position: relative;
    z-index: 3;
  }

  .header-controls .menu-toggle span {
    display: none;
  }

  .header-controls .theme-toggle {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}

@media (max-width: 620px) {
  .site-hosanna .theme-toggle {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .site-hosanna .theme-toggle__icon {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle {
    transition: none;
  }
}
