/* ============================================
   Top Ranked USA — site styles
   Brand: Heritage Navy / Barn Red / Aged Cream
   ============================================ */

:root {
  /* Brand palette */
  --navy: #14294a;
  --navy-deep: #0e1d36;
  --red: #b8262c;
  --red-deep: #7a1418;
  --cream: #f5ebd1;
  --cream-2: #e8d9b0;
  --gold: #c9a24b;
  --gold-border: #c9b77a;
  --ink: #2a2416;
  --denim: #6e8ca8;
  --muted: #7a6a45;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  --text-hero: clamp(2.5rem, 1.5rem + 4.6vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --measure: 62ch;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(20, 41, 74, 0.08), 0 8px 24px rgba(20, 41, 74, 0.07);

  --font-display: "Bespoke Slab", "Zodiak", Georgia, "Times New Roman", serif;
  --font-body: "Satoshi", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 700;
}

p {
  margin: 0 0 var(--space-4);
  max-width: var(--measure);
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.wrap-narrow {
  width: 100%;
  max-width: 780px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ---------- Shared bits ---------- */

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red);
  margin: 0 0 var(--space-3);
}

.eyebrow-light {
  color: var(--gold);
}

.stripe-rule {
  height: 4px;
  border: 0;
  margin: 0;
  background: repeating-linear-gradient(
    to right,
    var(--red) 0 28px,
    var(--cream-2) 28px 56px
  );
}

.stripe-rule--dark {
  background: repeating-linear-gradient(
    to right,
    var(--red) 0 28px,
    var(--navy-deep) 28px 56px
  );
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
}

.brandmark {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--cream);
}

.brandmark svg {
  width: 34px;
  height: 34px;
  flex: none;
}

.brandmark .bm-text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.15;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav a {
  color: var(--cream);
  font-size: var(--text-sm);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding-block: var(--space-1);
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.nav a:hover,
.nav a:focus-visible {
  border-bottom-color: var(--red);
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--gold);
}

@media (max-width: 720px) {
  .nav {
    gap: var(--space-4);
  }
  .nav a.nav-hide-sm {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--red);
  color: var(--cream);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--red-deep);
}

.btn-ghost {
  border-color: var(--cream-2);
  color: var(--cream);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(245, 235, 209, 0.1);
}

.btn-outline {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--navy);
  color: var(--cream);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--navy);
  color: var(--cream);
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--space-16), 9vw, var(--space-24));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: min(320px, 26vw);
  background: repeating-linear-gradient(
    to bottom,
    rgba(184, 38, 44, 0.85) 0 20px,
    rgba(245, 235, 209, 0.9) 20px 40px
  );
  opacity: 0.16;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 45%, #000 88%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--cream);
  font-size: var(--text-hero);
  margin-bottom: var(--space-5);
  letter-spacing: -0.02em;
}

.hero .lede {
  font-size: var(--text-lg);
  color: var(--cream-2);
  max-width: 34ch;
  margin-bottom: var(--space-8);
}

.hero .tagline {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 var(--space-6);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero-badge {
  justify-self: center;
}

.hero-badge img {
  width: min(340px, 74vw);
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.34));
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero-badge img {
    width: min(220px, 52vw);
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(var(--space-16), 7vw, var(--space-24));
}

.section-navy {
  background: var(--navy);
  color: var(--cream-2);
}

.section-navy h2,
.section-navy h3 {
  color: var(--cream);
}

.section-cream2 {
  background: #efe3c4;
}

.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-12);
}

.section-head h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

.section-head p {
  font-size: var(--text-lg);
  color: var(--muted);
}

.section-navy .section-head p {
  color: var(--cream-2);
}

/* ---------- Editions ---------- */

.editions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
}

.edition {
  background: #fffaf0;
  border: 1px solid var(--gold-border);
  border-top: 5px solid var(--red);
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.edition img {
  width: 132px;
  margin-bottom: var(--space-6);
}

.edition h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.edition .kicker {
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red);
  margin-bottom: var(--space-4);
}

.edition p {
  font-size: var(--text-sm);
  color: var(--ink);
  flex: 1;
}

.edition .btn {
  margin-top: var(--space-6);
  align-self: flex-start;
}

/* ---------- Stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-8);
  border-top: 1px solid rgba(245, 235, 209, 0.22);
  padding-top: var(--space-10);
}

.stat .num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold);
  line-height: 1;
  display: block;
  margin-bottom: var(--space-3);
  font-variant-numeric: tabular-nums lining-nums;
}

.stat .lbl {
  font-size: var(--text-sm);
  color: var(--cream-2);
  margin: 0;
  max-width: 30ch;
}

.stat .src {
  font-size: var(--text-xs);
  color: rgba(245, 235, 209, 0.6);
  margin: var(--space-2) 0 0;
}

.stat .src a {
  color: rgba(245, 235, 209, 0.72);
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-8);
  counter-reset: step;
}

.step {
  border-top: 3px solid var(--navy);
  padding-top: var(--space-5);
}

.step .n {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  display: block;
  margin-bottom: var(--space-3);
}

.step h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.step p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}

/* ---------- Pledge / trust ---------- */

.pledge {
  background: #fffaf0;
  border: 1px solid var(--gold-border);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-8);
}

.pledge h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.pledge ul {
  margin: 0;
  padding-left: 1.2em;
}

.pledge li {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  max-width: var(--measure);
}

.pledge li:last-child {
  margin-bottom: 0;
}

.pledge strong {
  color: var(--navy);
}

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--gold-border);
}

