/* Meridian — testbed design system.
   A believable product-analytics SaaS. Realistic enough that Canary's explorer
   treats every surface as a real app; the planted defects live in the pages,
   never in this stylesheet. */

:root {
  --paper: #fafaf7;
  --ink: #14151a;
  --ink-soft: #4a4d57;
  --ink-faint: #8a8d97;
  --line: #e6e4dc;
  --line-strong: #d3d0c4;
  --cobalt: #3b46e0;
  --cobalt-dark: #2a33b8;
  --coral: #f0573d;
  --mint: #16a06f;
  --amber: #d99100;
  --panel: #ffffff;
  --panel-alt: #f3f2ec;
  --shadow: 0 1px 2px rgba(20, 21, 26, 0.05), 0 8px 24px rgba(20, 21, 26, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 16px;
  letter-spacing: -0.011em;
}

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

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.025em; font-weight: 680; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.1rem, 4.5vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-faint); }
.mono { font-family: var(--mono); }
.center { text-align: center; }

/* ── top nav ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250, 250, 247, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 720; font-size: 1.06rem; color: var(--ink); letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--cobalt), #7a83ff);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  position: relative;
}
.brand .mark::after {
  content: ""; position: absolute; inset: 7px 7px auto auto;
  width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: 0.92;
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-size: 0.94rem; font-weight: 510; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-spacer { flex: 1; }

/* ── buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 0.94rem; font-weight: 560;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--panel-alt); }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

/* ── hero / sections ───────────────────────────────────────── */
.hero { padding: 84px 0 64px; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--cobalt);
  background: rgba(59, 70, 224, 0.08); padding: 5px 11px; border-radius: 999px; margin-bottom: 20px;
}
.hero p.lead { font-size: 1.2rem; max-width: 33ch; }
.lead { font-size: 1.16rem; color: var(--ink-soft); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 60ch; margin-bottom: 40px; }

/* ── cards / grids ─────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 6px; }
.card .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--panel-alt); display: grid; place-items: center; margin-bottom: 14px; font-size: 1.1rem; }

/* ── pricing ───────────────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.tier.featured { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt), var(--shadow); }
.tier .price { font-size: 2.4rem; font-weight: 720; letter-spacing: -0.03em; }
.tier .price span { font-size: 0.92rem; color: var(--ink-faint); font-weight: 500; }
.tier ul { list-style: none; padding: 0; margin: 18px 0 24px; }
.tier li { padding: 7px 0 7px 26px; position: relative; color: var(--ink-soft); font-size: 0.95rem; border-bottom: 1px solid var(--line); }
.tier li::before { content: "✓"; position: absolute; left: 0; color: var(--mint); font-weight: 700; }
.tier-logo { height: 30px; margin-bottom: 18px; opacity: 0.9; }

/* ── changelog ─────────────────────────────────────────────── */
.entry { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.entry .date { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-faint); }
.tag { display: inline-block; font-size: 0.72rem; font-family: var(--mono); padding: 2px 8px; border-radius: 5px; background: var(--panel-alt); color: var(--ink-soft); margin-right: 6px; }
.tag.new { background: rgba(22,160,111,0.12); color: var(--mint); }
.tag.fix { background: rgba(217,145,0,0.14); color: var(--amber); }

/* ── integrations ──────────────────────────────────────────── */
.logos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.logo-cell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px; display: flex; align-items: center; gap: 12px; font-weight: 560; }
.logo-cell .dot { width: 28px; height: 28px; border-radius: 8px; background: var(--panel-alt); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; color: var(--ink-soft); font-family: var(--mono); }
.status-pill .led { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(22,160,111,0.18); }

/* ── footer ────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: var(--panel-alt); margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 32px; padding: 52px 0 40px; }
.footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 9px; }
.footer a { color: var(--ink-soft); font-size: 0.92rem; }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px 0; font-size: 0.85rem; color: var(--ink-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ── auth (login / vault) ──────────────────────────────────── */
.auth-shell { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 48px 24px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 38px; width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 560; margin-bottom: 6px; color: var(--ink); }
.field input {
  width: 100%; padding: 11px 13px; font-family: inherit; font-size: 0.96rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink);
}
.field input:focus { outline: 2px solid rgba(59,70,224,0.4); border-color: var(--cobalt); }
.note { font-size: 0.85rem; color: var(--ink-faint); }

/* ── app shell (dashboard, gated) ──────────────────────────── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: #15161c; color: #c7c9d2; padding: 20px 14px; }
.side .brand { color: #fff; margin: 4px 8px 26px; }
.side .brand .mark { background: linear-gradient(135deg, #7a83ff, #3b46e0); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #aeb1be; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.93rem; font-weight: 510; }
.side nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.side nav a.active { background: rgba(123,131,255,0.16); color: #fff; }
.side .side-foot { margin-top: auto; padding: 12px; font-size: 0.8rem; color: #71747f; }
.main { padding: 28px 36px; background: var(--paper); }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.topbar h1 { font-size: 1.5rem; margin: 0; }
.topbar .spacer { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--coral), var(--amber)); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat .k { font-size: 0.8rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.stat .v { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }
.stat .d { font-size: 0.82rem; font-family: var(--mono); margin-top: 4px; }
.stat .d.up { color: var(--mint); }
.stat .d.down { color: var(--coral); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 14px; }
.chart { height: 200px; border-radius: var(--radius-sm); background:
  linear-gradient(180deg, rgba(59,70,224,0.10), rgba(59,70,224,0) 70%);
  border: 1px solid var(--line); position: relative; overflow: hidden; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.tbl th { text-align: left; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); }
table.tbl td { padding: 12px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
table.tbl tr:hover td { background: var(--panel-alt); }
.badge { font-family: var(--mono); font-size: 0.74rem; padding: 2px 8px; border-radius: 999px; }
.badge.ok { background: rgba(22,160,111,0.12); color: var(--mint); }
.badge.warn { background: rgba(217,145,0,0.14); color: var(--amber); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }

/* responsive-ish (the swarm runs a desktop viewport; this just keeps it sane) */
@media (max-width: 860px) {
  .grid-3, .tiers, .logos, .stat-row, .footer-inner { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
}
