/* SidelineAssistant — design tokens
   Athletic-institutional: Tapd's forest deepened + DealDiligence's brass + layered shadows.
   Light surfaces by default; dark mode overrides at the bottom (data-theme="dark"). */

@import url('https://api.fontshare.com/v2/css?f[]=switzer@400,500,600,700&f[]=satoshi@700&display=swap');

:root {
  /* Brand */
  --color-primary: #0d4d3a;
  --color-primary-hover: #0a3e2e;
  --color-primary-active: #072e22;
  --color-primary-soft: #e8f4ee;
  --color-primary-mist: #f2f9f5;

  /* Accent (brass) */
  --color-accent: #c7a46c;
  --color-accent-hover: #b08e57;
  --color-accent-deep: #8a6a3c;
  --color-accent-soft: #faf3e4;

  /* Hero canvas */
  --color-canvas-deep: #0d2a22;
  --color-canvas-deep-2: #14332a;

  /* Neutrals */
  --color-ink-900: #0f1f1a;
  --color-ink-800: #1c2a25;
  --color-ink-700: #2f3c37;
  --color-ink-500: #5b6a64;
  --color-ink-400: #8a9690;
  --color-ink-300: #b9c2bd;
  --color-ink-200: #dde3e0;
  --color-ink-100: #ecf0ed;
  --color-ink-50:  #f5f7f5;

  /* Semantic */
  --color-success: #047857;
  --color-success-soft: #e6f5ee;
  --color-warning: #b45309;
  --color-warning-soft: #fcf1e0;
  --color-danger:  #b91c1c;
  --color-danger-soft: #fbe9e9;
  --color-info:    #1e3a5f;

  /* Surfaces */
  --surface-recessed: #eef2ee;
  --surface-base:     #f5f7f5;
  --surface-elevated: #ffffff;
  --surface-floating: #ffffff;
  --surface-sidebar:  #fafbfa;
  --surface-dark:     #0d2a22;

  /* Borders */
  --border-hairline: #e3e8e5;
  --border-default:  #d0d7d3;
  --border-strong:   #a7b2ae;

  /* Spacing */
  --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; --space-24: 96px; --space-32: 128px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Layered shadows (color-tinted, never flat) */
  --shadow-sm:
    0 1px 0 0 rgb(13 77 58 / 0.03),
    0 1px 2px 0 rgb(13 31 26 / 0.06);

  --shadow-md:
    inset 0 1px 0 0 rgb(255 255 255 / 0.85),
    0 1px 2px 0 rgb(13 31 26 / 0.06),
    0 4px 12px -2px rgb(13 77 58 / 0.10);

  --shadow-lg:
    inset 0 1px 0 0 rgb(255 255 255 / 0.9),
    0 2px 4px -1px rgb(13 31 26 / 0.06),
    0 10px 24px -6px rgb(13 77 58 / 0.14);

  --shadow-floating:
    inset 0 1px 0 0 rgb(255 255 255 / 0.9),
    0 6px 16px -4px rgb(13 31 26 / 0.10),
    0 22px 48px -12px rgb(13 77 58 / 0.22);

  --shadow-header:
    0 1px 2px 0 rgb(13 31 26 / 0.04),
    0 4px 14px -6px rgb(13 77 58 / 0.12);

  --shadow-focus: 0 0 0 3px rgb(199 164 108 / 0.35);

  /* Z-index */
  --z-base: 0;  --z-elevated: 10; --z-sidebar: 20;  --z-appbar: 30;
  --z-dropdown: 40; --z-slideover: 50; --z-modal: 60; --z-toast: 70;

  /* Motion */
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-micro: 120ms;
  --duration-base: 220ms;
  --duration-slow: 320ms;

  /* Type */
  --font-display: "Fraunces", Georgia, "Source Serif Pro", serif;
  --font-body:    "Switzer", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-stat:    "Satoshi", "Fraunces", Georgia, serif;
}

