/* Jack’s Junk Hauling — v3. Tokens and rules from design-direction.md §3 and §7; copy from site-copy-v3.md. */

/* Archivo (OFL), self-hosted latin variable font (wdth 62–125, wght 100–900). */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

/* Fallbacks sized to Archivo's widths, so line breaks hold when the web font swaps in (no CLS).
   Arial, or its metric twins Liberation Sans / Arimo. Body: wdth 100. Narrow: the wdth 78 headings and prices.
   size-adjust values are estimates from published metrics; confirm CLS = 0 in the Lighthouse gate. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");
  font-weight: 100 549;
  size-adjust: 106%;
}
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold");
  font-weight: 550 900;
  size-adjust: 106%;
}
@font-face {
  font-family: "Archivo Narrow Fallback";
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold");
  font-weight: 100 900;
  size-adjust: 88%;
}

:root {
  --limestone: #F4F0E8;
  --paper: #FFFFFF;
  --ink: #1F2A2E;
  --rust: #B5462B;
  --rust-dark: #8F3620;
  --cedar: #3D5A47;
  --line: #D9D2C5;

  --font: Archivo, "Archivo Fallback", "Helvetica Neue", Arial, sans-serif;
  --font-narrow: Archivo, "Archivo Narrow Fallback", "Helvetica Neue", Arial, sans-serif;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 72px;
  --s9: 112px;

  --max: 1120px;
  --gutter: 20px;
  --radius: 6px;
}

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

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

body {
  margin: 0;
  background: var(--limestone);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
}

h1, h2, h3 {
  margin: 0 0 var(--s4);
  font-family: var(--font-narrow);
  font-stretch: 78%;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; font-weight: 750; }

p { margin: 0 0 var(--s4); max-width: 68ch; }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.2em; }
li { max-width: 68ch; }
li::marker { color: var(--cedar); }

a { color: var(--cedar); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

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

.skip {
  position: absolute; left: var(--s4); top: -80px; z-index: 10;
  padding: var(--s3) var(--s4); background: var(--paper); color: var(--ink); font-weight: 700;
}
.skip:focus { top: var(--s2); }

/* Buttons: rust is for the one action only. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 var(--s5);
  border: 0; border-radius: var(--radius);
  background: var(--rust); color: #FFFFFF;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover, .btn:active { background: var(--rust-dark); color: #FFFFFF; }
.btn-block { display: flex; width: 100%; }

/* Header */
.site-header {
  max-width: var(--max); margin: 0 auto; padding: var(--s2) var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
}
.brand { display: block; color: var(--ink); line-height: 0; }
/* 55 px keeps the kerned 129-unit wordmark at 120 px wide; overflow shows the 1-unit overshoot on C, S. */
.logo { display: block; width: auto; height: 55px; overflow: visible; }
.site-nav { display: flex; align-items: center; gap: var(--s5); }
.nav-link { display: inline-block; padding: var(--s3) var(--s1); color: var(--ink); font-weight: 600; }
.btn-header { display: none; }

/* Page body */
main { display: block; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
main > section { padding: var(--s7) 0; border-top: 1px solid var(--line); }

/* Hero */
.home > .hero { border-top: 0; padding: var(--s5) 0 var(--s6); }
.lede { font-size: 20px; }
.hero-cta { margin-top: var(--s5); }
.reassure { margin-top: var(--s3); color: var(--cedar); font-size: 16px; }
.mini-gauge { display: none; }
.mini-gauge text { font-family: var(--font); font-size: 14px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.mg-cab { fill: var(--ink); }
.mg-bg { fill: var(--paper); }
.mg-bed { fill: none; stroke: var(--ink); stroke-width: 3; }
.mg-tick { stroke: var(--ink); stroke-width: 2; }

/* Prices: the load gauge */
.loads { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: var(--s4); }
.load {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s4); align-items: start;
  max-width: none; padding: var(--s4); background: var(--paper); border: 1px solid var(--line);
}
.load h3 { margin-bottom: var(--s1); }
.load-size { margin: 0; }
.load-price {
  margin: var(--s2) 0; font-size: 32px; font-family: var(--font-narrow); font-stretch: 78%; font-weight: 800; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.load-eg { margin: 0; font-size: 16px; }

.gauge { display: block; width: 120px; height: auto; }
.g-cab { fill: var(--ink); }
.g-bg { fill: var(--paper); }
.g-bed { fill: none; stroke: var(--ink); stroke-width: 2; }
.g-fill {
  fill: var(--rust);
  transform-box: fill-box; transform-origin: left center;
  transition: transform 0.7s ease-out;
}
.g-tick { stroke: var(--line); stroke-width: 1.5; }
.gauge.is-waiting .g-fill { transform: scaleX(0); }

.price-note { font-weight: 600; }
.price-notes h3 { margin-top: var(--s5); }

/* How it works: numbered timeline, tags shaped like the tailgate mark */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding: 0 0 var(--s5) 56px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: -4px;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius);
  background: var(--limestone); font-weight: 800;
}
.steps li::after {
  content: ""; position: absolute; left: 17px; top: 36px; bottom: 0;
  border-left: 2px solid var(--line);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }

