:root {
  --paper: #F2F3EE;
  --paper-deep: #E4E7DF;
  --ink: #1D2A30;
  --ink-soft: #55656C;
  --prussian: #1F4E79;
  --prussian-deep: #163A5B;
  --rose: #E6B3AA;
  --rose-ink: #8C3B2E;
  --tint-a: #DCE6D2;
  --tint-b: #EDE3C4;
  --tint-c: #D6E0E8;
  --tint-d: #EBD7D2;
  --line: #9AA6A1;
  --focus: #1F4E79;

  --display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --body: "Public Sans", system-ui, sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: 2.4rem;
  --step-4: clamp(2.6rem, 6vw, 4.4rem);
  --measure: 62ch;
  --gutter: clamp(16px, 4vw, 48px);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}

a { color: var(--prussian); }
a:hover { color: var(--prussian-deep); }

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 10;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter);
  max-width: 1240px;
  margin: 0 auto;
}
.wordmark {
  font-family: var(--display);
  font-size: var(--step-2);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.top-cta {
  font-weight: 700;
  text-decoration: none;
  padding: 8px 2px;
  border-bottom: 2px solid currentColor;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 48px) var(--gutter) clamp(48px, 7vw, 96px);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: var(--step-4);
  letter-spacing: -0.005em;
  margin-bottom: 28px;
}

.lede {
  max-width: 44ch;
  margin: 0 0 18px;
  color: var(--ink);
}
.lede + .lede { color: var(--ink-soft); }

.button {
  display: inline-block;
  margin-top: 10px;
  background: var(--prussian);
  color: #FFFFFF;
  font: 700 var(--step-0)/1.2 var(--body);
  padding: 15px 22px;
  border: 0;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--prussian-deep); color: #FFFFFF; }

/* Atlas (the memorable element) */
.atlas {
  margin: 0;
  background: #FAFAF6;
  border: 1px solid var(--line);
  padding: clamp(12px, 2vw, 20px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.atlas-map {
  aspect-ratio: 4 / 3.3;
  width: 100%;
  background: var(--paper-deep);
  position: relative;
  overflow: hidden;
}
.atlas-map svg { display: block; width: 100%; height: 100%; }
.county { stroke: #5F6E6A; stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.county.is-farm { fill: var(--rose); stroke: var(--rose-ink); stroke-width: 1.6; }
.state-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; }
.pin-halo { fill: var(--paper); stroke: var(--rose-ink); stroke-width: 2; }
.pin-dot { fill: var(--rose-ink); }
.map-label {
  font-family: var(--display);
  font-size: 22px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: #FAFAF6;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.atlas-readout { min-height: 9.5rem; }
.year {
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 4.8rem);
  line-height: 0.95;
  margin: 0;
  font-variant-numeric: oldstyle-nums;
}
.place {
  font-family: var(--display);
  font-size: var(--step-2);
  margin: 6px 0 4px;
  color: var(--rose-ink);
}
.place-note {
  margin: 0;
  color: var(--ink-soft);
  max-width: 56ch;
  font-size: var(--step--1);
}

.slider-label {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.slider-row { display: flex; align-items: center; gap: 12px; }
.play {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--prussian);
  background: transparent;
  color: var(--prussian);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.play svg { width: 16px; height: 16px; fill: currentColor; }
.play[aria-pressed="true"] { background: var(--prussian); color: #FFFFFF; }

input[type="range"] {
  flex: 1;
  width: 100%;
  accent-color: var(--prussian);
  height: 44px;
  margin: 0;
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--ink-soft);
  padding-left: 56px;
  position: relative;
}
.slider-scale span:nth-child(2) {
  position: absolute;
  left: calc(56px + (100% - 56px) * (1863 - 1735) / (1900 - 1735));
  transform: translateX(-50%);
}

figcaption {
  font-size: var(--step--1);
  color: var(--ink-soft);
  border-top: 1px solid var(--paper-deep);
  padding-top: 12px;
}

/* Sections below the hero */
.records, .does, .coverage, .waitlist {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--gutter);
  border-top: 1px solid var(--line);
}
h2 { font-size: var(--step-3); margin-bottom: 14px; }
h3 { font-size: var(--step-1); margin-bottom: 8px; }
.section-lede { max-width: var(--measure); color: var(--ink-soft); margin: 0 0 28px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th {
  text-align: left;
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--ink-soft);
  padding: 10px 14px;
  border-bottom: 2px solid var(--ink);
}
td { padding: 0; border-bottom: 1px solid var(--line); }
td button {
  all: unset;
  display: block;
  width: 100%;
  padding: 14px;
  cursor: pointer;
  box-sizing: border-box;
}
td button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
tr:hover td, tr.is-active td { background: #FAFAF6; }
tr.is-active td:first-child { box-shadow: inset 4px 0 0 var(--rose-ink); }
.cell-year { font-family: var(--display); font-size: var(--step-1); font-variant-numeric: oldstyle-nums; }
.cell-record { font-family: var(--display); font-size: var(--step-1); color: var(--rose-ink); }
.fine { font-size: var(--step--1); color: var(--ink-soft); margin-top: 14px; }

.does-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  margin-top: 12px;
}
.does-grid p { margin: 0; max-width: 40ch; }
.works-with { margin: 36px 0 0; max-width: var(--measure); color: var(--ink-soft); }

.coverage p { max-width: var(--measure); margin: 0; }

/* Form */
form { max-width: 620px; display: grid; gap: 26px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, legend {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 0;
}
input[type="email"], select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #FFFFFF;
  border: 1.5px solid var(--ink-soft);
  border-radius: 4px;
  padding: 12px 14px;
  min-height: 48px;
}
input[type="email"][aria-invalid="true"] { border-color: var(--rose-ink); }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.checks label { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.checks input { width: 20px; height: 20px; accent-color: var(--prussian); flex: none; }
.error { color: var(--rose-ink); margin: 8px 0 0; font-size: var(--step--1); }
.form-status { margin: 0; min-height: 1.6em; font-weight: 700; }
.form-status.is-error { color: var(--rose-ink); }
.form-status.is-success { color: var(--prussian); }

.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.foot p { margin: 0 0 6px; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .does-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  /* Each record becomes a small block so "Same place today" stays visible. */
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }
  td { border: 0; display: block; }
  td button { padding: 4px 12px; }
  td:nth-child(1) { grid-row: 1 / span 3; }
  td:nth-child(1) button { padding-top: 6px; }
  .cell-event { color: var(--ink-soft); font-size: var(--step--1); }
  .cell-today { font-size: var(--step--1); color: var(--ink-soft); }
  .cell-today::before { content: "Today: "; }
  tr.is-active td:first-child { box-shadow: inset 4px 0 0 var(--rose-ink); }
  .map-label { font-size: 34px; }
}
@media (max-width: 520px) {
  .checks { grid-template-columns: minmax(0, 1fr); }
  .top-cta { font-size: var(--step--1); }
  .slider-scale span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
