@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;500;600;700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --docs-ink: #0f172a;
  --docs-muted: #475569;
  --docs-accent: #f97316;
  --docs-accent-strong: #ea580c;
  --docs-card: #ffffff;
  --docs-surface: #f8fafc;
  --docs-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  --docs-radius: 22px;
}

html[data-theme="dark"] {
  --docs-ink: #e2e8f0;
  --docs-muted: #94a3b8;
  --docs-accent: #fb923c;
  --docs-accent-strong: #f97316;
  --docs-card: #0f172a;
  --docs-surface: #0b1020;
  --docs-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

body {
  font-family: "Source Sans 3", "Noto Sans", "Helvetica Neue", sans-serif;
  color: var(--docs-ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(249, 115, 22, 0.18), transparent 60%),
    radial-gradient(900px 500px at 90% -20%, rgba(14, 116, 144, 0.16), transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 40%, #f1f5f9 100%);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(249, 115, 22, 0.18), transparent 60%),
    radial-gradient(900px 500px at 88% -20%, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(180deg, #0b1020 0%, #0f172a 45%, #0b1324 100%);
}

h1,
h2,
h3,
h4,
.navbar-brand,
.bd-sidebar-primary .sidebar-header {
  font-family: "Source Serif 4", "Times New Roman", serif;
  letter-spacing: -0.01em;
}

.bd-container,
.bd-content,
.bd-main {
  background: transparent;
}

.docs-home-hero {
  position: relative;
  padding: 3.5rem 3.2rem;
  border-radius: var(--docs-radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.98)),
    linear-gradient(120deg, rgba(249, 115, 22, 0.12), rgba(14, 116, 144, 0.1));
  box-shadow: var(--docs-shadow);
  overflow: hidden;
}

html[data-theme="dark"] .docs-home-hero {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(10, 14, 26, 0.98)),
    linear-gradient(120deg, rgba(249, 115, 22, 0.2), rgba(56, 189, 248, 0.12));
}

.docs-home-hero::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -140px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.25), transparent 60%);
  filter: blur(4px);
  opacity: 0.9;
}

.docs-home-hero::after {
  content: "";
  position: absolute;
  bottom: -140px;
  left: -160px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(14, 116, 144, 0.18), transparent 60%);
  filter: blur(2px);
  opacity: 0.8;
}

.docs-hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.6);
}

html[data-theme="dark"] .docs-hero-kicker {
  color: rgba(226, 232, 240, 0.7);
}

.docs-hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.7);
  margin-bottom: 1.2rem;
}

html[data-theme="dark"] .docs-hero-brand {
  color: rgba(226, 232, 240, 0.75);
}

.docs-hero-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.docs-hero-title {
  margin: 0.7rem 0 0.9rem;
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  max-width: 36rem;
}

.docs-hero-subtitle {
  font-size: 1.15rem;
  color: var(--docs-muted);
  max-width: 34rem;
}

.docs-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1.8rem 0 0;
}

.docs-hero-cta .sd-btn {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  font-size: 1rem;
}

.docs-hero-cta .sd-btn-primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}

.docs-hero-cta .sd-btn-primary:hover {
  background: #1f2937;
  border-color: #1f2937;
}

html[data-theme="dark"] .docs-hero-cta .sd-btn-primary {
  background: var(--docs-accent);
  border-color: var(--docs-accent);
  color: #0b1020;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.55);
}

html[data-theme="dark"] .docs-hero-cta .sd-btn-primary:hover {
  background: var(--docs-accent-strong);
  border-color: var(--docs-accent-strong);
}

.docs-hero-cta .sd-btn-secondary {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.3);
  color: #0f172a;
}

html[data-theme="dark"] .docs-hero-cta .sd-btn-secondary {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--docs-ink);
}

.docs-home-section-title {
  margin-top: 2.4rem;
  margin-bottom: 1rem;
  font-size: 1.6rem;
}

.docs-home-grid .sd-card {
  border-radius: var(--docs-radius);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--docs-card);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

html[data-theme="dark"] .docs-home-grid .sd-card {
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.6);
}

.docs-home-grid .sd-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.docs-home-grid .sd-card .sd-card-title {
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: 1.25rem;
}

.docs-home-grid .sd-card .sd-card-text {
  color: var(--docs-muted);
}

/* Demos landing page */
.demos-hero {
  position: relative;
  overflow: hidden;
  margin: 0.5rem 0 2.5rem;
  padding: 3.4rem 3.2rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 28px;
  background:
    radial-gradient(circle at 82% 18%, rgba(249, 115, 22, 0.2), transparent 24%),
    radial-gradient(circle at 12% 88%, rgba(14, 116, 144, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 252, 0.92));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.11);
}

