:root {
  --bg: #fdfcf9;
  --fg: #1d1d1b;
  --muted: #7a776f;
  --accent: #3b5bdb;
  --rule: #e6e2d8;
  --square-size: 7.5rem;
  /* Square fills stay fixed across color schemes so white text keeps its contrast. */
  --square-indigo: #3b4fa8;
  --square-clay: #a8442a;
  --square-forest: #2e6f40;
  --square-pink: #79305a;
  --square-black: black;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --fg: #ececec;
    --muted: #9b9890;
    --accent: #8ba4ff;
    --rule: #2b2b31;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  max-width: 44rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 ui-serif, Georgia, "Times New Roman", serif;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--fg);
}

nav a {
  margin-left: 1rem;
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
a:hover {
  color: var(--accent);
}

a {
  color: var(--accent);
}

main {
  padding: 2rem 0;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.9rem;
  line-height: 1.2;
}

.square {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--square-size);
  aspect-ratio: 1 / 1;
  padding: 0.5rem;
  background: var(--square-indigo);
  color: #fff;
  text-align: center;
  text-wrap: balance;
}

.entry {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.entry-text {
  flex: 1;
}

.square--indigo {
  background: var(--square-indigo);
}

.square--clay {
  background: var(--square-clay);
}

.square--forest {
  background: var(--square-forest);
}

.square--pink {
  background: var(--square-pink);
}

.square--black {
  background: var(--square-black);
}

/* The key reuses .entry markup at a smaller scale — overriding the variable
   resizes only the swatches inside it. */
.legend {
  --square-size: 3rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.legend .square {
  font-size: 0.75rem;
  padding: 0.25rem;
}

.legend .entry {
  margin: 0.75rem 0;
}

h2 {
  margin: 0 0 1rem;
}

.day + .day {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

/* The key's descriptions share the section-heading treatment, so both are
   defined once here to keep them from drifting apart. */
h2,
.legend .entry-text {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.meta {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

footer {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}