.timeline li {
  position: relative;
  padding: 0 0 var(--space-8) var(--space-8);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--cream);
  border: 3px solid var(--red);
  border-radius: 50%;
}

.timeline li.is-now::before {
  background: var(--red);
}

.timeline .when {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red);
  margin-bottom: var(--space-2);
}

/* Barn red fails contrast on navy — use gold on dark sections */
.section-navy .timeline .when {
  color: var(--gold);
}

.section-navy .timeline li::before {
  background: var(--navy);
  border-color: var(--gold);
}

.section-navy .timeline li.is-now::before {
  background: var(--gold);
}

.timeline h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.timeline p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}

/* ---------- Category groups ---------- */

.catgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .catgrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cat {
  background: #fffaf0;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-6);
}

.cat .cat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.cat h3 {
  font-size: var(--text-base);
}

.cat .count {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--red);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cat p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}

/* ---------- Form ---------- */

.form-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: start;
}

@media (max-width: 860px) {
  .form-shell {
    grid-template-columns: 1fr;
  }
}

.form-card {
  background: #fffaf0;
  border: 1px solid var(--gold-border);
  border-top: 5px solid var(--red);
  border-radius: var(--radius);
  padding: clamp(var(--space-6), 4vw, var(--space-10));
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.field .hint {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 400;
  display: block;
  margin-top: var(--space-1);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbbd97;
  border-radius: var(--radius);
  padding: 0.7em 0.85em;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(110, 140, 168, 0.35);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-foot {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: var(--space-4) 0 0;
}

.form-status {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  padding: var(--space-4);
  border-radius: var(--radius);
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-ok {
  background: #e8f0e4;
  border: 1px solid #7fa06a;
  color: #2f4a22;
}

.form-status.is-err {
  background: #f7e3e4;
  border: 1px solid var(--red);
  color: var(--red-deep);
}

/* Honeypot — off-screen for sighted users, invisible to screen readers,
   unreachable by keyboard, but still fillable by naive bots. */
.hp-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.form-card input.is-invalid,
.form-card select.is-invalid,
.form-card textarea.is-invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 38, 44, 0.16);
}

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ---------- Aside facts ---------- */

.facts h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-5);
}

.fact {
  border-top: 1px solid var(--gold-border);
  padding-block: var(--space-5);
}

.fact .num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--navy);
  line-height: 1;
  display: block;
  margin-bottom: var(--space-2);
  font-variant-numeric: tabular-nums lining-nums;
}

.fact p {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: 0;
}

.fact .src {
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy-deep);
  color: var(--cream-2);
  padding-block: var(--space-12);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.site-footer h4 {
  font-family: var(--font-display);
  color: var(--cream);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 var(--space-4);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: var(--space-2);
}

.site-footer a {
  color: var(--cream-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cream);
  text-decoration: underline;
}

.site-footer p {
  color: rgba(245, 235, 209, 0.66);
  font-size: var(--text-xs);
  max-width: 46ch;
}

.footer-bottom {
  border-top: 1px solid rgba(245, 235, 209, 0.18);
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  font-size: var(--text-xs);
  color: rgba(245, 235, 209, 0.6);
}

/* ---------- Utility ---------- */

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

.skip:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 100;
  background: var(--cream);
  color: var(--navy);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Photography ---------- */

.photo-strip {
  border-block: 1px solid var(--gold-border);
  background: var(--cream-2);
  padding-block: clamp(var(--space-10), 5vw, var(--space-16));
}

.photo-strip .strip-intro {
  max-width: 46ch;
  margin-bottom: var(--space-8);
}

.photo-strip .strip-intro p {
  color: var(--muted);
  margin-top: var(--space-2);
}

.photo-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.photo {
  margin: 0;
}

.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--gold-border);
  border-radius: 3px;
  box-shadow: 0 10px 26px rgba(20, 41, 74, 0.16);
}

.photo figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--muted);
  letter-spacing: 0.01em;
}

.photo figcaption strong {
  display: block;
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 2px;
}

.photo-band {
  position: relative;
  border-block: 1px solid var(--gold-border);
}

.photo-band img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 460px;
  object-fit: cover;
  display: block;
}

.photo-band figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: clamp(3rem, 9vw, 6rem) var(--space-8) var(--space-6);
  background: linear-gradient(
    to top,
    rgba(14, 29, 54, 0.94) 0%,
    rgba(14, 29, 54, 0.78) 34%,
    rgba(14, 29, 54, 0.34) 66%,
    rgba(14, 29, 54, 0) 100%
  );
  color: var(--cream);
}

.photo-band figcaption span {
  display: block;
  max-width: 46ch;
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 1rem + 0.5vw, 1.375rem);
  line-height: 1.35;
  text-wrap: balance;
}

@media (max-width: 860px) {
  .photo-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
  .photo-band img {
    aspect-ratio: 3 / 2;
    max-height: none;
  }
  .photo-band figcaption {
    position: static;
    padding: var(--space-5) var(--space-6) var(--space-6);
    background: var(--navy-deep);
  }
  .photo-band figcaption span {
    max-width: none;
    font-size: 1.0625rem;
  }
}

@media (max-width: 560px) {
  .photo-row {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

/* Three city editions no longer fit beside the brandmark on a phone.
   Drop the nav to its own full-width row instead of letting it overflow.
   Appended last so it wins over the 720px nav rule above. */
@media (max-width: 620px) {
  .site-header .bar {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .site-header .nav {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(201, 183, 122, 0.28);
  }
}
