/* ============================================================
   HARDESTY ROOFING — hardestyroofing.com
   "Tested. Trusted. Local." — Central Virginia, since 1990.
   Brand red / black / white system (red sampled from the logo);
   red reserved for the free-estimate CTA and the roofline tick.
   Signature: the roofline — pitched section cuts, a gable-peak
   estimate finale, shingle-course texture in dark sections.
   ============================================================ */

:root {
  /* color — Hardesty brand: red, black, white (red sampled from the logo) */
  --night: #101113;      /* deepest charcoal black — hero, footer */
  --storm: #16171a;      /* dark section field */
  --slate: #1d1f23;      /* raised dark panel */
  --granite: #2c2f34;    /* charcoal shingle — borders on dark */
  --mist: #9aa0a6;       /* muted text on dark */
  --porcelain: #f0f0f1;  /* primary text on dark */
  --limestone: #f2f1ed;  /* light editorial field */
  --mortar: #dedbd4;     /* light field borders */
  --ink: #141517;        /* text on light */
  --ink-soft: #55595e;   /* muted text on light */
  --ember: #bc2038;      /* Hardesty red — the estimate CTA + the roofline tick. */
  --ember-deep: #9d1a2f;
  --focus: #6fb3ff;

  /* type */
  --display: "Big Shoulders Display", "Archivo Narrow", "Arial Narrow", sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  /* scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --h3: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem);
  --h2: clamp(2.4rem, 1.8rem + 2.6vw, 4.2rem);
  --h1: clamp(3.4rem, 2.2rem + 6vw, 7.5rem);
  --mega: clamp(2.6rem, 1.6rem + 4.6vw, 5.6rem);

  /* rhythm */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 9vw, 8.5rem);
  --measure: 62ch;
  --header-h: 4.25rem;
  --pitch: clamp(1.75rem, 4vw, 3.5rem); /* the roofline cut */

  /* texture: asphalt grain (SVG noise) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--porcelain);
  font-family: var(--serif);
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 700; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

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

::selection { background: var(--ember); color: #fff; }

.container {
  width: min(100% - 2 * var(--gutter), 74rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--porcelain);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- type roles ---------- */

.display {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.015em;
  line-height: 0.94;
  text-wrap: balance;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 1.4rem;
}

/* the roofline tick — the logo's red roofline, kinked at roof pitch */
.eyebrow::before {
  content: "";
  flex: none;
  width: 2.1rem;
  height: 0.65rem;
  background: var(--ember);
  clip-path: polygon(0 100%, 58% 100%, 58% 32%, 72% 0, 86% 32%, 86% 100%, 100% 100%, 100% 82%, 0 82%);
}

.on-light .eyebrow { color: var(--ink-soft); }

.lede {
  font-size: var(--text-lg);
  line-height: 1.6;
  max-width: var(--measure);
}

.small { font-family: var(--sans); font-size: var(--text-sm); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.75rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

/* The one red surface. */
.btn-estimate {
  background: var(--ember);
  color: #fff;
  border-color: var(--ember);
}
.btn-estimate:hover { background: var(--ember-deep); border-color: var(--ember-deep); transform: translateY(-2px); }
.btn-estimate:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--porcelain);
  border-color: rgba(240, 240, 242, 0.45);
}
.btn-ghost:hover { border-color: var(--porcelain); transform: translateY(-2px); }

.on-light .btn-ghost { color: var(--ink); border-color: rgba(19, 28, 38, 0.35); }
.on-light .btn-ghost:hover { border-color: var(--ink); }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 14, 16, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(240, 240, 242, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 2.1rem; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
  font-family: var(--sans);
}

.site-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--porcelain);
  opacity: 0.85;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { opacity: 1; }
.site-nav a[aria-current="page"] {
  opacity: 1;
  border-bottom-color: var(--porcelain);
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--porcelain);
  white-space: nowrap;
}
.header-phone svg { flex: none; }

.header-cta { padding: 0.65rem 1.2rem; font-size: 0.92rem; }

