/* Lobby Ledger. One idea: a ledger page. Ruled entries, register numbers in the
   margin, a red margin line. Everything else stays quiet. */

:root {
  --paper: #fbfcfe;
  --sheet: #ffffff;
  --ink: #16213a;
  --soft: #4a5672;
  --rule: #d6deea;
  --margin: #c8402f;
  --blue: #2943b8;
  --on-blue: #ffffff;
  --field: #eef2f8;
  --wide: 70rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1320;
    --sheet: #121a2a;
    --ink: #e7ecf5;
    --soft: #a3aec4;
    --rule: #26324a;
    --margin: #e2675b;
    --blue: #93a8ff;
    --on-blue: #0d1320;
    --field: #172036;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1320; --sheet: #121a2a; --ink: #e7ecf5; --soft: #a3aec4; --rule: #26324a;
  --margin: #e2675b; --blue: #93a8ff; --on-blue: #0d1320; --field: #172036; color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "FLAR" 0;
  font-feature-settings: "tnum" 0;
}

h1, h2, h3, .wordmark {
  font-variation-settings: "FLAR" 100;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); font-weight: 650; margin: 0 0 1.25rem; }
h2 { font-size: 1.5rem; font-weight: 650; margin: 0 0 0.75rem; }
h3 { font-size: 1.125rem; font-weight: 650; margin: 1.75rem 0 0.5rem; }
p { margin: 0 0 1rem; max-width: 70ch; }

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--sheet); padding: 0.5rem 0.75rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Frame */
.site-head, main, .site-foot { max-width: var(--wide); margin-inline: auto; padding-inline: 1.5rem; }
.site-head {
  display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: space-between; align-items: baseline;
  padding-block: 1.25rem; border-bottom: 1px solid var(--rule);
}
.wordmark { font-size: 1.3rem; font-weight: 750; color: var(--ink); text-decoration: none; }
.glyph {
  display: inline-block; position: relative; width: 1rem; height: 1.2rem; margin-right: 0.5rem; vertical-align: -0.15rem;
  border: 1.5px solid var(--ink); border-radius: 2px;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, var(--rule) 3px 4px);
}
.glyph::before { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 1.5px; background: var(--margin); }
nav { display: flex; gap: 1.5rem; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
nav a:hover { text-decoration: underline; }

main section { margin-block: 3.5rem; }
.page-head { margin-top: 2.75rem; }
.narrow { max-width: 44rem; }
.narrow h2 { font-size: 1.2rem; margin-top: 2.25rem; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--soft); max-width: 42rem; }
.meta { color: var(--soft); font-size: 0.95rem; margin-bottom: 0.75rem; }
.note, .notes p { font-size: 0.875rem; color: var(--soft); }

/* Home */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 3.5rem; align-items: start;
  margin-top: 3.25rem;
}
.hero h1 { max-width: 13ch; }
.split {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 3.5rem;
  border-top: 1px solid var(--rule); padding-top: 2.75rem;
}
.aside { background: var(--field); padding: 1.5rem 1.75rem; border-radius: 6px; align-self: start; }
.aside p { font-size: 0.975rem; }
.more { font-weight: 600; }

