/* ─── Coronado's Painting Landing Page Design System ──────────────────────── */

/* ─── Typography & Font Pairings ─────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Work+Sans:wght@300;400;500;600;700&display=swap');

/* ─── Variables & Tokens (Gold & Black Theme — LOCAL PREVIEW) ─
   NOTE: This is a preview palette swap, not yet matched to the logo
   (which is still navy/red). Original navy/red values are preserved
   in git history — see the "theme-preview" branch pattern used
   previously in this repo to compare/revert. ───────────────── */
:root {
  /* HSL Colors — Red, White & Navy logo palette */
  --primary-hsl:       220, 71%, 25%;  /* Logo Navy        #12306D */
  --secondary-hsl:     221, 70%, 11%;  /* Deep Navy        #08142F */
  --tertiary-hsl:      356, 85%, 62%;  /* Bright Red (on dark) #F14955 */
  --accent-hsl:        356, 78%, 45%;  /* Logo Red         #CC1926 */
  --neutral-bg-hsl:    216, 40%, 97%;  /* Cool White       #F5F7FB */
  --sage-muted-hsl:    218, 12%, 55%;   /* Warm Muted Gray */
  --slate-gray-hsl:    218, 14%, 40%;   /* Warm Slate Gray */

  /* Compiled Colors */
  --primary:           hsl(var(--primary-hsl));
  --secondary:         hsl(var(--secondary-hsl));
  --tertiary:          hsl(var(--tertiary-hsl));
  --accent:            hsl(var(--accent-hsl));
  --neutral-bg:        hsl(var(--neutral-bg-hsl));
  --sage-muted:        hsl(var(--sage-muted-hsl));
  --slate-gray:        hsl(var(--slate-gray-hsl));
  --dark-charcoal:     #191c1d;
  --white:             #ffffff;

  /* Typography Sizes & Families */
  --font-heading:      'Plus Jakarta Sans', sans-serif;
  --font-body:         'Work Sans', sans-serif;

  /* Layout and Sizing Variables */
  --radius-sm:         4px;
  --radius-md:         8px;
  --radius-lg:         16px;
  --radius-full:       9999px;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Global Reset & Body Setup ───────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--neutral-bg);
  color: var(--dark-charcoal);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--secondary);
  line-height: 1.25;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--neutral-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Screen reader only utility */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* ─── Header Navigation ───────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(8, 20, 47, 0.05);
  background-color: rgba(248, 249, 250, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: background-color var(--transition-smooth), height var(--transition-smooth), border-color var(--transition-smooth);
}

/* Scrolled Nav bar look */
#header.scrolled {
  height: 70px;
  background-color: rgba(248, 249, 250, 0.95);
  border-bottom: 1px solid rgba(18, 48, 109, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.nav-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-svg {
  width: 36px;
  height: 36px;
  transition: transform var(--transition-smooth);
}

.logo-img {
  height: 62px;
  width: auto;
  object-fit: contain;
  transition: height var(--transition-smooth), transform var(--transition-smooth);
  flex-shrink: 0;
}

#header.scrolled .logo-img {
  height: 52px;
}

.nav-logo:hover .logo-img {
  transform: scale(1.05);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.02em;
}

.logo-text .highlight {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-gray);
  position: relative;
  padding: 6px 0;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-smooth);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Marks the nav link matching the page currently being viewed */
.nav-link.is-current,
.mobile-link.is-current {
  color: var(--primary);
}

.nav-link.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Faded Red Yelp link in navigation */
.nav-yelp {
  color: hsla(358, 60%, 58%, 0.85) !important;
}

.nav-yelp::after {
  background-color: #d32323 !important; /* Red hover underline matching brand */
}

.nav-yelp:hover {
  color: #d32323 !important;
}

/* Mobile nav yelp faded red */
.mobile-nav-yelp {
  color: hsla(358, 60%, 58%, 0.85) !important;
}

.mobile-nav-yelp:hover {
  color: #d32323 !important;
}

.nav-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  background-color: var(--primary);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 14px rgba(18, 48, 109, 0.2);
}

.nav-phone:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(8, 20, 47, 0.25);
}

.phone-icon {
  width: 16px;
  height: 16px;
}

/* Hamburger toggle menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--secondary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-smooth), opacity var(--transition-smooth);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile navigation drawer */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(248, 249, 250, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.mobile-link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--secondary);
  transition: color var(--transition-fast);
}

