:root {
  color-scheme: light;
  --ink: #1d1a16;
  --muted: #5e584e;
  --line: #e3dcd0;
  --paper: #f7f4ee;
  --card: #fffdf9;
  --accent: #234036;
  --accent-soft: #e7efe9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.25rem;
  background: var(--accent);
  color: #f4f7f4;
}

.site-header a { color: inherit; text-decoration: none; }
.site-header a:hover,
.site-header a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.2em; }

.brand { font-weight: 600; }

.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

main.wide { max-width: 72rem; }

h1 {
  font-size: 1.85rem;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

h2 { font-size: 1.28rem; margin: 1.8rem 0 0.45rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.35rem; }

.meta, .note { color: var(--muted); }
.meta { margin: 0.2rem 0 0.9rem; }

.crumb { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.75rem; }
.crumb a { color: inherit; }

.lead { margin-top: 0; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 0.42rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}

tr:last-child td { border-bottom: 0; }

th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.name-cell .team,
.team {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.banner {
  background: var(--accent-soft);
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
  margin: 0 0 1rem;
}

[hidden] { display: none !important; }

.class-list, .letter-nav, .district-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  padding: 0;
  list-style: none;
}

h4 { font-size: 0.98rem; margin: 0.9rem 0 0.3rem; }

.athlete {
  padding: 0.9rem 0 1.1rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}

.athlete h3 { margin-top: 0; }

.athlete:target {
  background: var(--accent-soft);
  border-radius: 6px;
  padding-inline: 0.8rem;
  margin-inline: -0.8rem;
}

.fastest { padding-left: 1.1rem; }
.fastest li { margin: 0.15rem 0; }

.search input {
  width: 100%;
  max-width: 36rem;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
}

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

footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  main { padding: 1.1rem 0.85rem 2.4rem; }
  h1 { font-size: 1.5rem; }
  th { letter-spacing: 0; }
  th, td { padding: 0.38rem 0.18rem; }
}
