:root {
  --ink: #0a1424;
  --ink-2: #13233b;
  --panel: #172942;
  --blue: #2d7ff9;
  --blue-dark: #1d5fc7;
  --cyan: #5ed8f4;
  --paper: #f5f7fb;
  --white: #ffffff;
  --muted: #68758a;
  --muted-dark: #a8b6c9;
  --line: #dbe2ec;
  --line-dark: #2c405d;
  --green: #23b26f;
  --amber: #e59a22;
  --red: #d94a58;
  --shadow: 0 24px 70px rgba(6, 18, 38, 0.16);
  --radius: 12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.hidden { display: none !important; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.view { min-height: calc(100vh - 140px); }

.site-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(29, 70, 122, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 70, 122, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black 0, transparent 760px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 74px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  background: rgba(245, 247, 251, 0.96);
  border-bottom: 1px solid rgba(187, 199, 216, 0.8);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--white);
  background: var(--ink);
  border: 2px solid var(--blue);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.primary-nav { display: flex; gap: 6px; margin-left: auto; }
.primary-nav a { padding: 9px 11px; color: #435168; font-size: 14px; font-weight: 650; border-radius: 8px; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--ink); background: #e9eef6; }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.system-chip { display: inline-flex; align-items: center; gap: 7px; color: #435168; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pulse-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(35, 178, 111, .14); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  font-size: 14px;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, input:focus-visible, select:focus-visible, .tab:focus-visible, .side-link:focus-visible { outline: 3px solid rgba(45, 127, 249, .24); outline-offset: 2px; }
.button-primary { color: var(--white); background: var(--blue); border-color: var(--blue); }
.button-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-secondary { color: var(--ink); background: var(--white); border-color: #c8d2df; }
.button-secondary:hover { border-color: #9faec1; background: #f9fbfe; }
.button-ghost { color: var(--ink); background: transparent; border-color: #cbd4e1; }
.button-ghost:hover { background: #e9eef6; }
.button-danger { color: #a22232; background: #fff4f5; border-color: #fac8ce; }
.button-large { min-height: 48px; padding-inline: 21px; }
.button-small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button-full { width: 100%; }
.icon-button, .text-button { border: 0; background: transparent; color: var(--muted); font-weight: 750; }
.icon-button:hover, .text-button:hover { color: var(--blue); }

.eyebrow { margin: 0 0 14px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 72px; align-items: center; padding-block: 104px 88px; }
.hero-copy h1 { margin: 0; max-width: 720px; font-size: clamp(48px, 6vw, 78px); line-height: .99; letter-spacing: -.057em; }
.hero-copy h1 span { color: var(--blue); }
.hero-lede { max-width: 650px; margin: 28px 0; color: #506077; font-size: 19px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 30px; color: #526177; font-size: 12px; font-weight: 700; }
.trust-row span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; vertical-align: 1px; background: var(--green); border-radius: 50%; }

.hero-console { color: #d9e7f7; background: var(--ink); border: 1px solid #2b4161; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.console-bar { display: flex; align-items: center; gap: 7px; padding: 14px 17px; border-bottom: 1px solid #243953; background: #0e1c31; }
.console-bar span { width: 8px; height: 8px; border-radius: 50%; background: #435675; }
.console-bar span:first-child { background: #d95a68; }
.console-bar span:nth-child(2) { background: #e4a63d; }
.console-bar span:nth-child(3) { background: #30b579; }
.console-bar code { margin-left: auto; color: #8ca3c2; font-size: 11px; }
.address-signal { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; margin: 22px; padding: 17px; background: #10243d; border: 1px solid #294361; border-radius: 11px; }
.signal-origin { position: relative; width: 26px; height: 26px; }
.signal-ring { position: absolute; inset: 0; border: 1px solid var(--cyan); border-radius: 50%; }
.signal-core { position: absolute; inset: 9px; background: var(--cyan); border-radius: 50%; }
.signal-line { height: 1px; background: #355474; }
.signal-result strong, .signal-result span { display: block; }
.signal-result strong { color: #f4fbff; font-size: 13px; }
.signal-result span { color: #86a0bf; font-size: 11px; }
.hero-console pre { min-height: 305px; margin: 0; padding: 10px 28px 30px; overflow: auto; font-size: 13px; line-height: 1.75; }
.hero-console pre b { color: var(--cyan); font-weight: 600; }
.console-footer { display: flex; justify-content: space-between; padding: 12px 18px; color: #81a0c2; background: #0e1c31; border-top: 1px solid #243953; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.metrics-band { color: var(--white); background: var(--ink); border-block: 1px solid #263b58; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.metrics-grid article { padding: 34px 28px; border-right: 1px solid #263b58; }
.metrics-grid article:last-child { border: 0; }
.metrics-grid strong, .metrics-grid span { display: block; }
.metrics-grid strong { font-size: 30px; letter-spacing: -.04em; }
.metrics-grid span { margin-top: 3px; color: #91a5c0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.section { padding-block: 100px; }
.section-heading { max-width: 760px; margin-bottom: 42px; }
.section-heading h2 { margin: 0 0 18px; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -.045em; }
.section-heading > p:last-child { margin: 0; color: var(--muted); font-size: 17px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feature-card { position: relative; min-height: 270px; padding: 30px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 32px rgba(9, 28, 55, .06); }
.feature-card:hover { border-color: #b8c8dc; }
.feature-wide { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.feature-number { color: var(--blue); font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; font-weight: 800; }
.feature-card h3 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.025em; }
.feature-card p { max-width: 520px; margin: 0; color: var(--muted); }
.feature-card code { position: absolute; left: 30px; bottom: 26px; padding: 7px 10px; color: #315f9f; background: #eef5ff; border: 1px solid #d7e7fd; border-radius: 7px; font-size: 12px; }
.feature-wide code { left: auto; right: 30px; }

.section-dark { color: var(--white); background: var(--ink); border-block: 1px solid #273c59; }
.playground-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 54px; padding-block: 92px; }
.playground-intro { padding-top: 10px; }
.playground-intro h2 { margin: 0 0 18px; font-size: 46px; letter-spacing: -.04em; }
.playground-intro > p:not(.eyebrow) { color: var(--muted-dark); }
.playground-intro a { color: var(--cyan); }
.field-label { display: block; margin: 32px 0 8px; color: #d4e0ee; font-size: 13px; font-weight: 750; }
.secret-field { display: flex; align-items: center; border: 1px solid #3b506e; border-radius: 9px; background: #102038; }
.secret-field input { flex: 1; color: var(--white); background: transparent; border: 0; }
.secret-field .icon-button { padding: 12px; color: #9db1ca; }
.field-help { color: var(--muted); font-size: 12px; }
.playground-panel { background: #102038; border: 1px solid #2b405f; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 26px 80px rgba(0, 0, 0, .3); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px; background: #0c1a2e; border-bottom: 1px solid #283e5e; }
.tab { padding: 11px; color: #92a6c0; background: transparent; border: 0; border-radius: 7px; font-size: 13px; font-weight: 800; }
.tab.active { color: var(--white); background: #1d3452; }
.tool-form { display: none; padding: 24px; }
.tool-form.active { display: block; }
label { display: block; color: inherit; font-size: 13px; font-weight: 750; }
input, select { width: 100%; min-height: 43px; margin-top: 7px; padding: 9px 11px; color: var(--ink); background: var(--white); border: 1px solid #c9d3e0; border-radius: 8px; }
input::placeholder { color: #9aa7b9; }
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
.playground-panel input, .playground-panel select { color: #eef6ff; background: #0b1728; border-color: #304763; }
.playground-panel .button { margin-top: 20px; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 13px; }
.result-shell { border-top: 1px solid #2b405f; }
.result-header { display: flex; justify-content: space-between; padding: 11px 16px; color: #9fb1c8; background: #0c1a2e; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.result-header .text-button { color: #9fb1c8; font-size: 11px; }
#playground-result { min-height: 250px; max-height: 440px; margin: 0; padding: 20px; overflow: auto; color: #cde1f8; background: #081426; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }

.developer-section { padding-bottom: 120px; }
.developer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.developer-grid article { padding: 28px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.developer-grid h3 { margin: 0 0 10px; }
.developer-grid p { min-height: 74px; color: var(--muted); }
.developer-grid a { color: var(--blue); font-weight: 800; }

.auth-shell { display: grid; grid-template-columns: 1fr 480px; gap: 86px; align-items: center; min-height: calc(100vh - 140px); padding-block: 80px; }
.auth-context h1 { margin: 0 0 20px; font-size: clamp(44px, 6vw, 70px); letter-spacing: -.055em; line-height: 1; }
.auth-context > p:not(.eyebrow) { max-width: 570px; color: var(--muted); font-size: 18px; }
.auth-proof { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 560px; margin-top: 38px; }
.auth-proof strong { grid-column: 1 / -1; }
.auth-proof span { padding: 13px 15px; color: #33445c; background: #eaf0f8; border: 1px solid #d7e0eb; border-radius: 8px; font-size: 12px; font-weight: 750; }
.auth-proof span::before { content: "✓"; margin-right: 8px; color: var(--green); }
.auth-card { padding: 34px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-form h2 { margin: 0 0 24px; font-size: 28px; letter-spacing: -.03em; }
.auth-form label { margin-bottom: 16px; }
.auth-form > p:last-child { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.auth-form a { color: var(--blue); font-weight: 800; }

.dashboard { display: grid; grid-template-columns: 260px 1fr; gap: 36px; padding-block: 56px 90px; }
.dashboard-sidebar { position: sticky; top: 104px; align-self: start; padding: 24px; background: var(--ink); color: var(--white); border-radius: var(--radius); }
.dashboard-sidebar h2 { margin: 0 0 3px; font-size: 22px; letter-spacing: -.03em; }
.dashboard-sidebar > p:not(.eyebrow) { margin: 0; color: #91a6c0; font-size: 12px; word-break: break-word; }
.dashboard-sidebar nav { display: grid; gap: 5px; margin: 30px 0; }
.side-link, .dashboard-sidebar nav a { width: 100%; padding: 10px 12px; color: #9fb1c8; background: transparent; border: 0; border-radius: 7px; text-align: left; font-size: 13px; font-weight: 750; }
.side-link.active, .side-link:hover, .dashboard-sidebar nav a:hover { color: var(--white); background: #1d3452; }
.dashboard-content { min-width: 0; }
.dashboard-panel { display: none; }
.dashboard-panel.active { display: block; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.panel-heading h1 { margin: 0; font-size: 42px; letter-spacing: -.045em; }
.panel-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.key-list { display: grid; gap: 12px; }
.key-card { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 22px; align-items: center; padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.key-card h3 { margin: 0 0 4px; font-size: 16px; }
.key-card code { color: var(--muted); font-size: 12px; }
.key-card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; padding: 4px 7px; color: #385273; background: #eef3f9; border: 1px solid #dbe5f0; border-radius: 6px; font-size: 10px; font-weight: 800; }
.badge-success { color: #176941; background: #edfbf4; border-color: #c5efd9; }
.badge-muted { color: #7e4a23; background: #fff7ec; border-color: #f5dfbf; }
.key-stats { color: var(--muted); font-size: 12px; }
.key-stats strong, .key-stats span { display: block; }
.key-stats strong { color: #35445a; }
.empty-state { padding: 44px; color: var(--muted); background: var(--white); border: 1px dashed #bdc8d6; border-radius: var(--radius); text-align: center; }
.endpoint-table { overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.endpoint-table div { display: grid; grid-template-columns: 260px 1fr; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.endpoint-table div:last-child { border: 0; }
.endpoint-table code { color: var(--blue-dark); font-weight: 800; }
.endpoint-table span { color: var(--muted); }

.modal { width: min(560px, calc(100% - 32px)); padding: 0; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 30px 100px rgba(0, 0, 0, .35); }
.modal::backdrop { background: rgba(4, 12, 24, .68); backdrop-filter: blur(5px); }
.modal form, .modal > div, .modal > p, .modal > .button { margin-inline: 30px; }
.modal form { margin-block: 30px; }
.modal > .modal-heading { margin-top: 30px; }
.modal > p { color: var(--muted); }
.modal > .button { width: calc(100% - 60px); margin-bottom: 30px; }
.modal-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 22px; }
.modal-heading h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.modal label { margin-top: 15px; }
.modal fieldset { margin: 18px 0; padding: 15px; border: 1px solid var(--line); border-radius: 9px; }
.modal legend { padding: 0 7px; font-size: 12px; font-weight: 800; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 600; }
.check input { width: auto; min-height: 0; margin: 3px 0 0; }
.revealed-secret { display: flex; gap: 8px; align-items: stretch; margin: 20px 30px; }
.revealed-secret code { flex: 1; max-height: 120px; padding: 14px; overflow: auto; color: #d7e8fb; background: var(--ink); border-radius: 8px; word-break: break-all; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 420px; padding: 13px 16px; color: var(--white); background: var(--ink); border: 1px solid #324a69; border-radius: 9px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #7f2330; border-color: #b94554; }
.footer { color: #93a7c0; background: #07111f; border-top: 1px solid #263954; }
.footer .wrap { display: flex; justify-content: space-between; gap: 20px; padding-block: 26px; font-size: 12px; }
.footer a { color: var(--cyan); }

@media (max-width: 1050px) {
  .primary-nav { display: none; }
  .nav-actions { margin-left: auto; }
  .system-chip { display: none; }
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 72px; }
  .hero-console { width: min(720px, 100%); }
  .playground-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; gap: 36px; }
  .auth-context { max-width: 700px; }
  .dashboard { grid-template-columns: 220px 1fr; }
}

@media (max-width: 760px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 66px; padding-inline: 14px; }
  .brand small { display: none; }
  .nav-actions .button-ghost { display: none; }
  .hero { padding-block: 62px; }
  .hero-copy h1 { font-size: 49px; }
  .hero-lede { font-size: 16px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid article:nth-child(2) { border-right: 0; }
  .metrics-grid article:nth-child(-n+2) { border-bottom: 1px solid #263b58; }
  .section { padding-block: 72px; }
  .feature-grid, .developer-grid { grid-template-columns: 1fr; }
  .feature-wide { display: block; }
  .feature-wide .feature-number { display: block; margin-bottom: 16px; }
  .feature-wide code { right: auto; left: 30px; }
  .playground-layout { padding-block: 68px; }
  .field-row { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; grid-template-columns: repeat(4, minmax(100px, 1fr)); }
  .auth-shell { padding-block: 50px; }
  .auth-proof { grid-template-columns: 1fr; }
  .auth-proof strong { grid-column: auto; }
  .dashboard { display: block; padding-top: 22px; }
  .dashboard-sidebar { position: static; margin-bottom: 24px; }
  .dashboard-sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .panel-heading { align-items: start; flex-direction: column; }
  .key-card { grid-template-columns: 1fr; gap: 14px; }
  .endpoint-table div { grid-template-columns: 1fr; gap: 4px; }
  .footer .wrap { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
