:root {
  --bg: #f6f9ff;
  --bg-soft: #eef5ff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-blue: #edf5ff;
  --line: #dbe7f6;
  --line-strong: #c5d7ef;
  --text: #172033;
  --muted: #60738c;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eaf2ff;
  --danger: #ef4444;
  --success: #10b981;
  --warn: #0284c7;
  --shadow: 0 22px 54px rgba(30, 71, 130, 0.12);
  --shadow-soft: 0 12px 30px rgba(39, 79, 135, 0.08);
  --container: 1120px;
  --wide: 1188px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 48%, #ffffff 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 560px);
  pointer-events: none;
}

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

img {
  display: block;
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(var(--wide), calc(100% - 28px));
  min-height: 72px;
  margin: 0 auto;
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  color: #162033;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.22);
  font-size: 13px;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  color: #53667f;
  font-size: 14px;
  font-weight: 600;
}

.site-nav a {
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--primary);
}

.nav-pill,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 18px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.btn:hover,
.nav-pill:hover {
  transform: translateY(-1px);
}

.btn.primary,
.nav-pill {
  border-color: transparent;
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.btn.primary:hover,
.nav-pill:hover {
  color: #ffffff;
  background: var(--primary-strong);
}

.btn.ghost:hover {
  border-color: #b8cdec;
  background: #f6faff;
  color: var(--primary);
}

.btn.danger {
  border-color: transparent;
  color: #ffffff;
  background: var(--danger);
}

.hero {
  position: relative;
  display: grid;
  justify-items: center;
  min-width: 0;
  padding: clamp(66px, 7.5vw, 96px) clamp(18px, 5vw, 72px) 58px;
  text-align: center;
}

.hero-copy {
  width: min(910px, calc(100vw - 36px));
  max-width: 100%;
  min-width: 0;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid #dae8fb;
  border-radius: 999px;
  padding: 6px 13px;
  background: rgba(255, 255, 255, 0.82);
  color: #506680;
  box-shadow: 0 8px 18px rgba(39, 79, 135, 0.05);
  font-size: 12px;
  font-weight: 800;
}

.hero-badge i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
}

.hero h1,
.page-title h1,
.panel h1 {
  margin: 0;
  color: #172033;
  line-height: 1.06;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 900px;
  margin-inline: auto;
  font-size: clamp(40px, 5.2vw, 70px);
  font-weight: 800;
  text-wrap: balance;
}

.hero h1 span {
  display: block;
  color: var(--primary);
}

.hero p,
.page-title p,
.panel p {
  color: var(--muted);
}

.hero p {
  max-width: 660px;
  margin: 18px auto 0;
  color: #5a6f89;
  font-size: clamp(16px, 1.45vw, 18px);
  line-height: 1.7;
  text-wrap: balance;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 14px;
  border: 1px solid #d9e7ff;
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--primary);
  background: #eef5ff;
  font-size: 13px;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
}

.hero-preview {
  width: min(910px, calc(100vw - 36px));
  max-width: 100%;
  min-width: 0;
  margin-top: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 30px 70px rgba(32, 85, 163, 0.14);
  text-align: left;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 45px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 999px;
  background: #93c5fd;
}

.dot:nth-child(2) {
  background: #60a5fa;
}

.dot:nth-child(3) {
  background: #2563eb;
}

.preview-title {
  color: #465b76;
  font-size: 13px;
  font-weight: 800;
}

.server-preview {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
}

.preview-sidebar,
.preview-main,
.metric-tile,
.flow-card {
  min-width: 0;
  border: 1px solid #e1ebf8;
  border-radius: var(--radius);
  background: #ffffff;
}

.preview-sidebar {
  padding: 15px;
}

.preview-sidebar strong,
.preview-main strong {
  display: block;
  margin-bottom: 12px;
  color: #172033;
}

.preview-nav {
  display: grid;
  gap: 7px;
}

.preview-nav span {
  border-radius: var(--radius);
  padding: 9px 11px;
  color: #64748b;
  background: #f6f9ff;
  font-size: 13px;
  font-weight: 800;
}

.preview-nav span.active {
  color: #ffffff;
  background: var(--primary);
}

.preview-main {
  padding: 16px;
}

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

.metric-row {
  margin-bottom: 12px;
}

.metric-tile {
  padding: 12px;
}

.metric-tile small {
  color: #61738b;
  font-size: 12px;
  font-weight: 800;
}

.metric-tile b {
  display: block;
  margin-top: 5px;
  color: #162033;
  font-size: 20px;
  line-height: 1.2;
}

.flow-card {
  min-height: 100px;
  padding: 12px;
  background: #f9fbff;
}

