/* Layout: one reading column with a full-width board band in the hero, the way a
   notation sheet gives a diagram room on the page. */

:root {
  --bg: #f1f3ee;
  --paper: #fbfbf7;
  --fg: #17221d;
  --muted: #56635b;
  --accent: #1f5b43;
  --brass: #9a6f1c;
  --line: #d3d9cf;
  --sq-light: #ecefe6;
  --sq-dark: #9fb6a6;
  --focus: #9a6f1c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1613;
    --paper: #15201b;
    --fg: #e6ece7;
    --muted: #a1b1a6;
    --accent: #7cc4a1;
    --brass: #e0b765;
    --line: #2a3a33;
    --sq-light: #2c3d35;
    --sq-dark: #17241e;
    --focus: #e0b765;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1613;
  --paper: #15201b;
  --fg: #e6ece7;
  --muted: #a1b1a6;
  --accent: #7cc4a1;
  --brass: #e0b765;
  --line: #2a3a33;
  --sq-light: #2c3d35;
  --sq-dark: #17241e;
  --focus: #e0b765;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.6 "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-wrap: break-word;
}
main, header, footer { max-width: 1040px; margin: 0 auto; }
p { margin: 0 0 1em; max-width: 66ch; }

h1, h2, h3, .brand {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); margin: 0.5em 0 0.35em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin: 0 0 0.6em; }
h3 { font-size: 1.15rem; margin: 0 0 0.35em; }
a { color: var(--accent); text-underline-offset: 0.2em; }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--paper); color: var(--fg);
  padding: 8px 12px; z-index: 20;
}
.skip:focus { left: 16px; top: 16px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

header.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-top: 22px; padding-bottom: 10px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-size: 1.3rem; }
.brand .mark { width: 28px; height: 28px; border-radius: 4px; }
header nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
header nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px;
}
header nav a:hover { color: var(--fg); background: var(--paper); }
header nav a[aria-current="page"] { color: var(--fg); background: var(--paper); box-shadow: inset 0 -2px 0 var(--brass); }

main { padding-bottom: 24px; }

.kicker {
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brass); margin: 0 0 0.4em;
}
.lead { font-size: 1.22rem; color: var(--muted); max-width: 40ch; }

/* hero: text and a real board side by side, stacking on phones */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px; align-items: center; padding: 28px 0 48px;
}
.hero-text { min-width: 0; }
.hero-board { margin: 0; min-width: 0; max-width: 460px; justify-self: end; width: 100%; }
.hero-board figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 8px; }

.board {
  display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1 / 1; width: 100%;
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  font-size: clamp(1.4rem, 4.4vw, 2.4rem); line-height: 1;
  font-family: "DejaVu Sans", "Segoe UI Symbol", "Apple Symbols", system-ui, sans-serif;
}
.board .sq { display: flex; align-items: center; justify-content: center; background: var(--sq-light); color: var(--fg); }
.board .sq.dark { background: var(--sq-dark); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
.btn {
  display: inline-block; background: var(--accent); color: var(--bg); text-decoration: none;
  padding: 12px 20px; border-radius: 6px; font-weight: 700; border: 2px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--paper); }

/* bands: full-width sections that alternate paper and page colour */
.band { padding: 40px 0; border-top: 1px solid var(--line); }
.band.alt { background: var(--paper); border-top: 0; border-radius: 8px; padding-inline: 20px; margin-block: 8px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 28px 32px; }
.cols article { min-width: 0; border-top: 2px solid var(--line); padding-top: 14px; }
.cols p { color: var(--muted); margin: 0; }
.status { color: var(--brass); font-weight: 700; font-size: 0.92rem; margin-top: 10px; }

ul.plain { padding-left: 1.2em; max-width: 66ch; }
ul.plain li { margin-bottom: 0.5em; }

.crumbs { color: var(--muted); font-size: 0.92rem; margin: 24px 0 0; }
.clip-wait {
  border: 1px dashed var(--line); border-radius: 6px; padding: 28px; color: var(--muted);
  background: var(--paper); max-width: 66ch;
}

footer.foot {
  border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem;
  padding-top: 18px; padding-bottom: 32px; margin-top: 16px;
}
footer.foot p { max-width: none; }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 12px; }
  .hero-board { justify-self: start; max-width: 380px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