/* Dark theme overrides — applied to the logged-in app shell */
[data-theme="dark"] {
  --surface-recessed: #0a2018;
  --surface-base:     #0d2a22;
  --surface-elevated: #14332a;
  --surface-floating: #1a3d33;
  --surface-sidebar:  #0a2018;

  --color-ink-900: #f5f7f5;
  --color-ink-800: #ecf0ed;
  --color-ink-700: #dde3e0;
  --color-ink-500: #a7b2ae;
  --color-ink-400: #8a9690;
  --color-ink-300: #5b6a64;
  --color-ink-200: #2f3c37;
  --color-ink-100: #1c2a25;
  --color-ink-50:  #14332a;

  --border-hairline: #1c3a30;
  --border-default:  #2a4a3e;
  --border-strong:   #3d5d51;

  --color-primary-soft: #14332a;
  --color-primary-mist: #0d2a22;

  --shadow-md:
    inset 0 1px 0 0 rgb(255 255 255 / 0.04),
    0 1px 2px 0 rgb(0 0 0 / 0.4),
    0 4px 12px -2px rgb(0 0 0 / 0.3);

  --shadow-lg:
    inset 0 1px 0 0 rgb(255 255 255 / 0.05),
    0 2px 4px -1px rgb(0 0 0 / 0.4),
    0 10px 24px -6px rgb(0 0 0 / 0.4);

  --shadow-floating:
    inset 0 1px 0 0 rgb(255 255 255 / 0.06),
    0 6px 16px -4px rgb(0 0 0 / 0.5),
    0 22px 48px -12px rgb(0 0 0 / 0.6);
}

/* ----- Reset + base ----- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-base);
  color: var(--color-ink-900);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}

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

/* Skip-to-content for a11y */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  z-index: 100;
}
.skip-link:focus { left: var(--space-3); top: var(--space-3); }

/* ----- Typography utilities ----- */

.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

.heading-hero {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.heading-1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.heading-2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.heading-3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.stat-number {
  font-family: var(--font-display);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-stretch: 90%;
}

/* ----- Components ----- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 22px;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-spring),
              background-color var(--duration-base) var(--ease-spring);
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-ink-900);
  box-shadow: var(--shadow-md);
}
.btn-accent:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink-800);
  border: 1px solid var(--border-default);
}
.btn-ghost:hover {
  background: var(--color-ink-50);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-ghost-on-dark {
  background: transparent;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 0.25);
}
.btn-ghost-on-dark:hover {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.5);
}

.btn-sm { padding: 8px 14px; font-size: 0.8125rem; }

.card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card--interactive {
  transition: transform var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-spring),
              border-color var(--duration-base) var(--ease-spring);
}
.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-default);
}

.card--feature {
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.card--feature::before {
  /* varsity stripes */
  content: "";
  position: absolute;
  inset: 2px 24px auto 24px;
  height: 4px;
  pointer-events: none;
  background:
    linear-gradient(to bottom, var(--color-accent) 0 1px, transparent 1px 3px, var(--color-primary) 3px 4px);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-spring);
}
.card--feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-floating); }
.card--feature:hover::before { opacity: 1; }

.kpi-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-hairline);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-5);
  box-shadow: var(--shadow-sm);
}
.kpi-card .eyebrow { margin-bottom: var(--space-2); }
.kpi-card .stat-number { font-size: 2rem; line-height: 1; color: var(--color-ink-900); }
.kpi-card .stat-context { color: var(--color-ink-500); font-size: 0.8125rem; margin-top: var(--space-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-conference { background: var(--color-accent-soft); color: var(--color-accent-deep); }
.pill-sport      { background: var(--color-primary-soft); color: var(--color-primary); }
.pill-status-open{ background: var(--color-success-soft); color: var(--color-success); }
.pill-status-past{ background: var(--color-ink-100); color: var(--color-ink-500); }
.pill-camp       { background: var(--color-primary); color: #fff; }
.pill-showcase   { background: var(--color-accent); color: var(--color-ink-900); }
.pill-tournament { background: var(--color-info); color: #fff; }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-ink-900);
  transition: border-color var(--duration-base) var(--ease-spring),
              box-shadow var(--duration-base) var(--ease-spring);
}
.input:focus { outline: none; border-color: var(--color-accent); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--color-ink-400); }

/* Hero dark canvas with layered radials + noise */
.hero-dark {
  position: relative;
  background: var(--surface-dark);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% -10%, rgb(199 164 108 / 0.18), transparent 45%),
    radial-gradient(circle at 10% 110%, rgb(13 77 58 / 0.55), transparent 50%),
    radial-gradient(circle at 50% 60%, rgb(94 207 184 / 0.05), transparent 60%);
  z-index: -2;
}
.hero-dark::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.45 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.06;
  pointer-events: none;
  z-index: -1;
  mix-blend-mode: overlay;
}

