:root {
  color-scheme: dark light;
  --ink: #080a0f;
  --ink-soft: #101721;
  --paper: #f6f3ea;
  --paper-soft: #e8e4d6;
  --muted: #9ea7b3;
  --line: rgba(255, 255, 255, 0.16);
  --line-dark: rgba(8, 10, 15, 0.14);
  --teal: #1ed7b5;
  --amber: #f5b84b;
  --red: #ff5c7a;
  --blue: #5ca7ff;
  --green: #92dc6d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body::selection {
  background: var(--teal);
  color: var(--ink);
}

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

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 15, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--paper);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(30, 215, 181, 0.45);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(30, 215, 181, 0.22), rgba(245, 184, 75, 0.18));
  color: var(--teal);
  font-size: 13px;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.top-nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a:hover,
.top-nav a:focus {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 82svh;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #080a0f 0%, #0d131c 48%, #14100d 100%);
}

.resolver-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.78;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, rgba(8, 10, 15, 0.92));
  pointer-events: none;
}

.hero-shell {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 84px 0 72px;
}

.eyebrow,
.section-number {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow span:first-child,
.section-number {
  color: var(--amber);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 22px;
  color: var(--paper);
  font-size: 68px;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 740px;
  color: var(--paper);
  font-size: 24px;
  line-height: 1.35;
}

.hero-copy,
.one-line-contract {
  max-width: 760px;
  color: #cbd1d8;
  font-size: 17px;
}

.hero-actions {
  display: grid;
  gap: 16px;
  max-width: 940px;
  margin-top: 34px;
}

.endpoint-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 10, 15, 0.76);
  box-shadow: var(--shadow);
}

.endpoint-strip code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--paper);
  font-size: 14px;
}

.method,
.endpoint-line span,
.status-line span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--teal);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.contract-pills,
.machine-links,
.field-groups,
.field-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contract-pills span,
.field-groups span,
.field-matrix span,
.machine-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8dde4;
  font-size: 13px;
}

.copy-button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}

.copy-button:hover,
.copy-button:focus {
  background: var(--teal);
  outline: none;
}

.copy-button.small {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 13px;
}

.section-rail {
  position: sticky;
  top: 68px;
  z-index: 9;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px max(20px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid rgba(8, 10, 15, 0.12);
  background: rgba(246, 243, 234, 0.92);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.section-rail a {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 6px;
  color: #44505d;
  font-size: 13px;
  font-weight: 800;
}

.section-rail a.active,
.section-rail a:hover,
.section-rail a:focus {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.doc-section {
  scroll-margin-top: 124px;
  padding: 88px 0;
}

.section-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: 42px;
  align-items: start;
}

.section-light {
  background: var(--paper);
  color: var(--ink);
}

.section-ink {
  background: #0e141d;
  color: var(--paper);
}

.section-demo {
  background:
    linear-gradient(90deg, rgba(30, 215, 181, 0.12), transparent 35%),
    linear-gradient(180deg, #15100d, #0b0f16);
  color: var(--paper);
}

.section-contract {
  background: #f1eee5;
  color: var(--ink);
  text-align: center;
}

.copy-column p,
.section-heading p,
.section-inner > p {
  color: inherit;
  max-width: 660px;
}

.section-light .copy-column p,
.section-light .section-heading p,
.section-contract p {
  color: #4e5965;
}

.section-ink .section-heading p,
.section-demo p {
  color: #c4ccd5;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.endpoint-line,
.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.endpoint-line code,
.status-line code {
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 800;
}

.status-line span {
  background: var(--red);
}

.field-groups,
.field-matrix {
  margin: 20px 0 28px;
}

.section-light .field-groups span,
.section-light .field-matrix span,
.section-contract .machine-links a {
  border-color: var(--line-dark);
  background: rgba(8, 10, 15, 0.05);
  color: #1b2632;
}

.fields-label {
  margin-bottom: 12px;
  font-weight: 900;
}

.code-panel,
.demo-console,
.good-inputs {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0f16;
  box-shadow: var(--shadow);
}

.section-light .code-panel,
.section-light .good-inputs {
  border-color: rgba(8, 10, 15, 0.16);
}

.code-panel.wide {
  width: 100%;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px 8px 16px;
  border-bottom: 1px solid var(--line);
  color: #cbd1d8;
  font-size: 13px;
  font-weight: 800;
}

pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: #e5edf4;
  font-size: 14px;
  line-height: 1.62;
  tab-size: 2;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.flow-step {
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.flow-step > span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
}

.mini-code {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #dfe8ef;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.notice-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.notice-strip p {
  margin: 0;
  padding: 18px;
  border-left: 4px solid var(--teal);
  background: rgba(8, 10, 15, 0.05);
  color: #3f4a55;
}

.notice-strip p + p {
  border-left-color: var(--amber);
}

.sample-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.sample-buttons button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--paper);
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 800;
}

.sample-buttons button.active,
.sample-buttons button:hover,
.sample-buttons button:focus {
  background: var(--amber);
  color: var(--ink);
  outline: none;
}

.demo-console {
  background: #080a0f;
}

.demo-input,
.demo-output {
  padding: 18px;
}

.demo-input {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.demo-input span,
.demo-output span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-input strong {
  font-size: 22px;
  line-height: 1.2;
}

.demo-output pre {
  margin-top: 12px;
  padding: 0;
  white-space: pre-wrap;
}

.good-inputs {
  padding: 24px;
  background: #101721;
}

.good-inputs h3 {
  color: var(--amber);
}

.good-inputs ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.good-inputs li {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e2e7ec;
  overflow-wrap: anywhere;
}

.contract-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 30px auto;
}

.contract-stack span {
  padding: 22px 16px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 20px;
  font-weight: 900;
}

.machine-links {
  justify-content: center;
  margin-top: 32px;
}

.machine-links a:hover,
.machine-links a:focus {
  background: var(--teal);
  color: var(--ink);
  outline: none;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px max(20px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--ink);
}

.site-footer code {
  color: var(--paper);
}

.copy-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  min-height: 38px;
  min-width: 120px;
  padding: 8px 12px;
  border: 1px solid rgba(30, 215, 181, 0.42);
  border-radius: 8px;
  background: rgba(8, 10, 15, 0.9);
  color: var(--paper);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.copy-status.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 50px;
  }

  .hero-lede {
    font-size: 21px;
  }

  .split-layout,
  .flow-grid,
  .notice-strip,
  .contract-stack {
    grid-template-columns: 1fr;
  }

  .flow-step {
    min-height: 0;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .section-rail {
    top: 116px;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .site-header,
  .section-rail {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: 86svh;
  }

  .hero-shell,
  .section-inner {
    width: calc(100% - 32px);
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 32px;
  }

  .hero-shell {
    padding-top: 64px;
  }

  .endpoint-strip {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .endpoint-strip .copy-button {
    width: 100%;
  }

  .doc-section {
    padding: 66px 0;
  }

  pre {
    font-size: 12px;
  }

  .copy-status {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

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

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