/* styles.css */
/* Pipeworks Plumbing & Drain Services Global Theme */

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

::selection {
  background: rgba(27, 160, 224, 0.35);
  color: #f8fafc;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background-color: #080e1a;
  color: #f1f5f9;
  line-height: 1.7;
  overflow-x: hidden;
  overflow-x: clip;
  scroll-padding-bottom: 80px;
  background-image:
    radial-gradient(ellipse 130% 70% at 50% -15%, rgba(27, 160, 224, 0.09), transparent 52%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(15, 111, 163, 0.07), transparent 48%),
    radial-gradient(ellipse 55% 45% at 0% 85%, rgba(5, 10, 20, 0.85), transparent 50%);
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Background Grain Layer */
.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

/* Main Homepage Hero Background */
#hero {
  /* PNG fallback; image-set picks WebP when supported (~100KB vs multi‑MB PNG) */
  background-image:
    linear-gradient(105deg, rgba(8,14,26,0.98) 32%, rgba(8,14,26,0.72) 52%, rgba(8,14,26,0.35) 100%),
    url('./Plumber repairing kitchen sink pipes.png');
  background-image:
    linear-gradient(105deg, rgba(8,14,26,0.98) 32%, rgba(8,14,26,0.72) 52%, rgba(8,14,26,0.35) 100%),
    -webkit-image-set(
      url('./Plumber repairing kitchen sink pipes.webp') type('image/webp'),
      url('./Plumber repairing kitchen sink pipes.png') type('image/png')
    );
  background-image:
    linear-gradient(105deg, rgba(8,14,26,0.98) 32%, rgba(8,14,26,0.72) 52%, rgba(8,14,26,0.35) 100%),
    image-set(
      url('./Plumber repairing kitchen sink pipes.webp') type('image/webp'),
      url('./Plumber repairing kitchen sink pipes.png') type('image/png')
    );
  background-size: cover;
  background-position: center;
  background-color: #080e1a;
}

/* Global Navigation & Header - Premium Glassmorphism */
#site-header {
  background-color: transparent;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#site-header.scrolled {
  background-color: rgba(8,14,26,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.07),
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 60px rgba(27, 160, 224, 0.04);
}

#mobile-menu { display: none; }
#mobile-menu.open { display: block; }