/* The ledger sheet */
.ledger {
  margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
}
.ledger figcaption {
  display: grid; grid-template-columns: 8.25rem minmax(0, 1fr); font-size: 0.875rem; color: var(--soft);
  border-bottom: 2px solid var(--ink);
}
.ledger figcaption .ref-head { padding: 0.9rem 0.75rem 0.8rem 1rem; text-align: right; font-size: 0.75rem; line-height: 1.9; }
.ledger figcaption .cap { padding: 0.9rem 1.25rem 0.8rem calc(2px + 1.75rem); }
.ledger ol { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: grid; grid-template-columns: 8.25rem 1.75rem minmax(0, 1fr); border-bottom: 1px solid var(--rule);
}
.ledger li:last-child { border-bottom: 0; }
.ledger .ref {
  padding: 0.8rem 0.6rem 0.8rem 0.6rem; text-align: right; font-size: 0.7rem; line-height: 2; color: var(--soft);
  font-feature-settings: "tnum" 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ledger .mark {
  border-left: 2px solid var(--margin); padding: 0.7rem 0 0.7rem 0.6rem; font-weight: 700; color: var(--blue);
}
.ledger .mark.out { color: var(--margin); }
.ledger .txt { padding: 0.7rem 1.25rem 0.7rem 0.15rem; line-height: 1.5; }
.ledger .txt a { color: var(--ink); text-decoration-color: var(--rule); }
.ledger .txt a:hover { text-decoration-color: var(--ink); }
.page-head + .ledger { margin-top: -1rem; }

/* Signup */
.signup { margin-top: 2rem; max-width: 30rem; }
.signup label { display: block; font-weight: 600; margin-bottom: 0.45rem; }
.signup-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.signup input {
  flex: 1 1 13rem; min-width: 0; font: inherit; color: var(--ink); background: var(--sheet);
  padding: 0.75rem 0.9rem; border: 1px solid var(--soft); border-radius: 4px;
}
.signup button {
  font: inherit; font-weight: 650; padding: 0.75rem 1.3rem; color: var(--on-blue); background: var(--blue);
  border: 0; border-radius: 4px; cursor: pointer;
}
.signup button:hover { filter: brightness(1.1); }
.fine { font-size: 0.875rem; color: var(--soft); margin-top: 0.6rem; }
.hp { position: absolute; left: -9999px; }
.cta { border-top: 2px solid var(--ink); padding-top: 2rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
thead th {
  text-align: left; vertical-align: bottom; font-size: 0.85rem; font-weight: 600; color: var(--soft);
  padding: 0.4rem 1rem 0.5rem 0; border-bottom: 2px solid var(--ink);
}
td { padding: 0.65rem 1rem 0.65rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
td:last-child, th:last-child { padding-right: 0; }
.num { text-align: right; white-space: nowrap; font-feature-settings: "tnum" 1; }
table.compact td { padding-block: 0.45rem; }
.sub { display: block; font-size: 0.8rem; color: var(--soft); }
.in { color: var(--blue); font-weight: 650; }
.out { color: var(--margin); font-weight: 650; }

table.league td:first-child { min-width: 14rem; }
tr.group th {
  text-align: left; font-weight: 650; font-variation-settings: "FLAR" 100;
  padding: 1.6rem 0 0.45rem; border-bottom: 1px solid var(--ink);
}
tr.group th span { font-weight: 400; font-size: 0.85rem; color: var(--soft); margin-left: 0.5rem; }
.scale { display: block; font-weight: 400; font-size: 0.75rem; }
.bar-cell { width: 34%; vertical-align: middle; }
.bar { position: relative; display: block; height: 0.55rem; min-width: 8rem; background: var(--field); border-radius: 3px; }
.bar span { position: absolute; top: 0; bottom: 0; background: var(--blue); border-radius: 3px; }
.bar.open span { background: linear-gradient(to right, var(--blue) 40%, transparent); }

details { margin-top: 1rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--blue); }
details h3 { font-size: 1rem; }
details p { font-size: 0.9rem; line-height: 1.75; }

/* Footer */
.site-foot {
  margin-top: 5rem; padding-block: 2rem 3rem; border-top: 1px solid var(--rule); font-size: 0.85rem; color: var(--soft);
}
.site-foot p { max-width: 80ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

@media (max-width: 1000px) {
  .hero, .split { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .hero h1 { max-width: 18ch; }
}
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-head, main, .site-foot { padding-inline: 1rem; }
  nav { gap: 1rem; }
  .ledger li { grid-template-columns: 1.75rem minmax(0, 1fr); }
  .ledger .ref, .ledger .ref-head { display: none; }
  .ledger figcaption { grid-template-columns: minmax(0, 1fr); }
  .ledger figcaption .cap { padding-left: 1rem; }
  .ledger .mark { padding-left: 0.5rem; }
  .ledger .txt { padding-right: 1rem; }
  .bar-cell { width: auto; }
}