/* mobile nav (CSS-only) */
.nav-toggle-input { position: absolute; opacity: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  cursor: pointer;
  border: 1px solid rgba(240, 240, 242, 0.2);
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--porcelain);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 63.75em) {
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.75rem var(--gutter) 1.5rem;
    background: var(--night);
    border-bottom: 1px solid var(--granite);
    transform: translateY(-130%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }
  .site-nav a {
    padding: 0.9rem 0.25rem;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(240, 240, 242, 0.08);
  }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--porcelain); }
  .nav-toggle { display: flex; }
  .header-phone { margin-left: auto; }
  .nav-toggle-input:checked ~ .site-nav { transform: translateY(0); visibility: visible; }
  .nav-toggle-input:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-input:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-toggle-input:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-toggle-input:focus-visible ~ .nav-toggle { outline: 3px solid var(--focus); outline-offset: 3px; }
  .header-phone .header-phone-number { display: none; }
  .header-cta { display: none; }
}

/* ---------- mobile call bar (one thumb-tap, always) ---------- */

.call-bar {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  grid-template-columns: 1fr 1.4fr;
  background: var(--night);
  border-top: 1px solid var(--granite);
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
  gap: 0.6rem;
}
.call-bar .btn { padding: 0.85rem 0.5rem; font-size: 0.95rem; }

@media (max-width: 47.5em) {
  .call-bar { display: grid; }
  body { padding-bottom: 4.4rem; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100svh - var(--header-h));
  isolation: isolate;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 38%;
}

/* storm scrim + asphalt grain */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    var(--grain),
    linear-gradient(200deg, rgba(13, 14, 16, 0.1) 0%, rgba(13, 14, 16, 0.45) 55%, rgba(13, 14, 16, 0.94) 100%);
}

.hero-inner {
  padding-block: clamp(3rem, 8vh, 6rem);
}

/* readability over photography */
.hero .eyebrow,
.panel .eyebrow { color: #c9ccd1; text-shadow: 0 1px 10px rgba(13, 14, 16, 0.85); }
.hero h1,
.panel h2, .panel h3,
.panel .lede { text-shadow: 0 2px 22px rgba(13, 14, 16, 0.65); }

.hero h1 {
  font-size: var(--h1);
  margin: 0 0 1.1rem;
  max-width: 12ch;
}

.hero h1 .line { display: block; }

.hero .lede {
  max-width: 44ch;
  color: var(--porcelain);
  text-shadow: 0 1px 12px rgba(13, 14, 16, 0.7);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  translate: -50% 0;
  color: var(--mist);
  opacity: 0.8;
}

/* the home hero's craftsman sits at ~1/3 of the frame; recenter him when the
   narrow mobile crop would otherwise cut him at the edge (beats the inline
   desktop object-position, hence the !important) */
@media (max-width: 47.5em) {
  .hero-home .hero-media img { object-position: 33% 32% !important; }
}

/* home hero: content column anchored right so the craftsman owns the left —
   grid justify-end moves the block as a unit, text inside stays left-ragged */
.hero-home { min-height: calc(88svh - var(--header-h)); }
.hero-home h1 { font-size: clamp(2.9rem, 1.9rem + 5vw, 6.4rem); }
.hero-home .hero-inner { display: grid; justify-content: end; }
.hero-home::before {
  background:
    var(--grain),
    linear-gradient(260deg, rgba(13, 14, 16, 0.5) 0%, rgba(13, 14, 16, 0.15) 55%, rgba(13, 14, 16, 0.05) 100%),
    linear-gradient(200deg, rgba(13, 14, 16, 0.1) 0%, rgba(13, 14, 16, 0.45) 55%, rgba(13, 14, 16, 0.94) 100%);
}

/* interior page hero */
.hero-sub { min-height: min(62svh, 34rem); }
.hero-sub h1 { font-size: var(--mega); }

/* ---------- sections ---------- */

.section { padding-block: var(--section); position: relative; }

.on-dark { background: var(--storm); color: var(--porcelain); }
.on-night { background: var(--night); color: var(--porcelain); }
.on-light { background: var(--limestone); color: var(--ink); }

/* shingle-course banding for dark fields */
.shingled {
  background-image:
    var(--grain),
    repeating-linear-gradient(
      180deg,
      rgba(240, 240, 242, 0.025) 0,
      rgba(240, 240, 242, 0.025) 1px,
      transparent 1px,
      transparent 84px
    );
}

/* the roofline cut: a section whose top edge rises at roof pitch,
   overlapping the section above via negative margin */
.cut-rise { clip-path: polygon(0 var(--pitch), 100% 0, 100% 100%, 0 100%); margin-top: calc(-1 * var(--pitch)); }
.cut-fall { clip-path: polygon(0 0, 100% var(--pitch), 100% 100%, 0 100%); margin-top: calc(-1 * var(--pitch)); }
/* gable peak — the estimate finale rises to a ridge at center */
.cut-gable {
  clip-path: polygon(0 calc(var(--pitch) * 2), 50% 0, 100% calc(var(--pitch) * 2), 100% 100%, 0 100%);
  margin-top: calc(-2 * var(--pitch));
  padding-top: calc(var(--section) + var(--pitch) * 2);
}

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: var(--h2); margin-bottom: 1.2rem; }
.section-head .lede { color: var(--mist); }
.on-light .section-head .lede { color: var(--ink-soft); }