.mobile-link:hover {
  color: var(--primary);
}

.mobile-phone {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  background-color: var(--accent);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  margin-top: 16px;
  box-shadow: 0 4px 14px rgba(204, 25, 38, 0.3);
}

/* ─── Hero Section with Quote Form ─────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100vh;
  padding: 120px 24px 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(8, 20, 47, 0.96) 0%, rgba(18, 48, 109, 0.88) 55%, rgba(25, 28, 29, 0.82) 100%);
  z-index: 2;
}

.hero-container {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  color: var(--white);
  padding-right: 24px;
}

/* Hero Logo — sized to match the "Greater Sacramento & Roseville Area" badge width */
.hero-logo {
  /* width drives the size so the logo aligns with the badge below it.
     clamp: 200px floor, 65vw fluid (≈325px at 500px, fills badge width),
     320px ceiling on large screens. height:auto preserves the logo's
     native aspect ratio (wide text wordmark, ~2.5:1). */
  width: clamp(200px, 65vw, 320px);
  height: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 20px;
  /* Multi-layer drop-shadow: white outline glow + dark depth shadow */
  filter:
    drop-shadow(0 0 1px rgba(255,255,255,0.9))
    drop-shadow(0 0 2px rgba(255,255,255,0.7))
    drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
  transition: filter var(--transition-fast), transform var(--transition-fast);
}

.hero-logo:hover {
  filter:
    drop-shadow(0 0 1px rgba(255,255,255,0.9))
    drop-shadow(0 0 3px rgba(255,255,255,0.6))
    drop-shadow(0 6px 24px rgba(0, 0, 0, 0.7));
  transform: scale(1.04);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tertiary); /* bright gold reads far better than deep gold against the dark hero */
  background-color: rgba(241, 73, 85, 0.15);
  border: 1px solid rgba(241, 73, 85, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.badge-icon {
  width: 14px;
  height: 14px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(90deg, #ffd9dc, #ff7a83);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 36px;
  max-width: 580px;
  line-height: 1.7;
}

.hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.trust-check {
  color: #ffd9dc;
  font-weight: 900;
}

/* Hero Glassmorphic Form */
.hero-form-wrapper {
  perspective: 1000px;
}

.quote-form-container {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-title {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.form-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  position: relative;
}

.form-group label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.8);
}

.form-group label .required {
  color: #ff6b6b;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  min-height: 44px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ff7a83;
  box-shadow: 0 0 0 3px rgba(255, 122, 131, 0.25);
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* Custom styled select arrow */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-wrapper::after {
  content: '▼';
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.form-group select:focus + .select-wrapper::after {
  color: #ff7a83;
}

.form-group select option {
  background-color: var(--secondary);
  color: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

/* Error text constraints styling */
.error-msg {
  font-size: 0.72rem;
  color: #ff6b6b;
  margin-top: 2px;
  min-height: 14px;
  display: block;
}

/* Invalid inputs styling natively matching guides */
.form-group input:invalid:user-invalid,
.form-group textarea:invalid:user-invalid,
.form-group select:invalid:user-invalid {
  border-color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.05);
}

/* ─── :user-valid / :user-invalid — Scroll-Driven Form Feedback ─ */
/*
 * Native CSS :user-invalid shows errors only AFTER the user has
 * interacted with a field (not prematurely on page load).
 * Baseline: Newly available (Chrome 119+, Firefox 88+, Safari 16.5+)
 */

/* Error state: red ring after user has touched the field */
.form-group input:user-invalid,
.form-group select:user-invalid,
.form-group textarea:user-invalid {
  border-color: #ff6b6b;
  background-color: rgba(255, 107, 107, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}

/* Success state: green ring once input is valid after interaction */
.form-group input:user-valid,
.form-group select:user-valid,
.form-group textarea:user-valid {
  /* Gold, not the near-black primary — primary would be invisible against
     this dark glassmorphic form now that the theme is black/gold. */
  border-color: rgba(241, 73, 85, 0.55);
  box-shadow: 0 0 0 3px rgba(241, 73, 85, 0.12);
}

/* Submit Form Button */
.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--tertiary), var(--accent));
  color: var(--secondary); /* dark text on gold — white-on-gold fails contrast (~2:1) */
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(204, 25, 38, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  min-height: 48px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(204, 25, 38, 0.45);
}

.submit-btn:active {
  transform: translateY(0);
}

.arrow-icon {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.submit-btn:hover .arrow-icon {
  transform: translateX(4px);
}

/* Successful Form Overlay animation */
.form-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 20, 47, 0.98);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-success-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.success-animation-card {
  text-align: center;
  transform: translateY(30px) scale(0.9);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.form-success-overlay.show .success-animation-card {
  transform: translateY(0) scale(1);
}

/* Success Checkmark Circle */
.checkmark-circle {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: block;
  stroke-width: 2;
  stroke: #ff7a83;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #ff7a83;
  margin: 0 auto 24px;
}

.checkmark-circle-line {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: var(--primary);
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke: var(--accent);
  stroke-linecap: round;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
  100% {
    stroke-dashoffset: 0;
  }
}

.success-title {
  color: var(--white);
  font-size: 1.8rem;
  margin-bottom: 12px;
  font-family: var(--font-heading);
}

.success-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 320px;
}

.btn-success-reset {
  background-color: var(--primary);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.btn-success-reset:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
}

/* ─── Services Section ────────────────────────────────────── */
.services-section {
  padding: 96px 24px;
  background-color: var(--white);
  position: relative;
  /* Performance: defer rendering until near viewport */
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 700px;
}

.section-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 48px;
}

.section-header.centered {
  text-align: center;
}

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--secondary);
}

