/* EzRouter shared design system
   Derived from Vercel / Geist. Light theme only. */

:root {
  /* Surfaces & hierarchy */
  --bg: #fafafa;
  --surface: #ffffff;
  --accents-1: #fafafa;
  --accents-2: #eaeaea;
  --accents-3: #999999;
  --accents-4: #888888;
  --accents-5: #666666;
  --accents-6: #444444;
  --accents-7: #111111;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* Text */
  --text: #000000;
  --text-muted: #666666;
  --text-faint: #999999;

  /* Brand & semantic */
  --brand: #0070f3;
  --brand-hover: #3291ff;
  --brand-soft: rgba(0, 112, 243, 0.08);
  --success: #0070f3;
  --warn: #f5a623;
  --danger: #ff1a1a;

  /* Typography */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  /* Space (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radii */
  --radius-sm: 2px;
  --radius: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 24px rgba(0, 0, 0, 0.08);

  /* Layout */
  --container: 1200px;
  --container-wide: 1400px;
  --gap: 24px;
  --nav-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: 56px; line-height: 1.05; letter-spacing: -0.035em; }
h2 { font-size: 40px; line-height: 1.15; letter-spacing: -0.03em; }
h3 { font-size: 28px; line-height: 1.2; }
h4 { font-size: 20px; line-height: 1.3; }

p { margin: 0; }
code, pre { font-family: var(--font-mono); font-size: 14px; }

/* ==== Container ==== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* ==== Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-5);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: #000;
  color: #fff;
  border-color: #000;
}
.btn-primary:hover { background: #222; color: #fff; }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--accents-1); }
.btn-ghost:hover { background: var(--accents-1); }
.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand); }

/* ==== Site navigation (shared) ==== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-nav__inner {
  max-width: var(--container-wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.site-nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.site-nav__logo-mark {
  width: 29px;
  height: auto;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-left: var(--space-4);
  font-size: 14px;
  color: var(--text-muted);
}
.site-nav__links a { transition: color 0.15s ease; }
.site-nav__links a:hover { color: var(--text); }
.site-nav__links a.is-active { color: var(--text); font-weight: 500; }
.site-nav__spacer { flex: 1; }
.site-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.site-nav__action-link {
  padding: 0 var(--space-2);
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.site-nav__action-link:hover { color: var(--text); }
.site-nav__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accents-2);
  display: inline-block;
}

/* ==== Footer ==== */
.site-footer {
  margin-top: var(--space-20);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.site-footer__inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer__links { display: flex; gap: var(--space-6); }
.site-footer__links a:hover { color: var(--text); }

/* ==== Scaffold note (Phase 0 placeholder) ==== */
.scaffold {
  max-width: var(--container);
  margin: var(--space-10) auto;
  padding: var(--space-6);
  background: var(--accents-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.scaffold strong { color: var(--text); font-weight: 600; }
.scaffold code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
}

@media (max-width: 720px) {
  .site-nav__links { display: none; }
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
}
