/* ==========================================================================
   The Yard Index — a scoreboard printed on white vinyl.
   Spec: docs/yard-index-redesign.md. One bold element per row: the rank numeral.
   Everything else is quiet, white, and legible in Florida sun on a phone.
   ========================================================================== */

:root {
  --paper:     #FFFFFF;
  --concrete:  #ECEBE6;
  --ink:       #1B1F1D;
  --turf:      #2E6B3F;
  --turf-deep: #1E4A2B;
  --marigold:  #F2B134;
  --sky:       #3E8ED0;
  --clay:      #B8402F;

  --ink-70: rgb(27 31 29 / .70);
  --ink-55: rgb(27 31 29 / .55);
  --rule:   #DCDAD3;

  --font-display: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-text: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  --fs-1: 3.5rem;
  --fs-2: 2.5rem;
  --fs-3: 1.75rem;
  --fs-4: 1.25rem;
  --fs-5: 1rem;
  --fs-6: 0.875rem;

  --measure: 760px;
  --measure-wide: 920px;
  --gutter: 1.25rem;
  --section: 4rem;
  --radius: 6px;
}

@media (max-width: 40rem) {
  :root { --fs-1: 2.5rem; --fs-2: 1.75rem; --fs-3: 1.5rem; --section: 2.5rem; --gutter: 1rem; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-5);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: var(--fs-1); }
h2 { font-size: var(--fs-2); }
h3 { font-size: var(--fs-4); font-weight: 600; line-height: 1.2; }

p { margin: 0 0 1rem; max-width: 68ch; }

a { color: var(--turf); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--turf-deep); }

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

img, svg { max-width: 100%; height: auto; display: block; }
table { border-collapse: collapse; width: 100%; }

.num { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--turf); color: var(--paper); padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }

/* ---- layout ------------------------------------------------------------ */

.wrap { width: min(100% - (2 * var(--gutter)), var(--measure)); margin-inline: auto; }
.wrap--wide { width: min(100% - (2 * var(--gutter)), var(--measure-wide)); margin-inline: auto; }

.section { padding-block: 0 var(--section); }
.section--fill { background: var(--concrete); padding-block: var(--section); margin-bottom: var(--section); }
.section > h2, .section > .wrap > h2 { margin-bottom: 1rem; }

.lede { font-size: var(--fs-4); line-height: 1.45; }
.small { font-size: var(--fs-6); color: var(--ink-70); }
.subtle { color: var(--ink-70); }

/* ---- buttons ----------------------------------------------------------- */

.btn {
  display: inline-block; border-radius: var(--radius); border: 2px solid transparent;
  padding: .7rem 1.4rem; min-height: 48px; line-height: 1.9;
  font-family: var(--font-text); font-size: var(--fs-5); font-weight: 600;
  text-decoration: none; cursor: pointer;
  background: var(--marigold); color: var(--ink);
}
.btn:hover { background: #E5A526; color: var(--ink); }
.btn--secondary { background: transparent; color: var(--turf); border-color: var(--turf); }
.btn--secondary:hover { background: var(--turf); color: var(--paper); }
.btn--small { min-height: 40px; padding: .4rem 1rem; font-size: var(--fs-6); line-height: 1.8; }

/* ---- header and footer ------------------------------------------------- */

.masthead { background: var(--turf); color: var(--paper); }
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .9rem; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  color: var(--paper); text-decoration: none; letter-spacing: .01em;
}
.wordmark:hover { color: var(--paper); }
.nav { display: flex; gap: 1.5rem; font-size: var(--fs-6); font-weight: 500; }
.nav a { color: var(--paper); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--marigold); }
.masthead :focus-visible { outline-color: var(--marigold); }

.crumbs { padding-block: 1.25rem .75rem; font-size: var(--fs-6); color: var(--ink-70); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--ink-55); }

.site-foot {
  border-top: 1px solid var(--rule); background: var(--paper);
  padding-block: 2.5rem 3rem; font-size: var(--fs-6); color: var(--ink-70);
}
.site-foot p { max-width: 72ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0 0 1.25rem; padding: 0; list-style: none; }
.foot-cities { margin-bottom: 1.75rem; }
.foot-cities h2 { font-family: var(--font-text); font-size: var(--fs-6); font-weight: 600; margin-bottom: .6rem; color: var(--ink); }
.foot-cities ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.foot-cities li[aria-current] { color: var(--ink-55); }

