:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --sunken: #f3f3f1;
  --line: #e7e6e3;
  --line-strong: #d6d5d1;
  --text: #0c0c0b;
  --dim: #6f6e69;
  --faint: #a3a29d;
  --accent: #ef5a24;
  --ok: #1f9d63;
  --code-bg: #0e0e0d;
  --code-text: #e9e8e4;
  --code-dim: #7d7c76;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #111110;
    --sunken: #0e0e0d;
    --line: #1f1f1d;
    --line-strong: #2c2c29;
    --text: #ededeb;
    --dim: #8e8d87;
    --faint: #5c5b56;
    --accent: #ff6a35;
    --ok: #35c27f;
    --code-bg: #111110;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
code, pre, .kicker, .eyebrow, .tag, .facts dt, .log, .api-tabs, .ref {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
code { font-size: 0.86em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--sunken); border: 1px solid var(--line); }
a { color: inherit; }
.dim { color: var(--dim); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 40px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; font-size: 16px; }
.brand-glyph {
  width: 12px; height: 18px;
  border: 2px solid currentColor;
  border-radius: 3.5px;
  position: relative;
}
.brand-glyph::after { content: ''; position: absolute; left: 50%; bottom: 1.5px; width: 3px; height: 1.5px; transform: translateX(-50%); background: var(--accent); border-radius: 1px; }
.nav nav { display: flex; gap: 26px; flex: 1; }
.nav nav a { color: var(--dim); text-decoration: none; font-size: 14px; transition: color .12s; }
.nav nav a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 14px;
  border-radius: 7px;
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn-lg { height: 42px; padding: 0 18px; font-size: 15px; }
.btn-dark { background: var(--text); color: var(--bg); }
.btn-dark:hover { background: color-mix(in srgb, var(--text) 82%, var(--bg)); }
.btn-line { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn-line:hover { border-color: var(--text); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 96px;
}
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; font-size: 12.5px; color: var(--dim); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.hero h1 {
  font-size: clamp(38px, 4.4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
  margin: 0 0 22px;
}
.lede { font-size: 17px; line-height: 1.6; color: var(--dim); max-width: 470px; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.facts { display: grid; grid-template-columns: repeat(3, auto); gap: 28px; margin: 44px 0 0; padding-top: 22px; border-top: 1px solid var(--line); justify-content: start; }
.facts div { min-width: 0; }
.facts dt { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 13.5px; }
.facts code { font-size: 0.9em; }

/* the phone + request log: what the API does, drawn */
.hero-visual { position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: 560px; }
.phone {
  width: 268px; height: 548px;
  border-radius: 44px;
  padding: 11px;
  background: #121211;
  box-shadow: 0 0 0 1px #2a2a27, 0 30px 60px -25px rgba(0,0,0,.35), 0 12px 24px -16px rgba(0,0,0,.25);
  flex-shrink: 0;
  margin-right: 8px;
}
.phone-screen { height: 100%; border-radius: 34px; background: #fbfbfa; color: #111; overflow: hidden; display: flex; flex-direction: column; }
.status-bar { display: flex; justify-content: space-between; padding: 14px 24px 0; font-size: 12px; font-weight: 600; }
.status-bar span:last-child { font-size: 8px; letter-spacing: 1px; padding-top: 2px; }
.app { padding: 46px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.app-title { font-size: 25px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 14px; }
.node { position: relative; border-radius: 10px; font-size: 13.5px; }
.node .ref {
  position: absolute; top: -8px; left: -8px;
  min-width: 20px; height: 17px; padding: 0 4px;
  border-radius: 4px;
  background: #111; color: #fff;
  font-size: 10px; line-height: 17px; text-align: center;
  z-index: 1;
}
.field { border: 1px solid #e3e2de; background: #fff; padding: 9px 12px 9px; display: flex; flex-direction: column; }
.field .ph { font-size: 10.5px; color: #8b8a85; }
.field .val { color: #111; }
.button { background: #111; color: #fff; text-align: center; padding: 12px; font-weight: 600; margin-top: 6px; }
.button.target { outline: 2px solid var(--accent); outline-offset: 3px; }
.button.target .ref { background: var(--accent); }
.tap {
  position: absolute; left: 50%; top: 50%;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: tap 2.4s ease-out infinite;
}
@keyframes tap {
  0%, 30% { transform: scale(.4); opacity: 0; }
  40% { opacity: 1; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}
.link { text-align: center; font-size: 12.5px; color: #6f6e69; padding: 6px; align-self: center; }
.divider { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #a3a29d; margin: 4px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #e7e6e3; }
.alt { border: 1px solid #e3e2de; background: #fff; text-align: center; padding: 11px; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { .tap { animation: none; opacity: .8; } }

.log {
  position: absolute; left: 0; bottom: 18px; z-index: 2;
  width: 284px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 18px 40px -22px rgba(0,0,0,.25);
  font-size: 12px;
  overflow: hidden;
}
.log-head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.log ol { list-style: none; margin: 0; padding: 6px 0; }
.log li { display: grid; grid-template-columns: 34px 1fr auto 36px; gap: 8px; padding: 5px 14px; align-items: baseline; color: var(--dim); }
.log li.hl { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--text); }
.log .m { color: var(--faint); }
.log li.hl .m { color: var(--accent); }
.log .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log .p i { font-style: normal; color: var(--faint); }
.log .s.ok { color: var(--ok); }
.log .t { text-align: right; color: var(--faint); }
.log-body { margin: 0; padding: 10px 14px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text); background: var(--sunken); }

/* ---------- sections ---------- */
.section { padding-top: 96px; padding-bottom: 24px; }
.section-head { margin-bottom: 40px; }
.eyebrow { font-size: 12px; color: var(--accent); margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.section h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 600; margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.grid article { background: var(--surface); padding: 26px 24px 28px; transition: background .15s; }
.grid article:hover { background: var(--bg); }
.grid .tag { font-size: 11.5px; color: var(--faint); margin: 0 0 30px; }
.grid h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 8px; }
.grid p { margin: 0; font-size: 14px; color: var(--dim); line-height: 1.55; }

/* ---------- api ---------- */
.api {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}
.api-tabs { display: flex; flex-direction: column; padding: 10px; gap: 2px; border-right: 1px solid var(--line); }
.api-tabs button {
  all: unset;
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--dim);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.api-tabs button:hover { color: var(--text); background: var(--bg); }
.api-tabs button.active { background: var(--sunken); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.api-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.api-tabs .m { width: 34px; flex-shrink: 0; font-size: 10.5px; color: var(--faint); }
.api-tabs button.active .m { color: var(--accent); }
.api-note { margin: auto 0 0; padding: 14px 12px 6px; font-family: 'Geist', sans-serif; font-size: 12.5px; color: var(--dim); line-height: 1.5; }
.api-note code { font-size: 0.85em; }
.api-panels { min-width: 0; }
.panel { display: none; padding: 22px; }
.panel.active { display: block; }
.panel-desc { margin: 0 0 16px; font-size: 14px; color: var(--dim); }
.panel pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  padding: 20px 22px;
  font-size: 12.8px;
  line-height: 1.7;
  overflow-x: auto;
  min-height: 300px;
}
.panel pre .c { color: var(--code-dim); }

/* ---------- status ---------- */
.status { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.status > div { padding: 26px 28px 30px; background: var(--surface); }
.status > div + div { border-left: 1px solid var(--line); background: var(--bg); }
.status h3 { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; margin: 0 0 16px; }
.sq { width: 8px; height: 8px; border-radius: 2px; border: 1.5px solid var(--faint); }
.sq.ok { background: var(--ok); border-color: var(--ok); }
.status ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.status li { font-size: 14px; color: var(--dim); padding-left: 17px; position: relative; line-height: 1.5; }
.status li::before { content: ''; position: absolute; left: 0; top: 0.72em; width: 7px; height: 1px; background: var(--faint); }

.principles-more { margin: 18px 0 0; font-size: 14px; color: var(--dim); }
.principles-more a { color: var(--text); text-underline-offset: 3px; }

/* ---------- footer ---------- */
.footer { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 40px; margin-top: 96px; border-top: 1px solid var(--line); font-size: 13px; }
.brand.small { font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-visual { justify-content: center; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .api { grid-template-columns: 1fr; }
  .api-tabs { border-right: none; border-bottom: 1px solid var(--line); }
  .api-note { margin-top: 6px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav nav { display: none; }
  .nav-inner { justify-content: space-between; }
  .facts { grid-template-columns: 1fr; gap: 14px; }
  .hero-visual { min-height: 0; flex-direction: column; gap: 20px; }
  .phone { margin-right: 0; }
  .log { position: static; width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .status { grid-template-columns: 1fr; }
  .status > div + div { border-left: none; border-top: 1px solid var(--line); }
  .footer { flex-direction: column; gap: 8px; }
}

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.price-card header h3 { margin: 0 0 6px; font-size: 15px; letter-spacing: -0.01em; }
.price-card .price { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.price-card .amt { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.price-card .per { color: var(--dim); font-size: 13px; }
.price-card .price-note { margin: -6px 0 2px; color: var(--dim); font-size: 13px; }
.price-card ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 9px; font-size: 13.5px; color: var(--dim); flex: 1; }
.price-card ul li { padding-left: 18px; position: relative; }
.price-card ul li::before { content: ''; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 2px; background: var(--line-strong); }
.price-card.featured ul li::before { background: var(--accent); }
.price-card ul strong { color: var(--text); font-weight: 600; }
.btn-block { width: 100%; justify-content: center; }
@media (max-width: 920px) { .pricing { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pricing { grid-template-columns: 1fr; } }
