:root {
  --bg: #f6f1e6;
  --ink: #2a2926;
  --muted: #5e5a54;
  --line: #ddd4c6;
  --burg: #7a3944;
  --blue: #6d7c86;
  --sage: #6e7f68;
  --serif: Georgia, "Palatino Linotype", Palatino, serif;
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
  --read: 740px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  background-color: #f6f1e6;
  background-image:
    linear-gradient(rgba(246, 241, 230, 0.86), rgba(246, 241, 230, 0.86)),
    url("../images/background_trivia.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
  opacity: 0.05;
  pointer-events: none;
  z-index: -1;
}

a { color: var(--burg); }
a:hover { color: #542832; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.skip {
  position: absolute;
  left: 0.7rem;
  top: -3rem;
  background: #fff;
  padding: 0.35rem 0.55rem;
}
.skip:focus { top: 0.45rem; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.read { max-width: var(--read); }

.mast { height: 60px; border-bottom: 1px solid var(--line); background: rgba(246, 241, 230, 0.92); position: relative; }
.mast-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.12rem; }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.2rem; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0.28rem 0.5rem;
}

.kicker {
  margin: 0 0 0.4rem;
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { margin: 0 0 0.45rem; font-size: clamp(2rem, 4vw, 3rem); }
h2 { margin: 0 0 0.7rem; font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { margin: 0; font-size: 1.25rem; }

.section { padding: 3.2rem 0; }
.section + .section { border-top: 1px solid var(--line); }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem 1.75rem;
  align-items: start;
}
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-9 { grid-column: 2 / span 9; }

.question {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  line-height: 1.35;
  margin: 0.8rem 0 0.4rem;
}

.rail { border-top: 1px solid var(--line); }
.rail div { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
.rail dt { margin: 0; }
.rail dd { margin: 0.2rem 0 0; }

.reveal-btn, .marks button, .day {
  font: inherit;
  color: var(--ink);
  background: transparent;
}

.reveal-btn, .marks button {
  border: 1px solid var(--burg);
  color: var(--burg);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.reveal-btn[aria-expanded="true"] {
  border-color: var(--sage);
  color: var(--sage);
  cursor: default;
}
.marks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.marks button:disabled { opacity: 0.55; }

.answer {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--sage);
}
.answer strong { font-family: var(--serif); color: var(--sage); font-size: 1.3rem; }

.q-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.15rem 0.8rem;
  border-top: 1px solid var(--line);
  padding: 0.95rem 0;
}
.q-num {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--burg);
  grid-row: span 3;
}
.q-row h3 { grid-column: 2; }
.q-row .kicker, .q-row .reveal, .q-row .marks { grid-column: 2; }

.ledger-row {
  display: grid;
  grid-template-columns: 11rem 1fr auto;
  gap: 0.6rem 0.8rem;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
  color: inherit;
  text-decoration: none;
}
.ledger-row:hover strong { color: var(--burg); }
.count { color: var(--blue); white-space: nowrap; }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.day {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  padding: 0.7rem 0.55rem 0.8rem;
  text-align: left;
}
button.day { cursor: pointer; }
.day .diff { color: var(--blue); font-size: 0.85rem; }
.day.is-today { border-bottom: 3px solid var(--burg); }
.today-mark {
  color: var(--burg);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.past-panel { margin-top: 1rem; }

.notes { margin: 0; border-top: 1px solid var(--line); }
.notes div { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
.notes dt {
  margin: 0;
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.notes dd { margin: 0.2rem 0 0; }

.archive { margin: 0; padding: 0; list-style: none; }
.archive li { border-top: 1px solid var(--line); padding: 0.8rem 0; }
.archive a { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; }
.archive a:hover { text-decoration: underline; }

.about-band { background: #efe6d6; }
.address { font-style: normal; }

.foot { padding: 1.3rem 0 2rem; }
.foot p { margin: 0; font-family: var(--serif); font-size: 1.12rem; }
.foot nav, .foot .mail { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; margin-top: 0.5rem; }

[data-fact-body] { white-space: pre-wrap; }
.prose h2 { font-size: 1.35rem; margin-top: 1.5rem; }
.prose p { margin: 0.75rem 0; }
.tally { color: var(--muted); }

@media (max-width: 760px) {
  body { background-attachment: scroll; }
  .span-8, .span-7, .span-6, .span-5, .span-4, .span-9 { grid-column: 1 / -1; }
  .ledger-row, .q-row { grid-template-columns: 1fr; }
  .q-num { grid-row: auto; }
  .q-row h3, .q-row .kicker, .q-row .reveal, .q-row .marks { grid-column: 1; }
  .week-strip {
    display: flex;
    overflow-x: auto;
    border-right: 0;
  }
  .day { min-width: 8.5rem; flex: 0 0 auto; }
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 2;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 1rem 0.9rem;
    flex-direction: column;
  }
  .nav.is-open { display: flex; }
}