/* ---------- proof rail (real credentials) ---------- */

.proof-rail {
  border-top: 1px solid var(--granite);
  border-bottom: 1px solid var(--granite);
  background: var(--night);
}

.proof-rail .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--granite);
}

.proof {
  background: var(--night);
  padding: 1.6rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.proof img { height: 3.4rem; width: auto; flex: none; }

.proof-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  display: block;
}
.proof-note {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--mist);
  line-height: 1.45;
  display: block;
  margin-top: 0.2rem;
}

@media (max-width: 63.75em) {
  .proof-rail .container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 34em) {
  .proof-rail .container { grid-template-columns: 1fr; }
  .proof { padding: 1.25rem 1.1rem; }
}

.proof svg { flex: none; color: var(--mist); }

@media (max-width: 34em) {
  .eyebrow { letter-spacing: 0.14em; }
}

/* ---------- editorial split (materials story) ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); }
.split.flip .split-media { order: -1; }

.split-media { position: relative; }
.split-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.split-media figcaption {
  font-family: var(--sans);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 0.8rem;
  color: var(--ink-soft);
}
.on-dark .split-media figcaption,
.on-night .split-media figcaption { color: var(--mist); }

.split h2 { font-size: var(--h2); margin-bottom: 1.2rem; }
.split h3 { font-size: var(--h3); margin-bottom: 1rem; }

@media (max-width: 56em) {
  .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip .split-media { order: 0; }
}

/* fact list — true numbers only */
.facts {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--mortar);
}
.facts li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--mortar);
  align-items: baseline;
}
.on-dark .facts, .on-night .facts { border-color: var(--granite); }
.on-dark .facts li, .on-night .facts li { border-color: var(--granite); }

.fact-figure {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.facts li p { font-size: 0.98rem; color: var(--ink-soft); margin: 0; }
.on-dark .facts li p, .on-night .facts li p { color: var(--mist); }

@media (max-width: 34em) {
  .facts li { grid-template-columns: 5.5rem 1fr; gap: 0.9rem; }
  .fact-figure { font-size: 1.9rem; }
}

/* ---------- cinematic work panels ---------- */

.panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(92svh, 46rem);
  isolation: isolate;
  overflow: hidden;
  color: var(--porcelain);
}

.panel-media { position: absolute; inset: 0; z-index: -2; }
.panel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    var(--grain),
    linear-gradient(100deg, rgba(13, 14, 16, 0.55) 0%, rgba(13, 14, 16, 0.18) 55%, rgba(13, 14, 16, 0.08) 100%),
    linear-gradient(190deg, rgba(13, 14, 16, 0.22) 0%, rgba(13, 14, 16, 0.56) 55%, rgba(13, 14, 16, 0.95) 100%);
}

.panel-inner {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}

.panel h2, .panel h3 { font-size: var(--h2); margin-bottom: 0.9rem; }
.panel .lede { max-width: 46ch; }

.panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.panel-tags li {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(240, 240, 242, 0.35);
  color: var(--porcelain);
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.8rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: var(--porcelain);
  text-decoration: none;
  border-bottom: 2px solid rgba(240, 240, 242, 0.5);
  padding-bottom: 0.3rem;
  transition: gap 0.18s ease, border-color 0.18s ease;
}
.panel-link:hover { gap: 0.9rem; border-color: var(--porcelain); }

/* ---------- service grid (interior pages) ---------- */

.service-grid {
  display: grid;
  /* min() guard: a bare 19rem minimum is wider than the container below roughly
   * 340px, which forced horizontal scroll on small phones. Layout is identical
   * at every width above that. */
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: 1.25rem;
}

