:root {
  --bg: #12131B;
  --bg-elevated: #1D1B2B;
  --bg-deep: #04070F;
  --border: #262339;
  --border-strong: #312B4B;
  --text: #F5F5F5;
  --text-muted: #A7A5BA;
  --text-dim: #6E6C85;
  --purple: #845CF3;
  --purple-dark: #6F47DE;
  --purple-deep: #583FA7;
  --gold: #A68752;
  --mint: #6AE7D0;
  --radius: 10px;
  --radius-lg: 14px;
  --maxw: 1280px;
  --sidebar-w: 260px;
  --header-h: 64px;
  --font-body: "Host Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--mint); }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: 2.4rem; margin: 0 0 .5em; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; margin: 2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.6em 0 .4em; }
h4 { font-size: 1rem; margin: 1.2em 0 .3em; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }

p { margin: 0 0 1em; color: var(--text-muted); }
p strong, li strong { color: var(--text); font-weight: 600; }

ul, ol { padding-left: 1.4em; color: var(--text-muted); }
li { margin: .25em 0; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: .1em .4em;
  border-radius: 6px;
  color: var(--mint);
}

pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.55;
  color: var(--text);
}
pre code { background: none; border: none; padding: 0; color: inherit; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(18, 19, 27, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-deep) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}
.brand-sub {
  color: var(--text-muted);
  font-weight: 400;
  font-size: .9rem;
  margin-left: .35rem;
}
.header-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: .93rem;
}
.header-links a { color: var(--text-muted); }
.header-links a:hover { color: var(--text); }
.header-cta {
  background: var(--purple);
  color: #fff !important;
  padding: .5rem .9rem;
  border-radius: 8px;
  font-weight: 500;
}
.header-cta:hover { background: var(--purple-dark); color: #fff !important; }

/* ---- Layout ---- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 2.5rem;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  padding: 2rem 0 2rem;
  overflow-y: auto;
}
.sidebar-section { margin-bottom: 1.6rem; }
.sidebar-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: .6rem;
  padding: 0 .75rem;
}
.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
  display: block;
  padding: .5rem .75rem;
  margin: 2px 0;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: .93rem;
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover {
  color: var(--text);
  background: var(--bg-elevated);
}
.sidebar-nav a.active {
  color: var(--text);
  background: var(--bg-elevated);
  border-left-color: var(--purple);
  font-weight: 500;
}

.content {
  min-width: 0;
  padding: 2.5rem 0 5rem;
  max-width: 820px;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: .75rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ---- Hero (landing) ---- */
.hero {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(132, 92, 243, 0.22), transparent 70%),
    radial-gradient(ellipse 40% 30% at 20% 40%, rgba(106, 231, 208, 0.08), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 {
  font-size: 3rem;
  max-width: 780px;
  margin: 0 auto .75rem;
}
.hero .lede {
  max-width: 620px;
  margin: 0 auto 2rem;
  font-size: 1.2rem;
}
.hero-accent {
  background: linear-gradient(135deg, var(--purple) 0%, var(--mint) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-ctas {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .7rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: .95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-primary {
  background: var(--purple);
  color: #fff;
}
.btn-primary:hover { background: var(--purple-dark); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--purple); color: var(--text); }

/* ---- Card grids ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  display: block;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
  color: inherit;
}
.card:hover {
  border-color: var(--purple);
  color: inherit;
  transform: translateY(-2px);
}
.card h3 {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
  color: var(--text);
}
.card p {
  margin: 0;
  font-size: .92rem;
  color: var(--text-muted);
}
.card .card-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(132, 92, 243, 0.25), rgba(132, 92, 243, 0.05));
  color: var(--purple);
  align-items: center;
  justify-content: center;
  margin-bottom: .9rem;
  font-weight: 600;
}

/* ---- Callout / note boxes ---- */
.callout {
  border-left: 3px solid var(--purple);
  background: rgba(132, 92, 243, 0.08);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.callout.note { border-left-color: var(--mint); background: rgba(106, 231, 208, 0.06); }
.callout.warn { border-left-color: var(--gold); background: rgba(166, 135, 82, 0.08); }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--text); }

/* ---- Step list ---- */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  margin: 1.5rem 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1rem 1rem 3.2rem;
  margin-bottom: .75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--purple-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
}
.steps > li h3 {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
}
.steps > li p:last-child { margin-bottom: 0; }

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .93rem;
}
th, td {
  text-align: left;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-elevated);
  border-bottom-color: var(--border-strong);
}
td { color: var(--text-muted); }
tr:hover td { color: var(--text); }

/* ---- Integration grid ---- */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}
.integration {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .93rem;
  color: var(--text);
  transition: border-color .15s ease;
}
.integration:hover { border-color: var(--purple-deep); color: var(--text); }
.integration-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  color: var(--gold);
  flex-shrink: 0;
}

/* ---- Metric cards ---- */
.metric {
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: .75rem 0;
}
.metric h3 {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.metric .tag {
  font-size: .7rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(132, 92, 243, 0.12);
  color: var(--purple);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.metric p { margin: 0; font-size: .93rem; }
.metric .formula {
  display: block;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--mint);
  margin-top: .5rem;
  padding: .5rem .7rem;
  background: var(--bg-deep);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  color: var(--text-dim);
  font-size: .88rem;
  text-align: center;
}
.site-footer a { color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
  }
  .hero h1 { font-size: 2.2rem; }
  h1 { font-size: 1.9rem; }
  .header-links .hide-mobile { display: none; }
}
