:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-elev: #101a2a;
  --bg-soft: #152235;
  --line: #243447;
  --text: #e8f4ff;
  --muted: #8ac9dc;
  --dim: #5a7a8c;
  --accent: #3dd6f5;
  --accent-ink: #042028;
  --ok: #5ecf9a;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Outfit", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --glow: rgba(61, 214, 245, 0.12);
  --brand-ring: rgba(61, 214, 245, 0.16);
  --card-hover: #3a5a70;
  --focus-ring: rgba(61, 214, 245, 0.4);
  --focus-border: #2a8aa0;
  --primary-border: #6ee4ff;
  --code: #c5d8e4;
  --header-bg: rgba(11, 18, 32, 0.84);
  --frame-bar: #0d1624;
  --us-line: #2a6a7a;
  --step-num: #3dd6f5;
  --atmosphere: radial-gradient(1100px 520px at 8% -8%, rgba(61, 214, 245, 0.14), transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(32, 120, 160, 0.18), transparent 50%);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4f8;
  --bg-elev: #f7fbfd;
  --bg-soft: #e2edf4;
  --line: #c5d6e2;
  --text: #102030;
  --muted: #4a6678;
  --dim: #6a8494;
  --accent: #0a9db8;
  --accent-ink: #f0fbff;
  --ok: #1f8a5a;
  --shadow: 0 18px 40px rgba(16, 40, 56, 0.08);
  --glow: rgba(10, 157, 184, 0.1);
  --brand-ring: rgba(10, 157, 184, 0.18);
  --card-hover: #8ab0c4;
  --focus-ring: rgba(10, 157, 184, 0.35);
  --focus-border: #0a9db8;
  --primary-border: #0a9db8;
  --code: #243848;
  --header-bg: rgba(238, 244, 248, 0.9);
  --frame-bar: #e4eef4;
  --us-line: #8ec8d8;
  --step-num: #0a7a90;
  --atmosphere: radial-gradient(1100px 520px at 10% -10%, rgba(10, 157, 184, 0.12), transparent 55%),
    radial-gradient(800px 400px at 90% 0%, rgba(40, 100, 140, 0.08), transparent 48%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--atmosphere), var(--bg);
  color: var(--text);
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.skip {
  position: absolute;
  left: 16px;
  top: -40px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 30;
  text-decoration: none;
}
.skip:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-name { font-size: 1.05rem; }
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 0.94rem;
  color: var(--muted);
}
.nav a { text-decoration: none; }
.nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  appearance: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--card-hover); }
.theme-toggle:focus-visible,
.btn:focus-visible,
.copy:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="dark"] .theme-toggle .icon-moon,
html:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.brand-hero {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0 0 18px;
  background: linear-gradient(120deg, var(--text) 30%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h1, h2, h3 {
  margin: 0 0 10px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
h1 {
  font-family: var(--display);
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1.18;
  font-weight: 700;
  max-width: 22ch;
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  max-width: 42ch;
}
h3 { font-size: 1.05rem; }
.lede { margin: 0; color: var(--muted); max-width: 58ch; font-size: 1.08rem; }

.btn, .btn-small {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-small { padding: 6px 10px; font-size: 0.88rem; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--primary-border);
  font-weight: 600;
}
.btn:hover { filter: brightness(1.06); }
html[data-theme="light"] .btn:hover { filter: brightness(0.97); }
html[data-theme="light"] .btn-primary:hover { filter: brightness(1.04); }

.hero { padding: 48px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 14px; }
.hero-secondary {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}
.hero-secondary a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.hero-secondary a:hover { text-decoration: underline; }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
}
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(94, 207, 154, 0.45);
  flex-shrink: 0;
}
.hero-visual { margin-top: 40px; }

.frame {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elev);
  box-shadow: var(--shadow), 0 0 0 1px rgba(61, 214, 245, 0.06);
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--frame-bar);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.78rem;
  font-style: normal;
}
.frame-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.frame-bar em {
  margin-left: 8px;
  font-style: normal;
  font-family: var(--mono);
}

.diagram {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  background: var(--bg);
}
.diagram-svg {
  width: 100%;
  height: auto;
  display: block;
  padding: 12px 8px;
}
.diagram-terminal {
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  min-height: 100%;
}
.diagram-node {
  opacity: 0;
  animation: nodeIn 0.7s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.12s + 0.15s);
}
.diagram-edges path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 0.9s ease forwards 0.55s;
}

@keyframes nodeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: revealUp 0.7s ease forwards;
}
.reveal-delay { animation-delay: 0.18s; }
@keyframes revealUp {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .diagram-node, .diagram-edges path {
    animation: none !important;
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
  }
}

