/* ============================================================
   Relay — marketing site styles
   Dark-friendly SaaS landing. Indigo accent. System fonts only.
   ============================================================ */
:root {
  --bg:        #0a0d16;
  --bg-2:      #0d1120;
  --panel:     #121829;
  --panel-2:   #172035;
  --text:      #e8ebf3;
  --muted:     #9aa6bf;
  --faint:     #6b7794;
  --accent:    #3b5bdb;   /* indigo */
  --accent-hi: #5b78f0;
  --accent-2:  #2ec4a6;   /* teal — "it works" */
  --warn:      #f0a83b;
  --danger:    #ef5a6b;
  --border:    #212a41;
  --border-hi: #2c3854;
  --radius:    14px;
  --shadow:    0 12px 40px -12px rgba(0,0,0,.6);
  --maxw:      1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  background:
    radial-gradient(1100px 620px at 78% -8%, #182a5c 0%, rgba(24,42,92,0) 58%),
    radial-gradient(900px 520px at 8% 4%, #123047 0%, rgba(18,48,71,0) 52%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img, svg { max-width: 100%; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Accessible focus ring across all interactive elements */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent-hi);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Skip link for keyboard/screen-reader users */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 8px 0; z-index: 100; font-weight: 600;
}
.skip:focus { left: 0; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,13,22,.72);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 18px; letter-spacing: -.01em;
  margin-right: auto; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 24px; height: 24px; display: block; }
.brand .tld { color: var(--faint); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  padding: 8px 12px; border-radius: 9px;
}
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-cta { margin-left: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; border: 1px solid transparent; font: inherit; font-weight: 600;
  padding: 12px 20px; border-radius: 11px; font-size: 15px;
  transition: transform .08s ease, filter .15s ease, background .15s ease, border-color .15s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: #fff; box-shadow: 0 8px 22px -8px rgba(59,91,219,.75);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost {
  background: var(--panel-2); color: var(--text); border-color: var(--border-hi);
}
.btn.ghost:hover { background: var(--panel); border-color: var(--accent); }
.btn.small { padding: 9px 15px; font-size: 14px; }
.btn.sm-nav { padding: 8px 15px; font-size: 14px; }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--accent-2);
  background: rgba(46,196,166,.1); border: 1px solid rgba(46,196,166,.32);
  padding: 5px 13px; border-radius: 999px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(46,196,166,.22); }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-hi); margin: 0 0 14px;
}

/* ---------- Hero ---------- */
.hero { padding: 80px 0 40px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 52px); margin: 16px 0 18px; letter-spacing: -.03em;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #7d93ff, #56d6bd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: 19px; color: var(--muted); max-width: 560px; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.hero-actions .btn { margin: 0; }
.hero-sub { font-size: 13.5px; color: var(--faint); }
.hero-sub a { color: var(--muted); }

/* Trace-waterfall illustration card */
.trace-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border-hi); border-radius: 18px; padding: 20px;
  box-shadow: var(--shadow);
}
.trace-card .tc-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--muted); margin-bottom: 4px;
}
.trace-card .verdict {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-2); font-weight: 600;
}

/* ---------- Section scaffolding ---------- */
.section { padding: 66px 0; }
.section-head { max-width: 680px; margin: 0 0 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 36px); margin: 0 0 12px; }
.section-head p { font-size: 17px; color: var(--muted); margin: 0; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ---------- Pillars (4 big feature blocks) ---------- */
.pillars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.pillar {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: border-color .15s ease, transform .15s ease;
}
.pillar:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.pillar .ico {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(59,91,219,.14); border: 1px solid rgba(59,91,219,.3); margin-bottom: 16px;
}
.pillar .ico svg { width: 22px; height: 22px; color: var(--accent-hi); }
.pillar h3 { font-size: 19px; margin: 0 0 8px; }
.pillar > p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.pillar ul { list-style: none; padding: 0; margin: 0; }
.pillar li {
  position: relative; padding: 4px 0 4px 22px; font-size: 13.5px; color: var(--muted);
}
.pillar li::before {
  content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent-2);
}

