/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --clr-brand:      #6366f1;
  --clr-brand-dark: #4f46e5;
  --clr-accent:     #8b5cf6;
  --clr-bg:         #0f0f13;
  --clr-bg-2:       #16161d;
  --clr-bg-3:       #1e1e28;
  --clr-border:     #2a2a38;
  --clr-text:       #e2e2f0;
  --clr-muted:      #8888aa;
  --clr-code-bg:    #12121a;
  --clr-green:      #22c55e;
  --clr-red:        #ef4444;
  --clr-amber:      #f59e0b;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;

  --radius:   8px;
  --radius-lg: 14px;
  --shadow:   0 4px 24px rgba(0,0,0,.4);
  --transition: 150ms ease;

  --max-w: 1160px;
  --docs-sidebar-w: 220px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clr-brand); text-decoration: none; }
a:hover { text-decoration: underline; }

ul[role="list"] { list-style: none; }

h1,h2,h3,h4 { line-height: 1.25; font-weight: 700; }

code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--clr-bg-3);
  padding: .15em .4em;
  border-radius: 4px;
  color: #c4b5fd;
}

pre {
  font-family: var(--font-mono);
  font-size: .82rem;
  background: var(--clr-code-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  line-height: 1.7;
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
  color: var(--clr-text);
  font-size: inherit;
}

/* Syntax colours */
.kw  { color: #818cf8; }   /* keyword / command */
.str { color: #86efac; }   /* string */
.num { color: #fda4af; }   /* number */
.key { color: #7dd3fc; }   /* JSON key */
.cm  { color: #4b5563; font-style: italic; } /* comment */

/* ============================================================
   Layout helpers
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--clr-brand);
  color: #fff;
}
.btn--primary:hover { background: var(--clr-brand-dark); }

.btn--outline {
  border-color: var(--clr-border);
  color: var(--clr-text);
  background: transparent;
}
.btn--outline:hover { border-color: var(--clr-brand); color: var(--clr-brand); }

.btn--ghost {
  color: var(--clr-muted);
  background: transparent;
}
.btn--ghost:hover { color: var(--clr-text); }

.btn--sm { padding: .4rem 1rem; font-size: .85rem; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  background: rgba(99,102,241,.2);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,.35);
  padding: .25rem .75rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-yes { color: var(--clr-green); font-size: .8rem; font-weight: 600; }
.badge-no  { color: var(--clr-muted); font-size: .8rem; }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,19,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--clr-text);
  white-space: nowrap;
  text-decoration: none;
}
.nav__logo:hover { color: var(--clr-text); text-decoration: none; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin-left: auto;
}

.nav__links a {
  color: var(--clr-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: color var(--transition);
  text-decoration: none;
}
.nav__links a:hover { color: var(--clr-text); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem;
  margin-left: auto;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 6rem 0 5rem;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,.18) 0%, transparent 70%);
  border-bottom: 1px solid var(--clr-border);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__text { display: flex; flex-direction: column; gap: 1.25rem; }

.hero__text h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  background: linear-gradient(135deg, #e2e2f0 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: 1.1rem;
  color: var(--clr-muted);
  max-width: 45ch;
  line-height: 1.7;
}

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Code window */
.code-window {
  background: var(--clr-code-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.code-window__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1rem;
  background: var(--clr-bg-3);
  border-bottom: 1px solid var(--clr-border);
}

.code-window__bar span {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--clr-border);
}
.code-window__bar span:nth-child(1) { background: #ef4444; }
.code-window__bar span:nth-child(2) { background: #f59e0b; }
.code-window__bar span:nth-child(3) { background: #22c55e; }

.code-window__label {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--clr-muted);
  background: none;
  padding: 0;
  border-radius: 0;
}

.code-window pre {
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 1.4rem 1.6rem;
}

/* ============================================================
   Section commons
   ============================================================ */
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  margin-bottom: .75rem;
}
.section-sub {
  text-align: center;
  color: var(--clr-muted);
  max-width: 55ch;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

/* ============================================================
   Features
   ============================================================ */
.features {
  padding: 5rem 0;
  border-bottom: 1px solid var(--clr-border);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover {
  border-color: var(--clr-brand);
  transform: translateY(-2px);
}

.feature-card__icon {
  font-size: 1.8rem;
  margin-bottom: .75rem;
}

.feature-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.feature-card p  { font-size: .9rem; color: var(--clr-muted); }

.features__list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1rem;
}

/* ============================================================
   Quickstart
   ============================================================ */
.quickstart {
  padding: 5rem 0;
  border-bottom: 1px solid var(--clr-border);
}

.steps-list { display: flex; flex-direction: column; gap: 2.5rem; }

.step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.step__num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--clr-brand);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: .1rem;
}

.step h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.step p  { color: var(--clr-muted); font-size: .95rem; margin-bottom: .75rem; }

/* Code tabs */
.code-tabs { background: var(--clr-code-bg); border: 1px solid var(--clr-border); border-radius: var(--radius); overflow: hidden; }

.code-tabs__nav {
  display: flex;
  border-bottom: 1px solid var(--clr-border);
}
.code-tabs__nav button {
  background: none;
  border: none;
  padding: .55rem 1rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--clr-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.code-tabs__nav button[aria-selected="true"],
.code-tabs__nav button.active {
  color: var(--clr-brand);
  border-bottom-color: var(--clr-brand);
}

.code-tabs__panels pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

.response-label { font-size: .82rem; color: var(--clr-muted); margin-top: .75rem; }

.response-block {
  background: var(--clr-bg-3);
  border: 1px solid var(--clr-border);
  margin: .4rem 0 0;
}

/* ============================================================
   Pricing
   ============================================================ */
.pricing {
  padding: 5rem 0;
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-bg-2);
}

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.plan-card {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.plan-card--featured {
  border-color: var(--clr-brand);
  background: linear-gradient(160deg, rgba(99,102,241,.08) 0%, var(--clr-bg) 50%);
}

.plan-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-brand);
  color: #fff;
  padding: .2rem .8rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  white-space: nowrap;
}

.plan-card h3 { font-size: 1.2rem; }

.plan-card__price {
  font-size: 2rem;
  font-weight: 800;
}
.plan-card__price span { font-size: 1rem; font-weight: 400; color: var(--clr-muted); }

.plan-card ul { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.plan-card li {
  font-size: .9rem;
  color: var(--clr-muted);
  padding-left: 1.2rem;
  position: relative;
}
.plan-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--clr-green);
  font-weight: 700;
}

.plan-card .btn { margin-top: .5rem; justify-content: center; }

/* ============================================================
   Docs section
   ============================================================ */
.docs-section {
  padding: 5rem 0;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) 1fr;
  gap: 3rem;
  align-items: start;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: .5rem;
}

.docs-sidebar__heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-muted);
  margin-bottom: .75rem;
}

.docs-sidebar > ul { display: flex; flex-direction: column; gap: .15rem; }
.docs-sidebar li { list-style: none; }

.docs-sidebar a {
  display: block;
  padding: .3rem .5rem;
  font-size: .88rem;
  color: var(--clr-muted);
  border-radius: 5px;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--clr-text);
  background: var(--clr-bg-3);
}

