/* SmallTownGuide.com
   Road-sign system: green guides, brown marks quality of life, yellow marks caution,
   red is reserved for Frank's checkmarks and errors. */

@font-face { font-family: "Caslon"; src: url("/assets/fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Caslon"; src: url("/assets/fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Caslon"; src: url("/assets/fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --green: #0f6a4c;
  --green-deep: #0a4f38;
  --green-tint: #e6f0eb;
  --brown: #6e4a2e;
  --brown-tint: #f3ece5;
  --yellow: #f5c518;
  --yellow-tint: #fdf5d4;
  --red: #c2272d;
  --ink: #1e2a2f;
  --muted: #55636a;
  --paper: #ffffff;
  --wash: #eef3f0;
  --rule: #d5ddd8;
  --post: #8a9599;
  --link: #0f6a4c;
  --field-text: #0a4f38;
  --field-bg: #ffffff;
  --shadow: rgba(30, 42, 47, 0.12);
  color-scheme: light;

  --serif: "Caslon", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sign: "Overpass", "Highway Gothic", "Helvetica Neue", Arial, sans-serif;

  /* Type scale around a 19px reading size */
  --step--1: 0.84rem;
  --step-0: 1.1875rem;
  --step-1: 1.4rem;
  --step-2: clamp(1.55rem, 1.3rem + 0.9vw, 1.85rem);
  --step-3: clamp(1.85rem, 1.5rem + 1.5vw, 2.4rem);
  --step-4: clamp(2.2rem, 1.6rem + 2.6vw, 3.4rem);
  --step-5: clamp(2.5rem, 1.7rem + 3.6vw, 4.3rem);

  --measure: 68ch;
  --wrap: 1180px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --radius-sign: 14px;
}

/* Dark mode: follows the device setting; the header switch stores an override in localStorage. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --green: #12805b;
  --green-deep: #0b3326;
  --green-tint: #183a2e;
  --brown: #8a5d3a;
  --brown-tint: #2b221a;
  --yellow: #f5c518;
  --yellow-tint: #2c2711;
  --red: #ef6b6f;
  --ink: #e4eae6;
  --muted: #a9b6b0;
  --paper: #121a17;
  --wash: #1a2521;
  --rule: #2f3d37;
  --post: #6f7a7e;
  --link: #7fd4ab;
  --field-text: #9fe3c2;
  --field-bg: #16201c;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green: #12805b;
  --green-deep: #0b3326;
  --green-tint: #183a2e;
  --brown: #8a5d3a;
  --brown-tint: #2b221a;
  --yellow: #f5c518;
  --yellow-tint: #2c2711;
  --red: #ef6b6f;
  --ink: #e4eae6;
  --muted: #a9b6b0;
  --paper: #121a17;
  --wash: #1a2521;
  --rule: #2f3d37;
  --post: #6f7a7e;
  --link: #7fd4ab;
  --field-text: #9fe3c2;
  --field-bg: #16201c;
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--link); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--yellow); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -0.005em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); margin-top: 1.6em; }
h3 { font-size: var(--step-2); margin-top: 1.4em; }
h4 { font-size: var(--step-1); }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1.1em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 700; }
small, .small { font-size: var(--step--1); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }
.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--ink); padding: 0.6rem 1rem; font-family: var(--sign); font-weight: 700; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Signs and buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--sign); font-weight: 800; font-size: 1.05rem; line-height: 1.2;
  padding: 0.85rem 1.35rem; min-height: 48px;
  border-radius: 10px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--green); color: #fff;
  box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #fff;
}
.btn:hover { background: var(--green-deep); color: #fff; box-shadow: inset 0 0 0 2px var(--green-deep), inset 0 0 0 4px #fff; }
.btn--quiet { background: transparent; color: var(--link); box-shadow: inset 0 0 0 2px var(--link); }
.btn--quiet:hover { background: var(--green-tint); color: var(--link); box-shadow: inset 0 0 0 2px var(--link); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.textlink { font-family: var(--sign); font-weight: 700; font-size: 1.05rem; }

/* Mile marker: used only for real sequences (the guide steps) */
.marker {
  flex: none; display: inline-grid; place-items: center;
  width: 2.4rem; min-height: 3rem; padding: 0.2rem 0;
  background: var(--green); color: #fff; border-radius: 6px;
  box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 3.5px #fff;
  font-family: var(--sign); font-weight: 800; font-size: 1.15rem; line-height: 1;
}

/* Hand-drawn checkbox from Frank's sketch */
.check { width: 1.55em; height: 1.55em; flex: none; overflow: visible; }
.check .box { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.check .tick { fill: none; stroke: var(--red); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.55rem; }
.checklist li { display: flex; align-items: center; gap: 0.8rem; margin: 0; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: relative; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand svg { width: 44px; height: 44px; }
.brand span { font-family: var(--sign); font-weight: 800; font-size: 1.32rem; letter-spacing: -0.01em; line-height: 1; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { font-family: var(--sign); font-weight: 700; font-size: 1.02rem; color: var(--ink); text-decoration: none; padding: 0.4rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--link); box-shadow: inset 0 -3px 0 var(--link); }
.nav .btn { padding: 0.65rem 1.05rem; font-size: 0.98rem; min-height: 44px; }
.nav .btn:hover, .nav .btn[aria-current="page"] { color: #fff; }
.menu { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .menu { display: block; position: static; }
  .menu > summary { list-style: none; cursor: pointer; font-family: var(--sign); font-weight: 800; font-size: 1rem; padding: 0.6rem 0.9rem; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--ink); }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu[open] > summary { background: var(--ink); color: var(--paper); }
  .menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 0.5rem var(--gutter) 1.25rem; display: grid; gap: 0.25rem; box-shadow: 0 12px 24px var(--shadow); }
  .menu-panel a { font-family: var(--sign); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  .menu-panel .btn { margin-top: 0.75rem; color: #fff; border-bottom: 0; }
}

/* Light/dark switch: sun shows in dark mode (switch to light), moon in light mode */
.theme-toggle { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { background: var(--wash); }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .sun { display: block; }
  :root:not([data-theme]) .theme-toggle .moon { display: none; }
}
.header-tools { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: var(--step-5); line-height: 1.05; margin-bottom: 1.6rem; max-width: 16ch; }
.hero .checklist { font-family: var(--sign); font-weight: 700; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); gap: 0.7rem; margin-bottom: 2rem; }
.hero .checklist .check { width: 1.6em; height: 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem 1.5rem; }
.hero-note { font-size: var(--step--1); color: var(--muted); margin-top: 1rem; max-width: 46ch; }

/* Aerial photo behind the hero: faded under the text, clear behind the sign */
.hero--photo { position: relative; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero--photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, var(--paper) 0%, color-mix(in srgb, var(--paper) 94%, transparent) 36%, color-mix(in srgb, var(--paper) 45%, transparent) 58%, transparent 80%);
}
.hero--photo .townsign-ground { display: none; }
.hero--photo .townsign { padding-bottom: 6rem; }
.hero--photo .townsign-posts::before, .hero--photo .townsign-posts::after { bottom: 0; height: calc(100% - 2rem); }

/* The population sign */
.townsign { position: relative; padding-bottom: 7.5rem; max-width: 470px; justify-self: center; width: 100%; }
.townsign-face {
  position: relative; z-index: 2;
  background: var(--green); color: #fff; text-align: center;
  border-radius: var(--radius-sign);
  padding: clamp(1.4rem, 3vw, 2.2rem) 1.2rem clamp(1.3rem, 3vw, 2rem);
  box-shadow: inset 0 0 0 5px var(--green), inset 0 0 0 9px #fff, 0 18px 30px -18px rgba(10, 79, 56, 0.6);
  font-family: var(--sign); line-height: 1.05;
}
.townsign-face .l1 { display: block; font-weight: 600; font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); margin-bottom: 0.35rem; }
.townsign-face .l2 { display: block; font-weight: 800; font-size: clamp(2.1rem, 1.5rem + 3vw, 3.2rem); letter-spacing: -0.01em; }
.townsign-face .l3 { display: block; font-weight: 700; font-size: clamp(1.15rem, 0.95rem + 1vw, 1.5rem); margin-top: 0.75rem; }
.townsign-posts { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 100%; }
.townsign-posts::before, .townsign-posts::after {
  content: ""; position: absolute; bottom: 1.6rem; width: 14px; height: calc(100% - 3rem);
  background: linear-gradient(90deg, #a9b3b6, var(--post) 60%, #737e82);
  border-radius: 2px;
}
.townsign-posts::before { left: 24%; }
.townsign-posts::after { right: 24%; }
.townsign-ground { position: absolute; z-index: 3; left: -18%; right: -18%; bottom: 0; height: 4.2rem; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.townsign-ground svg { width: 100%; height: 100%; }

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--wash { background: var(--wash); }
.section--green { background: var(--green); color: #fff; }
.section--green a { color: #fff; }
.section-head { max-width: var(--measure); margin-bottom: 2rem; }
.section-head h2 { margin-top: 0; }
.section-head p { color: var(--muted); font-size: var(--step-1); line-height: 1.5; }
.section--green .section-head p { color: #d8ebe2; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }

/* ---------- Income calculator ---------- */
.calc { background: var(--paper); border-radius: var(--radius-sign); box-shadow: inset 0 0 0 2px var(--rule); padding: clamp(1.25rem, 3vw, 2.25rem); }
.calc-sentence { font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.8rem); line-height: 1.9; margin: 0 0 1.25rem; }
.calc input, .calc select {
  font: inherit; font-family: var(--sign); font-weight: 700; color: var(--field-text);
  border: 0; border-bottom: 3px solid var(--link); background: var(--green-tint);
  padding: 0.05em 0.35em; border-radius: 6px 6px 0 0; max-width: 100%;
}
.calc input { width: 6.5ch; }
.calc select { max-width: min(100%, 24ch); cursor: pointer; }
.calc-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.calc-figure { background: var(--wash); border-radius: 10px; padding: 1rem 1.15rem; }
.calc-figure b { display: block; font-family: var(--sign); font-weight: 800; font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); color: var(--link); line-height: 1.1; }
.calc-figure span { font-size: var(--step--1); color: var(--muted); display: block; margin-top: 0.3rem; line-height: 1.4; }
.bars { display: grid; gap: 1rem; margin: 0.25rem 0 1.25rem; }
.bar { display: grid; grid-template-columns: 12rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 0.75rem; font-family: var(--sign); font-weight: 600; font-size: 0.95rem; }
.bar-track { display: block; height: 16px; background: var(--wash); border-radius: 8px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 8px; background: var(--green); transition: width 0.4s ease; }
.bar-fill--city { background: var(--post); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-cat { font-family: var(--sign); font-weight: 800; font-size: 1rem; margin: 0.4rem 0 0.35rem; }
.bars > div { display: grid; gap: 0.35rem; }
.source { font-size: var(--step--1); color: var(--muted); line-height: 1.45; margin: 0; }

/* ---------- Book offer ---------- */
.book-offer { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.book-cover { display: block; width: 100%; max-width: 340px; border-radius: 4px 10px 10px 4px; box-shadow: -6px 0 0 -2px #d9d2c4 inset, 0 24px 40px -22px rgba(30, 42, 47, 0.55); transform: rotate(-2deg); }
.inset { border: 2px solid var(--ink); border-radius: 4px; padding: 1.1rem 1.3rem 0.6rem; margin: 1.5rem 0; background: var(--paper); }
.inset h4, .inset h3 { font-family: var(--sign); font-weight: 800; font-size: 1.05rem; margin: 0 0 0.6rem; }
.inset ul { margin-bottom: 0.6rem; }
.inset li { margin-bottom: 0.2rem; }
.columns-2 { columns: 2 16rem; column-gap: 2rem; }
.columns-2 li { break-inside: avoid; }

/* ---------- Forms ---------- */
.signup { display: grid; gap: 0.9rem; max-width: 34rem; }
.signup-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 0.8rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-family: var(--sign); font-weight: 700; font-size: 0.98rem; }
.field input {
  font: inherit; font-size: 1.1rem; color: var(--ink); min-height: 52px;
  padding: 0.6rem 0.8rem; border: 2px solid var(--ink); border-radius: 8px; background: var(--field-bg); width: 100%;
}
.field input:focus { border-color: var(--link); outline: 3px solid var(--yellow); outline-offset: 1px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: var(--step--1); color: var(--muted); margin: 0; line-height: 1.5; }
.form-error { color: var(--red); font-family: var(--sign); font-weight: 700; font-size: 1rem; margin: 0; }
.form-error:empty { display: none; }
.section--green .field label, .section--green .form-note { color: #fff; }
.section--green .form-note a { color: #fff; }
.section--green .btn { background: #fff; color: var(--green-deep); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--green); }
.section--green .btn:hover { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 2px var(--yellow), inset 0 0 0 4px var(--ink); }
.section--green .form-error { color: #fff; background: var(--red); padding: 0.4rem 0.7rem; border-radius: 6px; }

/* ---------- Guide route ---------- */
.route { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 5vw, 4rem); }
.route li { display: flex; gap: 1rem; align-items: flex-start; padding: 1.1rem 0; border-top: 1px solid var(--rule); margin: 0; }
.route a { font-family: var(--serif); font-weight: 700; font-size: var(--step-1); line-height: 1.25; text-decoration: none; color: var(--ink); }
.route a:hover { color: var(--link); text-decoration: underline; }
.route p { margin: 0.25rem 0 0; font-size: 1.02rem; color: var(--muted); line-height: 1.5; }

/* ---------- Town types (sign colors carry meaning) ---------- */
.town-types { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem clamp(1.5rem, 3vw, 2.5rem); }
.town-types li { margin: 0; }
.tag {
  display: inline-block; font-family: var(--sign); font-weight: 800; font-size: 1.02rem; line-height: 1.2;
  padding: 0.45rem 0.8rem; border-radius: 8px; margin-bottom: 0.6rem;
  background: var(--green); color: #fff; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 3.5px #fff;
}
.tag--brown { background: var(--brown); box-shadow: inset 0 0 0 2px var(--brown), inset 0 0 0 3.5px #fff; }
.tag--caution { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 2px var(--yellow), inset 0 0 0 3.5px var(--ink); border-radius: 4px; }
.town-types p { margin: 0; font-size: 1.05rem; line-height: 1.55; }
.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-family: var(--sign); font-weight: 600; font-size: 0.95rem; color: var(--muted); margin-top: 2rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.legend i { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; }

/* ---------- Callouts ---------- */
.callout { border-radius: 8px; padding: 1.1rem 1.3rem; margin: 1.75rem 0; }
.callout > :last-child { margin-bottom: 0; }
.callout--caution { background: var(--yellow-tint); box-shadow: inset 4px 0 0 var(--yellow); }
.callout--life { background: var(--brown-tint); box-shadow: inset 4px 0 0 var(--brown); }
.callout--guide { background: var(--green-tint); box-shadow: inset 4px 0 0 var(--green); }
.callout-title { font-family: var(--sign); font-weight: 800; font-size: 1.05rem; margin: 0 0 0.4rem; display: block; }

/* ---------- Authors ---------- */
.authors figure { margin: 0; }
.authors img { border-radius: 8px; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.authors figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; font-style: italic; }
.pullquote { font-size: var(--step-2); line-height: 1.35; margin: 0 0 1.25rem; padding-left: 1.25rem; box-shadow: inset 4px 0 0 var(--red); }
.pullquote cite { display: block; font-style: normal; font-family: var(--sign); font-weight: 700; font-size: 1rem; color: var(--muted); margin-top: 0.75rem; }

/* ---------- Article lists ---------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 1.25rem 0; border-top: 1px solid var(--rule); margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 2rem; align-items: baseline; }
.post-list a { font-weight: 700; font-size: var(--step-1); line-height: 1.3; text-decoration: none; color: var(--ink); }
.post-list a:hover { color: var(--link); text-decoration: underline; }
.post-list p { margin: 0; grid-column: 1; color: var(--muted); font-size: 1.02rem; line-height: 1.5; }
.post-list .who { grid-column: 2; grid-row: 1; font-family: var(--sign); font-weight: 600; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }

/* ---------- Page and prose ---------- */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-head .lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 48ch; margin: 0; }
.crumbs { font-family: var(--sign); font-weight: 600; font-size: 0.95rem; margin-bottom: 1.25rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.byline { font-family: var(--sign); font-weight: 600; font-size: 1rem; color: var(--muted); margin-top: 1rem; }
.hero-photo { margin: 0 0 2.5rem; }
.hero-photo img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 8px; }
.hero-photo figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.5rem; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); }
.prose h3 { font-size: var(--step-1); }
.prose blockquote { margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem; box-shadow: inset 4px 0 0 var(--red); font-size: var(--step-1); line-height: 1.5; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; font-size: 1rem; }
.prose th, .prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-family: var(--sign); font-weight: 800; border-bottom: 2px solid var(--ink); }
.prose img { border-radius: 8px; margin: 1.5rem 0; }
.archive-note { font-style: italic; color: var(--muted); }

.page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; padding-bottom: clamp(3rem, 7vw, 5rem); }
.aside-sticky { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }
.aside-box { border-radius: 10px; background: var(--wash); padding: 1.25rem 1.3rem; }
.aside-box h2, .aside-box h3 { font-family: var(--sign); font-weight: 800; font-size: 1.1rem; margin: 0 0 0.6rem; }
.aside-box ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.aside-box ol a { font-family: var(--sign); font-weight: 600; font-size: 0.98rem; text-decoration: none; color: var(--ink); display: flex; gap: 0.6rem; padding: 0.3rem 0; }
.aside-box ol a span { color: var(--muted); min-width: 1.4rem; }
.aside-box ol a[aria-current="page"] { color: var(--link); }
.aside-box ol a:hover { color: var(--link); }
.aside-box p { font-size: 1rem; line-height: 1.5; }

.checkbox-panel { border: 2px solid var(--ink); border-radius: 6px; padding: 1.25rem 1.4rem 0.5rem; margin: 2.5rem 0; }
.checkbox-panel h2 { font-family: var(--sign); font-weight: 800; font-size: 1.2rem; margin: 0 0 0.9rem; }
.checkbox-panel .checklist { font-size: 1.08rem; line-height: 1.45; }
.checkbox-panel .checklist li { align-items: flex-start; }

.next-prev { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 2.5rem; }
.next-prev a { font-family: var(--sign); font-weight: 700; text-decoration: none; display: grid; gap: 0.2rem; }
.next-prev a small { color: var(--muted); font-weight: 600; }
.next-prev .next { text-align: right; grid-column: 2; }

.end-offer { background: var(--green); color: #fff; border-radius: 12px; padding: clamp(1.5rem, 4vw, 2.25rem); margin: 3rem 0 0; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.end-offer img { width: 120px; border-radius: 3px 6px 6px 3px; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5); }
.end-offer h2 { color: #fff; font-size: var(--step-1); margin: 0 0 0.4rem; }
.end-offer p { margin: 0 0 1rem; color: #e3f1ea; font-size: 1.05rem; }
.end-offer .btn { background: #fff; color: var(--green-deep); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--green); }
.end-offer .btn:hover { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 2px var(--yellow), inset 0 0 0 4px var(--ink); }

/* ---------- Tools ---------- */
.tool { padding-bottom: clamp(3rem, 7vw, 5rem); }
.wish-table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 1rem; }
.wish-table th, .wish-table td { border-bottom: 1px solid var(--rule); padding: 0.5rem; text-align: left; vertical-align: middle; }
.wish-table th { font-family: var(--sign); font-weight: 800; }
.wish-table input[type="text"] { font: inherit; color: var(--ink); background: var(--field-bg); width: 100%; min-width: 9rem; padding: 0.45rem 0.6rem; border: 2px solid var(--rule); border-radius: 6px; }
.wish-table select { font: inherit; font-family: var(--sign); font-weight: 600; font-size: 0.95rem; padding: 0.4rem; border: 2px solid var(--rule); border-radius: 6px; background: var(--field-bg); color: var(--ink); }
.quiz-q { border: 0; padding: 0; margin: 0 0 2rem; }
.quiz-q legend { font-weight: 700; font-size: var(--step-1); margin-bottom: 0.75rem; line-height: 1.35; }
.quiz-q label { color: var(--ink); display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.7rem 0.9rem; border: 2px solid var(--rule); border-radius: 8px; margin-bottom: 0.5rem; cursor: pointer; font-size: 1.05rem; line-height: 1.45; }
.quiz-q label:hover { border-color: var(--green); }
.quiz-q input { margin-top: 0.3rem; accent-color: var(--green); width: 1.1rem; height: 1.1rem; flex: none; }
.quiz-q label:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
.result-panel { border-radius: 12px; padding: 1.5rem; background: var(--wash); margin-top: 1.5rem; }
.result-panel[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; background: var(--green-deep); color: #d8ebe2; font-family: var(--sign); font-size: 0.98rem; }
.footer-skyline { display: block; width: 100%; height: auto; color: var(--green-deep); background: var(--paper); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 2rem; }
.site-footer h2 { font-family: var(--sign); font-weight: 800; font-size: 1rem; color: #fff; margin: 0 0 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.site-footer a { color: #fff; text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.site-footer p { margin: 0 0 0.75rem; line-height: 1.55; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.18); }
.footer-base .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; padding-top: 1.1rem; padding-bottom: 1.4rem; font-size: 0.9rem; color: #b9d6c8; }

/* ---------- Town pages ---------- */
.town-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: end; padding: clamp(2rem, 5vw, 3.5rem) 0 2rem; }
.town-head h1 { font-size: var(--step-4); margin-bottom: 0.9rem; }
.town-head .lede { font-size: var(--step-1); line-height: 1.5; max-width: 54ch; margin: 0; }
.town-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0; }
.town-tags .tag { margin: 0; text-decoration: none; }
.town-tags a.tag:hover { color: #fff; text-decoration: underline; }
.town-tags a.tag--caution:hover { color: var(--ink); }
.tag--plain { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); border-radius: 4px; }

/* The city limit sign: name, population, elevation */
.townsign--town { padding-bottom: 4.5rem; max-width: 360px; justify-self: end; }
.townsign--town::after { content: ""; position: absolute; left: -8%; right: -8%; bottom: 0; height: 3px; border-radius: 2px; background: var(--rule); }
.townsign--town .townsign-face { padding: 1.4rem 1rem 1.3rem; }
.townsign--town .l2 { display: block; font-weight: 800; font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.7rem); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.townsign--town .l3, .townsign--town .l4 { display: block; font-weight: 700; font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.35rem); margin-top: 0.55rem; }
.townsign--town .l4 { margin-top: 0.15rem; }
.townsign--town .townsign-posts::before, .townsign--town .townsign-posts::after { bottom: 0; height: calc(100% - 2rem); }

.glance { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.25rem 1.5rem; background: var(--wash); border-radius: 12px; padding: 1.2rem 1.4rem; margin: 0 0 2.75rem; }
.glance dt { font-family: var(--sign); font-weight: 700; font-size: 0.9rem; color: var(--muted); line-height: 1.3; }
.glance dd { margin: 0.15rem 0 0; font-family: var(--sign); font-weight: 800; font-size: clamp(1.25rem, 1rem + 0.9vw, 1.65rem); line-height: 1.15; font-variant-numeric: tabular-nums; }
.glance dd.sub { font-weight: 600; font-size: 0.86rem; color: var(--muted); line-height: 1.35; margin-top: 0.25rem; }

.town-body { min-width: 0; }
.town-body > h2 { font-size: var(--step-3); }
.town-body h3 { font-size: var(--step-2); margin-top: 2rem; }
.town-body section > p { max-width: var(--measure); }

.bookchecks { border: 2px solid var(--ink); border-radius: 6px; padding: 1.3rem 1.4rem 1rem; margin: 0 0 2.5rem; }
.bookchecks h2 { font-family: var(--sign); font-weight: 800; font-size: 1.25rem; margin: 0 0 1.1rem; }
.bookchecks ul { list-style: none; padding: 0; margin: 0 0 1.1rem; display: grid; gap: 1rem; }
.bookchecks li { display: flex; align-items: flex-start; gap: 0.9rem; margin: 0; }
.bookchecks .check { width: 2rem; height: 2rem; }
.bookchecks b { display: block; font-family: var(--sign); font-weight: 800; font-size: 1.08rem; line-height: 1.3; }
.bookchecks span { display: block; font-size: 1.04rem; line-height: 1.5; }
.bookchecks .q { font-family: var(--sign); font-weight: 800; font-size: 20px; fill: var(--muted); }

.facts { margin: 0 0 0.9rem; }
.facts > div { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0.25rem 1.5rem; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 1.02rem; line-height: 1.4; }
.facts dd { margin: 0; font-family: var(--sign); font-weight: 800; font-size: 1.1rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.facts dd small { display: block; font-weight: 600; font-size: 0.86rem; color: var(--muted); margin-top: 0.1rem; }
.town-body .source { margin: 0.6rem 0 0; max-width: var(--measure); }

/* Highway guide sign for distances */
.guide-sign { background: var(--green); color: #fff; font-family: var(--sign); border-radius: 12px; padding: 0.9rem 1.4rem; max-width: 36rem; margin: 0.6rem 0 1rem; box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 7px #fff, 0 14px 24px -18px rgba(10, 79, 56, 0.7); }
.guide-sign > div { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 0.5rem 0.2rem; }
.guide-sign span { font-weight: 700; font-size: 1.2rem; line-height: 1.2; }
.guide-sign small { display: block; font-weight: 600; font-size: 0.85rem; color: #d8ebe2; margin-top: 0.1rem; }
.guide-sign b { font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }

.nearby { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.nearby li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.nearby a { font-family: var(--sign); font-weight: 700; }
.nearby span { color: var(--muted); font-size: 0.92rem; text-align: right; }
.nearby--parks { grid-template-columns: minmax(0, 1fr); max-width: 40rem; }
.nearby .name { color: var(--ink); font-size: 1.02rem; text-align: left; }
.nearby .name small { color: var(--muted); font-size: 0.85rem; }
.local-note { margin: 0 0 1.75rem; }
.local-note blockquote { margin: 0; padding: 0.25rem 0 0.25rem 1.25rem; box-shadow: inset 4px 0 0 var(--red); font-size: var(--step-1); line-height: 1.5; }
.local-note blockquote p { margin: 0; }
.local-note figcaption { font-family: var(--sign); font-weight: 700; font-size: 1rem; color: var(--muted); margin: 0.6rem 0 0 1.25rem; }
.sources { font-size: var(--step--1); line-height: 1.5; color: var(--muted); padding-left: 1.3rem; }
.sources li { margin-bottom: 0.25rem; }

/* Small city limit signs on the home page */
.sign-row { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.25rem; }
.sign-row li { margin: 0; text-align: center; }
.sign-row small { display: block; font-family: var(--sign); font-weight: 600; font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }
.minisign { display: block; background: var(--green); color: #fff; text-decoration: none; font-family: var(--sign); border-radius: 10px; padding: 0.9rem 0.6rem 0.8rem; box-shadow: inset 0 0 0 3px var(--green), inset 0 0 0 5.5px #fff; line-height: 1.15; }
.minisign b { display: block; font-weight: 800; font-size: 1.15rem; overflow-wrap: anywhere; }
.minisign span { display: block; font-weight: 700; font-size: 0.9rem; margin-top: 0.35rem; }
.minisign:hover { background: var(--green-deep); color: #fff; box-shadow: inset 0 0 0 3px var(--green-deep), inset 0 0 0 5.5px #fff; }

/* State pages and the town finder */
.shortlists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; margin: 0 0 3rem; }
.shortlist h3 { font-family: var(--sign); font-weight: 800; font-size: 1.15rem; margin: 0 0 0.5rem; }
.shortlist ol { list-style: none; padding: 0; margin: 0; }
.shortlist li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); margin: 0; font-size: 1rem; }
.shortlist li a { font-family: var(--sign); font-weight: 700; }
.shortlist li span { color: var(--muted); font-size: 0.9rem; text-align: right; }
.shortlist .source { margin-top: 0.5rem; }
.table-scroll { overflow-x: auto; margin: 0 0 1rem; -webkit-overflow-scrolling: touch; }
.town-table { width: 100%; border-collapse: collapse; font-size: 1rem; font-variant-numeric: tabular-nums; }
.town-table th, .town-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.town-table th:first-child { text-align: left; }
.town-table thead th { font-family: var(--sign); font-weight: 800; font-size: 0.95rem; border-bottom: 2px solid var(--ink); vertical-align: bottom; white-space: normal; line-height: 1.25; }
.town-table tbody th { font-weight: 400; }
.town-table tbody th a { font-family: var(--sign); font-weight: 700; }
.town-table thead button { all: unset; cursor: pointer; display: inline-flex; gap: 0.3rem; align-items: center; }
.town-table thead button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 3px; }
.town-table th[aria-sort="ascending"] button::after { content: "\25B2"; font-size: 0.65em; }
.town-table th[aria-sort="descending"] button::after { content: "\25BC"; font-size: 0.65em; }

.finder { background: var(--wash); border-radius: 12px; padding: 1.25rem 1.4rem; margin: 0 0 1.25rem; }
.finder[hidden] { display: none; }
.finder-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem 1.2rem; }
.finder label { display: grid; gap: 0.3rem; font-family: var(--sign); font-weight: 700; font-size: 0.95rem; }
.finder select { font: inherit; font-weight: 600; padding: 0.55rem 0.6rem; border-radius: 8px; border: 2px solid var(--rule); background: var(--field-bg); color: var(--field-text); min-height: 44px; }
.finder-types { border: 0; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.finder-types legend { font-family: var(--sign); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.35rem; padding: 0; }
.finder-types label { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 600; }
.finder-types input { width: 1.1rem; height: 1.1rem; accent-color: var(--green); }
.finder-count { font-family: var(--sign); font-weight: 700; margin: 0 0 0.5rem; }
.finder-results { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.finder-results li { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 0.2rem 1rem; align-items: baseline; padding: 0.65rem 0; border-bottom: 1px solid var(--rule); margin: 0; font-size: 0.98rem; }
.finder-results a { font-family: var(--sign); font-weight: 700; font-size: 1.05rem; }
.finder-results span { color: var(--muted); font-variant-numeric: tabular-nums; }
.finder-results span b { color: var(--ink); font-family: var(--sign); font-weight: 700; }
.state-list ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 2rem; }
.state-list li { display: flex; justify-content: space-between; align-items: baseline; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.state-list a { font-family: var(--sign); font-weight: 700; font-size: 1.1rem; }
.state-list span { color: var(--muted); font-size: 0.92rem; }

@media (max-width: 960px) {
  .sign-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glance { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shortlists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .town-head { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; padding-top: 1.5rem; }
  .townsign--town { order: -1; justify-self: center; max-width: 300px; padding-bottom: 3.5rem; margin-bottom: 0.5rem; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 1rem 1.1rem; }
  .facts > div { grid-template-columns: minmax(0, 1fr); }
  .nearby, .shortlists { grid-template-columns: minmax(0, 1fr); }
  .sign-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finder-results li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .finder-results li a { grid-column: 1 / -1; }
  .guide-sign { padding: 0.8rem 1rem; }
  .guide-sign span { font-size: 1.05rem; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .town-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-layout { grid-template-columns: minmax(0, 1fr); }
  .aside-sticky { position: static; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .hero .wrap, .two-col, .split, .book-offer { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { gap: 0.5rem; }
  .townsign { order: -1; max-width: 340px; padding-bottom: 5.5rem; margin-bottom: 1rem; }
  .hero--photo .hero-bg { bottom: auto; height: 22rem; }
  .hero--photo::before { bottom: auto; height: 22rem; background: linear-gradient(180deg, transparent 0%, transparent 50%, var(--paper) 100%); }
  .hero--photo .townsign { margin-top: -0.5rem; padding-bottom: 5rem; }
  .route { grid-template-columns: minmax(0, 1fr); }
  .signup-row { grid-template-columns: minmax(0, 1fr); }
  .book-cover { max-width: 230px; margin: 0 auto; }
  .bar { grid-template-columns: 7rem minmax(0, 1fr) 3rem; font-size: 0.88rem; }
  .post-list li { grid-template-columns: minmax(0, 1fr); }
  .post-list .who { grid-column: 1; grid-row: auto; }
  .end-offer { grid-template-columns: minmax(0, 1fr); }
  .end-offer img { display: none; }
}
@media (max-width: 520px) {
  .brand { gap: 0.5rem; }
  .brand svg { width: 38px; height: 38px; }
  .brand span { font-size: 1.12rem; white-space: nowrap; }
  .header-tools { gap: 0.25rem; }
  .town-types { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .next-prev { grid-template-columns: minmax(0, 1fr); }
  .next-prev .next { grid-column: 1; text-align: left; }
}

/* ---------- The one orchestrated moment: checks draw in on load ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .check .tick { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.45s ease-out forwards; }
  .hero .checklist li:nth-child(1) .tick { animation-delay: 0.35s; }
  .hero .checklist li:nth-child(2) .tick { animation-delay: 0.65s; }
  .hero .checklist li:nth-child(3) .tick { animation-delay: 0.95s; }
  .hero .checklist li:nth-child(4) .tick { animation-delay: 1.25s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

@media print {
  .site-header, .site-footer, .footer-skyline, .end-offer, .aside-sticky, .no-print { display: none !important; }
  body { font-size: 12pt; }
  a { color: inherit; }
}
