* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #f8fafc;
}

img {
  max-width: 100%;
}

.container {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 60px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: #334155;
}

.hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative green->blue glows accenting the hero corners. Kept soft and
   edge-anchored so the backdrop imagery stays clear behind the content. */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
}

.hero-glow-a {
  width: 320px;
  height: 320px;
  top: -90px;
  left: -70px;
  background: radial-gradient(circle, rgba(164, 22, 26, 0.5), transparent 70%);
}

.hero-glow-b {
  width: 360px;
  height: 360px;
  bottom: -130px;
  right: -80px;
  background: radial-gradient(circle, rgba(47, 109, 134, 0.5), transparent 70%);
}

/* Hero background image slideshow — sits behind the hero content/card.
   Slides are built from a manifest in script.js; every image gets the
   same full-clarity cover + Ken-Burns treatment (no dim, blur, or overlay). */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}

.hero-bg-slide.is-active {
  opacity: 1;
  /* slow drift-zoom while the slide is showing (restarts each cycle) */
  animation: heroKenBurns 8s ease-out forwards;
}

@keyframes heroKenBurns {
  from {
    transform: scale(1.06) translate(0, 0);
  }
  to {
    transform: scale(1.18) translate(1.5%, -1.5%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-slide.is-active {
    animation: none;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* readable glass panel behind the hero text (images stay clear elsewhere) */
.hero-intro {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #2f6d86;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

h1, h2, h3, h4 {
  line-height: 1.2;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 1rem;
}

.hero-copy {
  font-size: 1.05rem;
  color: #475569;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #a4161a, #2f6d86);
  color: white;
  box-shadow: 0 8px 20px rgba(47, 109, 134, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(164, 22, 26, 0.32);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: #2f6d86;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

/* Shared glassmorphism treatment — translucent frosted panels with a soft
   shadow. Change this one rule to restyle every card/panel at once. */
.hero-card,
.card,
.step,
.testimonial,
.estimator-card,
.cta-box {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Lift + gradient-tinted shadow on hover for the interactive card groups */
.card:hover,
.step:hover,
.testimonial:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 109, 134, 0.35);
  box-shadow: 0 18px 40px rgba(47, 109, 134, 0.15);
}

/* Service cards: gradient accent bar sweeps in and the title takes the
   green->blue gradient when hovered */
.card {
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #a4161a, #2f6d86);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  transition: color 0.3s ease;
}

.card:hover h3 {
  background: linear-gradient(135deg, #a4161a, #2f6d86);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-card ul {
  padding-left: 1.1rem;
}

.section {
  padding: 3.5rem 0;
}

.alt-section {
  background: #f1f5f9;
}

.section-heading {
  margin-bottom: 1.5rem;
  max-width: 760px;
}

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

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  position: relative;
  max-width: 860px;
  /* left-aligned so the grid lines up with the section heading */
  margin: 0;
}

/* vertical connector runs down the center gap of the 2x2 grid;
   absolutely positioned so it never takes a grid cell */
.steps-connector {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  z-index: 0;
}

.steps-connector-progress {
  display: block;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, #a4161a, #2f6d86);
  border-radius: 999px;
}

.step {
  position: relative;
  z-index: 1;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.stat {
  text-align: center;
  padding: 1.75rem 1rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.stat-number {
  display: block;
  font-size: clamp(2.25rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #a4161a, #2f6d86);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  color: #475569;
  font-size: 0.95rem;
}

.testimonial p {
  margin-top: 0;
}

.cta-section {
  padding-top: 1rem;
}

.cta-box {
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Decorative green->blue glow inside the CTA panel */
.cta-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 25% 15%, rgba(164, 22, 26, 0.25), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(47, 109, 134, 0.25), transparent 55%);
}

/* keep CTA content above its glow layer */
.cta-box > *:not(.cta-glow) {
  position: relative;
  z-index: 1;
}

/* Coverage estimator — inputs card beside a tinted result card.
   Cards share the glassmorphism group; fields reuse the contact-form inputs. */
.estimator-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.estimator-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.area-row {
  display: grid;
  grid-template-columns: 1fr 7.5rem;
  gap: 0.6rem;
}

.estimator-card .btn {
  width: 100%;
  text-align: center;
}

/* result card carries a soft crimson->teal tint so it reads as the payoff */
.estimator-result {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, rgba(164, 22, 26, 0.1), transparent 55%),
    radial-gradient(circle at 85% 95%, rgba(47, 109, 134, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.65);
}

.result-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin: 0;
}

/* same crimson->teal gradient number treatment as the stats block */
.result-number {
  display: block;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0.25rem 0;
  background: linear-gradient(135deg, #a4161a, #2f6d86);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-summary {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 0.95rem;
}

.result-note {
  font-size: 0.82rem;
  color: #64748b;
  background: rgba(47, 109, 134, 0.08);
  border: 1px solid rgba(47, 109, 134, 0.18);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin: 0 0 1rem;
}

/* before the first estimate, hide the summary + disclaimer placeholders */
.estimator-result.is-placeholder .result-summary,
.estimator-result.is-placeholder .result-note {
  display: none;
}

/* Contact dialog / form */
.contact-dialog {
  width: min(480px, calc(100% - 2rem));
  padding: 0;
  border: none;
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
}

.contact-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.contact-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.75rem;
}

.contact-form h3 {
  margin: 0;
  font-size: 1.35rem;
}

.contact-form-intro {
  margin: 0 0 0.25rem;
  color: #64748b;
  font-size: 0.95rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.contact-form input,
.contact-form textarea,
.estimator-card input,
.estimator-card select {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus,
.estimator-card input:focus,
.estimator-card select:focus {
  outline: none;
  border-color: #2f6d86;
  box-shadow: 0 0 0 3px rgba(47, 109, 134, 0.15);
}

/* honeypot spam trap — visually and programmatically hidden from humans */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-status {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.form-status.is-pending {
  color: #64748b;
}

.form-status.is-success {
  color: #2f6d86;
}

.form-status.is-error {
  color: #a4161a;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.site-footer {
  background: #0f172a;
  color: #e2e8f0;
  padding: 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 1.5rem;
}

.site-footer ul {
  padding-left: 1rem;
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(226, 232, 240, 0.15);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* =========================================================
   Animations — state lives here, script.js toggles classes
   ========================================================= */

/* 2. Scroll reveal: fade in + slide up when .is-visible is added */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* hero text leads on load, the card follows a beat later */
.hero-card.reveal {
  transition-delay: 0.15s;
}

/* 3. Staggered cascade for grids of cards — 6th card lands ~1s
   after the first (0.4s delay + 0.6s duration = 1.0s) */
.stagger .reveal:nth-child(1) { transition-delay: 0s; }
.stagger .reveal:nth-child(2) { transition-delay: 0.08s; }
.stagger .reveal:nth-child(3) { transition-delay: 0.16s; }
.stagger .reveal:nth-child(4) { transition-delay: 0.24s; }
.stagger .reveal:nth-child(5) { transition-delay: 0.32s; }
.stagger .reveal:nth-child(6) { transition-delay: 0.4s; }

/* 1c. Typewriter blinking caret */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  background: #2f6d86;
  border-radius: 2px;
  animation: caretBlink 1s step-end infinite;
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

/* 1d. Primary CTA pulse (class toggled every 5s by script.js) */
.btn.is-pulsing {
  animation: ctaPulse 0.9s ease-out;
}

@keyframes ctaPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 109, 134, 0.55);
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(47, 109, 134, 0);
    transform: scale(1);
  }
}

/* respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .typewriter-cursor,
  .btn.is-pulsing,
  .hero-bg-slide.is-active {
    animation: none;
  }
}

/* =========================================================
   Responsive — tablet then mobile. Grids collapse, the hero
   stacks, spacing tightens, and the nav wraps to a column.
   ========================================================= */

/* Tablet: 2-column grids; the hero stacks to a single column */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-copy {
    max-width: none;
  }

  .card-grid,
  .testimonial-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: single-column everything, stacked nav, tighter spacing */
@media (max-width: 640px) {
  .section {
    padding: 2.5rem 0;
  }

  .hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-intro {
    padding: 1.35rem;
  }

  .card-grid,
  .steps,
  .testimonial-grid,
  .stats-grid,
  .estimator-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  /* single-column steps no longer form a 2x2, so the centered
     vertical connector has nothing to link — hide it */
  .steps-connector {
    display: none;
  }

  .nav-bar {
    flex-direction: column;
    gap: 0.6rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* let the two hero CTAs share the row and stay tappable */
  .hero-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
