/* ============================================================================
   Amperes — design system
   Shared CSS across landing / docs / pricing / status / dashboard.
   ============================================================================ */

:root {
  /* Surface */
  --bg: #fafbfc;
  --panel: #ffffff;
  --panel-2: #f4f6fa;
  --panel-dark: #0b1220;

  /* Ink */
  --ink: #0a0e1a;
  --ink-2: #1a2238;
  --muted: #5b6478;
  --muted-2: #8b94a8;

  /* Brand */
  --accent: #2563eb;          /* clear blue, slightly muted */
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --accent-ink: #1e3a8a;

  --warm: #f59e0b;            /* amber — used sparingly for energy/highlights */
  --warm-soft: #fef3c7;

  --good: #059669;            /* savings / positive */
  --good-soft: #d1fae5;

  --warn: #d97706;
  --warn-soft: #fed7aa;

  --bad: #dc2626;
  --bad-soft: #fee2e2;

  /* Borders */
  --border: #e6e8ee;
  --border-strong: #cbd2dc;

  /* Code */
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;
  --code-string: #86efac;
  --code-keyword: #93c5fd;
  --code-comment: #94a3b8;
  --code-header: #fbbf24;

  /* Radii */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 14, 26, 0.04);
  --shadow: 0 4px 12px rgba(10, 14, 26, 0.06), 0 1px 3px rgba(10, 14, 26, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 14, 26, 0.08), 0 4px 8px rgba(10, 14, 26, 0.04);

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, "Cascadia Code", Consolas, monospace;
}

/* ─── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss03";
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ─── Container ───────────────────────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-tight {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}
.brand svg { display: block; }
.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav a {
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav a:hover { color: var(--accent); }
.nav-cta {
  background: var(--ink);
  color: white !important;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 13px;
}
.nav-cta:hover { background: var(--ink-2); color: white !important; }

/* ─── Headings ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 36px; }
h3 { font-size: 22px; }
h4 { font-size: 17px; }

@media (max-width: 720px) {
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--ink);
  color: white;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 0.08s ease, background 0.12s ease;
  border: none;
  cursor: pointer;
}
.btn:hover {
  background: var(--ink-2);
  color: white;
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--panel); border-color: var(--ink); color: var(--ink); }

.btn-lg { padding: 14px 26px; font-size: 15px; }

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding: 96px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 30%, black 30%, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 30%, black 30%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 920px; margin: 0 auto; }
.hero h1 { margin-top: 16px; }
.hero .lede {
  font-size: 20px;
  color: var(--muted);
  margin: 24px auto 0;
  max-width: 720px;
  line-height: 1.5;
}
.hero-cta {
  margin-top: 40px;
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Code block ──────────────────────────────────────────────────────────── */
.code {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
  overflow-x: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  font-weight: 600;
}
.code-dots {
  display: inline-flex; gap: 6px; align-items: center;
}
.code-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
}
.tok-cmd { color: var(--code-header); }
.tok-key { color: var(--code-keyword); }
.tok-str { color: var(--code-string); }
.tok-com { color: var(--code-comment); font-style: italic; }
.tok-resp-header { color: #fbbf24; font-weight: 500; }
.tok-resp-value { color: var(--code-string); }

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--panel-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-2);
  border: 1px solid var(--border);
}

/* ─── Sections ────────────────────────────────────────────────────────────── */
section {
  padding: 80px 24px;
}
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 56px;
}
.section-header .lede {
  font-size: 18px;
  color: var(--muted);
  margin-top: 16px;
}

/* ─── Cards / Grid ────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 920px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.card h3 { margin-bottom: 12px; }
.card p { color: var(--muted); margin: 0; }
.card-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent-ink);
  margin-bottom: 18px;
}

/* ─── Stat strip ──────────────────────────────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--panel);
  margin: 56px auto;
  max-width: 880px;
}
.stat {
  padding: 28px 24px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}
.stat-value.good { color: var(--good); }
.stat-value.accent { color: var(--accent); }
.stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
  font-weight: 600;
}
@media (max-width: 720px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border); }
  .stat:nth-child(odd) { border-right: 1px solid var(--border); }
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel-2);
}

/* ─── Pills / badges ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill-good { background: var(--good-soft); color: #065f46; }
.pill-warn { background: var(--warn-soft); color: #92400e; }
.pill-warm { background: var(--warm-soft); color: #92400e; }
.pill-muted { background: var(--panel-2); color: var(--muted); }

.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--good);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 48px 24px 64px;
  background: var(--panel-2);
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand { color: var(--muted); font-size: 14px; max-width: 320px; }
.footer-col h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 700;
}
.footer-col a {
  display: block;
  color: var(--ink-2);
  font-size: 14px;
  padding: 4px 0;
}
.footer-col a:hover { color: var(--accent); }
.footer-meta {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  max-width: 1120px;
  margin-left: auto; margin-right: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 920px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ─── Two-column layout for docs ──────────────────────────────────────────── */
.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  margin-top: 32px;
}
.doc-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  font-size: 14px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.doc-sidebar h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 24px 0 8px;
  font-weight: 700;
}
.doc-sidebar a {
  display: block;
  padding: 5px 0;
  color: var(--ink-2);
  font-weight: 500;
}
.doc-sidebar a.active { color: var(--accent); font-weight: 600; }
.doc-sidebar a:hover { color: var(--accent); }

.doc-content h2 { margin-top: 48px; margin-bottom: 16px; }
.doc-content h2:first-child { margin-top: 0; }
.doc-content h3 { margin: 28px 0 12px; }
.doc-content p { margin: 12px 0; color: var(--ink-2); line-height: 1.65; }
.doc-content .code { margin: 16px 0; }
.doc-content ul, .doc-content ol { padding-left: 22px; line-height: 1.7; }
.doc-content li { margin: 6px 0; color: var(--ink-2); }

@media (max-width: 920px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }
}

/* ─── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 16px 0 0;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: var(--font-sans);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all 0.12s;
}
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.tab:hover { color: var(--ink); }
.tab-panel { display: none; margin-top: 0; }
.tab-panel.active { display: block; }
.tab-panel .code { border-radius: 0 0 var(--r-lg) var(--r-lg); margin-top: 0; }

/* ─── Misc ────────────────────────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 64px 0;
}

.text-muted { color: var(--muted); }
.text-small { font-size: 13px; }
.text-mono  { font-family: var(--font-mono); font-size: 0.9em; }
.text-center { text-align: center; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mt-6 { margin-top: 48px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.mb-6 { margin-bottom: 48px; }