.gold-divider {
  display: block;
  width: 64px;
  height: 4px;
  background: linear-gradient(90deg, var(--tertiary), var(--accent));
  border-radius: var(--radius-full);
  margin: 16px 0 20px;
}

.section-header.centered .gold-divider {
  margin: 16px auto 20px;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--slate-gray);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Services Grid & Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
}

.service-card {
  background-color: var(--neutral-bg);
  border: 1px solid rgba(8, 20, 47, 0.05);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: rgba(18, 48, 109, 0.15);
  box-shadow: 0 16px 40px rgba(8, 20, 47, 0.06);
}

.service-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.service-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-smooth);
}

.service-card:hover .service-card-image img {
  transform: scale(1.05);
}

.service-card-content {
  padding: 28px 32px 36px;
  position: relative;
}

.service-card-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-smooth);
}

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

.service-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  font-size: 0.92rem;
  color: var(--slate-gray);
  margin-bottom: 24px;
  line-height: 1.65;
}

.service-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background-color: rgba(204, 25, 38, 0.08);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ─── Before & After Showcase Slider ──────────────────────── */
.showcase-section {
  padding: 80px 24px 96px;
  background-color: var(--neutral-bg);
  border-block: 1px solid rgba(8, 20, 47, 0.05);
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 750px;
}

/* Extra top clearance for standalone pages where this is the first section
   under the fixed 80px header, rather than following the homepage hero. */
.page-first-section {
  padding-top: 152px;
}

@media (max-width: 768px) {
  .page-first-section {
    padding-top: 128px;
  }
}

/* ─── CTA Band (Our Work page) ─────────────────────────────── */
.cta-band {
  padding: 80px 24px;
  background-color: var(--secondary);
  text-align: center;
}

.cta-band-inner {
  max-width: 560px;
  margin: 0 auto;
}

.cta-band h2 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.02rem;
  margin-bottom: 32px;
}