/* Layout helpers */
.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--space-6); }
@media (min-width: 1024px) { .container { padding: 0 var(--space-8); } }

.section { padding: var(--space-24) 0; }
.section--tight { padding: var(--space-16) 0; }
@media (max-width: 768px) {
  .section { padding: var(--space-16) 0; }
  .section--tight { padding: var(--space-12) 0; }
}

/* Responsive 4-col footer grid — used on index + about */
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
}
@media (max-width: 768px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* Top nav */
.nav-top {
  position: sticky;
  top: 0;
  z-index: var(--z-appbar);
  background: rgb(255 255 255 / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-header);
}
.nav-top--dark {
  background: rgb(7 32 26 / 0.85);
  border-bottom-color: rgb(255 255 255 / 0.08);
  color: #fff;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.nav-links { display: flex; gap: var(--space-6); margin-left: var(--space-6); }
.nav-links a { font-size: 0.9375rem; color: var(--color-ink-700); transition: color var(--duration-base) var(--ease-spring); }
.nav-links a:hover { color: var(--color-primary); }
.nav-top--dark .nav-links a { color: rgb(255 255 255 / 0.85); font-weight: 500; }
.nav-top--dark .nav-links a:hover { color: var(--color-accent); }

/* Sport-filter pill in nav */
.sport-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--surface-elevated);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-ink-700);
  transition: border-color var(--duration-base) var(--ease-spring), background-color var(--duration-base) var(--ease-spring);
}
.sport-pill:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.sport-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
}
.nav-top--dark .sport-pill {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.15);
  color: #fff;
}

/* Live activity ticker */
.ticker {
  position: relative;
  height: 32px;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-hairline);
  overflow: hidden;
}
.ticker__track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: var(--space-8);
  align-items: center;
  height: 100%;
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker-scroll 60s linear infinite;
  font-size: 0.75rem;
  color: var(--color-ink-700);
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: var(--space-2); }
.ticker__time { color: var(--color-accent-deep); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.04em; }
.ticker__bullet { color: var(--color-ink-300); }

@keyframes ticker-scroll {
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}

/* Crest mark */
.crest-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  color: var(--color-primary);
}
.nav-top--dark .crest-mark { color: #fff; }
.crest-mark svg { width: 28px; height: 32px; }

/* Footer */
.footer {
  background: var(--color-canvas-deep);
  color: rgb(255 255 255 / 0.75);
  padding: var(--space-20) 0 var(--space-10);
}
.footer a { color: rgb(255 255 255 / 0.7); transition: color var(--duration-base) var(--ease-spring); }
.footer a:hover { color: #fff; }
.footer h4 {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-4);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 60ms !important;
    animation-duration: 60ms !important;
  }
}

/* Required-field marker — sitewide. Matches the standard `.field { label; input/select/textarea }`
   markup used across every form. `:has()` means new forms get the marker automatically. */
label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after {
  content: " *";
  color: var(--color-danger);
}

/* Danger confirmation modal — shared sitewide (delete account, sign-out, cancel registration, etc.) */
.confirm-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgb(15 31 26 / 0.45);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.confirm-modal.open { opacity: 1; pointer-events: all; }
.confirm-modal-box {
  background: var(--surface-elevated);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-floating);
  padding: var(--space-8);
  width: 100%; max-width: 420px;
  margin: var(--space-5);
  transform: translateY(8px);
  transition: transform 0.2s var(--ease-spring);
}
.confirm-modal.open .confirm-modal-box { transform: translateY(0); }
.confirm-modal-icon {
  width: 44px; height: 44px;
  background: var(--color-danger-soft);
  border-radius: var(--radius-full);
  display: grid; place-items: center;
  color: var(--color-danger);
  margin-bottom: var(--space-4);
}
.confirm-modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 500;
  color: var(--color-ink-900); margin: 0 0 var(--space-2);
}
.confirm-modal-body {
  font-size: 0.9375rem; color: var(--color-ink-500);
  line-height: 1.6; margin: 0 0 var(--space-6);
}
.confirm-modal-actions { display: flex; gap: var(--space-3); justify-content: flex-end; }
.btn-danger-solid {
  padding: 9px 20px; border-radius: var(--radius-lg);
  border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 600;
  background: var(--color-danger); color: #fff;
  transition: opacity 0.15s;
}
.btn-danger-solid:hover { opacity: 0.88; }
.btn-danger-solid:disabled { opacity: 0.5; cursor: default; }