/* ---------- Generic card grid ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin: 0 0 8px; font-size: 16.5px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent-hi); margin-bottom: 10px;
}

/* ---------- Wedge: why not GA4/GTM (compare table) ---------- */
.wedge { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.compare {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; font-size: 14.5px;
}
.compare th, .compare td { padding: 15px 18px; text-align: left; vertical-align: top; }
.compare thead th {
  font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--border); font-weight: 700;
}
.compare thead th.col-relay { color: var(--accent-hi); }
.compare tbody td { border-top: 1px solid var(--border); color: var(--muted); }
.compare tbody th {
  border-top: 1px solid var(--border); color: var(--text); font-weight: 600; width: 32%;
}
.compare .col-relay { background: rgba(59,91,219,.06); color: var(--text); }
.compare .yes { color: var(--accent-2); font-weight: 600; }
.compare .no  { color: var(--danger); }
.compare tr:first-child th, .compare tr:first-child td { border-top: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  text-align: center;
  background:
    radial-gradient(700px 300px at 50% -40%, rgba(59,91,219,.28), transparent 70%),
    var(--panel);
  border: 1px solid var(--border-hi); border-radius: 20px; padding: 52px 28px;
}
.cta-band h2 { font-size: clamp(26px, 3.6vw, 34px); margin: 0 0 12px; }
.cta-band p { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto 24px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- Pricing ---------- */
.price { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 760px; margin: 0 auto; }
.tier {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 30px;
  display: flex; flex-direction: column;
}
.tier.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.tier .tier-name { font-size: 18px; font-weight: 700; margin: 0; }
.tier .tier-badge {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent-2); background: rgba(46,196,166,.12);
  border: 1px solid rgba(46,196,166,.3); padding: 3px 9px; border-radius: 999px; margin-left: 8px;
}
.tier .amt { font-size: 40px; font-weight: 800; margin: 14px 0 4px; letter-spacing: -.02em; }
.tier .amt small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tier .tier-desc { color: var(--muted); font-size: 14px; margin: 0 0 18px; min-height: 40px; }
.tier ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.tier li {
  position: relative; padding: 8px 0 8px 26px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 14px;
}
.tier li::before {
  content: "✓"; position: absolute; left: 2px; top: 8px; color: var(--accent-2); font-weight: 700;
}
.tier li.muted::before { content: "•"; color: var(--faint); }
.tier .btn { width: 100%; }

/* ---------- FAQ / prose ---------- */
.prose { max-width: 720px; }
.prose p { color: var(--muted); font-size: 16px; }
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 20px; margin-bottom: 12px;
}
.faq details[open] { border-color: var(--border-hi); }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 15.5px; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-hi); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }

/* ---------- Notes / callouts ---------- */
.note {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; font-size: 14px; color: var(--muted); margin: 24px 0;
}
code {
  background: #0b1120; border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; font-size: 13px; color: #cdd6e6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---------- Contact ---------- */
.contact-card {
  max-width: 620px; margin: 0 auto; text-align: center;
  background: var(--panel); border: 1px solid var(--border-hi); border-radius: 18px;
  padding: 44px 32px; box-shadow: var(--shadow);
}
.contact-card h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 12px; }
.contact-card p { color: var(--muted); font-size: 17px; margin: 0 0 26px; }
.contact-meta { margin-top: 22px; font-size: 13.5px; color: var(--faint); }
.contact-meta a { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 30px; padding: 40px 0 48px;
  color: var(--muted); font-size: 13.5px;
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { color: var(--faint); font-size: 13px; margin: 0; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--muted); padding: 4px 0; font-size: 13.5px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--faint); }

/* ---------- Toast (dogfood feedback) ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent-2); color: #04231d; font-weight: 600;
  padding: 10px 18px; border-radius: 11px; opacity: 0;
  transition: opacity .22s ease, transform .22s ease; pointer-events: none;
  font-size: 14px; z-index: 80; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Docs hub (left-nav + prose) ---------- */