/* four-card grids read better as a 2×2 */
@media (min-width: 56em) {
  .service-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.service-card {
  background: var(--slate);
  border: 1px solid var(--granite);
  padding: 1.75rem 1.5rem;
}
.on-light .service-card {
  background: #fff;
  border-color: var(--mortar);
}

.service-card h3 {
  font-family: var(--display);
  font-size: 1.55rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.7rem;
}
.service-card p { font-size: 0.98rem; color: var(--mist); }
.on-light .service-card p { color: var(--ink-soft); }

/* clickable service cards (hub pages) */
a.service-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
a.service-card:hover { transform: translateY(-3px); border-color: var(--mist); }
.on-light a.service-card:hover { border-color: var(--ink-soft); }
.card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--porcelain);
}
.on-light .card-more { color: var(--ink); }

/* ---------- prose + FAQ ---------- */

.prose { max-width: 46rem; }
.prose h3 {
  font-family: var(--display);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 2.2rem 0 0.7rem;
}
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }

.faq-list { max-width: 50rem; }
.faq-list details {
  border-top: 1px solid var(--granite);
  padding: 0;
}
.faq-list details:last-child { border-bottom: 1px solid var(--granite); }
.on-light .faq-list details,
.on-light .faq-list details:last-child { border-color: var(--mortar); }
.faq-list summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0.25rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1;
  flex: none;
  transition: transform 0.18s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details > div { padding: 0 0.25rem 1.25rem; max-width: 60ch; }
.faq-list details > div p { color: var(--ink-soft); }
.on-dark .faq-list details > div p, .on-night .faq-list details > div p { color: var(--mist); }

/* ---------- town wall (service area) ---------- */

.town-wall {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  align-items: baseline;
}
.town-wall li {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(1.9rem, 1.2rem + 3.4vw, 4rem);
  line-height: 1.12;
  color: var(--porcelain);
}
.town-wall li.town-dim { color: var(--granite); }
@supports (-webkit-text-stroke: 1px black) {
  .town-wall li.town-dim { -webkit-text-stroke: 1px var(--mist); color: transparent; }
}
/* The towns are links now. A default underline at this display size is far too
 * heavy, so it only appears on hover and focus. */
.town-wall a {
  color: inherit;
  text-decoration: none;
  -webkit-text-stroke: inherit;
  transition: color 0.18s ease;
}
.town-wall a:hover,
.town-wall a:focus-visible {
  color: var(--ember);
  -webkit-text-stroke: 0;
}
.town-wall a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* .town-home carries no special treatment. The old "HQ" badge was removed
 * 2026-08-17: it read as bolted on, and the H1 directly above the wall already
 * says "Based in Midlothian." The class is kept on the markup so a marker can
 * be reintroduced later without touching every page. */

/* ---------- estimate finale ---------- */

.estimate {
  background: var(--night);
  color: var(--porcelain);
  text-align: center;
}
.estimate .container { max-width: 56rem; }

.estimate h2 {
  font-size: var(--h2);
  margin-bottom: 1rem;
}
.estimate .lede { margin-inline: auto; color: var(--mist); }

.estimate-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.estimate-phone {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--mega);
  letter-spacing: 0.02em;
  color: var(--porcelain);
  text-decoration: none;
  margin-top: 2.6rem;
  line-height: 1;
}
.estimate-phone:hover { color: #fff; }

.estimate-hours {
  font-family: var(--sans);
  font-size: var(--text-sm);
  color: var(--mist);
  margin-top: 0.9rem;
}

/* what happens next */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 3.2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  text-align: left;
}
.steps li {
  counter-increment: step;
  border-top: 2px solid var(--granite);
  padding-top: 1.1rem;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--mist);
  margin-bottom: 0.4rem;
}
.steps h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.steps p { font-size: 0.92rem; color: var(--mist); }

@media (max-width: 47.5em) {
  .steps { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--night);
  color: var(--mist);
  border-top: 1px solid var(--granite);
  font-family: var(--sans);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 2.5rem;
  padding-block: 3.5rem;
}

.site-footer h4 {
  color: var(--porcelain);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: var(--mist); text-decoration: none; }
.site-footer a:hover { color: var(--porcelain); }

.footer-brand img { height: 2rem; width: auto; margin-bottom: 1.1rem; }
.footer-brand p { max-width: 30ch; line-height: 1.6; }

.footer-badges { display: flex; gap: 0.9rem; margin-top: 1.2rem; }
.footer-badges img { height: 3.2rem; width: auto; }

.footer-legal {
  border-top: 1px solid var(--granite);
  padding-block: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-size: 0.8rem;
}

