/* Site-wide tokens and chrome (header, sport switcher, section nav, theme toggle).
   Every page loads this first; page-specific CSS comes after it and may override. */

/* ── TOKENS: dark (default) ── */
:root {
  color-scheme: dark;
  --bg:        #0a0b0f;
  --bg2:       #111319;
  --bg3:       #171a22;
  --bg4:       #1f232d;
  --border:    #222631;
  --border2:   #2d3240;
  --accent:    #8b87ff;
  --accent2:   #aaa7ff;
  --accentdim: #23214a;
  --blue:      #60a5fa;
  --green:     #34d399;
  --red:       #f87171;
  --orange:    #fb923c;
  --text:      #eceef3;
  --text2:     #a8aebb;
  --text3:     #6f7584;
  --mono:      'Geist Mono', 'SF Mono', ui-monospace, monospace;
  --sans:      'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --head:      'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:    14px;
  --radius-sm: 8px;
  --header-h:  52px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 8px 24px -8px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --ease:      cubic-bezier(.2, .8, .2, 1);
}

/* ── TOKENS: light ── */
:root.light {
  color-scheme: light;
  --bg:        #f6f7f9;
  --bg2:       #ffffff;
  --bg3:       #f0f1f4;
  --bg4:       #e6e8ed;
  --border:    #e4e6eb;
  --border2:   #d2d6de;
  --accent:    #5b55e6;
  --accent2:   #7570f0;
  --accentdim: #ecebff;
  --blue:      #2563eb;
  --green:     #059669;
  --red:       #dc2626;
  --orange:    #ea580c;
  --text:      #0e1015;
  --text2:     #3d4350;
  --text3:     #6b7180;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow:    0 8px 24px -10px rgba(16, 24, 40, .14), 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px -16px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .06);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; }
::selection { background: var(--accentdim); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

/* ── HEADER ── */
header {
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--head);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent2), var(--accent) 55%, color-mix(in srgb, var(--accent) 60%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  flex-shrink: 0;
}
.logo em { font-style: normal; font-weight: 500; color: var(--text3); margin-right: -4px; }

/* Sport switcher: MLB · NFL · NBA */
.sport-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}
.sport-link {
  font-family: var(--head);
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  text-decoration: none;
  padding: 3px 11px;
  border-radius: 999px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
a.sport-link:hover { color: var(--text); }
.sport-link.active { color: var(--text); background: var(--bg2); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border2); }
.sport-link.soon { opacity: .5; cursor: default; }

/* Section nav: the current sport's pages */
.site-nav { display: flex; gap: 2px; }
.nav-link {
  font-family: var(--head);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text3);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  transition: color .2s var(--ease), background .2s var(--ease);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--text); background: var(--bg3); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.theme-toggle {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--head);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--border2); color: var(--text); }

/* Narrow screens: the section nav scrolls sideways instead of pushing the header wider. */
@media (max-width: 900px) {
  header { padding: 0 12px; gap: 10px; }
  .site-nav { flex-shrink: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 6px 8px; }
}
/* Phones: the section tabs get their own scrollable row under the logo and sport switcher. */
@media (max-width: 760px) {
  :root, :root.light { --header-h: 94px; }
  header { flex-wrap: wrap; align-content: stretch; row-gap: 0; }
  header .site-nav {
    order: 10; flex: 1 0 100%; align-self: stretch; align-items: center; margin: 0 -12px; padding: 0 8px;
    border-top: 1px solid var(--border);
  }
}
@media (max-width: 560px) {
  header { gap: 8px; }
  .header-right { gap: 6px; }
  .theme-toggle { padding: 0 10px; }
  .logo { font-size: 16px; }
  .logo em { display: none; }
  .sport-link.soon { display: none; }
  #theme-label { display: none; }
}
