:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-2: #0b0f1a;
  --ink: #eef2f8;
  --muted: #93a0b8;
  --soft: rgba(255, 255, 255, .05);
  --line: rgba(148, 163, 194, .16);
  --line-strong: rgba(148, 163, 194, .28);
  --panel: #0e1320;
  --panel-2: #111827;

  /* CAPA accents */
  --purple: #7a5cff;
  --purple-soft: rgba(122, 92, 255, .14);
  --teal: #2fd9c4;
  --teal-soft: rgba(47, 217, 196, .13);
  --blue: #4d7cff;
  --blue-soft: rgba(77, 124, 255, .14);
  --gold: #e0b64d;
  --gold-soft: rgba(224, 182, 77, .14);
  --red: #ff6b6b;
  --red-soft: rgba(255, 107, 107, .13);

  --grad: linear-gradient(135deg, #7a5cff 0%, #4d7cff 48%, #2fd9c4 100%);
  --grad-soft: linear-gradient(135deg, rgba(122, 92, 255, .16), rgba(47, 217, 196, .12));

  --shadow: 0 24px 70px rgba(0, 0, 0, .55);
  --glow: 0 0 0 1px rgba(122, 92, 255, .28), 0 18px 50px rgba(77, 124, 255, .18);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 640px at 78% -8%, rgba(47, 217, 196, .10), transparent 60%),
    radial-gradient(1000px 600px at 12% 4%, rgba(122, 92, 255, .14), transparent 58%),
    radial-gradient(900px 700px at 50% 120%, rgba(77, 124, 255, .10), transparent 60%),
    linear-gradient(180deg, #080b12 0%, #0a0e18 45%, #080b12 100%);
  background-repeat: no-repeat;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button,
.card,
.toc-card,
.button,
.tag,
.eyebrow,
.figure,
.result-card,
.side-toc a {
  transition:
    color .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    box-shadow .22s ease,
    transform .22s ease,
    opacity .22s ease;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(122, 92, 255, .1);
  color: #cfd6ff;
  font-size: .94em;
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  margin: 18px 0 0;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #05070c;
  color: #d8f5ee;
  line-height: 1.65;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

pre code {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  overflow-wrap: normal;
}

pre code.language-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 18, .72);
  backdrop-filter: blur(16px);
}

.nav-inner,
.container,
.hero {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.nav-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-inner > * {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

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

.brand-hero {
  line-height: 0;
  margin-bottom: 4px;
}

.brand-hero img {
  width: min(460px, 84%);
  height: auto;
}

.links {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  color: var(--muted);
  font-size: 14px;
  scrollbar-width: none;
}

.links::-webkit-scrollbar {
  display: none;
}

.links a {
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.links a:hover,
.links a[aria-current="page"] {
  background: var(--soft);
  color: var(--ink);
}

.links a[aria-current="page"] {
  box-shadow: inset 0 0 0 1px var(--line);
}

.links a:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 74px 0 46px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 40px;
  align-items: center;
}

.hero.single {
  grid-template-columns: 1fr;
  max-width: 920px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
}

.eyebrow.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.eyebrow.blue .pulse {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(77, 124, 255, .18);
}

.eyebrow.gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.eyebrow.gold .pulse {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(224, 182, 77, .18);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(47, 217, 196, .16);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--ink);
}

h1 {
  max-width: 900px;
  font-size: clamp(40px, 6vw, 72px);
  background: linear-gradient(180deg, #ffffff 0%, #c7d0ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
}

h3 {
  font-size: 21px;
}

p {
  margin: 14px 0 0;
}

.lead {
  max-width: 780px;
  color: var(--muted);
  font-size: 20px;
}

.tagline {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 500;
  font-size: clamp(15px, 1.6vw, 20px);
  color: #8b93a8;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--grad);
  color: #0a0d16;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .01em;
  box-shadow: 0 12px 30px rgba(77, 124, 255, .28);
}

.button.secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--ink);
  box-shadow: none;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(77, 124, 255, .38);
}

.button.secondary:hover {
  border-color: var(--purple);
  background: var(--purple-soft);
  box-shadow: 0 12px 28px rgba(122, 92, 255, .2);
}

.terminal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #05070c;
  color: #d8ece5;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.terminal-head {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .02);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6b6b;
}

.dot:nth-child(2) {
  background: var(--gold);
}

.dot:nth-child(3) {
  background: var(--teal);
}

