/* Nexlab MCP — design system.
   Inter and JetBrains Mono are served from this container rather than a font
   CDN: the same faces, but no request to a third party on every page view and
   nothing to fail on a Tor circuit. */

@font-face { font-family: Inter; font-style: normal; font-weight: 400;
  font-display: swap; src: url(/static/fonts/Inter-400.woff2) format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500;
  font-display: swap; src: url(/static/fonts/Inter-500.woff2) format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600;
  font-display: swap; src: url(/static/fonts/Inter-600.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400;
  font-display: swap; src: url(/static/fonts/JetBrainsMono-400.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500;
  font-display: swap; src: url(/static/fonts/JetBrainsMono-500.woff2) format('woff2'); }

:root {
  --bg:          #08090a;
  --panel:       #0f1011;
  --surface:     rgba(255,255,255,.035);
  /* The opaque twin of --surface, for controls the browser paints outside the
     page: a dropdown popup composites against its own white sheet, not against
     --bg, so a translucent white there resolves to white. */
  --field:       #131519;
  --surface-2:   rgba(255,255,255,.055);
  --border:      rgba(255,255,255,.08);
  --border-soft: rgba(255,255,255,.05);
  --text:        #f7f8f8;
  --muted:       #a5acb8;
  --faint:       #62666d;
  --accent:      #7170ff;
  --accent-2:    #25d0ff;
  --success:     #10b981;
  --warn:        #f0b429;
  --danger:      #ff6b8a;
  --radius:      18px;
  --radius-sm:   11px;
  --max:         1160px;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Tell the browser this page is dark, so the controls it renders itself -
   dropdown popups, checkboxes, scrollbars, date pickers - stop defaulting to
   the light theme and drawing dark text on light chrome inside a dark page. */
:root { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A single soft light source behind the page, so the near-black does not read
   as flat. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 520px at 18% -8%, rgba(113,112,255,.16), transparent 62%),
    radial-gradient(760px 460px at 92% 4%, rgba(37,208,255,.10), transparent 60%);
}
main, header, footer { position: relative; z-index: 1; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 520px; }

a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }
.link { color: var(--accent-2); }
.link:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 510; letter-spacing: -0.035em; line-height: 1.1; }
h1 { font-size: clamp(38px, 6.4vw, 76px); letter-spacing: -1.5px; }
h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.9px; }
h3 { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0 0 16px; color: var(--muted); }

section { padding: 70px 0; }

/* ---------- header ---------- */

header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,9,10,.72);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border-soft);
}
header.site .bar { display: flex; align-items: center; gap: 26px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500;
         font-size: 15.5px; letter-spacing: -0.02em; }
.brand .mark {
  width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08090a; font: 600 12px/1 var(--sans);
}
.nav { margin-left: auto; display: flex; align-items: center; gap: 24px;
       font-size: 14px; color: var(--muted); }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero { padding: 92px 0 54px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px;
  font: 500 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: 99px;
  padding: 7px 14px; background: var(--surface);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success);
                box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.hero h1 { max-width: 15ch; }
.hero .lede { font-size: clamp(16px, 2vw, 19px); color: var(--muted);
              max-width: 64ch; margin: 24px 0 32px; line-height: 1.6; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; margin-top: 62px; background: var(--border-soft);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--panel); padding: 22px 24px; }
.stat .n { font: 500 30px/1 var(--sans); letter-spacing: -0.04em; }
.stat .l { margin-top: 8px; font: 400 12px/1 var(--mono); color: var(--faint);
           text-transform: uppercase; letter-spacing: .08em; }

/* ---------- cards ---------- */

