/* Chicken Counter — farm-ledger aesthetic.
   Paper, ink, one comb-red accent. Fonts are self-hosted on purpose: an app
   that promises nothing leaves your phone shouldn't leak visitor IPs to a
   font CDN. */

@font-face {
  font-family: 'Newsreader';
  src: url('/fonts/newsreader-400-latin.woff2') format('woff2-variations');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Zilla Slab';
  src: url('/fonts/zillaslab-700-latin.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --paper: #f2ece0;
  --paper-sunk: #e9e1d1;
  --paper-edge: #d8cdb7;
  --ink: #191713;
  --ink-soft: #5c5447;
  --red: #b33a25;
  --yolk: #d09216;

  --rule: color-mix(in srgb, var(--ink) 14%, transparent);

  --display: 'Zilla Slab', 'Rockwell', 'Bookman Old Style', serif;
  --body: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;

  --gut: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 34rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.5vw + 0.95rem, 1.1875rem);
  line-height: 1.65;
  font-variant-numeric: oldstyle-numeric;
  text-rendering: optimizeLegibility;
}

/* Paper grain. Cheap, self-contained, and it stops the flat beige from
   reading like an unstyled page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration-color: var(--red);
  text-underline-offset: 0.22em;
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--red);
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
  font-variant-numeric: lining-nums;
}

p {
  margin: 0 0 1.1em;
}

.wrap {
  width: min(72rem, 100%);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.measure {
  max-width: var(--measure);
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.75rem 1.25rem;
  border-bottom: 1.5px solid var(--ink);
}

.mark {
  font-family: var(--display);
  font-size: 1.0625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.mark::before {
  content: '';
  width: 1.05rem;
  height: 1.05rem;
  background: var(--red);
  border-radius: 60% 60% 55% 55% / 70% 70% 45% 45%;
  transform: rotate(-8deg);
}

.masthead nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--display);
}

.masthead nav a {
  text-decoration: none;
  padding-bottom: 0.15em;
  border-bottom: 1.5px solid transparent;
}

.masthead nav a:hover,
.masthead nav a[aria-current='page'] {
  border-bottom-color: var(--red);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
  grid-template-columns: 1fr;
  align-items: end;
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

.kicker {
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kicker::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--rule);
}

.hero h1 {
  font-size: clamp(3rem, 10vw, 6.5rem);
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--red);
}

.lede {
  font-size: clamp(1.1875rem, 1.1vw + 1rem, 1.5rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 30rem;
  margin-top: 1.75rem;
}

/* ---------- tally ---------- */

.tally {
  border: 1.5px solid var(--ink);
  background: var(--paper-sunk);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 10px 10px 0 color-mix(in srgb, var(--ink) 88%, transparent);
}

.tally svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.tally-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1.5px solid var(--ink);
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tally-caption b {
  font-size: 1.5rem;
  letter-spacing: 0;
  font-variant-numeric: lining-nums;
}

.stroke {
  fill: none;
  stroke: var(--ink);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 130;
  stroke-dashoffset: 130;
  animation: draw 0.44s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

.stroke.slash {
  stroke: var(--red);
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- sections ---------- */

section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
  border-top: 1.5px solid var(--ink);
}

.section-label {
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
}

h2 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  margin-bottom: 1.5rem;
  text-wrap: balance;
}

/* ledger rows */

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.ledger li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--rule);
}

.ledger li:first-child {
  border-top: 0;
  padding-top: 0;
}

@media (min-width: 48rem) {
  .ledger li {
    grid-template-columns: 3.5rem 16rem minmax(0, 1fr);
    align-items: baseline;
  }
}

.ledger li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--display);
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  color: var(--red);
  font-variant-numeric: lining-nums;
}

.ledger h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.ledger p {
  /* Two-column rows at this width, so auto-placement would drop the
     paragraph into the number gutter on the next row. Pin it under the
     heading instead. */
  grid-column: 2;
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
}

@media (min-width: 48rem) {
  .ledger p {
    /* Three columns here: the paragraph takes the third on its own. */
    grid-column: auto;
    margin-top: 0;
  }
}

/* inverted manifesto block */

.plain {
  background: var(--ink);
  color: var(--paper);
  border-top: 0;
}

.plain .section-label {
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}

.plain a {
  text-decoration-color: var(--yolk);
}

.plain a:hover {
  color: var(--yolk);
}

.nots {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: color-mix(in srgb, var(--paper) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
}

@media (min-width: 40rem) {
  .nots {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .nots {
    grid-template-columns: repeat(4, 1fr);
  }
}

.nots li {
  background: var(--ink);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
}

.nots b {
  display: block;
  font-family: var(--display);
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--yolk);
  margin-bottom: 0.4rem;
}

.nots span {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--paper) 78%, transparent);
}

/* status note */

.status {
  border: 1.5px solid var(--ink);
  border-left-width: 6px;
  border-left-color: var(--red);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--paper-sunk);
  max-width: 44rem;
}

.status p:last-child {
  margin-bottom: 0;
}

/* ---------- prose pages ---------- */

.prose {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3rem, 8vw, 6rem);
  border: 0;
}

.prose h1 {
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  margin-bottom: 1rem;
}

.prose .updated {
  font-family: var(--display);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--ink);
}

.prose h2 {
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  margin-top: 3rem;
  margin-bottom: 0.85rem;
}

.prose > .measure > h2:first-child {
  margin-top: 0;
}

.prose ul {
  margin: 0 0 1.1em;
  padding-left: 1.15rem;
}

.prose li {
  margin-bottom: 0.5em;
}

.prose li::marker {
  color: var(--red);
}

.callout {
  border-left: 3px solid var(--red);
  padding: 0.15rem 0 0.15rem 1.25rem;
  margin: 2rem 0;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

footer {
  border-top: 1.5px solid var(--ink);
  padding-block: 2.25rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

footer nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--display);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

footer a {
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 0.1em;
}

footer a:hover {
  border-bottom-color: var(--red);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }

  .stroke {
    stroke-dashoffset: 0;
  }
}