/* ---- city page head ---------------------------------------------------- */

.page-head { padding-bottom: 2rem; }
.page-head h1 { margin-bottom: .35rem; }
.page-head__sub { font-size: var(--fs-4); color: var(--ink-70); margin-bottom: 1.25rem; }
.page-head p { max-width: 68ch; }

.stat-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding-block: 1.25rem; margin-bottom: var(--section);
}
.stat-strip div { display: block; }
.stat-strip dt { order: 2; font-size: var(--fs-6); color: var(--ink-70); display: block; margin-top: .15rem; }
.stat-strip dd {
  order: 1; margin: 0; display: block;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-3);
  line-height: 1; font-variant-numeric: tabular-nums;
}

/* ---- the list ---------------------------------------------------------- */

.list-label {
  max-width: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: var(--fs-6); color: var(--ink-70); padding-bottom: .6rem;
  border-bottom: 2px solid var(--ink); margin-bottom: 0;
}

.rows { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--concrete);
}

.row__rank {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2);
  line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink);
  grid-row: 1 / span 2;
}

.row__main { min-width: 0; }
.row__name {
  font-family: var(--font-text); font-size: var(--fs-4); font-weight: 600;
  line-height: 1.3; margin: 0 0 .3rem; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap;
}
.row__name a { color: var(--ink); text-decoration: none; }
.row__name a:hover { color: var(--turf); text-decoration: underline; }

.row__signal { max-width: none; margin: 0 0 .3rem; font-variant-numeric: tabular-nums; }
.row__strength { margin: 0 0 .3rem; color: var(--turf-deep); font-weight: 500; }
.row__contact { max-width: none; margin: 0; font-size: var(--fs-6); color: var(--ink-70); }
.row__contact a { color: var(--turf); text-decoration: none; }
.row__contact a:hover { text-decoration: underline; }
.row__claim { margin: .5rem 0 0; font-size: var(--fs-6); }
.row__claim a { font-weight: 500; }

.row__score { grid-column: 2; max-width: none; margin: .6rem 0 0; }
.score-value {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.score-label { font-size: var(--fs-6); color: var(--ink-70); margin-right: .35rem; }
.score-bar { display: block; height: 4px; background: var(--concrete); margin-top: .35rem; max-width: 8rem; }
.score-bar span { display: block; height: 100%; background: var(--turf); }

.verified {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: var(--fs-6); font-weight: 600; color: var(--turf);
}

@media (min-width: 44rem) {
  .row { grid-template-columns: 3rem 1fr 7rem; column-gap: 1.5rem; }
  .row__score { grid-column: 3; grid-row: 1 / span 2; margin: 0; text-align: right; }
  .score-label { display: none; }
  .score-bar { margin-left: auto; }
}

/* ---- forms ------------------------------------------------------------- */

.form { display: grid; gap: 1.1rem; max-width: 34rem; }
.form-panel { background: var(--concrete); padding: 2rem var(--gutter); margin-bottom: var(--section); }
.form-panel .form { background: none; }
.form-panel h2 { margin-bottom: .5rem; }

/* .field is display:grid, which would beat the UA rule for [hidden]. */
[hidden] { display: none !important; }

.field { display: grid; gap: .3rem; }
.field label { font-size: var(--fs-6); font-weight: 600; }
.field .hint { font-weight: 400; color: var(--ink-70); }
.field__hint { font-size: var(--fs-6); color: var(--ink-70); margin: 0; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font-family: var(--font-text); font-size: max(16px, 1rem); line-height: 1.4;
  min-height: 48px; padding: .65rem .8rem; width: 100%;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--ink-55); border-radius: var(--radius);
}
textarea { min-height: 5rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; border-color: var(--sky); }
[aria-invalid="true"] { border-color: var(--clay); border-width: 2px; }

.field--check label {
  display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start;
  font-weight: 400; font-size: var(--fs-6); line-height: 1.5;
}
.field--check input { width: 1.15rem; height: 1.15rem; min-height: 0; margin-top: .2rem; accent-color: var(--turf); }

.form button[type="submit"] { justify-self: start; }
.form button[aria-busy="true"] { opacity: .7; cursor: progress; }