.cta-band-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tertiary), var(--accent));
  color: var(--secondary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 36px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(204, 25, 38, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.cta-band-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(204, 25, 38, 0.45);
}

.showcase-info {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}

.showcase-bullets {
  text-align: left;
}

.showcase-desc {
  font-size: 1.05rem;
  color: var(--slate-gray);
  line-height: 1.7;
  margin-bottom: 36px;
}

.showcase-bullets {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.showcase-bullet {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.bullet-dot {
  width: 8px;
  height: 8px;
  background-color: var(--tertiary);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 9px;
  box-shadow: 0 0 10px rgba(241, 73, 85, 0.4);
}

.showcase-bullet h3 {
  font-size: 0.95rem;
  color: var(--slate-gray);
}

.showcase-bullet strong {
  color: var(--secondary);
  font-family: var(--font-heading);
}

/* Real Project Photo Carousel */
.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gallery-carousel {
  position: relative;
}

.gallery-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 16px;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-item {
  flex: 0 0 78%;
  scroll-snap-align: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(8, 20, 47, 0.12);
  border: 1px solid rgba(8, 20, 47, 0.08);
  background-color: var(--white);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

@media (min-width: 640px) {
  .gallery-item {
    flex-basis: calc(50% - 12px);
  }
}

@media (min-width: 980px) {
  .gallery-item {
    flex-basis: calc(33.333% - 16px);
  }
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 70px rgba(8, 20, 47, 0.18);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.gallery-item img:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.gallery-item-video {
  position: relative;
}

.gallery-item-video .play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(10, 9, 7, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  pointer-events: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.gallery-item-video .play-button svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.gallery-item-video:hover .play-button {
  background: rgba(204, 25, 38, 0.9);
  transform: translate(-50%, -50%) scale(1.08);
}

.gallery-item figcaption {
  padding: 14px 16px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
}

/* Carousel prev/next arrows (shared style also used by lightbox) */
.gallery-carousel .carousel-nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(8, 20, 47, 0.1);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(8, 20, 47, 0.15);
  z-index: 10;
  transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.gallery-carousel .carousel-nav svg {
  width: 20px;
  height: 20px;
}

.gallery-carousel .carousel-nav:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: translateY(-50%) scale(1.05);
}

.gallery-carousel .carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.gallery-carousel .prev-btn {
  left: -23px;
}

.gallery-carousel .next-btn {
  right: -23px;
}

@media (max-width: 768px) {
  .gallery-carousel .prev-btn {
    left: 8px;
  }
  .gallery-carousel .next-btn {
    right: 8px;
  }
  .gallery-carousel .carousel-nav {
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* Slide indicator dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: rgba(8, 20, 47, 0.2);
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  padding: 0;
}

.carousel-dot:hover {
  background-color: rgba(8, 20, 47, 0.4);
}

.carousel-dot.active {
  background-color: var(--primary);
  transform: scale(1.2);
}

/* ─── Project Photo Lightbox ──────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 7, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
  padding: 60px 24px;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

.lightbox-img {
  max-width: min(90vw, 1100px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox-video {
  max-width: min(90vw, 1100px);
  max-height: 78vh;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  display: none;
  background: #000;
}

.lightbox-caption {
  color: var(--white);
  margin-top: 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.lightbox-close svg,
.lightbox-nav svg {
  width: 22px;
  height: 22px;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

@media (max-width: 640px) {
  .lightbox {
    padding: 90px 16px 40px;
  }
  .lightbox-close {
    top: 16px;
    right: 16px;
  }
  .lightbox-prev {
    left: 8px;
  }
  .lightbox-next {
    right: 8px;
  }
  .lightbox-nav,
  .lightbox-close {
    width: 40px;
    height: 40px;
  }
}

body.lightbox-open {
  overflow: hidden;
}

/* ─── Why Choose Us Section ────────────────────────────────── */
.why-section {
  padding: 96px 24px;
  background-color: var(--white);
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 600px;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

/* M6: Add visual separation between stacked why cards on mobile */
@media (max-width: 600px) {
  .why-grid {
    gap: 16px;
  }

  .why-card {
    border: 1px solid rgba(8, 20, 47, 0.07);
    box-shadow: 0 2px 12px rgba(8, 20, 47, 0.04);
  }
}

.why-card {
  background-color: var(--neutral-bg);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  border: 1px solid rgba(8, 20, 47, 0.03);
  position: relative;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.why-card:hover {
  transform: translateY(-6px);
  border-color: rgba(204, 25, 38, 0.15);
}

.why-num {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, rgba(8, 20, 47, 0.1) 0%, rgba(18, 48, 109, 0.05) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.why-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--secondary);
}

.why-card p {
  font-size: 0.92rem;
  color: var(--slate-gray);
  line-height: 1.6;
}

/* ─── Service Locations Section ───────────────────────────── */
.areas-section {
  padding: 96px 24px;
  background-color: var(--neutral-bg);
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 700px;
}

.areas-grid-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

.areas-info {
  padding-right: 24px;
}

.areas-desc {
  font-size: 1.05rem;
  color: var(--slate-gray);
  line-height: 1.7;
  margin-bottom: 36px;
}

/* Service Areas Cards Wrapper */
.areas-cards-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
  width: 100%;
}

/* Contact bridge widget */
.contact-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid rgba(8, 20, 47, 0.06);
  box-shadow: 0 10px 30px rgba(8, 20, 47, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

/* Yelp Card Styling */
.yelp-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid rgba(8, 20, 47, 0.06);
  box-shadow: 0 10px 30px rgba(8, 20, 47, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.yelp-card:hover {
  transform: translateY(-4px);
  border-color: rgba(211, 35, 35, 0.15); /* Yelp Red accent hover border */
}

.yelp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.yelp-icon {
  width: 24px;
  height: 24px;
  color: #d32323; /* Authentic Yelp Red */
}

.yelp-stars-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.yelp-stars {
  color: #d32323; /* Yelp red, legible on the card background */
  font-size: 1.15rem;
  letter-spacing: 2px;
  line-height: 1;
}

.yelp-rating {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-gray);
}

.yelp-block-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: rgba(211, 35, 35, 0.05);
  border: 1px solid rgba(211, 35, 35, 0.1);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: #d32323;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.yelp-block-btn:hover {
  background-color: #d32323;
  color: var(--white);
  transform: translateY(-2px);
}

.external-link-icon {
  width: 14px;
  height: 14px;
}

/* Adjust card layouts on small tablets/mobiles */
@media (max-width: 600px) {
  .areas-cards-wrapper {
    grid-template-columns: 1fr;
  }
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--slate-gray);
  margin-bottom: 24px;
}

.phone-block-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: rgba(18, 48, 109, 0.05);
  border: 1px solid rgba(18, 48, 109, 0.1);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--primary);
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.phone-block-btn:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.phone-icon-large {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.btn-subtext {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.btn-maintext {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
}

/* Cities Badges grid styling */
.cities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.city-badge {
  background-color: var(--white);
  border: 1px solid rgba(8, 20, 47, 0.04);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.city-badge:hover {
  transform: translateY(-3px);
  border-color: rgba(18, 48, 109, 0.1);
  box-shadow: 0 8px 24px rgba(8, 20, 47, 0.04);
}

.city-icon {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}

.city-icon svg {
  width: 100%;
  height: 100%;
}

.form-privacy {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
  color: var(--slate-gray);
}

.city-details h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
}

.city-details p {
  font-size: 0.78rem;
  color: var(--slate-gray);
}

/* ─── Footer Section ──────────────────────────────────────── */
#footer {
  background-color: var(--secondary);
  color: rgba(255, 255, 255, 0.8);
  padding: 80px 24px 40px;
  border-top: 4px solid var(--primary);
  font-family: var(--font-body);
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 400px;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.25fr 1.25fr;
  gap: 60px;
  margin-bottom: 60px;
}

.brand-col {
  padding-right: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-logo .logo-text {
  color: var(--white);
}

.footer-logo .logo-text .highlight {
  color: #ff7a83;
}

.footer-logo-img-wrapper {
  background: rgba(255, 255, 255, 0.95);
  padding: 5px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  transition: transform var(--transition-smooth) ease;
}

.footer-logo:hover .footer-logo-img-wrapper {
  transform: scale(1.05);
}

.footer-logo-img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 24px;
}

.license-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ff7a83;
  background-color: rgba(255, 122, 131, 0.1);
  border: 1px solid rgba(255, 122, 131, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.footer-col h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.footer-divider {
  display: block;
  width: 32px;
  height: 2px;
  background-color: var(--primary);
  margin-bottom: 24px;
}

.hours-list,
.contact-details-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.hours-list .closed {
  color: #ff6b6b;
  font-weight: 600;
}

.contact-details-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.05em;
}

.contact-value {
  color: var(--white);
  transition: color var(--transition-fast);
}

a.contact-value:hover {
  color: #ff7a83;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 30px;
  padding-right: 60px; /* prevent back-to-top button overlap */
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ─── Back to Top Button ────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background-color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast);
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--accent);
  transform: translateY(-2px);
}

.arrow-up-icon {
  width: 18px;
  height: 18px;
}

/* ─── Sticky Mobile Call Bar ───────────────────────────────── */
/* Hidden by default (desktop); shown only under the 768px breakpoint below. */
.mobile-call-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 998; /* below .mobile-menu (999) so the drawer still covers it when open */
  background-color: var(--secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.mobile-call-bar-inner {
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}

.mobile-call-btn,
.mobile-quote-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.mobile-call-btn {
  background-color: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(204, 25, 38, 0.35);
}

.mobile-call-btn:active {
  transform: scale(0.97);
}

.mobile-quote-btn {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-quote-btn:active {
  transform: scale(0.97);
}

.mobile-call-bar .phone-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Scroll Reveal Animation Effects ──────────────────────── */
/*
 * Baseline: The JS IntersectionObserver in app.js handles the .reveal class
 * for all browsers. For browsers that support Scroll-Driven Animations
 * (Chrome 115+, Edge 115+, Firefox 129+, Safari 18+), CSS takes over
 * entirely — no JS class toggling needed, more performant.
 */

/* Base state: elements start hidden for the JS observer fallback */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* JS fallback: class added by IntersectionObserver */
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Modern CSS Scroll-Driven Animation Override ──────────── */
/*
 * Progressive enhancement: if the browser supports scroll-driven
 * animations, override the JS-based approach entirely. The @supports
 * check MUST include animation-range to filter out partial support.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up {
      from {
        opacity: 0;
        transform: translateY(24px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Override .reveal — CSS animation replaces JS observer entirely */
    .reveal {
      /* Reset JS-fallback transition system */
      opacity: initial;
      transform: initial;
      transition: none;

      /* Scroll-driven animation */
      animation: reveal-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
      animation-timeline: view();
      /* Start when 5% enters viewport, finish when 45% is visible */
      animation-range: entry 5% entry 45%;
    }

    /* No-op: JS will still add .visible but it's redundant — CSS handles it */
    .reveal.visible {
      opacity: 1;
      transform: translateY(0);
      animation: none;
    }
  }
}

/* ─── Responsive Media Queries ────────────────────────────── */

/* Tablet viewports */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 60px;
    padding-top: 20px;
  }
  
  .hero-content {
    padding-right: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-subtitle {
    margin-inline: auto;
  }

  .hero-trust-row {
    justify-content: center;
  }

  .hero-form-wrapper {
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .showcase-info {
    padding-right: 0;
    text-align: left;
  }

  .showcase-bullets {
    align-items: flex-start;
    max-width: 480px;
    margin: 0 auto;
  }

  .areas-grid-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .areas-info {
    padding-right: 0;
    text-align: left;
  }

  /* M7: Center areas info text on tablet, but keep card content left-aligned */
  .areas-desc {
    text-align: left;
  }

  .contact-card {
    max-width: 480px;
    margin: 0 auto;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-col {
    grid-column: 1 / -1;
    padding-right: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

/* Mobile Nav bar adjustments */
@media (max-width: 768px) {
  #header {
    height: 70px;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .services-section,
  .showcase-section,
  .why-section,
  .areas-section,
  .cta-band {
    padding-block: 64px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-col {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-divider {
    margin-inline: auto;
  }

  .hours-list {
    width: 100%;
    max-width: 320px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Reveal the sticky call bar and make room for it so it doesn't cover
     footer content or overlap the back-to-top button. */
  .mobile-call-bar {
    display: block;
  }

  body {
    padding-bottom: 76px;
  }

  .back-to-top {
    bottom: 86px;
  }
}

/* Extra small devices adjustments */
@media (max-width: 480px) {
  .hero-section {
    padding-inline: 12px;
    padding-top: 100px;
  }

  /* M1: Prevent hero title overflow on very small screens */
  .hero-title {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Hero logo — mobile: already handled by 65vw clamp in main rule */

  .gradient-text {
    display: block;
  }

  /* M2: Trust badges row — smaller gap, tighter sizing */
  .hero-trust-row {
    gap: 10px 16px;
  }

  .trust-badge {
    font-size: 0.8rem;
  }

  /* M3: Ensure form has a small buffer from screen edges */
  .hero-form-wrapper {
    margin-inline: 4px;
  }

  .quote-form-container {
    padding: 24px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cities-grid {
    grid-template-columns: 1fr;
  }

  /* M4: Carousel nav buttons — move inside the image on small screens */
  .prev-btn {
    left: 6px;
  }

  .next-btn {
    right: 6px;
  }

  .carousel-nav {
    width: 34px;
    height: 34px;
    background-color: rgba(255, 255, 255, 0.92);
  }

  .carousel-nav svg {
    width: 16px;
    height: 16px;
  }

  /* Footer bottom: reset padding-right on small screens since button wraps */
  .footer-bottom {
    padding-right: 0;
  }

  /* M8: Tighten the sticky call bar so both buttons fit on narrow phones */
  .mobile-call-bar-inner {
    gap: 8px;
  }

  .mobile-call-btn,
  .mobile-quote-btn {
    font-size: 0.82rem;
    padding: 11px 8px;
  }
}