@media (max-width: 56em) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 34em) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- reveal motion (JS-gated; content visible without it) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js .reveal.is-in { opacity: 1; transform: none; }

html.js .hero h1 .line,
html.js .hero .lede,
html.js .hero .hero-ctas,
html.js .hero .eyebrow {
  animation: rise 0.85s cubic-bezier(0.2, 0.65, 0.25, 1) both;
}
html.js .hero .eyebrow { animation-delay: 0.05s; }
html.js .hero h1 .line:nth-child(1) { animation-delay: 0.15s; }
html.js .hero h1 .line:nth-child(2) { animation-delay: 0.26s; }
html.js .hero h1 .line:nth-child(3) { animation-delay: 0.37s; }
html.js .hero .lede { animation-delay: 0.5s; }
html.js .hero .hero-ctas { animation-delay: 0.62s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal,
  html.js .hero h1 .line,
  html.js .hero .lede,
  html.js .hero .hero-ctas,
  html.js .hero .eyebrow {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .panel-link { transition: none; }
}

/* ------------------------------------------------------------------ */
/* Location pages: quick-answer (GEO/AEO block) and the NAP card.      */
/* Added 2026-08-17 with the service-area build. Neither existed, and  */
/* .panel is a full-bleed media hero, not a content box.               */
/* ------------------------------------------------------------------ */

.quick-answer {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.5rem);
  border-left: 4px solid var(--ember);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(20, 21, 23, 0.07), 0 8px 24px rgba(20, 21, 23, 0.05);
}

.quick-answer .eyebrow { margin-bottom: 0.75rem; }

.quick-answer p {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--ink);
}

.nap-card {
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--slate);
  color: var(--porcelain);
  border: 1px solid var(--granite);
  border-radius: 2px;
}

.nap-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: var(--h3);
  letter-spacing: 0.01em;
}

.nap-card p { margin: 0 0 0.85rem; line-height: 1.55; }
.nap-card p:last-child { margin-bottom: 0; }
.nap-card a { color: var(--porcelain); }
.nap-card .small { color: var(--mist); font-size: var(--text-sm); }

/* ------------------------------------------------------------------ */
/* Quote request form. Added 2026-08-17: the Atlas build shipped with  */
/* no <form> anywhere on the site, phone CTAs only.                    */
/* ------------------------------------------------------------------ */

.quote-form {
  max-width: 46rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  background: #fff;
  border: 1px solid var(--mortar);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(20, 21, 23, 0.07), 0 10px 30px rgba(20, 21, 23, 0.06);
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field-full { grid-column: 1 / -1; }

.field label {
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.field .req { color: var(--ember); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font-family: var(--sans);
  font-size: 1rem; /* 16px minimum, stops iOS zooming the page on focus */
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--mortar);
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2355595e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.field textarea { min-height: 7rem; resize: vertical; }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--ink);
}

.field input:user-invalid,
.field textarea:user-invalid { border-color: var(--ember); }

.field .hint { font-size: var(--text-xs); color: var(--ink-soft); }

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
}

.quote-actions .btn { flex: 0 0 auto; }
.quote-consent { font-size: var(--text-xs); color: var(--ink-soft); margin-top: 1rem; }

.form-note {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--ember);
  background: var(--limestone);
  font-size: var(--text-sm);
  color: var(--ink);
}
.form-note[hidden] { display: none; }

/* Honeypot. Off-screen rather than display:none so bots still fill it. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .quote-grid { grid-template-columns: minmax(0, 1fr); }
  .quote-actions { flex-direction: column; align-items: stretch; }
  .quote-actions .btn { width: 100%; text-align: center; }
}

/* Reviews embed */
.reviews-embed { max-width: 72rem; margin-inline: auto; min-height: 20rem; }
.reviews-fallback { text-align: center; color: var(--ink-soft); font-size: var(--text-sm); }

/* Credentials list. Distinct from .facts: .fact-figure is a display-size stat
 * label with white-space:nowrap, built for short strings like "35+". Credential
 * names are full phrases and must wrap. Reusing .facts overflowed at 375px. */
.creds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}

.creds li { min-width: 0; }

.cred-name {
  display: block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  margin-bottom: 0.4rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--ember);
}

.creds li p { margin: 0; font-size: 0.98rem; line-height: 1.5; color: var(--ink-soft); }
.on-dark .creds li p, .on-night .creds li p { color: var(--mist); }