.error { color: var(--clay); font-size: var(--fs-6); font-weight: 500; margin: 0; }
.error[hidden] { display: none; }
.form-note { font-size: var(--fs-6); color: var(--ink-70); margin: 0; max-width: 52ch; }
.form-status { font-size: var(--fs-6); color: var(--clay); font-weight: 500; margin: 0; }
.form-success { border-left: 4px solid var(--turf); padding: 1rem 0 1rem 1.25rem; }
.form-success h2 { font-size: var(--fs-3); margin-bottom: .5rem; }
.form-success p { margin-bottom: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- movement, bands, disclosure --------------------------------------- */

.movement { display: grid; gap: 1.5rem; margin-bottom: 1rem; }
.movement h3 { font-family: var(--font-text); font-size: var(--fs-6); font-weight: 600; margin-bottom: .5rem; }
.movement ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.movement li { font-size: var(--fs-6); font-variant-numeric: tabular-nums; }
.movement .move { font-weight: 600; }
.move--up { color: var(--sky); }
.move--down { color: var(--clay); }
.move--new { color: var(--turf); }

@media (min-width: 44rem) { .movement { grid-template-columns: repeat(3, 1fr); } }

.band { background: var(--concrete); padding: 2rem var(--gutter); margin-bottom: var(--section); }
.band h2 { margin-bottom: .6rem; }
.band p { margin-bottom: 1rem; }
.band .btn { margin-right: 1rem; }
.band__actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; }

.how { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: var(--section); }
.how > summary {
  cursor: pointer; padding: 1.1rem 0; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-3);
  display: flex; align-items: center; gap: .6rem;
}
.how > summary::-webkit-details-marker { display: none; }
.how > summary::before { content: "\25B8"; color: var(--turf); font-size: .8em; }
.how[open] > summary::before { content: "\25BE"; }
.how__body { padding-bottom: 1.5rem; }

.weights { font-size: var(--fs-6); margin: 1.25rem 0; }
.weights th, .weights td { text-align: left; padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--concrete); vertical-align: top; }
.weights thead th { font-weight: 600; border-bottom: 1px solid var(--ink); }
.weights .num { text-align: right; white-space: nowrap; font-weight: 600; }
.weights td .subtle { display: block; font-weight: 400; }

.disclosure { border-left: 4px solid var(--turf); padding: .25rem 0 .25rem 1.25rem; margin-bottom: var(--section); }
.disclosure h2 { font-size: var(--fs-3); margin-bottom: .5rem; }
.disclosure p { font-size: var(--fs-6); color: var(--ink-70); margin: 0; }

.other-lists { margin-bottom: var(--section); }
.other-lists h2 { font-size: var(--fs-3); }
.other-lists ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: var(--fs-6); }
.other-lists li[aria-current] { color: var(--ink-55); }

/* ---- home -------------------------------------------------------------- */

.page-hero { margin: 1.75rem 0 0; }
.page-hero img {
  width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: center 62%;
  border: 1px solid var(--rule);
}

.city-list { list-style: none; margin: 0 0 var(--section); padding: 0; border-top: 1px solid var(--ink); }
.city-list li { border-bottom: 1px solid var(--concrete); }
.city-list a {
  display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: baseline;
  padding: 1rem 0; text-decoration: none; color: var(--ink);
}
.city-list a:hover .city-list__name { color: var(--turf); text-decoration: underline; }
.city-list__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-3); line-height: 1; }
.city-list__meta { font-size: var(--fs-6); color: var(--ink-70); text-align: right; font-variant-numeric: tabular-nums; }
.city-list__leader { grid-column: 1 / -1; font-size: var(--fs-6); color: var(--ink-70); }

