/* ══════════════════════════════════════════════════════════════
   CheddaBoards: shared site chrome
   Tokens, base, header/nav, buttons, footer. Loaded first on every
   page; page stylesheets (home.css, guide.css, inline) come after.
   ══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #101017;
  --bg-card: #14141c;
  --bg-elevated: #1c1c28;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --border-hard: #2a2a38;
  --border-accent: rgba(224, 176, 63, 0.35);
  --text-primary: #f0f0f5;
  --text-secondary: #9a9aaa;
  --text-tertiary: #82828f;     /* passes WCAG AA on every background here */
  --accent: #E0B03F;
  --accent-dim: rgba(224, 176, 63, 0.12);
  --accent-glow: rgba(224, 176, 63, 0.08);
  --neon: #33ff66;
  --neon-dim: rgba(51, 255, 102, 0.10);
  --neon-glow: rgba(51, 255, 102, 0.06);
  --green: #34d399;
  --red: #f87171;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --font-display: 'Space Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --radius: 2px;
  --shadow-hard: 4px 4px 0 var(--border-hard);
  --max: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Noise texture */
body::before {
  content: ""; position: fixed; inset: 0; opacity: 0.025; pointer-events: none; z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Subtle scanlines */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.04) 1px, transparent 1px, transparent 3px);
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; }

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

/* ── HEADER + NAV ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px; height: 56px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.site-header .logo-link { display: flex; align-items: center; text-decoration: none; }
.site-header .logo-img { height: 34px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  color: var(--text-secondary); text-decoration: none;
  font-family: var(--font-display); font-size: 0.78rem;
  transition: color 0.15s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-primary); }
.site-nav a.nav-primary {
  color: var(--neon); font-weight: 700;
  border: 1px solid rgba(51, 255, 102, 0.4); padding: 6px 12px;
}
.site-nav a.nav-primary:hover { background: var(--neon); color: var(--bg-primary); }

/* ── BUTTONS (terminal style) ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  text-decoration: none;
  border: 2px solid; border-radius: 0;
  transition: all 0.12s;
  cursor: pointer; white-space: nowrap;
}
.btn-sm { font-size: 0.8rem; padding: 8px 14px; }
.btn .cursor { display: inline-block; width: 9px; height: 1em; vertical-align: text-bottom; animation: cursorBlink 0.85s steps(1) infinite; }
@keyframes cursorBlink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.btn-primary {
  background: #000; color: var(--neon); border-color: var(--neon);
  text-shadow: 0 0 6px rgba(51, 255, 102, 0.5);
  box-shadow: 4px 4px 0 rgba(51, 255, 102, 0.35);
}
.btn-primary .prompt { color: var(--accent); }
.btn-primary .cursor { background: var(--neon); }
.btn-primary:hover { background: var(--neon); color: var(--bg-primary); text-shadow: none; transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(51, 255, 102, 0.35); }
.btn-primary:hover .prompt { color: var(--bg-primary); }
.btn-primary:hover .cursor { background: var(--bg-primary); }

.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-medium); box-shadow: var(--shadow-hard); }
.btn-secondary .prompt { color: var(--text-secondary); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--border-hard); }
.btn-secondary:hover .prompt { color: var(--accent); }

/* ── FOOTER ── */
.site-footer { padding: 48px 0 32px; text-align: left; }
.footer-top { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 32px; margin-bottom: 36px; }
.footer-brand { font-family: var(--font-pixel); font-size: 0.62rem; color: var(--accent); margin-bottom: 12px; line-height: 1.7; }
.footer-about { font-size: 0.82rem; color: var(--text-tertiary); line-height: 1.7; max-width: 260px; }
.footer-about a { color: var(--text-secondary); text-decoration: none; }
.footer-col h4 { font-family: var(--font-display); font-size: 0.66rem; font-weight: 700; color: var(--text-tertiary); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-secondary); text-decoration: none; font-size: 0.84rem; padding: 3px 0; transition: color 0.15s; }
.footer-col a:hover, .footer-about a:hover, .footer-bottom a:hover { color: var(--accent); }
.inline-logo { height: 14px; width: auto; vertical-align: -2px; margin-right: 5px; }
.footer-bottom { border-top: 1px solid var(--border-subtle); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.74rem; color: var(--text-tertiary); }
.footer-bottom a { color: var(--text-tertiary); text-decoration: none; }

/* ── RESPONSIVE (chrome only) ── */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: repeat(2, 1fr); }
  .footer-top > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .site-header .header-inner { height: 52px; padding: 0 16px; }
  .site-header .logo-img { height: 28px; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 0.74rem; }
  .site-nav a.nav-sec { display: none; }   /* phones keep Docs, Players, Dashboard */
  .wrap { padding-left: 16px; padding-right: 16px; }
  .btn { white-space: normal; }
}
@media (max-width: 420px) {
  .site-header .logo-img { height: 24px; }
  .site-nav { gap: 10px; }
  .site-nav a.nav-primary { padding: 5px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn .cursor { animation: none; }
  .btn:hover { transform: none; }
}