/* ------------------------------------------------------------------ */
/* Service area map. Replaces the old town wall 2026-08-17.            */
/* Inline SVG, no dependencies. Generated by _build/build-map.js.      */
/* ------------------------------------------------------------------ */

.area-map {
  margin: clamp(1.5rem, 4vw, 3rem) 0 0;
  max-width: 60rem;
  margin-inline: auto;
}

.area-map svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.area-map figcaption {
  margin-top: 1.1rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--mist);
}

/* drive-time rings */
.map-ring {
  fill: none;
  stroke: var(--granite);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
}

.map-ring-label {
  fill: var(--mist);
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-anchor: middle;
}

/* markers */
.map-pin { cursor: pointer; }
.map-star { fill: var(--ember); }

.map-label {
  fill: var(--mist);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  pointer-events: auto;   /* the label IS the marker and the link now */
  transition: fill 0.16s ease;
}

.map-pin.is-key .map-label { fill: var(--porcelain); font-size: 16px; }
.map-pin.is-home .map-label { fill: var(--ember); font-size: 17px; font-weight: 700; }

.map-pin:hover .map-label,
.map-pin:focus-visible .map-label { fill: var(--ember); }
.map-pin:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Phones: 30 labels will not fit. Keep the dots, keep the key markets, and let
   the directory grid below the map carry the complete list. */
@media (max-width: 46em) {
  .map-pin:not(.is-key):not(.is-home) .map-label { display: none; }
  .map-label { font-size: 26px; }
  .map-pin.is-key .map-label { font-size: 28px; }
  .map-pin.is-home .map-label { font-size: 30px; }
  .map-ring-label { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-label { transition: none; }
}

/* Financing callout. Sits directly above the form, so it lands in front of
 * anyone about to ask what this costs. Deliberately not a nav item: financing
 * answers a money objection at the moment money comes up. */
.financing-callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.75rem, 2vw, 1.4rem);
  flex-wrap: wrap;
  max-width: 46rem;
  margin: clamp(1.75rem, 4vw, 2.5rem) auto 0;
  padding: clamp(1rem, 2.5vw, 1.4rem) clamp(1.1rem, 3vw, 1.75rem);
  background: rgba(188, 32, 56, .1);
  border: 1px solid var(--ember);
  border-radius: 2px;
  text-align: left;
}

.financing-callout-text {
  font-family: var(--sans);
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--porcelain);
  margin: 0;
}

.financing-callout-text span {
  display: block;
  font-weight: 400;
  font-size: var(--text-sm);
  color: var(--mist);
  margin-top: .2rem;
}

.financing-callout .btn { flex: 0 0 auto; padding: .8rem 1.4rem; }

.on-light .financing-callout-text { color: var(--ink); }
.on-light .financing-callout-text span { color: var(--ink-soft); }

@media (max-width: 40em) {
  .financing-callout { flex-direction: column; align-items: stretch; text-align: center; }
  .financing-callout .btn { width: 100%; justify-content: center; }
}

/* Inline estimate form. Sits in the #estimate band at the foot of every page
 * so "Get a Free Estimate" lands on a real form, not another button. */
.estimate-form-wrap {
  max-width: 46rem;
  margin: clamp(1.75rem, 4vw, 2.75rem) auto 0;
  text-align: left;
}
.estimate .financing-link { margin-top: 1.6rem; }

/* Estimate CTAs jump to #quote-form rather than the top of the band, so the
 * visitor lands ON the form. The scroll margin keeps the phone number and
 * headline visible above it rather than scrolling them off. */
#quote-form { scroll-margin-top: clamp(150px, 30vh, 250px); }
.estimate .estimate-hours { margin-bottom: 0; font-size: var(--text-sm); }

/* ---------- NAV DROPDOWN (Option A) ---------- */

.site-nav { position: static; }