.docs-sidebar ul ul {
  margin-left: 1rem;
  margin-top: .15rem;
}
.docs-sidebar ul ul a { font-size: .82rem; }

/* Doc sections */
.doc-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--clr-border);
}
.doc-section:last-child { border-bottom: none; }

.doc-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--clr-text);
}

.doc-section h4 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 1.5rem 0 .6rem;
}

.doc-section p { color: var(--clr-muted); margin-bottom: .5rem; font-size: .95rem; }
.doc-section p a { color: var(--clr-brand); }

/* Endpoint block */
.endpoint {
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.endpoint__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.endpoint__path {
  font-family: var(--font-mono);
  font-size: 1rem;
  background: none;
  padding: 0;
  color: var(--clr-text);
}

.method {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.method--post { background: rgba(99,102,241,.2); color: #a5b4fc; }
.method--get  { background: rgba(34,197,94,.15); color: #86efac; }

.content-type {
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--clr-muted);
  font-weight: 400;
  margin-left: .5rem;
}

.status-200 { color: var(--clr-green); font-size: .82rem; font-weight: 600; font-family: var(--font-mono); }
.status-err { color: var(--clr-red);   font-size: .82rem; font-weight: 600; font-family: var(--font-mono); }

/* Tables */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .87rem;
  margin: .5rem 0;
}
.param-table th {
  text-align: left;
  padding: .5rem .75rem;
  background: var(--clr-bg-3);
  color: var(--clr-muted);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--clr-border);
}
.param-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-muted);
  vertical-align: top;
}
.param-table tr:last-child td { border-bottom: none; }
.param-table td code { font-size: .8rem; }

/* Operation cards */
.op-card {
  background: var(--clr-bg-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.op-card__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .85rem;
}

.op-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  background: none;
  padding: 0;
  color: #c4b5fd;
}

.op-tag {
  display: inline-block;
  background: var(--clr-bg-3);
  border: 1px solid var(--clr-border);
  color: var(--clr-muted);
  padding: .15rem .6rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
}

.op-card p { font-size: .9rem; color: var(--clr-muted); margin-bottom: .75rem; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--clr-bg-2);
  border-top: 1px solid var(--clr-border);
  padding: 3rem 0 1.5rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.footer__brand p { font-size: .9rem; color: var(--clr-muted); }

.site-footer nav ul {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.site-footer nav a { color: var(--clr-muted); font-size: .9rem; }
.site-footer nav a:hover { color: var(--clr-text); }

.footer__copy {
  text-align: center;
  font-size: .82rem;
  color: var(--clr-muted);
  border-top: 1px solid var(--clr-border);
  padding-top: 1.5rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__code  { order: -1; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; display: none; }
  .docs-sidebar.open { display: block; }
}

@media (max-width: 640px) {
  .nav__links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--clr-bg-2); border-bottom: 1px solid var(--clr-border); padding: 1rem 1.5rem; gap: 1rem; }
  .nav__links.open { display: flex; }
  .nav__toggle { display: flex; }
  .hero { padding: 3.5rem 0 3rem; }
  .features { padding: 3rem 0; }
  .quickstart { padding: 3rem 0; }
  .pricing { padding: 3rem 0; }
  .step { flex-direction: column; }
  .footer__inner { flex-direction: column; }
}

/* ============================================================
   Scrollbar (webkit)
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-muted); }