.terminal pre {
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dim {
  color: #6b7a90;
}

.section {
  padding: 66px 0;
}

.section.alt {
  border-block: 1px solid var(--line);
  background:
    radial-gradient(700px 300px at 20% 0%, rgba(122, 92, 255, .07), transparent 70%),
    rgba(255, 255, 255, .015);
}

.section-head {
  max-width: 820px;
  margin-bottom: 30px;
}

.section-head p {
  color: var(--muted);
  font-size: 17px;
}

.grid {
  display: grid;
  gap: 16px;
}

.hero > *,
.grid > *,
.toc > *,
.doc-layout > *,
.doc,
.doc section,
.card,
.toc-card,
.side-toc,
.terminal,
.architecture,
.flow > *,
.hooks > *,
.matrix > *,
.metric-board > *,
.result-grid > * {
  min-width: 0;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
}

.card:hover,
.toc-card:hover,
.figure:hover,
.result-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .5), 0 0 0 1px rgba(122, 92, 255, .18);
}

.card p,
.muted {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 14px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}

.tag.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.tag.gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.tag.red {
  color: var(--red);
  background: var(--red-soft);
}

.toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.toc-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
  overflow: hidden;
}

.toc-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--grad);
  opacity: .0;
  transition: opacity .22s ease;
}

.toc-card:hover::before {
  opacity: 1;
}

.toc-card h3 a {
  color: var(--ink);
}

.toc-card h3 a:hover {
  color: var(--teal);
}

.toc-card ol {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.toc-card li {
  margin: 7px 0;
}

.doc-layout {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 70px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.side-toc {
  position: sticky;
  top: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  --toc-indicator-top: 0px;
  --toc-indicator-height: 0px;
}

.side-toc strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
}

.toc-group {
  display: block;
  margin: 16px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.side-toc strong + .toc-group {
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}

.side-toc .toc-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.side-toc a {
  position: relative;
  z-index: 1;
  display: block;
  margin-inline: -8px;
  padding: 7px 10px 7px 14px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.side-toc a.toc-child {
  margin-left: 12px;
  padding-left: 16px;
}

.side-toc a:hover {
  color: var(--teal);
  background: var(--soft);
}

.side-toc-indicator {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: var(--toc-indicator-top);
  height: var(--toc-indicator-height);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(122, 92, 255, .22), rgba(47, 217, 196, .08));
  opacity: 0;
  pointer-events: none;
  transition:
    top .28s cubic-bezier(.22, 1, .36, 1),
    height .28s cubic-bezier(.22, 1, .36, 1),
    opacity .18s ease;
}

.side-toc-indicator::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 99px;
  background: var(--grad);
}

.side-toc.has-active .side-toc-indicator {
  opacity: 1;
}

.side-toc.is-jump .side-toc-indicator {
  transition: opacity .12s ease;
}

.side-toc a.is-active,
.side-toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 720;
}

.doc {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow);
}

.doc section + section {
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.doc section {
  scroll-margin-top: 92px;
}

.doc ul,
.doc ol {
  margin: 16px 0 0;
  padding-left: 22px;
}

.doc li {
  margin: 8px 0;
}

.doc a:not(.button) {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(47, 217, 196, .4);
}

.doc a:not(.button):hover {
  color: #6fe9d9;
}

.architecture {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.flow {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
  align-items: stretch;
  gap: 10px;
}

.flow-box {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .01) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flow-box span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.arrow {
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 28px;
  font-weight: 800;
}

.hooks,
.matrix,
.metric-board {
  display: grid;
  gap: 12px;
}

.hooks {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hook,
.metric {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
  padding: 14px;
}

.hook {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.matrix {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric strong {
  display: block;
  font-size: 30px;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.metric span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
  padding: 16px;
}

.result-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink);
}

.result-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.result-strip {
  display: grid;
  gap: 24px;
}

.result-strip .figure {
  margin-top: 0;
}

.figure {
  margin: 22px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure.narrow {
  max-width: 760px;
}

.figure-caption {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  color: var(--muted);
  font-size: 14px;
  background: var(--panel-2);
}

.data-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  background: rgba(122, 92, 255, .08);
  color: var(--ink);
}

.data-table td {
  color: var(--muted);
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .42s ease var(--reveal-delay, 0ms),
    transform .42s ease var(--reveal-delay, 0ms),
    box-shadow .22s ease,
    border-color .18s ease,
    background-color .18s ease;
}

@media (max-width: 960px) {
  .hero,
  .doc-layout,
  .grid.two,
  .grid.three,
  .toc,
  .result-grid,
  .flow,
  .hooks,
  .matrix,
  .metric-board {
    grid-template-columns: 1fr;
  }

  .side-toc {
    position: static;
  }

  .arrow {
    min-height: 24px;
    transform: rotate(90deg);
  }
}

@media (max-width: 640px) {
  .nav-inner,
  .container,
  .hero,
  .doc-layout {
    width: min(100% - 28px, 1180px);
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
    gap: 8px;
  }

  .links {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .hero {
    padding-top: 46px;
  }

  .doc {
    padding: 20px;
  }

  pre {
    padding: 14px;
    font-size: 12px;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .data-table tr + tr {
    margin-top: 10px;
  }

  .data-table td {
    border: 0;
    border-bottom: 1px solid var(--line);
  }

  .data-table td:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
