:root {
  color-scheme: light;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  --bg: #f4f7fb;
  --paper: #ffffff;
  --paper-muted: #f8fafc;
  --ink: #10182b;
  --text: #263750;
  --muted: #5f6d81;
  --line: #d7dfeb;
  --line-strong: #b9c6d8;
  --blue: #1f62d6;
  --blue-dark: #174da9;
  --blue-soft: #eaf1fe;
  --green: #137a4e;
  --red: #b42331;
  --amber: #a75a00;
  --code: #101b2e;
  --radius: 10px;
  --content: 1180px;
  --reference: 1480px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
button, input, textarea, select { font: inherit; }

.ecosystem-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
}

.ecosystem-header__inner {
  width: min(var(--content), calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}

.ecosystem-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: .13em;
  line-height: 1.05;
  white-space: nowrap;
}

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

.ecosystem-brand small {
  display: inline-flex;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.ecosystem-nav,
.ecosystem-actions,
.account-leftlinks,
.account-anon,
.account-right,
.hero__actions,
.inline-actions,
.user-keys-head-actions,
.atlas-actions,
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.ecosystem-nav {
  justify-content: center;
  gap: 22px;
}

.ecosystem-actions { justify-content: flex-end; gap: 14px; }
.ecosystem-nav a,
.ecosystem-actions a {
  color: #314057;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.ecosystem-nav a:hover,
.ecosystem-actions a:hover { color: var(--blue); }
.ecosystem-nav a[aria-current="page"] { color: var(--blue); }
.ecosystem-actions .ecosystem-cta {
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}
.ecosystem-actions .ecosystem-cta:hover { background: var(--blue-dark); color: #fff; }

.shell-menu-toggle {
  display: none;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.hero,
main,
.dev-footer {
  width: min(var(--content), calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  align-items: end;
  gap: 56px;
  padding: 68px 0 48px;
}

.hero__content { min-width: 0; }
.brand { display: none; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4, strong { color: var(--ink); }
h1 {
  max-width: 820px;
  margin-bottom: 20px;
  font-size: clamp(42px, 5.2vw, 64px);
  line-height: 1.03;
  letter-spacing: -.045em;
}
h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 3.5vw, 44px);
  line-height: 1.1;
  letter-spacing: -.03em;
}
h3 { margin-bottom: 9px; font-size: 21px; line-height: 1.25; }
h4 { margin-bottom: 8px; }
p, li, .lead, .muted, .api-note { color: var(--muted); }
.lead { max-width: 760px; font-size: 18px; }

.hero__actions { gap: 10px; margin-top: 28px; }
.hero__panel { min-width: 0; }
.stat-card {
  min-height: 112px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-value { margin-top: 8px; color: var(--ink); font-size: 20px; font-weight: 750; }

.primary-btn,
.secondary-btn,
.ghost-btn,
.link-btn,
button {
  min-height: 42px;
  margin: 0;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.primary-btn { background: var(--blue); border-color: var(--blue); color: #fff; }
.primary-btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.secondary-btn, .ghost-btn { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.secondary-btn:hover, .ghost-btn:hover { border-color: var(--blue); color: var(--blue); }
.link-btn { min-height: auto; padding: 0; color: var(--blue); }
.hero__actions .link-btn {
  min-height: 42px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hero__actions .primary-btn { color: #fff; }

.api-request-visual {
  padding: 18px;
  border: 1px solid #23324a;
  border-radius: 12px;
  background: #101b2e;
  box-shadow: 0 24px 58px rgba(16, 27, 46, .22);
  color: #e8eef9;
  transform: perspective(1100px) rotateX(var(--depth-x, 0deg)) rotateY(var(--depth-y, 0deg));
  transform-style: preserve-3d;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease;
}
.api-request-visual > * { transform: translateZ(22px); }
.request-visual__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: #9eabc0; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.request-visual__status { color: #6ee7b7; }
.request-line { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #33445f; border-radius: 8px; background: #16243a; font: 700 12px/1.35 "Cascadia Code",Consolas,monospace; }
.request-line code { color: #8eb8ff; }
.request-stages { display: grid; gap: 7px; margin: 12px 0; }
.request-stages>div { display: grid; grid-template-columns: 28px 1fr; gap: 1px 8px; padding: 9px 10px; border: 1px solid #2b3b54; border-radius: 8px; color: #9eabc0; transition: border-color .24s ease,background-color .24s ease,transform .24s ease; }
.request-stages b { grid-row: 1/3; color: #60708a; font: 800 10px/1.5 "Cascadia Code",monospace; }
.request-stages span { color: #dbe5f4; font-size: 12px; font-weight: 750; }
.request-stages small { font-size: 10px; }
.request-stages>div.active { border-color: #4f8ef7; background: #192d4a; transform: translateX(3px); }
.request-stages>div.active b { color: #8eb8ff; }
.request-response { margin: 0; padding: 12px!important; background: #0a1424!important; border-color: #26364f!important; color: #aab7ca!important; font-size: 11px!important; }
.request-response i { color: #8eb8ff; font-style: normal; }.request-response em { color: #6ee7b7; font-style: normal; }

.account-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0 0;
}
.account-leftlinks, .account-anon, .account-right { gap: 10px; }
.account-authed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: min(520px, 100%);
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.account-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-avatar { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; overflow: hidden; }
.account-text { min-width: 0; display: grid; gap: 1px; }
.account-name, .account-email { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name { color: var(--ink); font-size: 13px; font-weight: 750; }
.account-email { color: var(--muted); font-size: 12px; }
.account-plan, .status-badge, .usage-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

main { padding-bottom: 32px; }
.section { padding: 62px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; }
.section__header { max-width: 800px; margin-bottom: 28px; }
.section__header p { max-width: 720px; }

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

.card,
.compact-card,
.access-card,
.pricing-card,
.quickstart,
.quickstart__card,
.note,
.keys-panel,
.key-item,
.header-example,
.reveal-box,
.user-keys-panel {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card, .compact-card, .access-card, .pricing-card, .quickstart__card, .note { padding: 22px; }
.card ul, .pricing-card ul { margin: 14px 0 0; padding-left: 20px; }
.card li + li, .pricing-card li + li { margin-top: 6px; }
.card li > code,
.compact-card li > code,
p > code {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.access-grid { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.access-form, .api-contact-form { display: grid; gap: 13px; }
.access-form label, .field-label { color: var(--ink); font-size: 13px; font-weight: 750; }

input, select, textarea,
.inline-input, .inline-textarea,
.access-form input,
.api-contact-form input,
.api-contact-form textarea,
.atlas-filter input,
.atlas-textarea,
.user-keys-toolbar input {
  width: 100%;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.inline-textarea, .api-contact-form textarea, .atlas-textarea { min-height: 120px; resize: vertical; }
.inline-actions { gap: 10px; margin-top: 10px; }
.sandbox-output, .api-key-output code, .user-key-created code, .reveal-box pre, .codeblock, pre {
  display: block;
  max-width: 100%;
  overflow: auto;
  padding: 14px;
  background: var(--code);
  border: 1px solid #26364f;
  border-radius: 8px;
  color: #e8eef9;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}
code { font-family: "Cascadia Code", Consolas, monospace; }

.sandbox-key-list, .user-keys-list { display: grid; gap: 10px; }
.sandbox-key-item, .user-key-row { padding: 14px; background: var(--paper-muted); border: 1px solid var(--line); border-radius: 8px; }
.sandbox-key-head, .user-keys-head, .user-key-row, .user-keys-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.sandbox-key-meta, .user-key-meta, .user-keys-hint { color: var(--muted); font-size: 12px; }
.sandbox-key-name, .user-key-name { color: var(--ink); font-weight: 750; }
.sandbox-key-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.user-keys-panel { padding: 20px; }
.user-keys-filter { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 14px 0; }
.user-keys-pager { margin-top: 14px; }
.status-badge.active { border-color: #a8dec5; background: #edf9f3; color: var(--green); }
.status-badge.revoked, .usage-badge.limit-reached { border-color: #f2bec4; background: #fff1f2; color: var(--red); }
.pricing-card .price { color: var(--ink); font-size: 34px; font-weight: 800; }
.pricing-card .price span { color: var(--muted); font-size: 14px; font-weight: 500; }

.upgrade-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(10, 20, 36, .55);
}
.upgrade-modal.active { display: grid; }
.upgrade-modal-content { width: min(560px, 100%); background: #fff; border-radius: 12px; box-shadow: 0 24px 70px rgba(12, 25, 48, .22); }
.upgrade-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.upgrade-modal-body { padding: 20px; }
.close-upgrade { min-width: 40px; padding: 6px; background: transparent; }

.quickstart { padding: 24px; }
.quickstart__header { margin-bottom: 18px; }
.quickstart__grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.atlas-console {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 650px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.atlas-sidebar { border-right: 1px solid var(--line); background: var(--paper-muted); }
.atlas-sidebar__top, .atlas-main { padding: 18px; }
.atlas-filter { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.atlas-meta { margin-top: 12px; }
.atlas-title, .atlas-op { color: var(--ink); font-weight: 800; }
.atlas-subtitle, .atlas-op__hint, .atlas-desc { color: var(--muted); font-size: 12px; }
.atlas-tree { padding: 8px 10px 18px; }
.atlas-tree__label, .atlas-panel__title { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.atlas-group { border-top: 1px solid var(--line); }
.atlas-group__head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 8px; background: transparent; border: 0; color: var(--ink); }
.atlas-group__items { padding: 0 4px 8px; }
.atlas-item { display: block; width: 100%; padding: 9px; background: transparent; border: 0; border-radius: 7px; text-align: left; }
.atlas-item:hover, .atlas-item.active { background: var(--blue-soft); }
.atlas-method { color: var(--blue); font-size: 10px; font-weight: 800; }
.atlas-main__header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.atlas-actions { gap: 8px; }
.atlas-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.atlas-panel { padding: 16px; background: var(--paper-muted); border: 1px solid var(--line); border-radius: 8px; }
.atlas-panel__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 12px; }

.ref-section {
  width: min(1320px, calc(100vw - 40px));
  margin-left: 50%;
  transform: translateX(-50%);
}
.ref-section .section__header { max-width: 940px; }
.docs-console {
  height: clamp(560px, 68vh, 760px);
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.docs-console rapi-doc { display: block; width: 100%; height: 100%; }

.dev-footer {
  margin-top: 40px;
  padding: 28px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.dev-footer p { margin-bottom: 14px; }
.dev-footer-logo { display:block; width:285px; height:auto; margin:0 auto 18px; }
.footer-links { gap: 8px 20px; }
.footer-links a { color: #314057; text-decoration: none; }
.footer-links a:hover { color: var(--blue); }

.motion-ready .motion-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .38s ease, transform .38s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--motion-order, 0) * 55ms);
}
.motion-ready .motion-reveal.is-visible { opacity: 1; transform: translateY(0); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(31, 98, 214, .28);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .ecosystem-header__inner { grid-template-columns: 1fr auto auto; padding: 14px 0; }
  .ecosystem-nav { display: none; }
  .ecosystem-header__inner .shell-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .ecosystem-header__inner.shell-menu-open .ecosystem-nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .ecosystem-header__inner.shell-menu-open .ecosystem-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 8px 4px;
  }
  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 48px; }
  .hero__panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card-grid, .feature-grid, .auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atlas-console { grid-template-columns: 1fr; }
  .atlas-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .ecosystem-header__inner, .hero, main, .dev-footer { width: min(100% - 28px, var(--content)); }
  .ecosystem-actions a:not(.ecosystem-cta) { display: none; }
  h1 { font-size: 42px; }
  .hero__panel, .card-grid, .feature-grid, .auth-grid, .atlas-panels { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .account-bar, .account-authed, .sandbox-key-head, .user-keys-head, .user-key-row { align-items: stretch; flex-direction: column; }
  .account-authed { min-width: 0; }
  .account-name, .account-email { max-width: 210px; }
  .ref-section { width: calc(100vw - 20px); }
  .docs-console { height: 620px; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .api-request-visual { transform: none !important; }
}
