:root {
  color-scheme: dark;
  --bg: #07080f;
  --bg-elev: #0f1220;
  --bg-soft: #14182b;
  --border: #252b45;
  --text: #e8ebff;
  --muted: #aab0d2;
  --accent: #7c5cff;
  --accent-soft: #2b2350;
  --success: #61d39b;
  --warn: #f5ca73;
  --radius: 12px;
  --shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f8ff;
    --bg-elev: #ffffff;
    --bg-soft: #eef2ff;
    --border: #d8def6;
    --text: #1f2440;
    --muted: #58618b;
    --accent: #5a35f5;
    --accent-soft: #e8e0ff;
    --success: #1a9b66;
    --warn: #9a6a00;
    --shadow: 0 10px 24px rgba(44, 53, 102, 0.14);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080f;
  --bg-elev: #0f1220;
  --bg-soft: #14182b;
  --border: #252b45;
  --text: #e8ebff;
  --muted: #aab0d2;
  --accent: #7c5cff;
  --accent-soft: #2b2350;
  --success: #61d39b;
  --warn: #f5ca73;
  --shadow: 0 18px 35px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8ff;
  --bg-elev: #ffffff;
  --bg-soft: #eef2ff;
  --border: #d8def6;
  --text: #1f2440;
  --muted: #58618b;
  --accent: #5a35f5;
  --accent-soft: #e8e0ff;
  --success: #1a9b66;
  --warn: #9a6a00;
  --shadow: 0 10px 24px rgba(44, 53, 102, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

code,
pre {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.container {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}

.site-nav .inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
}

.brand-logo {
  width: 30px;
  height: 30px;
}

.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.nav-links a:not(.btn) {
  color: var(--muted);
  font-weight: 500;
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn).active {
  color: var(--text);
  text-decoration: none;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 120;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-fab:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elev));
}

.theme-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-fab-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-fab-tooltip {
  position: absolute;
  right: calc(100% + 0.55rem);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 8px;
  padding: 0.34rem 0.55rem;
  font-size: 0.74rem;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.theme-fab:hover .theme-fab-tooltip,
.theme-fab:focus-visible .theme-fab-tooltip {
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  opacity: 0.92;
  text-decoration: none;
}

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

.btn-secondary:hover {
  background: var(--bg-soft);
  text-decoration: none;
}

.hero {
  padding: 3.75rem 0 2rem;
}

.hero-marketing {
  max-width: 1040px;
}

.hero-kicker {
  margin: 0 0 1.25rem;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

h1 {
  margin: 1rem 0 0;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.lead {
  margin-top: 1rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  max-width: 760px;
}

.hero-cta {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.product-story {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
  align-items: start;
}

.section-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.product-copy h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
}

.product-lead {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 62ch;
}

.product-grid {
  display: grid;
  gap: 0.9rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
}

.product-card h3 {
  margin: 0;
  font-size: 1rem;
}

.product-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.setup-shell {
  margin-top: 4rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.setup-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.setup-shell h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.setup-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-elev);
  overflow: hidden;
}

.setup-card-header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1rem 0.85rem;
}

.setup-card-header h3 {
  margin: 0;
  font-size: 1rem;
}

.setup-card-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.setup-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-soft));
  color: var(--text);
  font-weight: 700;
  flex-shrink: 0;
}

.setup-card pre {
  margin: 0;
  padding: 0.95rem 1rem 1rem;
  overflow-x: auto;
  font-size: 0.86rem;
}

.env-note {
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.env-note span {
  color: var(--text);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.trust-item::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 14%, transparent);
}

.pills {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.mockup {
  margin-top: 1.5rem;
  overflow: hidden;
}

.mockup-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 50%, transparent);
}

.url {
  margin-left: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.mockup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.9rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.section {
  padding: 3.25rem 0 0.7rem;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
}

.section-subtitle {
  color: var(--muted);
  margin-top: 0.35rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
}

.image-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.code-card {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elev);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 0.55rem 0.75rem;
}

.code-title {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.copy-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--bg-soft);
}

.code-card pre {
  margin: 0;
  padding: 0.9rem;
  overflow-x: auto;
  font-size: 0.87rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1rem;
}

.feature h3 {
  margin: 0;
  font-size: 1rem;
}

.feature p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.docs-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1rem;
  color: var(--text);
}

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

.layout-doc {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  gap: 1.2rem;
  align-items: start;
  padding-top: 1.2rem;
}

.sidebar {
  position: sticky;
  top: 84px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 0.8rem;
}

.sidebar h4 {
  margin: 0.4rem 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar a {
  display: block;
  border-radius: 9px;
  color: var(--muted);
  padding: 0.4rem 0.55rem;
  font-size: 0.92rem;
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--bg-soft);
}

.mobile-submodules {
  display: none;
}

.mobile-submodules summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  padding: 0.7rem 0.85rem;
}

.mobile-submodules summary::-webkit-details-marker {
  display: none;
}

.mobile-submodules nav {
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  padding: 0.5rem;
}

.mobile-submodules nav a {
  display: block;
  border-radius: 8px;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
  font-size: 0.92rem;
}

.mobile-submodules nav a:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--bg-soft);
}

.doc-main h1 {
  margin-top: 0;
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
}

.step {
  border-left: 1px solid var(--border);
  padding: 0 0 1.6rem 1.1rem;
  margin-left: 0.3rem;
}

.step h2 {
  font-size: 1.35rem;
  margin: 0;
}

.step ol {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
}

.step li {
  margin-bottom: 0.45rem;
}

.callout {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-top: 0.7rem;
  color: var(--muted);
}

.callout.tip {
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
}

.callout.warn {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.92rem;
}

th {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--bg-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.footer .inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
}

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

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

.moved-note {
  margin-top: 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 0.8rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .layout-doc {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .sidebar-submodules {
    display: none;
  }

  .mobile-submodules {
    display: block;
    margin: 1rem 0;
  }
}

@media (max-width: 760px) {
  .nav-links {
    gap: 0.65rem;
  }

  .product-story,
  .setup-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    flex-shrink: 0;
  }

  .theme-fab {
    right: 0.9rem;
    bottom: 0.9rem;
    width: 2.75rem;
    height: 2.75rem;
  }

  .theme-fab-tooltip {
    display: none;
  }

  .features,
  .docs-grid,
  .mockup-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2.3rem;
  }
}