.section { padding: 72px 0; }
.section h2 { margin-bottom: 14px; }
.section .lede { margin-bottom: 22px; }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
}
.panel p { margin: 0; color: var(--muted); }
.panel h3 { margin-bottom: 8px; }
.path { color: var(--accent) !important; margin-bottom: 10px !important; font-size: 0.88rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.contrast-us { border-color: var(--us-line); }
.contrast-us h3 { color: var(--accent); }
html[data-theme="light"] .contrast-us h3 { color: var(--accent); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { position: relative; overflow: hidden; }
.feature::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--step-num);
  margin-bottom: 10px;
}
.steps p { margin: 0; color: var(--muted); }

.ticks { margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); }
.ticks li {
  position: relative;
  padding: 8px 0 8px 18px;
  border-top: 1px solid var(--line);
}
.ticks li:first-child { border-top: 0; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.install-section { padding-bottom: 40px; }
.terminal {
  margin: 22px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071018;
  overflow: hidden;
  box-shadow: var(--shadow);
}
html[data-theme="light"] .terminal { background: #102030; }
.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #243447;
  color: #8aa4b4;
  font-size: 0.8rem;
  font-family: var(--mono);
}
.copy {
  appearance: none;
  border: 1px solid #243447;
  background: #152235;
  color: #e8f4ff;
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}
.copy:hover { filter: brightness(1.08); }
.terminal pre {
  margin: 0;
  padding: 18px 16px 20px;
  overflow-x: auto;
  color: #c5d8e4;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
}
.after-install { color: var(--muted); margin: 0 0 8px; max-width: 70ch; }
.after-install a { color: var(--accent); }

.services-section { padding-top: 40px; padding-bottom: 88px; }
.service-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 8px 0 20px;
  border-top: 1px solid var(--line);
}
.service-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 16px 28px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.service-row h3 { margin: 0; font-family: var(--display); }
.service-row p { margin: 0; color: var(--muted); max-width: 62ch; }
.services-note {
  margin: 0 0 8px;
  color: var(--dim);
  font-size: 0.95rem;
  max-width: 62ch;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 28px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.footer-inner p { margin: 10px 0 0; max-width: 52ch; }
.footer-inner a { color: var(--text); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.legal { margin: 0; color: var(--dim); font-size: 0.8rem; max-width: 90ch; }

/* Doc pages */
body.is-doc .brand-hero { display: none; }
.doc-page { padding: 40px 0 72px; }
.doc-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: 88px;
  font-size: 0.88rem;
}
.doc-toc nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}
.doc-toc a { text-decoration: none; }
.doc-toc a:hover { color: var(--text); }
.doc-toc .toc-title {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--dim);
  margin: 0 0 10px;
}
.doc-body { max-width: 72ch; }
.doc-body > .eyebrow { margin-bottom: 8px; }
.doc-body > h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  max-width: none;
  margin-bottom: 12px;
}
.doc-lead { color: var(--muted); font-size: 1.08rem; margin: 0 0 28px; max-width: 60ch; }
.doc-body h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 40px 0 14px;
  max-width: none;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.doc-body h2:first-of-type { border-top: 0; padding-top: 0; }
.doc-body h2.doc-part {
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  margin-top: 48px;
  padding-top: 28px;
  border-top: 2px solid var(--line);
  color: var(--text);
}
.doc-body h2.doc-part:first-of-type {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
}
.doc-body h3 {
  font-size: 1.05rem;
  margin: 24px 0 10px;
}
.doc-body p { color: var(--muted); margin: 0 0 14px; }
.doc-body ul, .doc-body ol {
  color: var(--muted);
  margin: 0 0 16px;
  padding-left: 1.2em;
}
.doc-body li { margin: 0.35em 0; }
.doc-body a { color: var(--accent); }
.doc-body .table-wrap { margin: 0 0 20px; }
.doc-body .compare { font-size: 0.9rem; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.compare th, .compare td {
  text-align: left;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.compare thead th {
  border-top: 0;
  color: var(--dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 550;
}
.compare tbody th { font-weight: 550; width: 28%; color: var(--text); }
.compare td { color: var(--muted); }
.compare code { color: var(--code); }

.doc-body .terminal { margin: 12px 0 20px; }
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font-size: 0.9rem;
}
.doc-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.doc-note {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
  .doc-toc nav { flex-direction: row; flex-wrap: wrap; gap: 10px 16px; }
}

@media (max-width: 900px) {
  .features, .steps { grid-template-columns: 1fr 1fr; }
  .diagram { grid-template-columns: 1fr; }
  .diagram-terminal { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 108px; }
  .wrap { width: min(1120px, calc(100% - 28px)); }
  .header-inner { flex-wrap: wrap; min-height: 56px; gap: 10px 16px; padding: 10px 0; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 14px; overflow-x: auto; }
  .header-actions { margin-left: auto; }
  .hero { padding-top: 28px; }
  .split, .features, .steps, .footer-inner { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .hero-points { flex-direction: column; gap: 8px; }
  .service-row { grid-template-columns: 1fr; gap: 6px; }
  h1 { max-width: none; }
}
