/* mcpmeter — enterprise system v2
   typography: Geist (variable sans) + Geist Mono
   palette: white paper, deep ink, restrained blue accent
   reference: github.com / rapidapi.com / vercel
*/

:root {
  --bg:           #FFFFFF;
  --bg-soft:      #F6F8FA;
  --bg-soft-2:    #EBEEF2;
  --border:       #D1D9E0;
  --border-soft:  #DEE3EA;
  --border-strong:#1F2328;
  --ink:          #1F2328;
  --ink-soft:     #424952;
  --muted:        #656D76;
  --muted-soft:   #898F97;
  --accent:       #0969DA;
  --accent-hover: #0550AE;
  --accent-bg:    #DDF4FF;
  --positive:     #1A7F37;
  --positive-bg:  #DAFBE1;
  --warning:      #9A6700;
  --danger:       #CF222E;

  /* Dark surface (hero, code blocks) */
  --dark-bg:        #0D1117;
  --dark-bg-soft:   #161B22;
  --dark-bg-2:      #21262D;
  --dark-border:    #30363D;
  --dark-border-2:  #21262D;
  --dark-text:      #F0F6FC;
  --dark-text-soft: #C9D1D9;
  --dark-muted:     #8B949E;
  --dark-accent:    #58A6FF;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html, body { overflow-x: hidden; max-width: 100vw; }
body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* Prevent grid/flex children from expanding to fit content */
.min-w-0-all > * { min-width: 0; }

/* Type sizes */
.t-display    { font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; }
.t-h1         { font-size: clamp(2rem, 3.5vw, 3rem);   font-weight: 600; letter-spacing: -0.022em; line-height: 1.1; }
.t-h2         { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.018em; line-height: 1.18; }
.t-h3         { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; }
.t-h4         { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.t-lead       { font-size: 1.125rem; line-height: 1.55; color: var(--ink-soft); }
.t-lead-lg    { font-size: clamp(1.125rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--ink-soft); }
.t-body       { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }
.t-body-sm    { font-size: 0.875rem; line-height: 1.55; color: var(--muted); }
.t-meta       { font-size: 0.8125rem; line-height: 1.5; color: var(--muted); font-feature-settings: 'tnum' 1; }
.t-eyebrow    {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); font-feature-settings: 'tnum' 1;
}
.t-eyebrow-muted {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}

.font-mono { font-family: 'Geist Mono', ui-monospace, 'JetBrains Mono', monospace; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px; font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: #000; border-color: #000; }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--ink); background: var(--bg-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 5px; }

/* On dark surfaces */
.btn-on-dark.btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.btn-on-dark.btn-primary:hover { background: #F0F6FC; }
.btn-on-dark.btn-secondary { background: transparent; color: #fff; border-color: var(--dark-border); }
.btn-on-dark.btn-secondary:hover { background: var(--dark-bg-2); border-color: var(--dark-muted); }

/* Link */
.link {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s ease;
}
.link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.link-ink {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease;
}
.link-ink:hover { border-color: var(--ink); }

/* Card */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card-link { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.card-link:hover {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(31,35,40,0.04);
}
.card-soft { background: var(--bg-soft); border-color: var(--border-soft); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  line-height: 1.3;
}
.badge-accent { color: var(--accent); border-color: #B6E3FF; background: var(--accent-bg); }
.badge-positive { color: var(--positive); border-color: #B5E5C2; background: var(--positive-bg); }
.badge-warning { color: var(--warning); border-color: #F2D87B; background: #FFF8C5; }
.badge-mono { font-family: 'Geist Mono', ui-monospace, monospace; padding: 2px 7px; font-size: 11.5px; }

.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--positive);
  flex-shrink: 0;
}
.dot-blue { background: var(--accent); }
.dot-amber { background: var(--warning); }

/* Section dividers */
.divider { border-top: 1px solid var(--border); }
.divider-soft { border-top: 1px solid var(--border-soft); }
.divider-strong { border-top: 1px solid var(--ink); }

/* Code block (light surface, dark inside) */
.codeblock {
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--dark-text-soft);
}
.codeblock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--dark-bg-soft);
  border-bottom: 1px solid var(--dark-border);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--dark-muted);
}
.codeblock-body {
  padding: 18px 20px;
  overflow-x: auto;
  white-space: pre;
}
.tk-key   { color: #FF7B72; }      /* property name */
.tk-str   { color: #A5D6FF; }      /* string */
.tk-cmt   { color: #8B949E; }      /* comment */
.tk-num   { color: #79C0FF; }      /* number */
.tk-op    { color: #FF7B72; }      /* operator */
.tk-fn    { color: #D2A8FF; }      /* function */
.tk-tag   { color: #7EE787; }      /* tag */

/* Inline code */
code:not([class]) {
  font-family: 'Geist Mono', monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--ink);
}

/* Input */
.input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9,105,218,0.2);
}
.input-on-dark {
  background: var(--dark-bg-soft);
  color: #fff;
  border-color: var(--dark-border);
}
.input-on-dark::placeholder { color: var(--dark-muted); }
.input-on-dark:focus {
  border-color: var(--dark-accent);
  box-shadow: 0 0 0 3px rgba(88,166,255,0.2);
}

/* Hero dark surface */
.surface-dark {
  background: var(--dark-bg);
  color: var(--dark-text);
  position: relative;
}
.surface-dark .t-lead, .surface-dark .t-lead-lg, .surface-dark .t-body { color: var(--dark-text-soft); }
.surface-dark .t-meta, .surface-dark .t-body-sm { color: var(--dark-muted); }

/* Subtle dot grid for dark hero */
.dotgrid {
  background-image: radial-gradient(circle at 1px 1px, rgba(240,246,252,0.07) 1px, transparent 0);
  background-size: 28px 28px;
  background-position: 0 0;
}

/* Subtle background dots for marquee dividers */
.shadow-glow {
  box-shadow: 0 1px 0 rgba(31,35,40,0.04), 0 0 0 1px rgba(31,35,40,0.04);
}

/* Selection */
::selection { background: var(--accent); color: #fff; }
.surface-dark ::selection { background: var(--dark-accent); color: var(--dark-bg); }

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

/* Reveal on load */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .7s cubic-bezier(.2,.7,.15,1) both; }
.d-1 { animation-delay: .04s; }
.d-2 { animation-delay: .12s; }
.d-3 { animation-delay: .22s; }
.d-4 { animation-delay: .34s; }
.d-5 { animation-delay: .48s; }

/* Status dot animation (live) */
@keyframes ping-soft {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}
.dot-live { position: relative; }
.dot-live::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping-soft 1.6s ease-out infinite;
}

/* Tabs */
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab-active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

/* Container */
.container-page { max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) {
  .container-page { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1024px) {
  .container-page { padding-left: 40px; padding-right: 40px; }
}

/* Codeblock — force containment in narrow columns */
.codeblock { min-width: 0; max-width: 100%; }
.codeblock-body { font-size: 12.5px; }
@media (min-width: 640px) {
  .codeblock-body { font-size: 13.5px; }
}

/* Touch-friendlier buttons on mobile */
@media (max-width: 640px) {
  .btn { padding: 11px 16px; min-height: 42px; }
  .btn-lg { padding: 13px 20px; font-size: 14.5px; min-height: 46px; }
  .btn-sm { padding: 8px 12px; min-height: 36px; }
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 56px 0 0 0;
  background: var(--bg);
  z-index: 25;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  overflow-y: auto;
}
.mobile-menu.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.hamburger { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; }
.hamburger:hover { background: var(--bg-soft); }

/* Logo wordmark */
.logo {
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.018em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.logo-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: #fff;
  border-radius: 5px;
  font-family: 'Geist Mono', monospace;
  font-weight: 600; font-size: 12px;
}
.surface-dark .logo { color: #fff; }
.surface-dark .logo-mark { background: #fff; color: var(--dark-bg); }
