:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #606060;
  --line: #e8e8e8;
  --brand: #0f8f8a;
  --brand-ink: #0a5552;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --sans: "Space Grotesk", "Inter", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

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

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

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--brand);
  margin-right: 0.5rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav a {
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
  background: #f4f4f4;
}

.btn {
  padding: 0.28rem 0.5rem;
  font-size: 0.88rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
}

.btn-primary {
  border-color: var(--brand);
  color: var(--brand-ink);
}

main {
  padding: 2.4rem 0 3.4rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 5.2vw, 3.2rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0;
}

.lead {
  color: var(--muted);
  margin-top: 0.75rem;
}

.hero {
  max-width: 760px;
}

.chip {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.cta-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.code {
  margin-top: 0.85rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: #0e0e0e;
  color: #f7f7f7;
  border: 1px solid #1d1d1d;
  padding: 0.9rem;
  overflow: auto;
  line-height: 1.6;
  white-space: pre;
}

.code-comment {
  color: #6a737d;
}

.code-dim {
  color: #8b949e;
}

.code-ok {
  color: #7ee787;
}

.mono {
  font-family: var(--mono);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #f4f4f4;
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.code code {
  background: none;
  padding: 0;
}

.section {
  margin-top: 2rem;
}

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

.card,
.step,
.doc-block,
.toc,
.faq-item {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.9rem;
}

.card p,
.step p,
.faq-item p {
  margin-top: 0.45rem;
  color: var(--muted);
}

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

.step-num {
  display: inline-block;
  font-family: var(--mono);
  color: var(--brand-ink);
  margin-bottom: 0.4rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.pill {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

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

.doc-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.2rem;
}

.toc {
  position: sticky;
  top: 12px;
  height: max-content;
  padding: 0.7rem;
}

.toc-heading {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 0.7rem;
  margin-bottom: 0.15rem;
}

.toc-heading:first-child {
  margin-top: 0;
}

.toc a {
  display: block;
  color: var(--muted);
  padding: 0.18rem 0;
  font-size: 0.85rem;
}

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

.doc-content {
  min-width: 0;
}

.doc-block {
  margin-bottom: 0.7rem;
}

.doc-block p {
  margin-top: 0.45rem;
  color: var(--muted);
}

.doc-block p a {
  color: var(--brand-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-block h2 {
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.doc-block h3 {
  margin-top: 1rem;
  margin-bottom: 0.2rem;
  color: var(--ink);
}

.doc-block ul,
.doc-block ol {
  margin: 0.4rem 0 0 0;
  padding-left: 1.4rem;
  color: var(--muted);
}

.doc-block li {
  margin-top: 0.2rem;
}

.doc-block li strong {
  color: var(--ink);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

thead {
  text-align: left;
}

th {
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-bottom: 2px solid var(--line);
  color: var(--ink);
}

td {
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}

td code {
  font-size: 0.82em;
}

/* ---- pipeline steps ---- */

.pipeline-steps {
  margin: 0.6rem 0 0 0;
  padding-left: 1.4rem;
  color: var(--muted);
}

.pipeline-steps li {
  margin-top: 0.35rem;
}

.pipeline-steps li strong {
  color: var(--ink);
}

/* ---- faq ---- */

.faq-list {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.6rem;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] {
  border-color: #d6efee;
  background: #fbffff;
}

/* ---- footer ---- */

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

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

footer a:hover {
  color: var(--ink);
}

.foot-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

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

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

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

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

@media (max-width: 880px) {
  .grid-3,
  .steps,
  .split,
  .doc-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

@media (max-width: 680px) {
  .header-row {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem 0;
  }

  .nav {
    justify-content: center;
    flex-wrap: wrap;
  }

  table {
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 0.3rem 0.4rem;
  }
}