html[data-theme="dark"] .demos-hero {
  border-color: rgba(148, 163, 184, 0.16);
  background:
    radial-gradient(circle at 82% 18%, rgba(249, 115, 22, 0.2), transparent 24%),
    radial-gradient(circle at 12% 88%, rgba(56, 189, 248, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(8, 13, 25, 0.96));
}

.demos-hero-eyebrow {
  margin-bottom: 0.8rem;
  color: var(--docs-accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.demos-hero-title {
  max-width: 48rem;
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.demos-hero-subtitle {
  max-width: 47rem;
  margin-top: 1.15rem;
  color: var(--docs-muted);
  font-size: 1.15rem;
  line-height: 1.65;
}

.demos-capability-grid {
  margin-top: 1.3rem;
  margin-bottom: 2.8rem;
}

.demos-capability-card {
  position: relative;
  overflow: hidden;
  min-height: 19rem;
  border: 1px solid rgba(148, 163, 184, 0.26) !important;
  border-radius: 24px !important;
  background: var(--docs-card) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.demos-capability-card::before {
  content: "";
  display: block;
  height: 5px;
  margin: -1rem -1rem 1.4rem;
  background: linear-gradient(90deg, var(--docs-accent), rgba(249, 115, 22, 0.18));
}

.demos-capability-card-surrogate::before {
  background: linear-gradient(90deg, #0e7490, rgba(14, 116, 144, 0.16));
}

.demos-capability-card-workflow::before {
  background: linear-gradient(90deg, #7c3aed, rgba(124, 58, 237, 0.16));
}

.demos-capability-card:hover {
  transform: translateY(-6px);
  border-color: rgba(148, 163, 184, 0.45) !important;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.13);
}

.demos-capability-card .sd-card-title {
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: 1.5rem;
  line-height: 1.15;
}

.demos-capability-card .sd-card-body {
  color: var(--docs-muted);
  line-height: 1.65;
}

.demos-capability-card .sd-card-footer {
  border-top: 0;
  background: transparent;
  color: var(--docs-ink);
}

html[data-theme="dark"] .demos-capability-card {
  border-color: rgba(148, 163, 184, 0.17) !important;
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.5);
}

.demos-start-grid .sd-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

html[data-theme="dark"] .demos-start-grid .sd-card {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.15);
}

.demos-start-grid .sd-card-title {
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: 1.25rem;
}

.demos-start-grid .sd-card-body {
  color: var(--docs-muted);
}

.demos-feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.8rem 0 1rem;
  padding: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.72);
}

html[data-theme="dark"] .demos-feature-strip {
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.48);
}

.demos-feature-strip > div {
  padding: 0.5rem 0.65rem;
  color: var(--docs-muted);
  line-height: 1.45;
}

.demos-feature-strip strong {
  color: var(--docs-ink);
}

.demos-feature-number {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--docs-accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.ask-repo-widget {
  min-width: min(26rem, 42vw);
}

.ask-repo-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.ask-repo-input,
.ask-repo-dialog-input {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.88);
  color: var(--docs-ink);
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  min-width: 0;
  outline: none;
}

.ask-repo-input {
  width: min(22rem, 36vw);
  font-size: 0.92rem;
}

.ask-repo-input:focus,
.ask-repo-dialog-input:focus {
  border-color: rgba(249, 115, 22, 0.85);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.ask-repo-button,
.ask-repo-dialog-button,
.ask-repo-close {
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
}

.ask-repo-button:hover,
.ask-repo-dialog-button:hover,
.ask-repo-close:hover {
  background: linear-gradient(135deg, #fb923c, #f97316);
}

.ask-repo-dialog-button-secondary {
  background: #0f172a;
}

.ask-repo-dialog-button-secondary:hover {
  background: #1f2937;
}

.ask-repo-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(5px);
  z-index: 2000;
}

.ask-repo-overlay.is-open {
  display: flex;
}

.ask-repo-dialog {
  width: min(52rem, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--docs-card);
  color: var(--docs-ink);
  border-radius: 24px;
  box-shadow: var(--docs-shadow);
  padding: 1.35rem;
}

.ask-repo-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ask-repo-dialog-title {
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.ask-repo-dialog-form {
  margin-bottom: 0.85rem;
}

.ask-repo-dialog-input {
  width: 100%;
}

.ask-repo-dialog-actions {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.ask-repo-hint {
  color: var(--docs-muted);
  margin-bottom: 0.8rem;
}

.ask-repo-preview {
  margin: 0;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.12);
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
}

html[data-theme="dark"] .ask-repo-input,
html[data-theme="dark"] .ask-repo-dialog-input {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.32);
}

html[data-theme="dark"] .ask-repo-preview {
  background: rgba(15, 23, 42, 0.75);
}

html[data-theme="dark"] .ask-repo-overlay {
  background: rgba(2, 6, 23, 0.58);
}

@media (max-width: 900px) {
  .demos-feature-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .docs-home-hero {
    padding: 2.5rem 2rem;
  }

  .docs-hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-hero-cta .sd-btn {
    width: 100%;
    text-align: center;
  }

  .demos-hero {
    padding: 2.4rem 1.6rem;
    border-radius: 22px;
  }

  .demos-hero-title {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .demos-capability-card {
    min-height: auto;
  }

  .ask-repo-widget {
    display: none;
  }

  .ask-repo-dialog-form {
    margin-bottom: 0.85rem;
  }

  .ask-repo-dialog-actions {
    flex-direction: column;
  }
}