#mobile-menu nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Premium Dark Cards */
.card {
  background: linear-gradient(165deg, #101c33 0%, #0d1526 48%, #0a121f 100%);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 12px 32px rgba(8, 14, 26, 0.55),
    0 0 0 1px rgba(27, 160, 224, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(27,160,224,0.28);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.25),
    0 20px 48px rgba(8, 14, 26, 0.65),
    0 0 40px rgba(27, 160, 224, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Service Detail Cards */
.service-detail-card {
  background: linear-gradient(180deg, #0e1628 0%, #0b1221 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    0 16px 40px rgba(8, 14, 26, 0.5),
    0 0 0 1px rgba(27, 160, 224, 0.05);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.service-detail-card:hover {
  transform: translateY(-4px);
  border-color: rgba(27,160,224,0.22);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.3),
    0 24px 56px rgba(8, 14, 26, 0.55),
    0 0 48px rgba(27, 160, 224, 0.1);
}

/* Service page hero imagery — depth without flat Tailwind shadows */
.service-detail-media {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 20px 48px rgba(8, 14, 26, 0.4),
    0 0 0 1px rgba(27, 160, 224, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Base Service Display Cards (Homepage) */
.service-card {
  background: linear-gradient(180deg, #121c30 0%, #0f172a 55%, #0c1424 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.22),
    0 14px 36px rgba(8, 14, 26, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(27,160,224,0.3);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.28),
    0 28px 56px rgba(8, 14, 26, 0.6),
    0 0 36px rgba(27, 160, 224, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.service-card .card-img {
  position: relative; 
  height: 180px; 
  overflow: hidden;
}

@media (max-width: 640px) {
  .service-card .card-img { height: 160px; }
}

.service-card .card-img img {
  width: 100%; 
  height: 100%; 
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.service-card .card-img .img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, #0f172a 0%, rgba(15,23,42,0.4) 55%, rgba(15,23,42,0.1) 100%);
}

.service-card .card-img .card-icon {
  position: absolute; bottom: 12px; left: 16px;
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(27,160,224,0.2); backdrop-filter: blur(8px);
  border: 1px solid rgba(27,160,224,0.35);
  display: flex; align-items: center; justify-content: center;
}

.priority-badge {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 12px; border-radius: 100px;
  background: rgba(20, 132, 188, 0.92); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
  font-size: 0.68rem; font-weight: 700; color: #fff;
  letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(8, 14, 26, 0.35), 0 0 0 1px rgba(27, 160, 224, 0.15);
}

/* Light Mode Aesthetic (Why Us) */
.card-light {
  background: #ffffff;
  border: 1px solid rgba(8, 14, 26, 0.07);
  box-shadow:
    0 1px 2px rgba(8, 14, 26, 0.04),
    0 8px 28px rgba(8, 14, 26, 0.06),
    0 0 0 1px rgba(27, 160, 224, 0.04);
  border-radius: 16px;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.card-light:hover {
  transform: translateY(-3px);
  border-color: rgba(27,160,224,0.22);
  box-shadow:
    0 2px 6px rgba(8, 14, 26, 0.06),
    0 16px 40px rgba(27, 160, 224, 0.1),
    0 0 0 1px rgba(27, 160, 224, 0.1);
}

.section-light {
  background-color: #f6f5f1;
  background-image:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(27, 160, 224, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(15, 111, 163, 0.05), transparent 50%);
}
.whyus-bg {
  background: linear-gradient(180deg, #0f192d 0%, #0d1526 45%, #0a121f 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(27, 160, 224, 0.04);
}

/* Icon Elements */
.icon-ring {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(27,160,224,0.14), rgba(27,160,224,0.06));
  border: 1px solid rgba(27,160,224,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.check-item {
  display: flex; align-items: flex-start; gap: 10px;
}

.info-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px;
}

.info-box-cyan {
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: 12px;
  padding: 20px;
}

.info-box-amber {
  background: rgba(251,191,36,0.07);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 12px;
  padding: 20px;
}

/* Buttons — brand-forward, restrained (no generic blue / shimmer) */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  border-radius: 10px; border: none; cursor: pointer;
  background-image: linear-gradient(135deg, #0f6fa3 0%, #1484bc 38%, #1BA0E0 72%, #3dbaea 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.18),
    0 10px 28px rgba(27, 160, 224, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease, opacity 0.22s ease;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 14px 36px rgba(27, 160, 224, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:focus-visible {
  outline: 2px solid #55b9ed;
  outline-offset: 3px;
}

.btn-primary:active { transform: scale(0.97) translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  background: rgba(255,255,255,0.06); color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(27,160,224,0.32);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(27, 160, 224, 0.12),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-secondary:focus-visible {
  outline: 2px solid #55b9ed;
  outline-offset: 3px;
}

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

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: #0f6fa3;
  background: #fff;
  border: 1px solid rgba(15, 111, 163, 0.22);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  box-shadow:
    0 1px 2px rgba(8, 14, 26, 0.05),
    0 8px 24px rgba(27, 160, 224, 0.09),
    0 0 0 1px rgba(27, 160, 224, 0.05);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.btn-outline:hover {
  transform: translateY(-2px);
  color: #06334d;
  border-color: rgba(27, 160, 224, 0.4);
  box-shadow:
    0 4px 12px rgba(8, 14, 26, 0.08),
    0 14px 36px rgba(27, 160, 224, 0.14),
    0 0 0 1px rgba(27, 160, 224, 0.1);
}

.btn-outline:focus-visible {
  outline: 2px solid #1BA0E0;
  outline-offset: 3px;
}

.btn-outline:active { transform: scale(0.98) translateY(0); }

/* Nav Underline */
nav a { position: relative; }
nav a::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 2px; background: #1BA0E0; border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.16,1,0.3,1);
}
nav a:hover::after, nav a:focus-visible::after { width: 100%; }

/* Fade Up & Reveal Engine */
.fade-up {
  opacity: 0; transform: translateY(28px) scale(0.98);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}

.fade-up.visible { opacity: 1; transform: translateY(0) scale(1); }

@keyframes reveal-up {
  from { clip-path: inset(0 0 100% 0); opacity: 0; transform: translateY(14px); }
  to   { clip-path: inset(0 0 0% 0);   opacity: 1; transform: translateY(0); }
}

.reveal-heading { opacity: 0; clip-path: inset(0 0 100% 0); }
.reveal-heading.visible { animation: reveal-up 0.8s cubic-bezier(0.16,1,0.3,1) forwards; }

.float-bob { animation: float-bob 4.5s ease-in-out infinite; }
@keyframes float-bob {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-10px); }
}

/* Form Styling */
.form-input {
  width: 100%; padding: 13px 16px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: #f1f5f9;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.form-input::placeholder { color: #64748b; }
.form-input:focus { border-color: #1BA0E0; box-shadow: 0 0 0 3px rgba(27,160,224,0.14), inset 0 1px 2px rgba(0, 0, 0, 0.1); background: rgba(27,160,224,0.06); }

/* 16px+ inputs avoid iOS zoom on focus */
@media (max-width: 640px) {
  .form-input { font-size: 1rem; }
}
.form-input:hover:not(:focus) { border-color: rgba(27,160,224,0.3); }
.form-input option { background: #0d1526; color: #f1f5f9; }

/* Testimonials */
.testimonial-card {
  background: linear-gradient(180deg, #ffffff 0%, #fafaf8 100%);
  border: 1px solid rgba(8, 14, 26, 0.07);
  border-left: 3px solid #1BA0E0;
  border-radius: 16px; padding: 28px;
  box-shadow:
    0 1px 2px rgba(8, 14, 26, 0.05),
    0 10px 32px rgba(8, 14, 26, 0.07),
    0 0 0 1px rgba(27, 160, 224, 0.05);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.testimonial-card:hover {
  transform: translateY(-3px);
  border-color: rgba(27, 160, 224, 0.15);
  box-shadow:
    0 4px 12px rgba(8, 14, 26, 0.08),
    0 20px 48px rgba(27, 160, 224, 0.12),
    0 0 0 1px rgba(27, 160, 224, 0.08);
}

/* Trust Pills Grid (Hero) */
.trust-grid { display: flex; gap: 12px; }
.trust-pill {
  white-space: nowrap; font-size: 0.78rem; font-weight: 600; color: #e2e8f0;
  background: rgba(255,255,255,0.06); padding: 8px 16px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Base structural CSS */
section {
  scroll-margin-top: clamp(4.5rem, 14vw, 6rem);
}

/* Reserve space above anchor targets for fixed header + notch */
@media (min-width: 1024px) {
  section { scroll-margin-top: 5.5rem; }
}

/* Main content clears fixed mobile CTA bar (home page only) */
@media (max-width: 768px) {
  main#main-content.has-mobile-cta {
    padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }
}

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

.service-card .card-img img {
  height: 100%;
  max-height: none;
}

.services-page-hero {
  background-color: #080e1a;
  background-image:
    radial-gradient(ellipse 90% 70% at 20% -30%, rgba(27, 160, 224, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 95% 10%, rgba(15, 111, 163, 0.1), transparent 45%);
}

.section-contact {
  background: linear-gradient(180deg, #060a12 0%, #080e1a 40%, #0a101c 100%);
  position: relative;
}

.section-contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(27, 160, 224, 0.08), transparent 55%);
  pointer-events: none;
}

.site-footer {
  background: linear-gradient(180deg, #03070e 0%, #050a14 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(27, 160, 224, 0.05);
}

/* Sticky Bars */
.sticky-call-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: none;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  background: rgba(8, 14, 26, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow:
    0 -4px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(27, 160, 224, 0.08);
}

@media (max-width: 768px) { .sticky-call-bar { display: flex; gap: 12px; } }

/* Sticky call bar buttons — absolute overflow prevention.
   Uses !important to win against Tailwind CDN JIT same-specificity rules.
   max-width: calc(50% - 6px) = exactly half the flex row minus half the 12px gap.
   overflow: hidden on bar clips anything that escapes regardless of font rendering. */
.sticky-call-bar { overflow: hidden !important; }
.sticky-call-bar .btn-primary,
.sticky-call-bar .btn-secondary {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  max-width: calc(50% - 6px) !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  font-size: 0.875rem !important;
  overflow: hidden !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* FAQ Summary */
summary:focus-visible { outline: 2px solid #1BA0E0; outline-offset: 4px; border-radius: 8px; }
details[open] summary ~ * { animation: slideDown 0.3s ease-out; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes counter-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stat-number { display: inline-block; }
.stat-number.animated { animation: counter-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-wrapper {
  overflow: hidden;
  max-width: 100%;             /* prevent wide marquee track from inflating parent width */
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-track { display: flex; width: max-content; gap: 12px; animation: marquee 24s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }

@media (max-width: 400px) { .marquee-wrapper { display: none; } }

@media (hover: none) {
  .btn-primary:hover { transform: none; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 10px 28px rgba(27, 160, 224, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
  .btn-outline:hover { transform: none; }
  .btn-secondary:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .marquee-track { animation: none; }
  .float-bob { animation: none; }
}

/* Hero CTA buttons — pure CSS layout, Tailwind flex classes removed from HTML */
/* !important used to win against Tailwind CDN JIT injection regardless of cascade order */
/* Mobile default: stack buttons full-width */
.hero-cta-group {
  flex-direction: column !important;
  max-width: 100% !important;
}
.hero-cta-group > a {
  width: 100% !important;
  min-width: 0 !important;     /* prevent flex-item min-width:auto from overriding width */
  max-width: 100% !important;
  box-sizing: border-box !important;
  justify-content: center;
}
/* Tablet/desktop: side-by-side */
@media (min-width: 640px) {
  .hero-cta-group {
    flex-direction: row !important;
    max-width: none !important;
  }
  .hero-cta-group > a {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* Ensure footer clears the fixed mobile sticky CTA bar */
@media (max-width: 768px) {
  .site-footer {
    padding-bottom: calc(5rem + max(0px, env(safe-area-inset-bottom)));
  }
}
