/* NilAllDraw — "Honours Even"
   Chalk paper, ink, pitch green, old gold. Serif headlines (Newsreader),
   system sans for metadata. Mobile-first; dark theme via tokens. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  src: url("fonts/newsreader.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #efede2;
  --ink: #1c2119;
  --muted: #4a5244;
  --faint: #7a7663;
  --rule: #c9c5b2;
  --rule-strong: #1c2119;
  --pitch: #1e5c38;
  --pitch-ink: #efede2;
  --gold: #a08430;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
/* No data-theme attribute = follow the system; "light"/"dark" = reader's choice.
   The two dark blocks must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15190f;
    --ink: #e8e6d9;
    --muted: #aab3a0;
    --faint: #8b937f;
    --rule: #2e3428;
    --rule-strong: #e8e6d9;
    --pitch: #2c7047;
    --pitch-ink: #e8e6d9;
    --gold: #c2a44e;
  }
}
:root[data-theme="dark"] {
  --paper: #15190f;
  --ink: #e8e6d9;
  --muted: #aab3a0;
  --faint: #8b937f;
  --rule: #2e3428;
  --rule-strong: #e8e6d9;
  --pitch: #2c7047;
  --pitch-ink: #e8e6d9;
  --gold: #c2a44e;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--pitch); outline-offset: 2px; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.1rem; }

/* Masthead */
.masthead { position: relative; text-align: center; padding: 1.1rem 1rem 0.7rem; border-bottom: 2px solid var(--rule-strong); }
.theme-toggle {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--pitch); outline-offset: 2px; }
.m-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  letter-spacing: -0.015em;
  text-decoration: none;
  line-height: 1.1;
}
.m-name .dash { color: var(--pitch); }
.m-date {
  margin: 0.25rem 0 0;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Section tabs */
.tabs {
  display: flex;
  justify-content: safe center;
  gap: 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--rule);
  padding: 0 0.6rem;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--faint);
  padding: 0.6rem 0.55rem;
  white-space: nowrap;
}
.tab.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--pitch); }

/* Day groups */
main.wrap { padding-top: 0.4rem; padding-bottom: 1.5rem; }
.day-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.4rem 0 0.2rem;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.day-head::before, .day-head::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}
.page-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 1.4rem 0 0.2rem;
  text-wrap: balance;
}

/* Stories */
.story { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.story:last-of-type { border-bottom: 0; }
.story h3 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.3;
  text-wrap: balance;
}
.story h3 a { text-decoration: none; }
.story h3 a:hover { text-decoration: underline; text-decoration-color: var(--pitch); text-underline-offset: 3px; }
.snippet { margin: 0 0 0.4rem; font-size: 0.93rem; line-height: 1.5; color: var(--muted); }
.meta {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.meta .dot { color: var(--faint); }
.meta .sec { color: var(--faint); }
.lang {
  background: var(--pitch);
  color: var(--pitch-ink);
  border-radius: 3px;
  padding: 0.1rem 0.32rem;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

/* Archive */
.archive { list-style: none; margin: 0; padding: 0; }
.archive li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); font-size: 0.98rem; line-height: 1.35; }
.archive li:last-child { border-bottom: 0; }
.archive a { text-decoration: none; font-weight: 500; }
.archive a:hover { text-decoration: underline; text-decoration-color: var(--pitch); text-underline-offset: 3px; }
.ameta {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.archive-link {
  margin: 1.6rem 0 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.archive-link a { color: var(--pitch); text-decoration: none; }
.archive-link a:hover { text-decoration: underline; }

/* Empty state + 404 */
.empty { text-align: center; padding: 3.5rem 1rem; font-style: italic; color: var(--muted); }
.empty .big { font-size: 1.3rem; }
.empty a { color: var(--pitch); }

/* Footer */
.footer { border-top: 2px solid var(--rule-strong); margin-top: 1rem; padding-top: 1.1rem; padding-bottom: 2.5rem; text-align: center; }
.foot-line { margin: 0 0 0.45rem; font-style: italic; font-size: 0.9rem; color: var(--muted); }
.foot-line.muted { font-style: normal; font-family: var(--sans); font-size: 0.68rem; color: var(--faint); letter-spacing: 0.02em; }

@media (min-width: 700px) {
  .story h3 { font-size: 1.22rem; }
  .tab { font-size: 0.7rem; padding: 0.7rem 0.8rem; }
}