.factor-table { font-size: var(--fs-5); margin-bottom: 1.5rem; }
.factor-table th, .factor-table td { text-align: left; padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--concrete); vertical-align: top; }
.factor-table thead th { font-size: var(--fs-6); font-weight: 600; border-bottom: 1px solid var(--ink); }
.factor-table .num { text-align: right; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.factor-table th .subtle { display: block; font-weight: 400; font-size: var(--fs-6); margin-top: .15rem; }

.points { display: grid; gap: 1.5rem; margin-bottom: var(--section); }
.points h3 { margin-bottom: .3rem; }
.points p { margin: 0; }
@media (min-width: 44rem) { .points { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

/* ---- score page -------------------------------------------------------- */

.score-head { background: var(--turf); color: var(--paper); padding-block: 2rem; margin-bottom: var(--section); }
.score-head h1 { color: var(--paper); margin-bottom: .35rem; font-size: var(--fs-2); }
.score-head p { color: var(--paper); margin-bottom: 0; }
.score-head .subtle { color: rgb(255 255 255 / .78); }
.score-head a { color: var(--paper); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-block: 1.5rem; margin-bottom: var(--section); }
.compare__label { font-size: var(--fs-6); color: var(--ink-70); margin: 0 0 .3rem; }
.compare__value {
  max-width: none; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-1); line-height: 1; margin: 0 0 .3rem; font-variant-numeric: tabular-nums; }
.compare__sub { font-size: var(--fs-6); color: var(--ink-70); margin: 0; }

.factors { display: grid; gap: 1.75rem; margin-bottom: var(--section); }
.factor { border-top: 1px solid var(--concrete); padding-top: 1rem; }
.factor__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.factor__label { font-family: var(--font-text); font-size: var(--fs-5); font-weight: 600; margin-bottom: .75rem; }
.factor__weight { font-size: var(--fs-6); color: var(--ink-70); }
.bars { display: grid; gap: .4rem; margin-bottom: .7rem; }
.bar { display: grid; grid-template-columns: 3.5rem 1fr auto; align-items: center; gap: .75rem; font-size: var(--fs-6); }
.bar__who { color: var(--ink-70); }
.bar__track { display: block; height: 12px; background: var(--concrete); }
.bar__fill { display: block; height: 100%; }
.bar__value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar--you .bar__fill { background: var(--turf); }
.bar--you .bar__who { color: var(--ink); font-weight: 600; }
.bar--leader .bar__fill { background: repeating-linear-gradient(135deg, var(--ink-55) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1px var(--ink-55); }
.bar--median .bar__fill { background: var(--rule); }
.factor__note { font-size: var(--fs-6); color: var(--ink-70); margin: 0; }

.moves { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 1.25rem; }
.moves li { border-left: 4px solid var(--marigold); padding-left: 1.25rem; }
.moves h3 { margin-bottom: .3rem; }
.moves .pts { font-size: var(--fs-6); font-weight: 600; color: var(--turf-deep); }
.moves p { margin-bottom: .25rem; }

.badge-block { display: grid; gap: 1.5rem; margin-bottom: var(--section); }
.badge-block img { border: 1px solid var(--rule); max-width: 20rem; }
.embed pre {
  background: var(--concrete); padding: 1rem; overflow-x: auto; white-space: pre-wrap;
  word-break: break-all; font-size: var(--fs-6); margin: 0 0 .75rem;
}
.copy-status { font-size: var(--fs-6); color: var(--turf); margin-left: .75rem; }

@media (min-width: 44rem) { .badge-block { grid-template-columns: 20rem 1fr; gap: 2rem; align-items: start; } }

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

.prose h2 { font-size: var(--fs-3); margin-top: 2.25rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.2em; max-width: 68ch; }
.prose li { margin-bottom: .4rem; }
.prose code { background: var(--concrete); padding: .1rem .3rem; }
.prose .portrait-figure { margin: 0 0 1.75rem; max-width: 15rem; }
.prose .portrait-figure img { border: 1px solid var(--rule); }
.prose .portrait-figure figcaption { font-size: var(--fs-6); color: var(--ink-70); margin-top: .5rem; }
.plain-links { list-style: none; padding: 0; }
.plain-links li { margin-bottom: .4rem; }
.changelog { display: grid; gap: .6rem; margin-bottom: 1rem; }
.changelog div { display: grid; grid-template-columns: 6rem 1fr; gap: .75rem; }
.changelog dt { font-weight: 600; font-variant-numeric: tabular-nums; }
.changelog dd { margin: 0; }

@media (min-width: 40rem) { .prose .portrait-figure { float: right; margin: .3rem 0 1.25rem 2rem; } }

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

@media print {
  .masthead, .site-foot, .band, .form-panel, .skip-link { display: none; }
  body { color: #000; }
  .row { break-inside: avoid; }
}
