:root {
  --paper: #f7f8f6;
  --ink: #17202a;
  --muted: #5d6873;
  --line: #d5dad3;
  --panel: #ffffff;
  --pylon: #f2611d;
  --pylon-ink: #b8430c;
  --turf: #2e6b4f;
  --loss: #a33a2b;
  --code-bg: #eceee9;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12191f;
    --ink: #e8ebe6;
    --muted: #9aa5ae;
    --line: #2b3640;
    --panel: #18222a;
    --pylon-ink: #ff8a50;
    --turf: #6fbf95;
    --loss: #ec8a7a;
    --code-bg: #1f2a33;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration-color: var(--pylon); text-underline-offset: 0.18em; }
a:hover { color: var(--pylon-ink); }
:focus-visible { outline: 3px solid var(--pylon); outline-offset: 2px; }

.wrap { max-width: 72rem; margin: 0 auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; padding-block: 0.9rem; }
.wordmark {
  font: 700 1.5rem/1 var(--display);
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.wordmark::before { content: ""; width: 0.5rem; height: 1.35rem; background: var(--pylon); display: inline-block; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-weight: 500; }
.site-nav a { text-decoration: none; padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--pylon); }
.search { margin-left: auto; position: relative; min-width: min(100%, 16rem); flex: 0 1 18rem; }
.search input {
  width: 100%;
  font: inherit;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}
.search ul {
  position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 4px);
  list-style: none; margin: 0; padding: 0.25rem 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.search li a { display: block; padding: 0.4rem 0.7rem; text-decoration: none; }
.search li a:hover, .search li a:focus { background: var(--code-bg); }
.search li small { color: var(--muted); }

main { padding-block: 2.5rem 4rem; }

/* Type */
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0 0 0.6rem; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; letter-spacing: -0.01em; max-width: 18ch; }
h2 { font-size: 1.9rem; font-weight: 600; margin-top: 2.75rem; }
h3 { font-size: 1.35rem; font-weight: 600; margin-top: 1.75rem; }
p, li { max-width: 68ch; }
.lede { font-size: 1.25rem; color: var(--muted); max-width: 52ch; margin-top: 0; }
.muted { color: var(--muted); }
small, .small { font-size: 0.875rem; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }

/* Home: hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem 3.5rem;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem) 0 clamp(1.5rem, 4vw, 3rem);
  border-bottom: 2px solid var(--ink);
}
.hero h1 { max-width: 14ch; font-size: clamp(2.8rem, 7vw, 5.2rem); line-height: 0.95; margin-bottom: 1.1rem; }
.hero .lede { margin-bottom: 1.25rem; }
.eyebrow {
  font: 700 0.9rem/1 var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pylon-ink);
  margin: 0 0 0.9rem;
}
.proof { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.proof li {
  font-size: 0.9rem; font-weight: 500;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.proof li::before { content: "✓"; color: var(--turf); font-weight: 700; margin-right: 0.4rem; }
.cta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--pylon);
  border-radius: 12px;
  padding: 1.5rem 1.6rem 1.25rem;
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.25);
}
.cta h2 { margin-top: 0; font-size: 2.1rem; }
.cta p { margin: 0 0 0.75rem; }
.cta .urlbox { margin-bottom: 1rem; }
.btn.big { font-size: 1.1rem; padding: 0.75rem 1.2rem; }
ol.steps.compact { margin: 0 0 0.75rem; font-size: 0.95rem; }
ol.steps.compact li { margin-bottom: 0.35rem; }
.section-title { margin-top: 3rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.features .panel { border-radius: 10px; }
.features p { margin-bottom: 0; color: var(--muted); }

/* Home: question -> tool call */
.calls { list-style: none; padding: 0; margin: 1rem 0 0; max-width: none; display: grid; gap: 0.75rem; }
.calls li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 1rem;
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.calls li:hover { border-color: color-mix(in srgb, var(--pylon) 55%, var(--line)); box-shadow: 0 6px 20px rgb(0 0 0 / 0.06); }
.calls .q { font: 600 1.45rem/1.2 var(--display); }
.calls .call {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
  padding-left: 1.1rem;
  position: relative;
}
.calls .call::before { content: ""; position: absolute; left: 0; top: 0.2em; bottom: 0.2em; width: 3px; background: var(--pylon); }
.calls .actions { display: flex; gap: 0.75rem; align-items: start; white-space: nowrap; }

.btn {
  font: 600 0.95rem/1 var(--body);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--pylon); border-color: var(--pylon); color: #1b0d05; }
.btn.primary:hover { background: var(--pylon-ink); border-color: var(--pylon-ink); color: #fff; }
.btn.quiet { border-color: var(--line); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 2rem 3rem; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem 1.4rem; }
.panel h2:first-child, .panel h3:first-child { margin-top: 0; }

.urlbox { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.urlbox code { flex: 1 1 16rem; padding: 0.55rem 0.7rem; font-size: 0.95rem; overflow-x: auto; white-space: nowrap; }

ol.steps { padding-left: 1.4rem; }
ol.steps li { margin-bottom: 0.6rem; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 600 0.95rem/1.2 var(--display); letter-spacing: 0.02em; color: var(--muted); background: var(--paper); position: sticky; top: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--pylon) 6%, transparent); }
.rank { font: 700 1.1rem/1 var(--display); width: 3rem; }
tr.top .rank { color: var(--pylon-ink); }
.pos { color: var(--turf); }
.neg { color: var(--loss); }
.win { color: var(--turf); font-weight: 600; }
.loss { color: var(--loss); font-weight: 600; }

/* Stat tiles for player / team headers */
.headline { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 2rem; margin-bottom: 1.5rem; }
.headline img { width: 96px; height: auto; border-radius: 6px; background: var(--code-bg); }
.facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.keystats { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0; border-top: 2px solid var(--ink); margin: 1rem 0 0; }
.keystats div { padding: 0.75rem 0.75rem 0.85rem 0; border-bottom: 1px solid var(--line); }
.keystats dt { font-size: 0.85rem; color: var(--muted); }
.keystats dd { margin: 0; font: 700 1.75rem/1.1 var(--display); }

/* Forms */
form.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: end; margin: 1rem 0; }
form.filters label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
form.filters select, form.filters input {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.55rem; min-width: 6rem; max-width: 100%;
}
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-top: 1rem; }
.tabs a { padding: 0.45rem 0.9rem; text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { border-bottom-color: var(--pylon); }

.notice { border-left: 4px solid var(--pylon); padding: 0.75rem 1rem; background: var(--panel); margin: 1rem 0; max-width: 68ch; }
mark.todo { background: var(--pylon); color: #fff; padding: 0 0.25em; }
.formula { font-size: 0.9rem; color: var(--muted); }

.divisions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem 2rem; }
.divisions ul { list-style: none; padding: 0; margin: 0; }
.divisions li { padding: 0.35rem 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 0.6rem; }
.divisions img { width: 28px; height: 28px; object-fit: contain; }

.site-footer { border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  .calls li { grid-template-columns: 1fr; }
  .calls .call { white-space: normal; overflow-wrap: anywhere; }
  .search { margin-left: 0; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

.results { list-style: none; padding: 0; margin: 1rem 0; }
.results li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