.grid { display: grid; gap: 14px;
        grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

.card {
  position: relative; display: block; padding: 22px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
/* a hairline of accent light along the top edge on hover */
.card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .18s ease;
}
a.card:hover { border-color: rgba(255,255,255,.16); transform: translateY(-2px);
               background: #121314; }
a.card:hover::after { opacity: .85; }

.card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.card h3 { flex: 1; color: var(--text); }
.card .desc {
  color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot { display: flex; align-items: center; gap: 9px; padding-top: 15px;
             border-top: 1px solid var(--border-soft); }

.mono-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  font: 500 13px/1 var(--mono); color: #fff; letter-spacing: -.02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

.price { font: 500 14px/1 var(--mono); color: var(--text); }
.pill {
  font: 400 11.5px/1 var(--mono); color: var(--faint); letter-spacing: .02em;
  border: 1px solid var(--border); border-radius: 99px; padding: 5px 10px;
  white-space: nowrap; text-transform: uppercase;
}
.pill.ok { color: var(--success); border-color: rgba(16,185,129,.3); }
.pill.bad { color: var(--danger); border-color: rgba(255,107,138,.3); }
.pill.accent { color: var(--accent-2); border-color: rgba(37,208,255,.28); }

/* ---------- buttons and forms ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--text); color: #08090a; cursor: pointer;
  font: 500 14.5px/1 var(--sans); letter-spacing: -0.01em;
  transition: opacity .15s ease, transform .1s ease;
}
.btn:hover { opacity: .88; color: #08090a; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--text);
             border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); color: #fff; }
.btn.small { padding: 8px 14px; font-size: 13px; }

label { display: block; font: 400 13px/1 var(--mono); color: var(--muted);
        text-transform: uppercase; letter-spacing: .05em; margin-bottom: 9px; }
/* `input` with no type attribute is a text input, but `input[type=text]` does
   not match it - and the console forms are full of them. Selecting by what a
   control is *not* keeps checkboxes, radios and buttons out of this. */
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]):not([type=hidden]),
textarea, select {
  width: 100%; padding: 12px 14px; color: var(--text);
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); outline: none;
  font: 400 15px var(--sans); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--faint); }

/* The options are drawn in a popup outside the page, which inherits the
   select's own background rather than the page's. With the translucent
   --surface that meant near-white text on a near-white sheet: the visibility
   chooser in the console was unreadable until it was clicked through blind. */
select { background-color: var(--field); }
select option, select optgroup { background-color: var(--field); color: var(--text); }

/* Chrome paints its own opaque background on an autofilled field, which on a
   dark page turns the input white with near-white text in it. There is no
   background property to override — the inset shadow is the only way to cover
   it, and the text colour has to be forced separately. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #14161a inset;
  box-shadow: 0 0 0 1000px #14161a inset;
  caret-color: var(--text);
  transition: background-color 100000s ease-in-out 0s;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(113,112,255,.55);
  box-shadow: 0 0 0 3px rgba(113,112,255,.14);
}
.field { margin-bottom: 18px; }
.hint { font-size: 13px; color: var(--faint); margin-top: 8px; line-height: 1.5; }

/* ---------- panels, tables, code ---------- */

.panel { background: var(--panel); border: 1px solid var(--border);
         border-radius: var(--radius); padding: 26px; }
.notice { border: 1px solid var(--border); background: var(--surface);
          border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px;
          color: var(--muted); margin-bottom: 20px; }
.notice.bad { border-color: rgba(255,107,138,.35); color: var(--danger); }
.notice.ok { border-color: rgba(16,185,129,.35); color: var(--success); }
.notice.warn { border-color: rgba(240,180,41,.35); color: var(--warn); }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; padding: 0 12px 12px; color: var(--faint);
     font: 400 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; }
td { padding: 13px 12px; border-top: 1px solid var(--border-soft);
     vertical-align: top; color: var(--muted); }
td:first-child { color: var(--text); }
tbody tr:hover td { background: rgba(255,255,255,.02); }

code { font: 400 13px var(--mono); color: var(--accent-2); }
pre {
  font: 400 12.5px/1.7 var(--mono); color: var(--muted);
  background: #0b0c0d; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px; overflow-x: auto; margin: 0 0 18px;
}
pre code { color: inherit; }
.tool-name { font: 500 13px var(--mono); color: var(--accent-2); }

/* ---------- search ---------- */

.toolbar { display: flex; gap: 12px; align-items: center; margin: 0 0 22px;
           flex-wrap: wrap; }
.search { flex: 1; min-width: 260px; position: relative; }
.search input { padding-left: 42px; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
              color: var(--faint); }

/* ---------- console ----------
   The admin pages are a different job from the storefront: dense, tabular, and
   read by one person who already knows what everything means. Same tokens, less
   air, and a second navigation bar so the sections are reachable without
   going back to the top-level nav. */