.flow-card .pill {
  display: inline-flex;
  margin-bottom: 9px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e8f1ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.flow-card p {
  margin: 0;
  color: #52657d;
  font-size: 13px;
  line-height: 1.55;
}

.terminal {
  margin: 0;
  padding: clamp(18px, 3vw, 28px);
  overflow-x: auto;
  color: #16417f;
  font-size: 14px;
  line-height: 1.7;
}

.terminal .muted {
  color: #73849d;
}

.terminal .ok {
  color: var(--primary);
}

.section,
.page-pad {
  padding: 70px clamp(18px, 5vw, 72px);
}

.section > .section-title,
.section > .grid,
.section > .panel {
  width: min(var(--container), 100%);
  margin-inline: auto;
}

.section-title,
.page-title {
  max-width: 820px;
  margin-bottom: 28px;
}

.section-title {
  margin-inline: auto;
  text-align: center;
}

.section-title p {
  margin: 0 auto;
  max-width: 660px;
  color: var(--muted);
}

.section-title h2,
.page-title h1 {
  margin: 0 0 10px;
  color: #172033;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  text-wrap: balance;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card,
.panel,
.stat,
.price-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(30, 71, 130, 0.055);
}

.card,
.stat,
.price-card,
.panel {
  padding: 24px;
}

.card,
.price-card,
.stat {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover,
.price-card:hover,
.stat:hover {
  transform: translateY(-3px);
  border-color: #bcd2f2;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.1);
}

.card h3,
.price-card h3,
.panel h2 {
  margin: 0 0 8px;
  color: #172033;
  line-height: 1.3;
}

.card p,
.price-card p,
.stat p {
  margin: 0;
  color: var(--muted);
}

.price-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 100%;
}

.price-card.featured {
  border-color: #9ec2ff;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.12);
}

.price-card .btn {
  width: 100%;
  margin-top: auto;
}

.price {
  margin: 6px 0 14px;
  color: #162033;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.1;
}

.price span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.steps {
  counter-reset: step;
}

.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  color: var(--primary);
  background: #dbeafe;
  font-weight: 800;
}

.narrow {
  width: min(760px, calc(100% - 36px));
  margin: 0 auto;
}

.auth-panel {
  margin-top: 28px;
  box-shadow: var(--shadow-soft);
}

.auth-panel h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 42px);
}

.auth-panel form {
  margin-top: 22px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #52657d;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #9ec2ff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 24px;
  width: min(var(--wide), calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.sidebar a {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 13px;
  color: var(--muted);
  font-weight: 800;
}

.sidebar a.active,
.sidebar a:hover {
  border-color: #d9e7ff;
  color: var(--primary);
  background: #eef5ff;
}

.content-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

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

.stat strong {
  display: block;
  margin-top: 4px;
  color: #162033;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.api-key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  border: 1px dashed #b7cdec;
  border-radius: var(--radius);
  padding: 14px;
  background: #f7faff;
}

.api-key-box code {
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.panel .table-wrap {
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--muted);
  background: #f8fbff;
  font-size: 13px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: var(--radius);
  padding: 3px 9px;
  color: var(--primary);
  background: #eaf2ff;
  font-size: 12px;
  font-weight: 800;
}

.badge.success {
  color: #047857;
  background: #dff8ec;
}

.badge.warn {
  color: var(--warn);
  background: #e0f2fe;
}

.badge.danger {
  color: #b91c1c;
  background: #fee2e2;
}

.code-block {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  color: #123765;
  background: #f8fbff;
  font-size: 14px;
  line-height: 1.65;
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.doc-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.doc-section h2 {
  margin: 0 0 14px;
  color: #172033;
}

.toast {
  position: fixed;
  top: 92px;
  right: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.toast.success {
  color: #065f46;
  background: #dcfce7;
}

.toast.error {
  color: #991b1b;
  background: #fee2e2;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 34px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
}

.site-footer strong {
  color: #172033;
}

.site-footer p {
  margin: 4px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

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

@media (max-width: 1080px) {
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell,
  .server-preview,
  .metric-row,
  .flow-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    font-size: 13px;
  }

  .hero {
    overflow: hidden;
    padding-inline: 18px;
    padding-top: 48px;
  }

  .hero-copy,
  .hero-preview {
    width: 100%;
    max-width: calc(100vw - 36px);
  }

  .hero-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    justify-content: center;
    max-width: 100%;
  }

  .hero-badge {
    white-space: nowrap;
  }

  .hero h1 {
    max-width: 330px;
    font-size: clamp(31px, 8.8vw, 34px);
    line-height: 1.08;
    text-wrap: auto;
  }

  .hero p {
    max-width: 300px;
    text-wrap: auto;
  }

  .actions {
    flex-direction: column;
    align-items: center;
    max-width: 100%;
  }

  .actions .btn {
    width: min(100%, 270px);
  }

  .preview-title {
    display: none;
  }

  .hero-preview {
    margin-top: 34px;
  }

  .grid.four,
  .stats {
    grid-template-columns: 1fr;
  }

  .api-key-box {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    white-space: normal;
  }
}

@media (max-width: 460px) {
  .site-header,
  .app-shell {
    width: min(100% - 18px, var(--wide));
  }

  .site-header {
    top: 9px;
    padding: 10px 12px;
  }

  .section,
  .page-pad {
    padding-inline: 14px;
  }

  .hero-badges {
    grid-template-columns: 1fr;
  }

  .card,
  .stat,
  .price-card,
  .panel {
    padding: 18px;
  }

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