/* Haynes Group v3: brighter color, motion, and interactive widgets.
   Layered on v2. Respects prefers-reduced-motion. No external fonts/CDNs. */

:root {
  --coral: #c4452a;
  --coral-soft: #fde6df;
  --sunset: #e56b2e;
  --teal: #0b6b62;
  --teal-soft: #e4f5f2;
  --lake: #0e6f8a;
  --lake-soft: #e4f4f9;
  --gold: #b7791f;
  --gold-bright: #f6c453;
  --gold-soft: #fbeecb;
  --accent-mortgage: #2e5288;
  --accent-real-estate: #0b6b62;
  --accent-construction: #c4452a;
  --accent-title: #9a7218;
}

/* Brighter section washes — text stays navy/ink for contrast */
.band-warm {
  background: linear-gradient(180deg, #fff4e8 0%, #f8eee0 52%, var(--paper) 100%);
}
.band-sky {
  background: linear-gradient(180deg, #dceef8 0%, #eef6fb 55%, #f7fbfd 100%);
}
.band-teal {
  background: linear-gradient(180deg, var(--teal-soft) 0%, #f3fbf9 100%);
}
.band-coral {
  background: linear-gradient(180deg, var(--coral-soft) 0%, #fff7f3 100%);
}
.band-gold {
  background: linear-gradient(180deg, var(--gold-soft) 0%, #fffaf0 100%);
}
.page-mortgage .page-hero-v2 {
  background:
    radial-gradient(1000px 480px at 90% -15%, rgba(46, 82, 136, 0.22), transparent 60%),
    radial-gradient(700px 380px at -8% 110%, rgba(246, 196, 83, 0.35), transparent 55%),
    linear-gradient(180deg, #e8eef8 0%, var(--paper) 100%);
}
.page-real-estate .page-hero-v2 {
  background:
    radial-gradient(1000px 480px at 90% -15%, rgba(14, 111, 138, 0.22), transparent 60%),
    radial-gradient(700px 380px at -8% 110%, rgba(11, 107, 98, 0.18), transparent 55%),
    linear-gradient(180deg, #e4f4f9 0%, var(--paper) 100%);
}
.page-construction .page-hero-v2 {
  background:
    radial-gradient(1000px 480px at 90% -15%, rgba(196, 69, 42, 0.16), transparent 60%),
    radial-gradient(700px 380px at -8% 110%, rgba(229, 107, 46, 0.22), transparent 55%),
    linear-gradient(180deg, #fde6df 0%, var(--paper) 100%);
}
.page-title .page-hero-v2 {
  background:
    radial-gradient(1000px 480px at 90% -15%, rgba(183, 121, 31, 0.22), transparent 60%),
    linear-gradient(180deg, var(--gold-soft) 0%, var(--paper) 100%);
}

.hero-v2, .page-hero-v2, .page-hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-v2::before, .page-hero-v2::before {
  content: "";
  position: absolute;
  inset: auto -8% -30% 40%;
  height: 70%;
  background: radial-gradient(closest-side, rgba(246, 196, 83, 0.45), rgba(229, 107, 46, 0.18) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: hg-blob 16s ease-in-out infinite;
}
.hero-v2 .wrap, .page-hero-v2 .wrap { position: relative; z-index: 1; }

@keyframes hg-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6%, -8%) scale(1.12); }
}

/* Division accent stripes on service cards */
#service-mortgage { border-top: 6px solid var(--accent-mortgage); }
#service-real-estate { border-top: 6px solid var(--accent-real-estate); }
#service-construction { border-top: 6px solid var(--accent-construction); }
#service-title { border-top: 6px solid var(--accent-title); }
#service-fsbo { border-top: 6px solid var(--lake); }

.service-card .svc-icon,
.fact-icon, .nbhd-card .nbhd-icon {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin: 0 0 0.85rem;
}
.service-card .svc-icon svg,
.fact-icon svg,
.nbhd-card .nbhd-icon svg { width: 1.7rem; height: 1.7rem; display: block; }
#service-mortgage .svc-icon { background: #e7eef8; color: var(--accent-mortgage); }
#service-real-estate .svc-icon { background: var(--teal-soft); color: var(--accent-real-estate); }
#service-construction .svc-icon { background: var(--coral-soft); color: var(--accent-construction); }
#service-title .svc-icon { background: var(--gold-soft); color: var(--accent-title); }
#service-fsbo .svc-icon { background: var(--lake-soft); color: var(--lake); }

/* Hover tilt — only when a pointer can hover and motion is OK */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .service-card, .panel, .review-card, .nbhd-card, .team-card, .fact-card, .flip-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform-style: preserve-3d;
  }
  .service-card:hover, .panel:hover, .review-card:hover, .nbhd-card:hover, .team-card:hover, .fact-card:hover {
    transform: perspective(900px) rotateX(2deg) rotateY(-3deg) translateY(-6px);
    box-shadow: var(--shadow-lift);
  }
}

/* ---------- Fact counters ---------- */
.fact-strip {
  background: linear-gradient(120deg, #1c2c44 0%, #243f6a 48%, #0e4d4a 100%);
  color: #f3eee4;
  padding-block: 1.6rem;
}
.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.fact-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(243, 238, 228, 0.16);
  border-radius: 20px;
  padding: 1.15rem 1.2rem 1.25rem;
}
.fact-card .fact-icon { background: rgba(246, 196, 83, 0.2); color: var(--gold-bright); }
.fact-num {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  margin: 0 0 0.35rem;
  color: #fff;
  letter-spacing: -0.03em;
}
.fact-label { margin: 0; font-weight: 650; color: #f3eee4; }
.fact-note { margin: 0.35rem 0 0; font-size: 0.85rem; color: #c9c3b8; }

/* ---------- Neighborhood scroller ---------- */
.nbhd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.nbhd-nav { display: flex; gap: 0.4rem; }
.nbhd-nav button {
  width: 2.6rem; height: 2.6rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--navy);
  cursor: pointer; font-size: 1.2rem; line-height: 1;
}
.nbhd-nav button:hover { background: var(--teal-soft); border-color: var(--teal); }
.nbhd-nav button:focus-visible { box-shadow: var(--focus); outline: none; }
.nbhd-scroller {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0.25rem;
  padding: 0.25rem 0.15rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.nbhd-card {
  flex: 0 0 min(86%, 280px);
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  margin: 0;
}
.nbhd-card h3 { margin: 0 0 0.15rem; color: var(--navy); font-size: 1.25rem; }
.nbhd-card .eyebrow { margin-bottom: 0.35rem; }
.nbhd-card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }
.nbhd-card[data-place="txk-ar"] .nbhd-icon { background: #e7eef8; color: var(--accent-mortgage); }
.nbhd-card[data-place="txk-tx"] .nbhd-icon { background: var(--coral-soft); color: var(--coral); }
.nbhd-card[data-place="hs"] .nbhd-icon { background: var(--teal-soft); color: var(--teal); }
.nbhd-card[data-place="hsv"] .nbhd-icon { background: var(--gold-soft); color: var(--gold); }
.nbhd-card[data-place="lh"] .nbhd-icon { background: var(--lake-soft); color: var(--lake); }

/* ---------- Budget explorer (percentages only) ---------- */
.budget-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-lift);
  padding: clamp(1.2rem, 3vw, 2.1rem);
}
.budget-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.5rem; align-items: start; }
.budget-sliders label { display: block; font-weight: 600; color: var(--navy); margin: 0 0 0.3rem; }
.budget-sliders .row { margin: 0 0 1.1rem; }
.budget-sliders input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  height: 1.4rem;
}
.budget-value { font-weight: 700; color: var(--teal); }
.budget-result {
  background: linear-gradient(180deg, var(--teal-soft), #fff);
  border-radius: 20px;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
}
.budget-meters { display: grid; gap: 0.85rem; margin: 0.8rem 0 1rem; }
.meter-label { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 600; color: var(--navy); margin-bottom: 0.25rem; }
.meter {
  height: 14px;
  background: #e6ebe8;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}
.meter > span {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--lake));
  width: 0%;
  transition: width 0.25s ease;
}
.meter.is-tight > span { background: linear-gradient(90deg, var(--sunset), var(--coral)); }
.meter-mark {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--navy); opacity: 0.55;
}
.budget-status { margin: 0 0 0.6rem; font-weight: 650; color: var(--navy); }
.budget-disclaimer, .budget-box .fine { margin: 0; font-size: 0.86rem; color: var(--text-mute); }
.budget-guide { margin: 0 0 0.75rem; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Review carousel ---------- */
.review-carousel { position: relative; }
.review-viewport { overflow: hidden; }
.review-track {
  display: flex;
  gap: 1.2rem;
  transition: transform 0.4s ease;
}
.review-carousel .review-card {
  flex: 0 0 100%;
  min-width: 0;
}
@media (min-width: 800px) {
  .review-carousel.is-multi .review-card { flex-basis: calc(50% - 0.6rem); }
}
.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.carousel-controls button {
  width: 2.6rem; height: 2.6rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--navy);
  cursor: pointer; font-size: 1.2rem;
}
.carousel-controls button:hover { background: var(--gold-soft); }
.carousel-controls button:focus-visible { box-shadow: var(--focus); outline: none; }
.carousel-dots { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.carousel-dots button {
  width: 0.7rem; height: 0.7rem; padding: 0; border-radius: 99px;
  background: var(--line-strong); border: 0; cursor: pointer;
}
.carousel-dots button[aria-current="true"] { background: var(--navy); width: 1.3rem; }

/* ---------- Initials avatar ---------- */
.initials-avatar {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--accent-mortgage), var(--lake));
  color: #fff;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}
.initials-avatar span { line-height: 1; }

/* ---------- Sticky mobile CTA + back-to-top ring ---------- */
.mobile-cta-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(28, 44, 68, 0.96);
  color: #f3eee4;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(20, 24, 32, 0.25);
  gap: 0.5rem;
}
.mobile-cta-bar a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-weight: 650;
  border-radius: 999px;
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.mobile-cta-bar .cta-book { background: var(--coral); }
.mobile-cta-bar .cta-call { background: transparent; border: 1px solid rgba(243, 238, 228, 0.45); color: #f3eee4; }
@media (max-width: 800px) {
  .mobile-cta-bar { display: flex; }
  body.has-mobile-cta { padding-bottom: 5.2rem; }
}
.to-top {
  position: fixed;
  right: 0.85rem;
  bottom: 1rem;
  z-index: 61;
  width: 3rem; height: 3rem;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:focus-visible { box-shadow: var(--focus); outline: none; }
.to-top svg { width: 2.7rem; height: 2.7rem; display: block; }
.to-top .ring-bg { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.to-top .ring-fg { fill: none; stroke: var(--coral); stroke-width: 3; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.to-top .arrow { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 800px) {
  .to-top { bottom: 5.6rem; }
}

.flip-tag.is-fact { background: var(--teal-soft); color: var(--teal); }
.flip-card .face-front { background: linear-gradient(180deg, #fff, var(--gold-soft)); }
.flip-card .face-back { background: linear-gradient(180deg, #fff, var(--teal-soft)); }
.pc-opt input:checked + span { border-color: var(--coral); background: var(--coral-soft); box-shadow: inset 0 0 0 1px var(--coral); }
.pc-opt input:checked + span b::after { color: var(--coral); }

@media (max-width: 800px) {
  .fact-grid, .budget-grid { grid-template-columns: 1fr; }
  .nbhd-card { flex-basis: 82%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-v2::before, .page-hero-v2::before,
  .sc-sun, .sc-cloud { animation: none !important; }
  .review-track, .meter > span, .to-top { transition: none; }
  .service-card:hover, .panel:hover, .review-card:hover, .nbhd-card:hover, .team-card:hover, .fact-card:hover {
    transform: none;
  }
}
@media print {
  .mobile-cta-bar, .to-top { display: none !important; }
  body.has-mobile-cta { padding-bottom: 0; }
}
