/* Relay landing — design tokens match relay/web/static/style.css */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;

  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --accent:       #6366f1;
  --accent-dark:  #4f46e5;
  --accent-light: #818cf8;
  --accent-bg:    #eef2ff;

  --up:          #10b981;
  --up-bg:       #d1fae5;
  --down:        #ef4444;
  --down-bg:     #fee2e2;
  --degraded:    #f59e0b;
  --degraded-bg: #fef3c7;

  --bg:      #f8fafc;
  --surface: #ffffff;
  --border:  #e2e8f0;

  --text:       #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --sidebar-bg: #0f172a;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.10), 0 10px 10px -5px rgba(0,0,0,.04);

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  --nav-h: 64px;
  --max-w: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  color: var(--gray-700);
}
pre {
  margin: 0;
  padding: 20px 24px;
  background: var(--gray-900);
  color: #e2e8f0;
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .8125rem;
  line-height: 1.7;
  box-shadow: var(--shadow-lg);
}
pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo svg { flex-shrink: 0; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a:not(.btn) {
  color: var(--text-muted);
  font-size: .9375rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-links a:not(.btn):hover {
  color: var(--text);
  background: var(--gray-100);
  text-decoration: none;
}
.nav-links .btn {
  margin-left: 4px;
}
.nav-links .btn-primary {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(99,102,241,.3);
}
.nav-links .btn-primary:hover {
  background: var(--accent-dark) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(99,102,241,.3);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--gray-50);
  color: var(--text);
  border-color: var(--gray-300);
}
.btn-sm { padding: 7px 14px; font-size: .875rem; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99,102,241,.12), transparent),
    radial-gradient(ellipse 40% 40% at 80% 50%, rgba(99,102,241,.06), transparent);
  pointer-events: none;
}
.hero-content { position: relative; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-size: .8125rem;
  font-weight: 500;
  border-radius: var(--r-full);
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 8px;
  height: 8px;
  background: var(--up);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin: 0 0 20px;
  color: var(--text);
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  padding-top: 8px;
}
.hero-stat {
  text-align: center;
}
.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.hero-stat-label {
  font-size: .8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
section { padding: 80px 0; }
.section-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  line-height: 1.2;
}
.section-desc {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 0 48px;
  line-height: 1.7;
}
.section-header { margin-bottom: 48px; }
.section-header.center { text-align: center; }
.section-header.center .section-desc { margin-left: auto; margin-right: auto; }

/* ── Screenshots ──────────────────────────────────────────────────────────── */
.screenshots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.screenshot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform .2s, box-shadow .2s;
}
.screenshot-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.screenshot-card img {
  width: 100%;
  height: auto;
  display: block;
}
.screenshot-caption {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.screenshot-caption strong {
  display: block;
  font-size: .9375rem;
  margin-bottom: 4px;
}
.screenshot-caption span {
  font-size: .8125rem;
  color: var(--text-muted);
}

/* ── Features grid ────────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  transition: border-color .15s, box-shadow .15s;
}
.feature-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}
.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: var(--r);
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
}
.feature-card p {
  font-size: .875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Comparison table ─────────────────────────────────────────────────────── */
.compare-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
.compare-table th,
.compare-table td {
  padding: 14px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.compare-table th:first-child,
.compare-table td:first-child { text-align: left; }
.compare-table thead th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: .875rem;
}
.compare-table thead th.relay-col {
  background: var(--accent-bg);
  color: var(--accent-dark);
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody td:first-child {
  font-weight: 500;
  color: var(--text);
}
.check { color: var(--up); font-weight: 600; }
.cross { color: var(--gray-300); }
.relay-highlight { background: rgba(99,102,241,.04); font-weight: 600; }

/* ── Quick start ──────────────────────────────────────────────────────────── */
.quickstart {
  background: var(--sidebar-bg);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.quickstart h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
.quickstart p {
  color: var(--gray-400);
  margin: 0 0 24px;
  font-size: .9375rem;
  line-height: 1.7;
}
.quickstart pre {
  margin: 0;
  font-size: .75rem;
}

/* ── Monitor types ────────────────────────────────────────────────────────── */
.monitor-types {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.monitor-type {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  text-align: center;
}
.monitor-type code {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-bg);
  margin-bottom: 8px;
}
.monitor-type span {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── CTA ──────────────────────────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 80px 0;
}
.cta-box {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--r-xl);
  padding: 64px 48px;
  color: #fff;
}
.cta-box h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -.02em;
}
.cta-box p {
  opacity: .85;
  margin: 0 0 32px;
  font-size: 1.0625rem;
}
.cta-box .btn-primary {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: var(--shadow-lg);
}
.cta-box .btn-primary:hover {
  background: var(--gray-50);
  color: var(--accent-dark);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  background: var(--sidebar-bg);
  color: var(--gray-400);
  padding: 48px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p {
  font-size: .875rem;
  line-height: 1.7;
  margin: 0;
  max-width: 280px;
}
.footer-col h4 {
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 16px;
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: var(--gray-400);
  font-size: .875rem;
  text-decoration: none;
}
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8125rem;
}

/* ── Docs page ────────────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 40px 0 80px;
  align-items: start;
}
.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.docs-sidebar h3 {
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin: 0 0 12px;
  padding-left: 12px;
}
.docs-sidebar ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.docs-sidebar a {
  display: block;
  padding: 7px 12px;
  font-size: .875rem;
  color: var(--text-muted);
  border-radius: var(--r);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.docs-sidebar a:hover,
.docs-sidebar a.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-left-color: var(--accent);
  text-decoration: none;
}
.docs-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -.02em;
}
.docs-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin: 0 0 40px;
  line-height: 1.7;
}
.docs-content h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 48px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.docs-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.docs-content h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 28px 0 12px;
}
.docs-content p {
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 16px;
}
.docs-content ul, .docs-content ol {
  color: var(--text-muted);
  padding-left: 24px;
  margin: 0 0 16px;
  line-height: 1.75;
}
.docs-content li { margin-bottom: 6px; }
.docs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin: 20px 0 24px;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.docs-table th,
.docs-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.docs-table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: .8125rem;
  color: var(--text-muted);
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table code { font-size: .8125rem; }
.docs-callout {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--accent-bg);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: var(--r-lg);
  margin: 20px 0;
  font-size: .875rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.docs-callout svg { flex-shrink: 0; color: var(--accent); margin-top: 2px; }
.docs-content pre { margin: 16px 0 24px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .screenshots { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .quickstart { grid-template-columns: 1fr; padding: 32px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .monitor-types { grid-template-columns: repeat(3, 1fr); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 8px; }
  .docs-sidebar h3 { width: 100%; }
  .docs-sidebar ul { display: contents; margin: 0; }
  .docs-sidebar a { border-left: none; border: 1px solid var(--border); }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--shadow-lg);
  }
  .nav-toggle { display: block; }
  .features-grid { grid-template-columns: 1fr; }
  .monitor-types { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  section { padding: 56px 0; }
  .cta-box { padding: 40px 24px; }
}
