/* Shared by every page: the home page, 404, and the generated blog pages. */

:root {
  --bg: #fbfaf8;
  --fg: #1c1b19;
  --muted: #6b6862;
  --rule: #e4e0d9;
  --accent: #9a5b34;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --fg: #eceae4;
    --muted: #98948c;
    --rule: #2c2b26;
    --accent: #d99a6c;
  }
}

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

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) 1.5rem 4rem;
}

.header { margin-bottom: 3rem; }

.name {
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.tagline {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.attribution {
  margin: 0.5rem 0 0;
  text-align: right;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.section {
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.section-title {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.prose { margin: 0 0 1.1rem; }
.prose:last-child { margin-bottom: 0; }

.list {
  margin: 0;
  padding-left: 1.1rem;
}
.list li { margin-bottom: 0.4rem; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding-bottom: 1px;
}
a:hover { border-bottom-color: var(--accent); }

.footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Blog */

.crumbs {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2.5rem;
}
.crumbs span { margin: 0 0.4rem; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.9rem;
}

.post-date {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-title {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}

.post-body { margin-top: 2rem; }
.post-body a { overflow-wrap: anywhere; }

/* Game */

.scoreboard {
  display: flex;
  gap: 1.5rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.scoreboard strong { color: var(--fg); font-weight: 600; }

.board {
  display: block;
  /* Fit the whole board on screen; arrow keys can't scroll during play. */
  width: min(100%, max(16rem, calc(100vh - 19rem)));
  aspect-ratio: 1 / 1;
  margin: 1.5rem auto 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  /* Swipes steer the snake instead of scrolling the page. */
  touch-action: none;
  cursor: pointer;
}

.game-message {
  min-height: 1.65em;
  margin: 0.75rem 0 0;
  text-align: center;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}
