/* shared.css — Design tokens and shared styles for readme.speedrun.com */

:root {
  /* Colors */
  --bg: #0a0a0a;
  --surface: #111;
  --surface-2: #1a1a1a;
  --border: #1e1e1e;
  --text: #d4d4d4;
  --text-bright: #f0f0f0;
  --text-dim: #888;
  --accent: #22c55e;
  --accent-dim: #166534;
  --error: #e85454;

  /* Fonts */
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --nav-height: 48px;
  --nav-height-minimal: 32px;
  --container-terminal: 680px;
  --container-wide: 960px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f5f5f5;
  --border: #e5e5e5;
  --text: #333;
  --text-bright: #111;
  --text-dim: #666; /* was #999, failed WCAG AA contrast on white */
  --accent: #16a34a;
  --accent-dim: #dcfce7;
  --error: #dc2626;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff;
    --surface: #fafafa;
    --surface-2: #f5f5f5;
    --border: #e5e5e5;
    --text: #333;
    --text-bright: #111;
    --text-dim: #666; /* was #999, failed WCAG AA contrast on white */
    --accent: #16a34a;
    --accent-dim: #dcfce7;
    --error: #dc2626;
  }
}

/* Nav bar styles */
.sr-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 13px;
}

[data-theme="light"] .sr-nav {
  background: rgba(255, 255, 255, 0.9);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .sr-nav {
    background: rgba(255, 255, 255, 0.9);
  }
}

.sr-nav-minimal {
  height: var(--nav-height-minimal);
}

.sr-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-wide);
  margin: 0 auto;
}

.sr-nav-logo {
  color: var(--text-bright);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.sr-nav-logo:hover {
  color: var(--accent);
}

.sr-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.sr-nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.sr-nav-links a:hover {
  color: var(--text-bright);
}

.sr-nav-links a[aria-current="page"] {
  color: var(--accent);
}

.sr-nav-cta {
  color: var(--accent) !important;
  font-weight: 500;
}

.sr-nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.sr-nav-badge {
  color: var(--accent);
  font-size: 11px;
}

/* Hamburger menu (mobile) */
.sr-nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  line-height: 1;
}

.sr-nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px;
  z-index: 99;
  flex-direction: column;
  gap: 16px;
}

.sr-nav-mobile-menu.open {
  display: flex;
}

.sr-nav-mobile-menu a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 0;
}

.sr-nav-mobile-menu a:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  .sr-nav-links {
    display: none;
  }
  .sr-nav-hamburger {
    display: block;
  }
  /* Keep Join CTA visible on mobile next to hamburger */
  .sr-nav-mobile-join {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    margin-right: 8px;
  }
}

@media (min-width: 769px) {
  .sr-nav-mobile-join {
    display: none;
  }
}

/* Skip link (accessibility) */
.sr-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  z-index: 200;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
}

.sr-skip-link:focus {
  top: 0;
}

/* Footer styles */
.sr-footer {
  padding: 32px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sr-footer a {
  color: var(--text-bright);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sr-footer a:hover {
  color: var(--accent);
}
