:root {
  color-scheme: light;
  --bg: #f3efe6;
  --ink: #1b1914;
  --muted: #5c564c;
  --line: #e3d9c8;
  --card: #fffdf8;
  --teal: #0f4c5c;
  --teal-dark: #0b3642;
  --amber: #8a4b12;
  --focus: #0f4c5c;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

a { color: var(--teal-dark); }

a:hover { color: var(--amber); }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.8rem;
  z-index: 2;
}

.skip:focus { top: 0.5rem; }

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--teal);
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: end;
  justify-content: space-between;
  padding: 1rem 0 1.1rem;
}

.brand {
  text-decoration: none;
  color: var(--ink);
}

.brand:hover { color: var(--teal); }

.kicker {
  margin: 0;
  color: var(--amber);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-name {
  margin: 0.1rem 0 0;
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
}

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.search label {
  font-size: 0.9rem;
  font-weight: 650;
}

.search input,
.form input,
.form textarea {
  font: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid #cbbfaa;
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  min-width: 14rem;
}

.search button,
.button {
  font: inherit;
  font-weight: 650;
  color: white;
  background: var(--teal);
  border: 0;
  border-radius: 4px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.search button:hover,
.button:hover { background: var(--teal-dark); color: white; }

main { padding: 1.5rem 0 3rem; }

h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0.3rem 0 0.6rem; }

h2 { font-size: 1.4rem; margin: 2rem 0 0.7rem; }

.lede { font-size: 1.12rem; max-width: 42rem; margin-top: 0; }

.note, .meta { color: var(--muted); }

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--muted);
}

.grid, .roster, .stack {
  list-style: none;
  padding: 0;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.7rem;
}

.grid a, .roster a, .result a {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.grid a:hover, .roster a:hover, .result a:hover {
  border-color: var(--teal);
}

.card-title, .name {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.8rem;
}

.roster a, .result a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.75rem;
  align-items: center;
}

.mono {
  grid-row: span 3;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 8px;
  background: var(--teal);
  color: #f4f0e8;
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-weight: 700;
}

.place { grid-column: 2; margin: 0; color: var(--muted); font-size: 0.92rem; }

time { font-size: 0.92rem; color: var(--muted); }

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.2rem;
}

.table-wrap { overflow-x: auto; margin: 1rem 0 1.4rem; }

.record, .sheet {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
}

.record caption, .sheet caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: 0 0 0.45rem;
}

.record th, .record td, .sheet th, .sheet td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.record th {
  width: 12rem;
  color: var(--muted);
  font-weight: 650;
  background: #f7f3ea;
}

.record td { font-weight: 650; }

.record time { color: inherit; font-size: 1rem; }

.sheet th {
  background: #f7f3ea;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet td:first-child, .sheet td:last-child { white-space: nowrap; }

.record tr:last-child th, .record tr:last-child td, .sheet tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 640px) {
  .record, .record tbody, .record tr, .record th, .record td { display: block; width: auto; }
  .record th { border-bottom: 0; padding-bottom: 0.15rem; }
  .record td { padding-top: 0.15rem; }
  .sheet td:first-child, .sheet td:last-child { white-space: normal; }
}

.prose { max-width: 42rem; }

.prose p { margin: 0.7rem 0; }

.form { display: grid; gap: 0.8rem; max-width: 32rem; }

.form label { font-weight: 650; display: grid; gap: 0.3rem; }

.form textarea { min-height: 8rem; resize: vertical; }

.alert {
  background: #fff4e8;
  border: 1px solid #efd0b0;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}

.result { list-style: none; padding: 0; display: grid; gap: 0.7rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 0 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.6rem; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .search input { min-width: 100%; }
  .search { width: 100%; }
}