/* What we take */
.take-grid { display: grid; gap: var(--s5); }
.take-grid h2 { font-size: 24px; }

/* Where we work */
.cities { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-weight: 700; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { padding: var(--s4) 0; font-weight: 700; cursor: pointer; }
.faq details p { margin: 0 0 var(--s4); }

/* Quote form */
.quote-form { padding: var(--s5) var(--gutter); background: var(--paper); border: 1px solid var(--line); }
.field { margin-bottom: var(--s5); }
.field > label, .legend { display: block; margin-bottom: var(--s1); font-weight: 700; }
.hint { margin: 0 0 var(--s2); font-size: 15px; }
.field input[type="text"], .field textarea, .field input[type="file"] {
  display: block; width: 100%; min-height: 48px; padding: var(--s3);
  border: 1px solid var(--line); border-bottom: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font: inherit;
}
.field textarea { resize: vertical; }
.field-error { margin: var(--s1) 0 0; color: var(--rust-dark); font-size: 15px; font-weight: 600; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--rust-dark) !important; }
fieldset { margin: 0 0 var(--s5); padding: 0; border: 0; }
.choice { display: flex; align-items: center; gap: var(--s3); min-height: 48px; }
.choice input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--rust); }
.consent { align-items: flex-start; padding-top: var(--s3); }
.consent input { margin-top: 2px; }
.next { margin: var(--s3) 0 0; font-size: 15px; }

/* Sticky quote bar (mobile only). Without JavaScript it simply stays. */
.quote-bar {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 calc(var(--gutter) * -1); padding: var(--s3) var(--gutter);
  background: var(--limestone); border-top: 1px solid var(--line);
  transition: transform 0.2s ease-out, visibility 0.2s;
}
.quote-bar.is-hidden { transform: translateY(100%); visibility: hidden; }

/* Footer */
.site-footer { margin-top: var(--s7); padding: var(--s7) var(--gutter); background: var(--ink); color: var(--limestone); }
.site-footer .inner { max-width: var(--max); margin: 0 auto; }
.site-footer a { color: var(--limestone); }
.site-footer :focus-visible { outline-color: var(--limestone); }
.footer-logo { display: block; width: 129px; height: 59px; overflow: visible; margin-bottom: var(--s5); color: var(--limestone); }
.footer-links { margin: 0; }

/* Simple pages: thanks, privacy, SMS terms, 404 */
.page { max-width: calc(68ch + var(--gutter) * 2); }
.page > section { border-top: 0; }
.page h2 { font-size: 24px; margin-top: var(--s6); }
.updated { font-size: 15px; }

@media (min-width: 640px) {
  .loads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .take-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  :root { --gutter: 32px; }
  h1 { font-size: 64px; }
  h2 { font-size: 40px; }
  h3 { font-size: 24px; }

  .btn-header { display: inline-flex; }

  /* Desktop hero: headline and mini gauge left, the form's first step right. */
  .home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); column-gap: var(--s8); }
  .home > * { grid-column: 1 / -1; }
  .home > .hero { grid-column: 1; grid-row: 1; padding-top: var(--s8); }
  .home > .quote { grid-column: 2; grid-row: 1; align-self: start; border-top: 0; padding-top: var(--s7); }
  .home > .quote h2 { font-size: 32px; }
  .hero-cta { display: none; }
  .mini-gauge { display: block; max-width: 480px; margin: var(--s6) 0 0; }

  main > section { padding: var(--s8) 0; }
  .loads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .load { grid-template-columns: minmax(0, 1fr); }
  .gauge { width: 160px; }
  .price-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7); }

  .steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s5); }
  .steps li { padding: 56px 0 0; }
  .steps li::before { top: 0; }
  .steps li::after { left: 44px; right: var(--s2); top: 17px; bottom: auto; border-left: 0; border-top: 2px solid var(--line); }
  .steps li:last-child { padding-bottom: 0; }

  .quote-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .g-fill, .quote-bar { transition: none; }
}
