.contact-reference-page {
  --contact-ink: #14263e;
  --contact-copy: #415775;
  --contact-link: #174eab;
  --contact-paper: #f4f8fc;
  --contact-border: #cdddee;
}

body.reference-inner-page .contact-reference-page > :is(.ref-hub, .ref-prep, .ref-area) {
  background-color: var(--contact-paper);
}

body.reference-inner-page .contact-reference-page > .ref-hub {
  background: linear-gradient(180deg, #e8f1fb 0, var(--contact-paper) 76px);
}

body.reference-inner-page .contact-reference-page > .ref-prep {
  padding-block-start: 0;
}

body.reference-inner-page .contact-reference-page .ref-section :is(.ref-card, .ref-panel, .ref-cta) {
  --section-ink: var(--contact-ink);
  --section-copy: var(--contact-copy);
  --section-link: var(--contact-link);
  background: #fcfeff;
  border-color: var(--contact-border);
  box-shadow: 0 15px 34px -24px #315d9090;
}

body.reference-inner-page .contact-reference-page .ref-section a:not(.button):hover {
  color: #0c367a;
}

.contact-reference-page .ref-card::before {
  margin-block-end: 13px;
  background: #3b79ce;
  box-shadow: none;
}

body.reference-inner-page .contact-reference-page > .ref-area {
  padding-block: clamp(34px, 4.4vw, 66px);
  background:
    radial-gradient(ellipse at 8% 100%, #e5f1fc 0%, transparent 60%),
    #fcfeff;
  border-block: 1px solid #d9e7f3;
  scroll-margin-top: 110px;
}

.service-area-layout {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.contact-reference-page .service-area-copy h2 {
  font-size: clamp(2rem, 4.15vw, 3.85rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.04;
  margin-block-end: .44em;
}

.contact-reference-page .service-area-copy p:not(.eyebrow) {
  max-width: 42ch;
}

.contact-reference-page .service-area-note {
  padding-inline-start: 14px;
  border-inline-start: 2px solid #5996e3;
}

.service-map {
  min-width: 0;
  position: relative;
  margin: 0;
  padding: clamp(8px, 1.3vw, 16px);
  border: 1px solid #c5d9ed;
  border-radius: 28px;
  background: linear-gradient(145deg, #fff, #f5faff);
  box-shadow: 0 18px 48px -27px #1a447ad9, 0 3px 11px -7px #2c559f40;
}

.service-map-plot {
  --hutto-x: .671;
  --hutto-y: .551;
  --hutto-w: .238;
  --hutto-h: .14756;
  position: relative;
  overflow: hidden;
  border: 1px solid #cddff0;
  border-radius: 19px;
  background: #edf5fc;
}

.service-map-art {
  display: block;
  width: 100%;
  height: auto;
}

.service-map-render {
  position: relative;
  container-type: inline-size;
}

.service-map-hutto {
  position: absolute;
  inset-inline-start: calc(var(--hutto-x) * 100%);
  inset-block-start: calc(var(--hutto-y) * 100%);
  width: calc(var(--hutto-w) * 100%);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: transform .2s ease, filter .2s ease;
}

.service-map-hutto-art {
  display: block;
  width: 62%;
  height: auto;
  flex: none;
}

.service-map-hutto-tag {
  position: relative;
  margin-inline-start: .35em;
  padding: .35em .75em;
  border: 1px solid #e1edf9;
  border-radius: .55em;
  background: linear-gradient(145deg, #f9fcff, #deedf9);
  box-shadow: 0 .55em .8em -.35em #31567875;
  color: #10294d;
  font-size: clamp(.45rem, 1vw, 1rem);
  font-size: clamp(.42rem, 1.84cqw, 1.125rem);
  font-weight: 750;
  line-height: 1.1;
}

.service-map-hutto-tag::before {
  position: absolute;
  content: "";
  inset-inline-end: calc(100% + .34em);
  inset-block-start: 50%;
  width: .68em;
  height: .68em;
  transform: translateY(-50%);
  border: .13em solid #fff;
  border-radius: 50%;
  background: #215dc2;
  box-shadow: 0 0 .35em #3276cd94;
}

.contact-reference-page .service-map-cities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 8px;
}

.service-map-town {
  min-width: 0;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid #d0e0f3;
  border-radius: 8px;
  background: #fcfeff;
  color: #152d50;
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.25;
}

.service-map-town--jarrell {
  border-color: #3063af;
  background: #17345f;
  color: #fff;
}

.service-map-town--jarrell .service-map-label {
  color: #fff;
}

.service-map-label small {
  display: block;
  color: #c1ddff;
  font-size: .69rem;
  font-weight: 600;
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .contact-reference-page .service-map-cities {
    position: absolute;
    inset: 0;
    display: block;
    padding: 0;
  }

  .service-map-town {
    position: absolute;
    top: calc(var(--town-y) * 100%);
    left: calc(var(--town-x) * 100%);
    width: calc(var(--town-w) * 100%);
    height: calc(var(--town-h) * 100%);
    padding: 0;
    border: 0;
    background: transparent;
  }

  .service-map-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Reuse the original art at its displayed scale within each town's bounds. */
  .service-map-town::before {
    position: absolute;
    content: "";
    inset: 0;
    border-radius: 9px;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: calc(100% / var(--town-w)) calc(100% / var(--town-h));
    background-position:
      calc(100% * var(--town-x) / (1 - var(--town-w)))
      calc(100% * var(--town-y) / (1 - var(--town-h)));
    opacity: 0;
    transition: opacity .16s ease, transform .2s ease, box-shadow .2s ease;
  }

  .service-map-plot:hover .service-map-town::before {
    background-image: url("/media/cpt-central-texas-3d-map.png");
  }

  .service-map-town:hover {
    z-index: 1;
  }

  .service-map-town:hover::before {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 7px 16px -7px #17345f91;
  }

  .service-map-town--waco {
    --town-x: 0.61198; --town-y: 0.05078;
    --town-w: 0.25391; --town-h: 0.13574;
  }

  .service-map-town--temple {
    --town-x: 0.58659; --town-y: 0.19141;
    --town-w: 0.22786; --town-h: 0.10254;
  }

  .service-map-town--belton {
    --town-x: 0.53255; --town-y: 0.28711;
    --town-w: 0.22135; --town-h: 0.10547;
  }

  .service-map-town--killeen {
    --town-x: 0.14714; --town-y: 0.24707;
    --town-w: 0.21094; --town-h: 0.13770;
  }

  .service-map-town--jarrell {
    --town-x: 0.50846; --town-y: 0.39258;
    --town-w: 0.23503; --town-h: 0.13281;
  }

  .service-map-town--georgetown {
    --town-x: 0.39974; --town-y: 0.52539;
    --town-w: 0.29167; --town-h: 0.10938;
  }

  .service-map-town--round-rock {
    --town-x: 0.36523; --town-y: 0.63379;
    --town-w: 0.30013; --town-h: 0.12012;
  }

  .service-map-town--hutto {
    --town-x: var(--hutto-x);
    --town-y: var(--hutto-y);
    --town-w: var(--hutto-w);
    --town-h: var(--hutto-h);
  }

  .service-map-town--hutto::before {
    content: none;
  }

  .service-map-plot:has(.service-map-town--hutto:hover) .service-map-hutto {
    transform: translateY(-2px) scale(1.05);
    filter: drop-shadow(0 5px 6px #17345f59);
  }

  .service-map-town--austin {
    --town-x: 0.08138; --town-y: 0.68750;
    --town-w: 0.28451; --town-h: 0.19043;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-map-town::before,
  .service-map-hutto {
    transition: none;
  }

  .service-map-town:hover::before,
  .service-map-plot:has(.service-map-town--hutto:hover) .service-map-hutto {
    transform: none;
  }
}

.service-map figcaption {
  color: #516785;
  padding: .62rem .4rem .12rem;
  font-size: .78rem;
}

body.reference-inner-page .contact-reference-page > .ref-cta-section {
  padding-block-end: clamp(64px, 8vw, 116px);
  background: linear-gradient(to bottom, #f4f8fc 0 48%, #dbe8f7 66%, #5b718e 82%, var(--site-footer-ink) 100%);
}

.contact-reference-page .ref-cta {
  padding: clamp(25px, 3vw, 42px);
}

.contact-reference-page .ref-cta h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
}

.contact-reference-page .ref-cta-actions .secondary {
  background: #fcfeff;
  color: #174eab;
  border-color: #6694d0;
}

.contact-reference-page .ref-cta-actions .secondary:hover {
  background: #e8f2fd;
}

@media (max-width: 800px) {
  .service-area-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .service-map {
    border-radius: 22px;
  }

  .service-area-copy .area-break {
    display: none;
  }
}