.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a,
.nav-item > button {
  font-family: var(--sans); font-size: 0.92rem; font-weight: 600; letter-spacing: 0.04em;
  color: var(--porcelain); opacity: 0.85; text-decoration: none;
  background: none; border: 0; cursor: pointer; padding: 0.35rem 0;
  display: inline-flex; align-items: center; gap: 0.35rem;
  border-bottom: 2px solid transparent;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.nav-item > a:hover, .nav-item > button:hover,
.nav-item:hover > button, .nav-item:focus-within > button { opacity: 1; }
.nav-item > a[aria-current="page"],
.nav-item.is-section > button { opacity: 1; border-bottom-color: var(--porcelain); }
.nav-item > button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.nav-item .caret { width: 9px; height: 9px; flex: none; opacity: 0.7; transition: transform 0.18s ease; }
.nav-item:hover .caret, .nav-item:focus-within .caret, .nav-item.is-open .caret { transform: rotate(180deg); }

.mega {
  position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px);
  min-width: 15rem; background: var(--slate);
  border: 1px solid var(--granite); border-top: 2px solid var(--ember);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  padding: 1.25rem 1.4rem 1.1rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 200;
}
.nav-item:hover .mega, .nav-item:focus-within .mega, .nav-item.is-open .mega {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
/* keep the last menu on screen */
.nav-item:last-child .mega { left: auto; right: 0; transform: translate(0, 6px); }
.nav-item:last-child:hover .mega,
.nav-item:last-child:focus-within .mega,
.nav-item:last-child.is-open .mega { transform: translate(0, 0); }
/* bridge the gap so the pointer can travel into the menu */
.mega::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }

.mega-cols { display: flex; gap: 2.5rem; }
.mega-col { min-width: 11.5rem; }
.mega h3 {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mist); margin: 0 0 0.7rem;
  padding-bottom: 0.45rem; border-bottom: 1px solid var(--granite);
}
.mega ul { list-style: none; margin: 0; padding: 0; }
.mega a {
  display: block; font-family: var(--sans); font-size: 0.88rem; font-weight: 500;
  color: var(--porcelain); opacity: 0.82; text-decoration: none;
  padding: 0.42rem 0.55rem; margin-left: -0.55rem; border: 0; border-radius: 3px;
  line-height: 1.3; transition: background 0.12s ease, opacity 0.12s ease;
}
.mega a:hover { opacity: 1; background: rgba(240, 240, 241, 0.07); }
.mega a[aria-current="page"] { opacity: 1; background: rgba(188, 32, 56, 0.16); }
.mega a .sub { display: block; font-size: 0.72rem; color: var(--mist); font-weight: 400; margin-top: 0.1rem; }
.mega a.is-hub { font-weight: 700; }
.mega a.is-hub .lbl::after { content: " \2192"; opacity: 0.55; }

.mega-foot {
  margin: 1.05rem -1.4rem -1.1rem; padding: 0.85rem 1.4rem;
  background: rgba(0, 0, 0, 0.28); border-top: 1px solid var(--granite);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.mega-foot p { font-family: var(--sans); font-size: 0.8rem; color: var(--mist); margin: 0; }
.mega-foot .btn { padding: 0.5rem 0.9rem; font-size: 0.8rem; white-space: nowrap; }

@media (max-width: 63.75em) {
  .site-nav { max-height: calc(100vh - var(--header-h)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .nav-item { display: block; }
  .nav-item > a,
  .nav-item > button {
    display: flex; width: 100%; justify-content: space-between;
    padding: 0.9rem 0.25rem; font-size: 1.05rem;
    border-bottom: 1px solid rgba(240, 240, 242, 0.08);
  }
  .nav-item.is-section > button { border-bottom-color: rgba(240, 240, 242, 0.08); }
  .nav-item .caret { width: 11px; height: 11px; }
  /* hover must not open anything on a touch screen: display wins over opacity */
  .mega,
  .nav-item:hover .mega,
  .nav-item:focus-within .mega {
    display: none; position: static; transform: none; opacity: 1; visibility: visible;
    pointer-events: auto; min-width: 0; background: none; border: 0; box-shadow: none;
    padding: 0.35rem 0 0.85rem;
  }
  .nav-item.is-open .mega { display: block; transform: none; }
  .nav-item:last-child .mega { right: auto; transform: none; }
  .mega::before { display: none; }
  .mega-cols { flex-direction: column; gap: 0; }
  .mega-col { min-width: 0; }
  .mega h3 { margin: 0.6rem 0 0.3rem; border-bottom: 0; padding-bottom: 0; }
  .mega a {
    margin-left: 0; padding: 0.6rem 0 0.6rem 0.75rem;
    font-size: 0.95rem; border-radius: 0; border-left: 2px solid var(--granite);
  }
  .mega a[aria-current="page"] { border-left-color: var(--ember); }
  .mega-foot { display: none; }
}

/* deep-linked exterior services get a moment of confirmation */
.service-card:target {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
}
