/* Buffalo Roofing — buffaloroofingutah.com
   Utah flag palette. Slab display (Zilla Slab) for a sturdy, built feel; Public Sans for plain reading. */
:root {
  --navy: #1f2f51;
  --navy-deep: #162340;
  --red: #8c0b1d;
  --red-dark: #6f0817;
  --gold: #d4a017;
  --gray: #3a3a3a;
  --stone: #eef0f3;   /* cool light surface, not cream */
  --line: #cfd4dc;
  --white: #ffffff;
  --display: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 68rem;
  --gutter: 1.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--white);
  color: var(--gray);
  font: 400 1.0625rem/1.6 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: .18em; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); color: var(--navy); line-height: 1.1; margin: 0 0 .5em; font-weight: 700; }
h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
h3 { font-size: 1.375rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--gold); color: var(--navy); padding: .75rem 1rem; z-index: 10; font-weight: 700; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: var(--white); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1rem; min-height: 4.25rem; }
/* Main nav: its own row under the brand on phones, inline beside the button on wider screens */
.site-nav { order: 3; width: 100%; border-top: 1px solid rgba(255,255,255,.14); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; color: #e6e9f0; font-weight: 600; font-size: .95rem; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
@media (min-width: 40rem) {
  .site-nav { order: 0; width: auto; border: 0; margin-left: auto; }
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--white); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.125rem; white-space: nowrap; }
@media (min-width: 52rem) { .brand { font-size: 1.25rem; } }
.brand:hover { color: var(--white); }
.brand img { width: 44px; height: 44px; border-radius: 8px; }
.header-cta { color: var(--white); font-weight: 600; font-size: .95rem; text-decoration: none; padding: .6rem .9rem; border: 2px solid var(--gold); border-radius: 6px; min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.header-cta:hover { background: var(--gold); color: var(--navy); }

/* ---------- Hero: navy storm, roofline into white ---------- */
.hero {
  position: relative;
  background:
    repeating-linear-gradient(105deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #e6e9f0;
  padding: 2.5rem 0 6.5rem;
  overflow: hidden;
}
.hero .wrap { display: grid; gap: 2rem; align-items: center; }
.hero-mark { width: 112px; border-radius: 14px; border: 3px solid var(--gold); box-shadow: 0 0 0 6px rgba(212,160,23,.15); }
.hero h1 {
  color: var(--white);
  font-size: clamp(2.75rem, 1.6rem + 6vw, 5.25rem);
  line-height: .98;
  letter-spacing: -.01em;
  margin-bottom: .35em;
  max-width: 11ch;
}
.hero .promise { font-size: 1.1875rem; max-width: 34rem; color: #e6e9f0; }
.hero .story { font-size: 1rem; max-width: 34rem; color: #c3cad8; margin-bottom: 1.75rem; }
/* the roofline: a ridge silhouette (a roof peak among Wasatch ridges) cutting navy into white */
.ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 72px; display: block; }
@media (min-width: 52rem) {
  .hero { padding: 4.5rem 0 8.5rem; }
  .hero .wrap { grid-template-columns: auto 1fr; gap: 3.5rem; }
  .hero-mark { width: 220px; }
  .ridge { height: 110px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: .85rem 1.4rem;
  background: var(--red); color: var(--white);
  font: 700 1.0625rem/1.2 var(--body);
  border: 0; border-radius: 6px; text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.btn:hover { background: var(--red-dark); color: var(--white); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
section { padding: 3.5rem 0; }
.lede { max-width: 38rem; font-size: 1.125rem; }

/* Services: one featured (the evaluation), three plain */
.services-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
.service { border-left: 4px solid var(--navy); padding: .25rem 0 .25rem 1.1rem; }
.service p { margin: 0; }
.service.featured { border: 0; background: var(--navy); color: #e6e9f0; padding: 1.5rem; border-radius: 10px; border-top: 6px solid var(--gold); }
.service.featured h3 { color: var(--white); font-size: 1.625rem; }
.service.featured a { color: var(--gold); font-weight: 700; }
@media (min-width: 52rem) {
  .services-grid { grid-template-columns: 1.3fr 1fr; grid-template-rows: repeat(3, auto); column-gap: 2.5rem; }
  .service.featured { grid-row: 1 / span 3; padding: 2rem; }
}

/* Why us: stone band, three statements */
.why { background: var(--stone); }
.why-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
.why-list h3 { margin-bottom: .3em; }
.why-list h3::before { content: ""; display: block; width: 2.5rem; height: 4px; background: var(--red); margin-bottom: .75rem; }
.why-list p { margin: 0; max-width: 32rem; }
@media (min-width: 52rem) { .why-list { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

/* Service area */
.places { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.places li { border: 1.5px solid var(--line); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; color: var(--navy); font-size: .95rem; }
.rural { margin-top: 1.25rem; font-family: var(--display); font-size: 1.375rem; color: var(--navy); }

/* ---------- Lead form ---------- */
.lead { background: var(--navy); color: #e6e9f0; }
.lead h2 { color: var(--white); }
.lead .wrap { display: grid; gap: 2rem; }
@media (min-width: 52rem) { .lead .wrap { grid-template-columns: 1fr 1.2fr; gap: 4rem; align-items: start; } }
.lead-card { background: var(--white); color: var(--gray); border-radius: 12px; padding: 1.5rem 1.25rem; border-top: 6px solid var(--gold); }
@media (min-width: 52rem) { .lead-card { padding: 2rem; } }
.field { margin: 0 0 1rem; }
.field label { display: block; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.field .opt { font-weight: 400; color: #5b6270; }
.field input, .field textarea {
  width: 100%; font: 400 1rem/1.4 var(--body); /* 16px: no iOS zoom */
  font-size: max(16px, 1rem);
  padding: .75rem .85rem; min-height: 48px;
  border: 1.5px solid #9aa3b2; border-radius: 6px; background: var(--white); color: var(--gray);
}
.field input:focus, .field textarea:focus { border-color: var(--navy); outline: 3px solid var(--gold); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: grid; grid-template-columns: 28px 1fr; gap: .6rem; align-items: start; font-size: .9rem; line-height: 1.5; margin: 1.25rem 0 .4rem; cursor: pointer; }
.consent input { width: 24px; height: 24px; margin: 0; accent-color: var(--navy); }
.consent-links { font-size: .9rem; margin: 0 0 1.25rem 2.35rem; }
.status { min-height: 1.5em; margin: .75rem 0 0; font-weight: 600; color: var(--red); }
.thanks { font-size: 1.125rem; }
.thanks strong { font-family: var(--display); font-size: 1.5rem; color: var(--navy); display: block; margin-bottom: .4rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-deep); color: #c3cad8; padding: 2.5rem 0; font-size: .95rem; }
.site-footer a { color: var(--white); }
.site-footer .wrap { display: grid; gap: .75rem; }
.footer-line { font-family: var(--display); color: var(--gold); font-size: 1.25rem; margin: 0; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }
#license { color: #e6e9f0; }

/* ---------- Legal / simple pages ---------- */
.doc { padding: 2.5rem 0 3.5rem; }
.doc .wrap { max-width: 44rem; }
.doc h1 { font-size: clamp(2.25rem, 1.8rem + 2vw, 3rem); }
.doc h2 { font-size: 1.5rem; margin-top: 2rem; }
.doc .updated { color: #5b6270; font-size: .95rem; }
.doc .sms { background: var(--stone); border-left: 4px solid var(--gold); padding: 1rem 1.1rem; border-radius: 0 8px 8px 0; }
.lost { text-align: left; padding: 4rem 0 5rem; }
.lost h1 { font-size: clamp(2.5rem, 2rem + 3vw, 4rem); }


/* ---------- Why the buffalo (/why-the-buffalo) ----------
   One bold moment: the hero bison standing into slanted, wind-driven snow.
   Everything after it is a quiet long read: chapter title left, text right on wide screens. */
.wb-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #e6e9f0; padding: 2.5rem 0 5.5rem;
}
/* wind-driven snow: thin streaks slanting down from the right, drifting slowly (off for reduced motion) */
.wb-storm {
  position: absolute; inset: -20% -10%;
  background:
    repeating-linear-gradient(-62deg, rgba(255,255,255,.09) 0 1.5px, transparent 1.5px 23px),
    repeating-linear-gradient(-58deg, rgba(255,255,255,.05) 0 1px, transparent 1px 41px);
  animation: wb-wind 9s linear infinite;
}
@keyframes wb-wind { to { transform: translate(-46px, 82px); } }
.wb-hero .wrap { position: relative; display: grid; gap: 1.5rem; align-items: end; }
.wb-hero h1 {
  color: var(--white); font-size: clamp(3rem, 1.7rem + 7vw, 6.5rem);
  line-height: .92; letter-spacing: -.015em; margin: 0 0 .3em; max-width: 8ch;
}
.wb-answer { font-size: 1.1875rem; line-height: 1.55; max-width: 32rem; margin: 0; }
.wb-hero .ridge { bottom: -2px; }
.wb-bison { width: 100%; max-width: 30rem; justify-self: end; margin-bottom: -.5rem; }
.wb-bison-body { fill: var(--gray); stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; }
.wb-bison-horn { fill: #f4f5f7; }
.wb-bison-tuft { fill: var(--gray); }
.wb-bison-tail { fill: none; stroke: var(--gray); stroke-width: 6; stroke-linecap: round; }
.wb-bison-eye { fill: var(--navy-deep); }
@media (min-width: 52rem) {
  .wb-hero { padding: 4.5rem 0 7.5rem; }
  .wb-hero .wrap { grid-template-columns: 1fr 1.1fr; gap: 2rem; }
  .wb-bison { margin-bottom: -1.5rem; }
}

/* overlap the hero's bottom edge by 2px so no hairline shows at fractional heights */
.wb-story { position: relative; margin-top: -2px; background: var(--white); }
.wb-chapter { padding: 3rem 0; }
.wb-cols { display: grid; gap: .5rem; }
@media (min-width: 52rem) {
  .wb-chapter { padding: 4rem 0; }
  .wb-cols { grid-template-columns: 15rem 1fr; gap: 3rem; }
  .wb-cols > h2 { position: sticky; top: 1.5rem; align-self: start; }
}
.wb-body { max-width: 40rem; font-size: 1.125rem; line-height: 1.7; }
.wb-body h3 { font-size: 1.375rem; }

/* small source numbers: links down to the Sources list */
.ref {
  display: inline-block; vertical-align: super; font-size: .68em; line-height: 1;
  font-weight: 700; color: var(--red); text-decoration: none; padding: .15em .2em; margin-left: .05em;
}
.ref:hover { text-decoration: underline; }

/* the ranch saying, set big */
.wb-saying { margin: 0 0 2rem; padding: 0; }
.wb-saying blockquote { margin: 0; }
.wb-saying p {
  font-family: var(--display); color: var(--navy); margin: 0;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); line-height: 1.1;
}
.wb-saying p::before { content: "\201C"; color: var(--gold); margin-right: .05em; }
.wb-saying p::after { content: "\201D"; color: var(--gold); }
.wb-saying figcaption { margin-top: .75rem; color: #5b6270; font-size: 1rem; }

/* saying vs science box */
.wb-truth { background: var(--stone); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; padding: 1.25rem 1.25rem .5rem; margin: 1.75rem 0; font-size: 1.0625rem; }
.wb-truth h3 { font-size: 1.25rem; }
.wb-tag { display: inline-block; font-weight: 700; font-size: .85rem; padding: .1rem .55rem; border-radius: 999px; margin-right: .4rem; }
.wb-tag-true { background: var(--navy); color: var(--white); }
.wb-tag-folk { background: var(--white); color: var(--red); border: 1.5px solid var(--red); }

/* gold roofline between chapters */
.wb-divider { display: flex; justify-content: center; }
.wb-divider svg { width: 9rem; height: 1rem; overflow: visible; }
.wb-divider path { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* bison by the numbers */
.wb-stats { display: grid; gap: 0; margin: 2rem 0; border-top: 2px solid var(--navy); }
.wb-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.wb-stats dt { font-size: 1rem; color: #5b6270; }
.wb-stats dd { margin: 0; font-family: var(--display); color: var(--navy); font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1; white-space: nowrap; }
@media (min-width: 40rem) {
  .wb-stats { grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
  .wb-stats > div { flex-direction: column-reverse; justify-content: flex-end; border-bottom: 0; padding: 1rem 1rem 1rem 0; }
  .wb-stats > div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
}

.wb-pull {
  font-family: var(--display); color: var(--red); font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  line-height: 1.2; margin: 1.75rem 0; padding-left: 1rem; border-left: 4px solid var(--red);
}

/* comeback timeline: a real sequence in time */
.wb-timeline { list-style: none; margin: 2rem 0; padding: 0; border-left: 3px solid var(--gold); }
.wb-timeline li { position: relative; padding: 0 0 1.75rem 1.5rem; display: grid; gap: .15rem; }
.wb-timeline li:last-child { padding-bottom: 0; }
.wb-timeline li::before { content: ""; position: absolute; left: -9px; top: .45rem; width: 15px; height: 15px; border-radius: 50%; background: var(--white); border: 3px solid var(--navy); }
.wb-when { font-weight: 700; color: #5b6270; font-size: .95rem; }
.wb-num { font-family: var(--display); color: var(--navy); font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); line-height: 1.05; }
.wb-timeline li:nth-child(2) .wb-num { color: var(--red); }
.wb-what { font-size: 1.0625rem; line-height: 1.55; }

/* Utah band */
.wb-utah { background: var(--stone); }
.wb-places { display: grid; gap: 1.5rem; margin: 1.5rem 0; }
.wb-places > section { padding: 0; border-top: 4px solid var(--navy); padding-top: 1rem; }
.wb-places p { margin-bottom: .75em; }
@media (min-width: 64rem) { .wb-places { grid-template-columns: 1fr 1fr; gap: 2rem; } }
.wb-safety { background: var(--white); border-radius: 10px; border-top: 6px solid var(--red); padding: 1.25rem 1.25rem .5rem; font-size: 1.0625rem; }
.wb-safety h3 { font-size: 1.25rem; }

/* logo + flag */
.wb-logo-row { display: grid; gap: 1.25rem; align-items: center; margin-bottom: 1.5rem; }
.wb-logo-row img { width: 140px; border-radius: 14px; }
.wb-logo-row p { font-family: var(--display); color: var(--navy); font-size: 1.5rem; line-height: 1.25; margin: 0; }
@media (min-width: 40rem) { .wb-logo-row { grid-template-columns: 160px 1fr; } .wb-logo-row img { width: 160px; } }
.wb-flag { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .6rem; }
.wb-flag li { display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; align-items: start; }
.wb-swatch { width: 2rem; height: 1.25rem; border-radius: 3px; margin-top: .3rem; }
.wb-swatch-white { background: var(--white); border: 1.5px solid var(--line); }
.wb-swatch-hive { background: var(--gold); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); width: 1.6rem; height: 1.4rem; margin-left: .2rem; }

/* promises: navy band */
.wb-promises { background: var(--navy); color: #e6e9f0; padding: 3.5rem 0; }
.wb-promises h2 { color: var(--white); }
.wb-promises ul { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
.wb-promises h3 { color: var(--white); margin-bottom: .3em; }
.wb-promises h3::before { content: ""; display: block; width: 2.5rem; height: 4px; background: var(--gold); margin-bottom: .75rem; }
.wb-promises p { margin: 0; max-width: 30rem; }
@media (min-width: 52rem) { .wb-promises ul { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.wb-cta { padding: 3.5rem 0; }
.wb-cta .wrap { max-width: 44rem; }
.wb-cta p { font-size: 1.125rem; margin-bottom: 1.5rem; }

.wb-sources { padding: 2.5rem 0 3.5rem; border-top: 1px solid var(--line); font-size: .95rem; }
.wb-sources h2 { font-size: 1.5rem; }
.wb-sources ol { margin: 0; padding-left: 1.5rem; display: grid; gap: .5rem; max-width: 48rem; }
.wb-sources li { padding-left: .25rem; }
.wb-sources li:target { background: #fdf3d6; outline: 2px solid var(--gold); border-radius: 4px; }
.wb-sources a { overflow-wrap: anywhere; }
