:root {
  --mh-primary: #4f46e5;
  --mh-primary-hover: #4338ca;
  --mh-primary-soft: #eef2ff;
  --mh-ink: #0f172a;
  --mh-text-secondary: #64748b;
  --mh-text-muted: #94a3b8;
  --mh-canvas: #f4f6fb;
  --mh-surface: #ffffff;
  --mh-border: #e2e8f0;
  --mh-radius: 14px;
  --mh-radius-control: 10px;
  --mh-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
  --mh-code-bg: #0f172a;
  --mh-max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--mh-ink);
  background: var(--mh-canvas);
  line-height: 1.55;
}

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

.page {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--mh-border);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-left: 12px;
  color: var(--mh-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

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

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--mh-border);
  border-radius: 999px;
  background: #f8fafc;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--mh-text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--mh-surface);
  color: var(--mh-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--mh-radius-control);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--mh-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--mh-primary-hover);
}

.btn-ghost {
  background: var(--mh-surface);
  border-color: var(--mh-border);
  color: var(--mh-ink);
}

.btn-ghost:hover {
  border-color: #c7d2fe;
  background: var(--mh-primary-soft);
}

.btn-lg {
  min-height: 44px;
  padding: 0 18px;
}

main {
  max-width: var(--mh-max);
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: center;
  padding: 28px 0 48px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--mh-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.lede {
  margin: 16px 0 0;
  color: var(--mh-text-secondary);
  font-size: 17px;
  max-width: 36em;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}

.trust-strip li {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--mh-surface);
  border: 1px solid var(--mh-border);
  color: var(--mh-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.code-card {
  background: var(--mh-code-bg);
  color: #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--mh-shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.code-card-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #94a3b8;
}

.code-card pre {
  margin: 0;
  padding: 16px 18px 20px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.section {
  padding: 48px 0;
}

.section-alt {
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.55), transparent);
}

.section-head {
  margin-bottom: 24px;
  max-width: 40em;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--mh-text-secondary);
}

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

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

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

.step-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--mh-primary-soft);
  color: var(--mh-primary);
  font-size: 13px;
  font-weight: 700;
}

.card {
  background: var(--mh-surface);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p {
  margin: 0;
  color: var(--mh-text-secondary);
  font-size: 14px;
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--mh-primary);
  font-size: 14px;
  font-weight: 600;
}

.field-list {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--mh-text-secondary);
}

.field-list code {
  color: var(--mh-ink);
  font-weight: 600;
}

.compact-list {
  margin-top: 12px;
}

.doc-code-card {
  margin-top: 16px;
}

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

.reference-grid .doc-code-card {
  margin-top: 16px;
}

.compact-note {
  margin-top: 12px;
  overflow-wrap: anywhere;
}

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

.port-grid .card {
  text-align: center;
}

.port-grid strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.port-grid span {
  color: var(--mh-text-secondary);
  font-size: 13px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.note {
  margin: 16px 0 0;
  color: var(--mh-text-secondary);
  font-size: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--mh-border);
}

th {
  color: var(--mh-text-secondary);
  font-weight: 600;
}

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

.cta-band {
  text-align: center;
  background: linear-gradient(135deg, #eef2ff, #f8fafc 55%, #fff);
  border: 1px solid var(--mh-border);
  border-radius: 20px;
  padding: 40px 24px;
  margin-top: 24px;
}

.cta-band h2 {
  margin: 0;
  font-size: 28px;
}

.cta-band p {
  margin: 10px auto 0;
  max-width: 32em;
  color: var(--mh-text-secondary);
}

.cta-band .hero-cta {
  justify-content: center;
}

.site-footer {
  max-width: var(--mh-max);
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--mh-text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--mh-border);
}

.site-footer strong {
  display: block;
  color: var(--mh-ink);
  margin-bottom: 4px;
}

.footer-links {
  display: flex;
  gap: 16px;
  font-weight: 600;
}

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

@media (max-width: 900px) {
  .hero,
  .feature-grid,
  .integrate-grid,
  .steps-grid,
  .doc-grid,
  .reference-grid,
  .port-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .header-actions {
    margin-left: auto;
  }
}
