:root {
  --bg: #06090d;
  --bg-soft: #080d13;
  --panel: #0b1118;
  --panel-2: #0e161f;
  --line: #1a2632;
  --line-strong: #2a3c4e;
  --text: #dbe5ef;
  --muted: #7d8fa3;
  --accent: #6c8cff;
  --accent-2: #e07a5f;
  --accent-dim: #2f3f7a;
  --accent-2-dim: #7a3f2f;
  --ok: #3ddc97;
  --ok-dim: #1f6f4f;
  --warn: #ffb020;
  --warn-dim: #7a5200;
  --danger: #ff5c5c;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --grid: 48px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scrollbar-color: var(--line-strong) var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(108, 140, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 140, 255, 0.035) 1px, transparent 1px),
    radial-gradient(
      900px 500px at 12% -10%,
      rgba(108, 140, 255, 0.08),
      transparent 60%
    ),
    radial-gradient(
      700px 420px at 95% 5%,
      rgba(224, 122, 95, 0.05),
      transparent 65%
    );
  background-size:
    var(--grid) var(--grid),
    var(--grid) var(--grid),
    100% 100%,
    100% 100%;
  color: var(--text);
  font: 16px/1.6 var(--sans);
}

::selection {
  background: var(--accent);
  color: #04110f;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 2px solid var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6rem;
}
h1 {
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.2rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #05090d;
  border: 1px solid var(--line);
  padding: 0.08rem 0.32rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.eyebrow::before {
  content: "// ";
  color: var(--accent-2);
  opacity: 0.55;
}

/* ---------- top bar ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 2rem;
  background: #04070a;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}
.dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--line-strong);
  background: rgba(6, 9, 13, 0.9);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent 35%);
  opacity: 0.55;
}

.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
}
.brand::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 0.6rem;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(108, 140, 255, 0.8);
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}
.site-nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.site-nav a.button {
  color: #04110f;
  border-bottom: none;
}

/* ---------- layout ---------- */

.page {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  flex: 1;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 2rem;
  border-top: 1px solid var(--line-strong);
  background: #04070a;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--accent-2);
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 3rem;
  align-items: end;
  padding: 2rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
}
.hero-copy > * {
  animation: rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-copy > :nth-child(2) {
  animation-delay: 0.07s;
}
.hero-copy > :nth-child(3) {
  animation-delay: 0.14s;
}
.hero-copy > :nth-child(4) {
  animation-delay: 0.21s;
}

.hero h1 {
  margin: 0.9rem 0 0;
  font-family: var(--mono);
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-transform: uppercase;
}
.hero h1::after {
  content: "_";
  color: var(--accent-2);
  animation: blink 1.2s steps(1) infinite;
}

.lead {
  max-width: 58ch;
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.8rem;
  flex-wrap: wrap;
}

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #04110f;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.button:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 24px rgba(108, 140, 255, 0.22);
  text-decoration: none;
  transform: translateY(-1px);
}
.button-small {
  padding: 0.4rem 0.75rem;
  font-size: 0.64rem;
}
.button-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.button-ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  background: rgba(224, 122, 95, 0.06);
}

/* ---------- spec panel ---------- */

.spec-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0a121a, #05090d);
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}
.spec-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  opacity: 0.5;
  animation: scan 6s linear infinite;
  pointer-events: none;
}
.spec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}
.spec-row:last-child {
  border-bottom: none;
}
.spec-row span:first-child {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.6rem;
  padding-top: 0.1rem;
}
.spec-row span:last-child {
  color: var(--text);
  text-align: right;
}

/* ---------- section heads ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 3.25rem 0 1.25rem;
}
.section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
  transform: translateY(-4px);
}

/* ---------- feature grid ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  counter-reset: feat;
}
.features article {
  position: relative;
  background: var(--panel);
  padding: 1.5rem 1.35rem 1.6rem;
  counter-increment: feat;
  transition: background 0.2s ease;
}
.features article:hover {
  background: var(--panel-2);
}
.features article::before {
  content: "0" counter(feat);
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  opacity: 0.7;
}
.features h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.features h3 {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}
.features p {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
}
.features-flat article {
  background: var(--bg-soft);
}
.features-flat article:hover {
  background: var(--panel-2);
}

/* ---------- panels ---------- */

