/* SlackBus — shared design tokens */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #2a2a2a;
  --muted: #6b6b6b;
  --faint: #a0a0a0;
  --line: rgba(10, 10, 10, 0.10);
  --line-soft: rgba(10, 10, 10, 0.06);
  --accent: #E8782B;
  --accent-ink: #ffffff;
  --accent-soft: rgba(232, 120, 43, 0.12);
  --flow: #2EB67D;
  --flow-soft: rgba(46, 182, 125, 0.18);
  --warn: #E04E2C;
  --good: #1F8A5B;

  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 6px;
  --radius-lg: 10px;

  --maxw: 1240px;
  --pad-x: clamp(20px, 4vw, 56px);

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #111111;
  --ink: #fafafa;
  --ink-2: #e8e8e8;
  --muted: #8a8a8a;
  --faint: #5a5a5a;
  --line: rgba(250, 250, 250, 0.12);
  --line-soft: rgba(250, 250, 250, 0.07);
  --accent: #FF9447;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(255, 148, 71, 0.16);
  --flow: #3ECF8E;
  --flow-soft: rgba(62, 207, 142, 0.20);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
  /* faint schematic grid */
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad-x);
}

/* ─── Type ─── */
.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(44px, 7vw, 92px); line-height: 0.98; letter-spacing: -0.035em; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -0.025em; }
h3 { font-size: 19px; line-height: 1.3; }

.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--muted); max-width: 60ch; }

/* ─── Top nav ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 17px;
}
.brand-mark {
  width: 22px; height: 22px;
  display: inline-block;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  transition: color .15s;
}
.nav-links a:hover { color: var(--ink); }

.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform .08s ease, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--ink); }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ─── Schematic helpers ─── */
.bus {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: square;
}
.line-el { stroke: var(--ink); stroke-width: 1.5; fill: none; }
.line-dim { stroke: var(--muted); stroke-width: 1; fill: none; }
.dot { fill: var(--ink); }
.accent-stroke { stroke: var(--accent); }
.accent-fill { fill: var(--accent); }
.flow-stroke { stroke: var(--flow); }
.flow-fill { fill: var(--flow); }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 56px 0 40px;
  margin-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--ink-2); font-size: 14px; transition: color .15s; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .nav-links a:not(.theme-toggle) { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}