.docs-wrap {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 44px;
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px 0;
}
.docs-nav { position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; }
.docs-nav h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint);
  margin: 0 0 8px; padding-left: 12px;
}
.docs-nav h4 + .docs-nav-group { margin-bottom: 22px; }
.docs-nav a {
  display: block; color: var(--muted); font-size: 13.5px; padding: 5px 12px;
  border-radius: 8px; border-left: 2px solid transparent;
}
.docs-nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.docs-body { min-width: 0; padding-bottom: 40px; }
.docs-body .docs-intro { color: var(--muted); font-size: 17px; max-width: 62ch; margin: 0 0 8px; }
.doc-section { scroll-margin-top: 84px; padding: 30px 0; border-top: 1px solid var(--border); }
.doc-section:first-of-type { border-top: 0; padding-top: 8px; }
.doc-section > h2 {
  font-size: clamp(23px, 3vw, 30px); margin: 0 0 6px;
}
.doc-section .doc-eyebrow {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-hi); margin: 0 0 10px;
}
.doc-section h3 { font-size: 18px; margin: 26px 0 8px; }
.doc-section h4 { font-size: 15px; margin: 18px 0 6px; color: var(--text); }
.docs-body p { color: var(--muted); font-size: 15px; max-width: 68ch; }
.docs-body ul, .docs-body ol { color: var(--muted); font-size: 14.5px; padding-left: 22px; margin: 10px 0; }
.docs-body li { margin: 5px 0; }
.docs-body strong { color: var(--text); font-weight: 600; }
.docs-body a { color: var(--accent-hi); }

/* Code blocks */
.docs-body pre {
  background: #0b1120; border: 1px solid var(--border-hi); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 16px 0; font-size: 13px; line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}
.docs-body pre code {
  background: none; border: 0; padding: 0; color: #cdd6e6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
}
.code-label {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--faint); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 0 0 8px 8px; border-top: 0; padding: 3px 10px; margin: -16px 0 0 4px;
}

/* Doc tables */
.doc-table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 16px 0; font-size: 13.5px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.doc-table th, .doc-table td { padding: 11px 14px; text-align: left; vertical-align: top; }
.doc-table thead th {
  font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--faint);
  border-bottom: 1px solid var(--border); font-weight: 700;
}
.doc-table tbody td { border-top: 1px solid var(--border); color: var(--muted); }
.doc-table tbody td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.doc-table tbody tr:first-child td { border-top: 0; }

/* Callout inside docs */
.doc-note {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; font-size: 14px; color: var(--muted); margin: 18px 0;
}
.doc-note p { margin: 0; max-width: none; color: var(--muted); font-size: 14px; }
.doc-note strong { color: var(--text); }
.tok { color: var(--accent-2); }

/* ---------- What's new ---------- */
.wn-head { max-width: 640px; margin: 0 0 8px; }
.wn-list { max-width: 760px; margin: 0 auto; padding: 8px 0 0; }
.wn-entry {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 26px; margin-bottom: 18px;
  transition: border-color .15s ease, transform .15s ease;
}
.wn-entry:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.wn-entry .wn-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wn-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent-hi); background: rgba(59,91,219,.14); border: 1px solid rgba(59,91,219,.3);
  padding: 3px 10px; border-radius: 999px;
}
.wn-badge.ship {
  color: var(--warn); background: rgba(240,168,59,.12); border-color: rgba(240,168,59,.32);
}
.wn-entry h3 { font-size: 19px; margin: 0 0 8px; }
.wn-entry p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; max-width: 62ch; }
.wn-see {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
}
.wn-see svg { width: 14px; height: 14px; color: var(--accent-2); flex: none; }
.wn-see code { background: none; border: 0; padding: 0; color: var(--accent-hi); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 56px 0 32px; }
  .pillars, .grid-2, .price { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; gap: 28px; }
  .docs-wrap { grid-template-columns: 1fr; gap: 8px; }
  .docs-nav {
    position: static; max-height: none; overflow: visible;
    border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 16px;
    background: var(--panel);
  }
  .docs-nav-group { display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-nav h4 { padding-left: 4px; }
}
@media (max-width: 620px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px 8px; font-size: 13.5px; }
  .nav-links a.hide-sm { display: none; }
  .section { padding: 48px 0; }
  .cta-band { padding: 40px 20px; }
  /* Make the compare table scannable on narrow screens */
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare tbody th { border-top: 1px solid var(--border-hi); padding-bottom: 4px; }
  .compare tbody td { border-top: 0; padding-top: 4px; padding-bottom: 12px; }
  .compare tbody td::before { content: attr(data-label) ": "; color: var(--faint); font-weight: 600; }
  .compare .col-relay { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