.panel,
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.5rem;
}
.panel {
  margin-bottom: 1.25rem;
}
.panel::before,
.panel::after,
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--accent-2);
  opacity: 0.7;
  pointer-events: none;
}
.panel::before,
.card::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}
.panel::after,
.card::after {
  right: -1px;
  bottom: -1px;
  border-left: none;
  border-top: none;
}
.panel.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(108, 140, 255, 0.15);
}
.panel > h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.15rem;
}
.panel > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.card.narrow {
  max-width: 460px;
  margin: 2rem auto;
}

/* ---------- forms ---------- */

.stack {
  display: grid;
  gap: 1rem;
}
label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

input,
select {
  background: #05090d;
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-family: var(--sans);
  width: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.12);
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.row input {
  flex: 1 1 280px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}
.span-2 {
  grid-column: span 2;
}

/* ---------- tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th,
.table td {
  text-align: left;
  padding: 0.6rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.table th {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--line-strong);
}
.table tbody tr {
  transition: background 0.15s ease;
}
.table tbody tr:hover {
  background: rgba(108, 140, 255, 0.045);
}
.table tbody tr:last-child td {
  border-bottom: none;
}

.status {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-done {
  color: var(--ok);
  border-color: var(--ok-dim);
  background: rgba(61, 220, 151, 0.07);
}
.status-wip {
  color: var(--warn);
  border-color: var(--warn-dim);
  background: rgba(255, 176, 32, 0.06);
}
.status-plan {
  color: var(--muted);
}
.status-table td:last-child {
  white-space: nowrap;
}

/* ---------- misc ---------- */

.mono {
  font-family: var(--mono);
}
.small {
  font-size: 0.82rem;
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--danger);
}
.notice {
  border-left: 2px solid var(--accent);
  background: rgba(108, 140, 255, 0.05);
  padding: 0.75rem 1rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.badge-active {
  color: var(--ok);
  border-color: var(--ok-dim);
}
.badge-revoked {
  color: var(--danger);
  border-color: var(--danger);
}

.inline-form {
  display: inline;
  margin: 0;
}
.link-button {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.link-button:hover {
  color: var(--accent);
  text-decoration: underline;
}
.link-button.danger:hover {
  color: var(--danger);
}

.license {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.license:first-of-type {
  border-top: none;
  padding-top: 0;
}
.license-head {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.facts {
  display: flex;
  gap: 2rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}
.facts div {
  display: flex;
  gap: 0.4rem;
}
.facts dt {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd {
  margin: 0;
}

.code,
.prose pre {
  background: #05090d;
  border: 1px solid var(--line);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.key {
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

/* ---------- docs ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
}
.docs-sidebar {
  border-right: 1px solid var(--line);
  padding-right: 1.5rem;
}
.docs-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.45rem;
}
.docs-sidebar li.active a {
  color: var(--accent);
  font-weight: 600;
}
.docs-sidebar a {
  color: var(--muted);
  font-size: 0.9rem;
}
.doc-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.doc-list a {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.prose {
  max-width: 78ch;
}
.prose h1,
.prose h2,
.prose h3 {
  margin-top: 1.8em;
}
.prose h1 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.8rem;
}
.prose h2 {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.15rem;
}
.prose code {
  font-family: var(--mono);
  background: #05090d;
  border: 1px solid var(--line);
  padding: 0.1rem 0.3rem;
  font-size: 0.88em;
}
.prose pre {
  padding: 1rem;
}
.prose pre code {
  border: none;
  background: none;
  padding: 0;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
}
.prose th {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.prose blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  border-left: 2px solid var(--accent-dim);
  color: var(--muted);
  background: rgba(108, 140, 255, 0.03);
}
.legal {
  max-width: 80ch;
}

/* ---------- cta strip ---------- */

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding: 1.75rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(
    90deg,
    rgba(108, 140, 255, 0.06),
    transparent 60%
  );
}
.cta h2 {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
}
.cta .actions {
  margin-top: 0;
}

/* ---------- animation ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@keyframes scan {
  0% {
    top: -5%;
  }
  100% {
    top: 105%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .spec-panel {
    max-width: 520px;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: none;
  }
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.9rem 1.25rem;
  }
  .site-nav {
    flex-wrap: wrap;
    gap: 0.9rem;
  }
  .page {
    padding: 2rem 1.25rem 4rem;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .docs-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 1rem;
  }
  .span-2 {
    grid-column: auto;
  }
  .section-head {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .section-head::after {
    display: none;
  }
}
