/* ── Custom properties ─────────────────────────────────────── */
:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --card:      #21262d;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --accent:    #238636;
  --accent-h:  #2ea043;
  --link:      #58a6ff;
  --danger:    #f85149;
  --success:   #3fb950;
  --warning:   #e3b341;
  --r:         6px;
  --r-lg:      12px;
  --max-w:     1100px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 1rem;
  background: var(--accent);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: var(--r);
  z-index: 9999;
  font-size: .9rem;
}
.skip-link:focus { left: 1rem; }

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

/* ── Navigation ─────────────────────────────────────────────── */
.site-nav {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}
.nav-brand span { color: var(--success); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--muted); font-size: .9rem; transition: color .15s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--r);
  font-size: .9rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  text-decoration: none;
  line-height: 1.4;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-h);
}
.btn-primary:hover { background: var(--accent-h); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--card); border-color: var(--muted); }
.btn-lg { padding: .7rem 1.6rem; font-size: 1rem; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(63,185,80,.12);
  color: var(--success);
  border: 1px solid rgba(63,185,80,.3);
  border-radius: 999px;
  padding: .25rem .8rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.025em;
  margin-bottom: 1rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 .highlight { color: var(--success); }
.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }
.section-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--success);
  margin-bottom: .4rem;
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: .6rem;
  letter-spacing: -.02em;
}
.section-sub {
  color: var(--muted);
  font-size: 1rem;
  max-width: 520px;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

/* ── How it works ───────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.6rem;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  background: rgba(63,185,80,.12);
  border: 1px solid rgba(63,185,80,.3);
  color: var(--success);
  font-weight: 700;
  font-size: .82rem;
  border-radius: 50%;
  margin-bottom: .9rem;
}
.step-card h3 { font-size: .95rem; font-weight: 600; margin-bottom: .4rem; }
.step-card p { color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* ── Pricing ────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.pricing-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
}
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 24px rgba(35,134,54,.15);
}
.pricing-badge {
  position: absolute;
  top: -1px;
  right: 1.1rem;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .55rem;
  border-radius: 0 0 var(--r) var(--r);
}
.pricing-tier {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .65rem;
}
.pricing-price {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: .2rem;
  letter-spacing: -.03em;
}
.pricing-price sup { font-size: 1.1rem; vertical-align: super; font-weight: 600; }
.pricing-credits { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }
.pricing-features {
  list-style: none;
  margin-bottom: 1.75rem;
  flex: 1;
}
.pricing-features li {
  padding: .35rem 0;
  font-size: .88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* ── Code blocks ────────────────────────────────────────────── */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  color: var(--muted);
}
.code-dots { display: flex; gap: .35rem; }
.code-dots span {
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: var(--border);
}
.code-body { padding: 1.1rem 1.25rem; overflow-x: auto; }
pre { margin: 0; }
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: .82rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre;
}
.token-key  { color: #79c0ff; }
.token-str  { color: #a5d6ff; }
.token-num  { color: #79c0ff; }
.token-bool { color: #ff7b72; }
.token-null { color: #ff7b72; }
.token-cmd  { color: #ffa657; }
.token-flag { color: #d2a8ff; }
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--r);
  padding: .18rem .45rem;
  font-size: .72rem;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* ── API preview ────────────────────────────────────────────── */
.api-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ── MCP section ────────────────────────────────────────────── */
.mcp-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2rem;
}
.mcp-clients {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  list-style: none;
  padding: 0;
}
.mcp-client {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .3rem .7rem;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
}
.mcp-hint {
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: .9rem;
}
.mcp-hint code {
  background: var(--card);
  padding: .1rem .3rem;
  border-radius: 3px;
  font-size: .8rem;
}

/* ── API spec link ──────────────────────────────────────────── */
.api-spec-link { margin-top: 1rem; font-size: .9rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand { font-weight: 600; font-size: .9rem; color: var(--text); text-decoration: none; }
.footer-brand span { color: var(--success); }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { font-size: .83rem; color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-copy { font-size: .8rem; color: var(--muted); }

/* ── New page header ────────────────────────────────────────── */
.page-header { margin-bottom: 0; }
.page-title { font-size: 1.3rem; font-weight: 700; }
.page-sub { color: var(--muted); font-size: .88rem; margin-top: .3rem; }
.new-content { padding-top: 2rem; padding-bottom: 4rem; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: .7rem 1.1rem;
  font-size: .9rem;
  font-weight: 500;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Form elements ──────────────────────────────────────────── */
.form-section { max-width: 620px; }
.form-group { margin-bottom: 1.15rem; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .35rem;
}
.form-label .req { color: var(--danger); margin-left: .15rem; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .28rem; }
.form-label-sub { font-size: .78rem; color: var(--muted); margin-bottom: .2rem; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: .55rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}
.form-input.error,
.form-select.error,
.form-textarea.error { border-color: var(--danger); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select option { background: var(--surface); }

.char-counter {
  font-size: .78rem;
  color: var(--muted);
  text-align: right;
  margin-top: .25rem;
}
.char-counter.warn { color: var(--warning); }
.char-counter.over { color: var(--danger); }

.field-error {
  font-size: .78rem;
  color: var(--danger);
  margin-top: .28rem;
  display: none;
}
.field-error.show { display: block; }

/* ── Package cards ──────────────────────────────────────────── */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.pkg-card {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.pkg-card:hover { border-color: var(--muted); }
.pkg-card.selected { border-color: var(--accent); background: rgba(35,134,54,.08); }
.pkg-card:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.pkg-card input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.pkg-name { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.pkg-price { display: block; font-size: 1.45rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; margin-bottom: .15rem; }
.pkg-credits { display: block; font-size: .75rem; color: var(--muted); }

/* ── Autocomplete ───────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }
.tag-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .35rem .6rem;
  min-height: 2.4rem;
  transition: border-color .15s, box-shadow .15s;
  cursor: text;
}
.tag-input-row:focus-within {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}
.tag-input-row.error { border-color: var(--danger); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: rgba(88,166,255,.12);
  color: var(--link);
  border: 1px solid rgba(88,166,255,.25);
  border-radius: 999px;
  padding: .12rem .45rem;
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}
.tag-remove {
  background: transparent;
  border: none;
  color: var(--link);
  font-size: .88rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: .65;
  display: flex;
  align-items: center;
}
.tag-remove:hover { opacity: 1; }
.tech-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: .88rem;
  outline: none;
  flex: 1;
  min-width: 110px;
  padding: .1rem 0;
}
.tech-input::placeholder { color: var(--muted); }
.ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  max-height: 200px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.ac-dropdown.open { display: block; }
.ac-option {
  padding: .45rem .85rem;
  font-size: .88rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.ac-option:last-child { border-bottom: none; }
.ac-option:hover,
.ac-option.hi { background: var(--surface); }

/* ── Responsibilities ───────────────────────────────────────── */
.resp-list { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .5rem; list-style: none; padding: 0; }
#btn-add-resp { margin-top: .3rem; }
.resp-item { display: flex; gap: .45rem; align-items: center; }
.resp-item .form-input { flex: 1; }
.resp-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--r);
  padding: .45rem .55rem;
  font-size: .9rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.resp-del:hover { color: var(--danger); border-color: var(--danger); }
.resp-del:disabled { opacity: .35; cursor: not-allowed; }

/* ── Salary row ─────────────────────────────────────────────── */
.salary-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: .7rem;
}

/* ── Work mode radios ───────────────────────────────────────── */
.radio-group { display: flex; gap: .6rem; flex-wrap: wrap; }
.radio-card {
  flex: 1;
  min-width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r);
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .15s, background .15s, color .15s;
  position: relative;
}
.radio-card:hover { border-color: var(--muted); }
.radio-card:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
.radio-card input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.radio-card.selected {
  border-color: var(--link);
  background: rgba(88,166,255,.08);
  color: var(--link);
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--r);
  font-size: .88rem;
  margin-bottom: 1.1rem;
  border-left: 3px solid;
  line-height: 1.5;
}
.alert-error   { background: rgba(248,81,73,.08);  border-color: var(--danger);  color: #ff8b88; }
.alert-success { background: rgba(63,185,80,.08);  border-color: var(--success); color: var(--success); }
.alert-info    { background: rgba(88,166,255,.08); border-color: var(--link);    color: var(--link); }
.alert a { color: inherit; font-weight: 600; }

/* ── State screens ──────────────────────────────────────────── */
.state-screen {
  text-align: center;
  padding: 4rem 1rem;
  max-width: 520px;
  margin: 0 auto;
}
.state-icon { font-size: 2.75rem; margin-bottom: .85rem; line-height: 1; }
.state-screen h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: .65rem; }
.state-screen p { color: var(--muted); margin-bottom: 1.5rem; font-size: .95rem; }

/* ── Divider ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.75rem 0; }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 2.5rem 0; }
  .api-preview { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .pricing-grid { grid-template-columns: 1fr; }
  .salary-row { grid-template-columns: 1fr 1fr; }
  .pkg-grid { grid-template-columns: 1fr; }
}