.subnav {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(15,16,17,.7);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  position: sticky; top: 64px; z-index: 40;
}
.subnav .wrap { display: flex; align-items: center; gap: 22px; height: 46px;
                overflow-x: auto; scrollbar-width: none; }
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav-label { font: 500 11.5px/1 var(--mono); color: var(--faint);
                text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.subnav-gap { flex: 1; }
.subnav a { font-size: 14px; color: var(--muted); white-space: nowrap;
            padding: 4px 0; border-bottom: 1.5px solid transparent; }
.subnav a:hover { color: var(--text); }
.subnav a.on { color: var(--text); border-bottom-color: var(--accent); }

section.console { padding: 34px 0 80px; }
.page-head { display: flex; align-items: flex-start; gap: 20px;
             flex-wrap: wrap; margin-bottom: 24px; }
.page-head h2 { font-size: 26px; letter-spacing: -0.6px; }
.page-head p { margin: 8px 0 0; font-size: 14px; max-width: 68ch; }
.page-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.metrics { display: grid; gap: 1px; background: var(--border-soft);
           border: 1px solid var(--border); border-radius: var(--radius);
           overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metric { background: var(--panel); padding: 18px 20px; }
.metric .n { font: 500 26px/1 var(--sans); letter-spacing: -0.04em; }
.metric .l { margin-top: 7px; font: 400 11.5px/1 var(--mono); color: var(--faint);
             text-transform: uppercase; letter-spacing: .08em; }
.metric .sub { margin-top: 6px; font-size: 12.5px; color: var(--faint); }

.panel + .panel, .metrics + .panel, .panel + .metrics { margin-top: 18px; }
.panel h3 { margin-bottom: 4px; }
.panel .panel-note { font-size: 13px; color: var(--faint); margin: 0 0 18px; }
.panel.flush { padding: 8px 10px; }

/* A secret is masked by a class rather than by type=password, which would hand
   the field to the browser's password manager - offering to save an API key as
   a login, then autofilling it later over a working credential. Supported in
   Chrome, Safari and Firefox 128+; where it is not, the value is legible only
   while the operator is typing it, since the box is never pre-filled. */
.secret { display: inline-flex; align-items: center; gap: 6px; }
.secret input.masked { -webkit-text-security: disc; }
.secret .reveal { font: 400 11.5px/1 var(--mono); text-transform: uppercase;
                  letter-spacing: .06em; padding: 7px 9px; }

/* What we have to be told to somebody else's console. Set apart from the fields
   above it, because these are read and copied out, never typed in. */
.urlbox { margin-top: 18px; padding: 16px 18px 4px; border-radius: 10px;
          border: 1px dashed var(--border); background: var(--surface); }
.urlbox h4 { margin: 0 0 12px; font: 500 11.5px/1 var(--mono); color: var(--faint);
             text-transform: uppercase; letter-spacing: .09em; }
.urlbox table { margin: 0; }
.urlbox td { border: 0; padding: 5px 12px 5px 0; }
/* One click selects the whole URL: a half-copied callback is a mismatch error
   that names nothing. */
.copyable { user-select: all; word-break: break-all; }

/* A row of controls that has to stay on one line and wrap as a unit. */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.btn.tiny { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.danger { background: rgba(255,107,138,.12); color: var(--danger);
              border-color: rgba(255,107,138,.32); }
.btn.danger:hover { background: rgba(255,107,138,.2); color: var(--danger); }

/* Inline inputs inside a table cell must not stretch to 100% like form fields. */
table input:not([type=checkbox]):not([type=radio]), table select,
.row input:not([type=checkbox]):not([type=radio]), .row select {
  width: auto; padding: 7px 10px; font-size: 13.5px; border-radius: 8px;
}
.w-tiny { width: 76px !important; }
.w-small { width: 120px !important; }
.w-mid { width: 200px !important; }

.pill.off { color: var(--faint); border-style: dashed; }
.pill.warn { color: var(--warn); border-color: rgba(240,180,41,.3); }
.pill.private { color: var(--accent); border-color: rgba(113,112,255,.35); }

.slug { font: 400 13px var(--mono); color: var(--accent-2); }
.dim { color: var(--faint); font-size: 12.5px; }
.truncate { display: block; max-width: 42ch; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap; }
.scroll-x { overflow-x: auto; }

/* ---------- footer ---------- */

footer.site { border-top: 1px solid var(--border-soft); padding: 46px 0 60px;
              margin-top: 70px; }
footer.site .cols { display: flex; gap: 60px; flex-wrap: wrap; }
footer.site p, footer.site a { font-size: 13.5px; color: var(--faint); }
footer.site a:hover { color: var(--muted); }
footer.site strong { font: 500 12px/1 var(--mono); color: var(--muted);
                     text-transform: uppercase; letter-spacing: .07em; }

@media (max-width: 700px) {
  .hero { padding: 62px 0 34px; }
  section { padding: 46px 0; }
  .nav { gap: 15px; font-size: 13.5px; }
  .nav a.hide-sm { display: none; }
  .stats { margin-top: 40px; }
}
