:root {
  color-scheme: dark;
  --bg: #07080a;
  --surface: #101217;
  --surface-2: #151923;
  --line: #252b36;
  --line-soft: #1b202a;
  --text: #f4f6fb;
  --muted: #a5adba;
  --soft: #c5ccd8;
  --cyan: #3dd8c4;
  --orange: #ff8a3d;
  --blue: #8ab4ff;
}

body.theme-light {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --line: #d8e0ea;
  --line-soft: #e7edf4;
  --text: #111827;
  --muted: #617084;
  --soft: #344154;
  --blue: #315ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 260px;
  height: auto;
  display: block;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.76fr) minmax(560px, 1.24fr);
  gap: 44px;
  align-items: center;
  padding: 56px 0 44px;
}

.hero.agent {
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  text-align: center;
}

.hero.compact {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: 58px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: 0;
}

.agent h1 {
  margin-right: auto;
  margin-left: auto;
}

.lede {
  max-width: 670px;
  margin-bottom: 28px;
  color: var(--soft);
  font-size: 20px;
  line-height: 1.55;
}

.agent .lede {
  margin-right: auto;
  margin-left: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.agent .actions {
  justify-content: center;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.button.primary {
  color: #07100f;
  border-color: var(--cyan);
  background: var(--cyan);
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.hero-cta {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary {
  width: fit-content;
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  color: #07100f;
  background: var(--cyan);
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.btn-secondary {
  width: fit-content;
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.theme-light .btn-secondary:hover {
  background: rgba(17, 24, 39, 0.04);
}

.curl-snippet {
  width: min(100%, 440px);
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.curl-snippet code {
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.cta-hint {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.fact,
.panel,
.code-panel,
.flow-card,
.mode-card,
.choice-card,
.task-card,
.badge {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.fact {
  padding: 15px;
}

.fact span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.fact strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.fact strong [data-count-value] {
  color: var(--cyan);
  font-weight: 700;
}

.fact strong [data-count-unit] {
  color: var(--text);
  font-weight: 700;
}

.fact strong [data-count-value],
.fact strong [data-count-unit] {
  display: inline;
  margin-bottom: 0;
  font-size: inherit;
}

.code-panel {
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.code-head a {
  color: var(--blue);
}

pre {
  margin: 0;
  padding: 18px;
  overflow: auto;
}

code {
  color: #dfe6f2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre;
}

.theme-light code {
  color: #1f2937;
}

.api-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.api-pair .code-panel {
  height: 100%;
}

.api-pair pre {
  min-height: 308px;
  padding: 16px;
}

.api-pair code {
  font-size: 11.5px;
  line-height: 1.58;
}

.route-widget {
  display: none;
  max-height: 0;
  margin-top: 24px;
  padding: 24px;
  overflow: hidden;
  opacity: 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
}

.route-widget.is-open {
  max-height: 980px;
  opacity: 1;
}

.route-widget-title {
  margin-bottom: 16px;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.6;
}

.route-widget-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.route-widget select {
  min-height: 44px;
  min-width: min(100%, 280px);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
}

.route-preview-result {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.preview-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.preview-row span {
  color: var(--muted);
  font-size: 13px;
}

.preview-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.preview-row a {
  color: var(--blue);
}

.preview-muted {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section {
  padding: 50px 0;
}

.section-title {
  max-width: 760px;
  margin-bottom: 24px;
}

.section > h2 {
  margin-bottom: 24px;
}

h2 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: 0;
}

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

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

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

.panel,
.mode-card,
.choice-card,
.task-card {
  min-width: 0;
  padding: 22px;
}

.panel h3,
.mode-card h3,
.choice-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.3;
}

.panel p,
.mode-card p,
.choice-card p,
.flow-step p,
.task-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.task-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.task-card-roadmap {
  border: 1px dashed var(--line);
  background: transparent;
}

.task-card-roadmap strong {
  color: var(--orange);
}

.metric {
  margin-bottom: 24px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 26px;
  line-height: 1;
}

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 26px;
}

.flow-card {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  text-align: left;
}

.flow-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.flow-arrow {
  color: var(--orange);
  font-size: 26px;
  text-align: center;
}

.response-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 22px;
  align-items: start;
}

.choice-list {
  display: grid;
  gap: 12px;
}

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.choice-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

.mode-card strong {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--orange);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.mode-table {
  display: grid;
  gap: 12px;
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mode-row strong {
  flex: 0 0 132px;
  color: var(--orange);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.mode-row p {
  flex: 1 1 280px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.mode-row code {
  flex: 1.2 1 360px;
  min-width: 0;
  display: block;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

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

.badge {
  min-width: 0;
  display: block;
  padding: 22px;
}

.badge strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.badge span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.panel a {
  color: var(--blue);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 24px;
  align-items: stretch;
}

.pricing {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.55fr);
  gap: 28px;
  align-items: center;
  padding: 38px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pricing p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.footer {
  display: grid;
  gap: 10px;
  padding: 56px 0;
  border-top: 1px solid var(--line-soft);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 14px;
}

.footer-meta {
  color: var(--soft);
  font-size: 12px;
}

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

.variant-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 42px 0 72px;
}

.api-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1.4fr) 80px minmax(0, 2fr);
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.method-get {
  background: rgba(138, 180, 255, 0.12);
  color: var(--blue);
}

.method-post {
  background: rgba(61, 216, 196, 0.12);
  color: var(--cyan);
}

.api-path {
  font-size: 14px;
  color: var(--text);
  background: transparent;
  padding: 0;
}

.api-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.api-free {
  background: rgba(165, 173, 186, 0.1);
  color: var(--soft);
}

.api-paid {
  background: rgba(255, 138, 61, 0.12);
  color: var(--orange);
}

.api-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.api-row code {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal,
  .reveal-step {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(56px);
    will-change: opacity, filter, transform;
  }

  .reveal.is-visible,
  .reveal-step.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), filter 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .reveal-step.is-visible {
    transition-delay: var(--reveal-delay, 0ms);
  }

  .route-widget {
    transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-step {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero,
  .hero.compact,
  .response-layout,
  .split,
  .pricing {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .mode-grid,
  .signal-grid,
  .task-grid,
  .badges-row,
  .variant-list,
  .api-pair {
    grid-template-columns: 1fr;
  }

  .mode-row {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-row strong,
  .mode-row p,
  .mode-row code {
    flex: none;
    width: 100%;
  }

  .flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }

  .api-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "method path price"
      "desc desc desc";
    gap: 8px 12px;
  }

  .api-method {
    grid-area: method;
  }

  .api-path {
    grid-area: path;
    overflow-x: auto;
  }

  .api-price {
    grid-area: price;
  }

  .api-row p {
    grid-area: desc;
    margin-top: 4px;
  }

  .preview-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 32px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }

  .brand img {
    width: 190px;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
    font-size: 12px;
  }

  .nav a {
    padding: 0 7px;
  }

  .hero,
  .section {
    padding: 34px 0;
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 27px;
  }

  .lede {
    font-size: 18px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .cta-buttons,
  .route-widget-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary,
  .curl-snippet,
  .route-widget select {
    width: 100%;
  }

  pre {
    max-height: 285px;
  }

  code {
    font-size: 12px;
  }
}
