/* League of Agents — design tokens + stylesheet. See league_site/web/theme.py
   for the palette rationale and the WCAG contrast ratios these tokens hold. */

:root {
  color-scheme: light dark;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #14171c;
  --text-muted: #475569;
  --border: #d8dce3;
  --border-strong: #828a9a;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --link: var(--accent);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;
  --text-2xl: 2.75rem;

  --radius: 0.375rem;
  --max-width: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151a;
    --surface: #1b1f27;
    --surface-2: #232833;
    --text: #e6e9ef;
    --text-muted: #a3adc2;
    --border: #2b313d;
    --border-strong: #5b6478;
    --accent: #ff8a3d;
    --accent-ink: #14171c;
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--space-2) var(--space-4);
  z-index: 10;
}
.skip-link:focus {
  left: var(--space-4);
  top: var(--space-4);
}

a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 0.15em; }
a:hover, a:focus-visible { text-decoration-thickness: 0.16em; }
:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 2px; }

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

.site-header {
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
}
.site-header .wrap {
  max-width: 64rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  font-size: var(--text-md);
}
.wordmark:hover, .wordmark:focus-visible { color: var(--accent); }
.wordmark-glyph { color: var(--accent); font-size: 1.2em; }
.wordmark-accent { color: var(--accent); margin-left: 0.35em; }

nav[aria-label="Primary"] {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
nav[aria-label="Primary"] a { color: var(--text-muted); text-decoration: none; }
nav[aria-label="Primary"] a:hover,
nav[aria-label="Primary"] a:focus-visible { color: var(--accent); }

main {
  max-width: 64rem;
  padding-top: var(--space-7);
  padding-bottom: var(--space-8);
}
main > .wrap { padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.25;
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
}
h1 {
  font-size: var(--text-2xl);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 0;
}
h2 {
  font-size: var(--text-xl);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
}
h3 { font-size: var(--text-lg); }
h4, h5, h6 { font-size: var(--text-md); }

p, ul, ol, table, blockquote, pre { margin: 0 0 var(--space-4) 0; }

ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-2); }
li > ul, li > ol { margin-top: var(--space-2); }

blockquote {
  border-left: 3px solid var(--accent);
  margin-left: 0;
  padding: var(--space-1) var(--space-4);
  color: var(--text-muted);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 0.1em 0.35em;
}
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

.table-wrap { overflow-x: auto; margin: 0 0 var(--space-4) 0; }
table { border-collapse: collapse; width: 100%; margin: 0; font-size: var(--text-sm); }
th, td {
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}
th { font-family: var(--font-mono); background: var(--surface-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-5);
}
.button:hover, .button:focus-visible { text-decoration: none; filter: brightness(1.08); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-5) 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.site-footer:empty, .site-footer .wrap:empty { display: none; }

@media (max-width: 40rem) {
  main { padding-top: var(--space-5); }
  h1 { font-size: var(--text-xl); }
}
