/* Tokens, type and the numbered ledger are borrowed from rhymeswithjazz.com. */
:root {
  --color-surface: #edf0d9;
  --color-surface-raised: #dce3bd;
  --color-text: #252e20;
  --color-text-secondary: #46533a;
  --color-text-muted: #58654b;
  --color-accent: #526716;
  --color-border: #a5b18a;
  --font-masthead: "Bricolage Grotesque", Arial, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;
  --font-mono: "Space Mono", monospace;
  --size-meta: .875rem;
  --wrapper-gutter: clamp(20px, 5vw, 64px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-surface: #20241f;
    --color-surface-raised: #333a2e;
    --color-text: #e9ebdb;
    --color-text-secondary: #c8ccbb;
    --color-text-muted: #afb8a3;
    --color-accent: #d9ee76;
    --color-border: #66725a;
    color-scheme: dark;
  }
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(fonts/bricolage-grotesque-latin.woff2) format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/space-mono.woff2) format("woff2");
}

@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/space-mono-bold.woff2) format("woff2");
}

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

body, h1, h2, p, ol, dl, dd { margin: 0; }

body {
  font: 1.125rem/1.7 var(--font-body);
  background: var(--color-surface);
  color: var(--color-text);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--color-accent);
  text-underline-offset: .2em;
  text-decoration-thickness: 1px;
}

a:hover { text-decoration: none; }

:focus-visible {
  outline: 2px solid;
  outline-offset: 5px;
}

h1, h2 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.wrapper {
  max-width: 80rem;
  padding-inline: var(--wrapper-gutter);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  padding: 12px;
  color: #000;
  background: #fff;
}

/* Masthead */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  padding: 1.5rem 0 1rem;
  text-align: right;
}

.site-title {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: end;
  justify-items: end;
  gap: 0 .12em;
  font-family: var(--font-masthead);
  font-size: clamp(4rem, 10vw, 9rem);
  font-variation-settings: "opsz" 96;
  font-weight: 800;
  font-stretch: 85%;
  line-height: .9;
  letter-spacing: -.035em;
  color: var(--color-accent);
  text-decoration: none;
}

.title-word-rhymes { grid-column: 1 / -1; }

.site-tagline {
  font: var(--size-meta)/1.6 var(--font-mono);
  color: var(--color-text-secondary);
}

/* Page header */
.page-header { padding-top: 2.5rem; }

.eyebrow {
  margin-bottom: 1rem;
  font: var(--size-meta)/1.6 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
}

.page-header h1 {
  max-width: 20ch;
  margin-bottom: .75rem;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 1.05;
}

.page-description {
  max-width: 50ch;
  font-size: 1.4375rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

/* The tally: four zeros */
.tally { margin-top: 3rem; }

.tally dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}

.tally dl > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 1.25rem 1.25rem 1rem;
  background: var(--color-surface-raised);
}

.tally dt {
  font: var(--size-meta)/1.5 var(--font-mono);
  color: var(--color-text-secondary);
}

.tally dd {
  font-family: var(--font-masthead);
  font-size: clamp(4rem, 9vw, 7rem);
  font-variation-settings: "opsz" 96;
  font-weight: 800;
  font-stretch: 85%;
  line-height: .9;
  color: var(--color-accent);
}

.tally-note {
  margin-top: .75rem;
  font: var(--size-meta)/1.6 var(--font-mono);
  color: var(--color-text-muted);
}

/* Numbered sections, after the home page's post ledger */
.ledger {
  margin-top: 2rem;
  padding: 0;
  list-style: none;
  counter-reset: entries;
}

.ledger li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 28px 0;
}

.ledger li:before {
  counter-increment: entries;
  content: "0" counter(entries);
  grid-row: 1 / span 4;
  font: 400 2rem/1 var(--font-body);
  letter-spacing: -.04em;
  color: var(--color-accent);
}

.ledger li > * { grid-column: 2; }

.ledger h2 {
  margin-bottom: .75rem;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.8rem);
}

.ledger p,
.contact p {
  max-width: 62ch;
  font-size: 1.25rem;
  line-height: 1.75;
}

.ledger p + p { margin-top: 1rem; }

.contact {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-surface-raised);
}

.contact h2 {
  margin-bottom: .5rem;
  font-size: 2rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.25rem;
  padding: 2.5rem 0;
  font: var(--size-meta)/1.7 var(--font-mono);
  color: var(--color-text-muted);
}

@media (width >= 70em) {
  .tally,
  .ledger,
  .contact { max-width: 62rem; }

  .ledger li {
    grid-template-columns: 8rem minmax(0, 1fr);
    column-gap: 2rem;
  }

  .ledger li:before { font-size: 3rem; }
}

@media (width <= 640px) {
  .site-header { display: block; }
  .site-title { font-size: min(17vw, 6.5rem); }
  .site-tagline { display: block; margin-top: .5rem; }
  .page-description { font-size: 1.25rem; }
  .ledger p, .contact p { font-size: 1.125rem; }
  .tally dl { grid-template-columns: 1fr 1fr; }
}

@media print {
  :root {
    --color-surface: white;
    --color-surface-raised: #eee;
    --color-text: black;
    --color-text-secondary: #333;
    --color-text-muted: #444;
    --color-accent: black;
    --color-border: #aaa;
  }
}
