/* ==========================================================================
   Valley Wide Cleaning — Premium Design System
   Refined Sage + Warm Cream + Brushed Gold
   FLUID RESPONSIVE — scales smoothly from 320px → 4K (3840px+)
   ========================================================================== */

:root {
  /* ===================== Color tokens ===================== */
  --sage-50:  #f4f9f5;
  --sage-100: #e6f0e9;
  --sage-200: #c8e0d0;
  --sage-300: #9cc4a8;
  --sage-400: #6ea582;
  --sage-500: #4f8865;
  --sage-600: #3d6e51;
  --sage-700: #325843;
  --sage-800: #2a4736;
  --sage-900: #1d3326;

  --cream:       #faf7f2;
  --cream-soft:  #f7f3ec;
  --pearl:       #f1ebe1;
  --linen:       #ebe4d6;
  --stone-warm:  #d9d2c4;

  --gold:        #c9a961;
  --gold-light:  #e5d4a7;
  --gold-deep:   #a48749;

  --ink:    #1a201d;
  --slate:  #3d4641;
  --muted:  #6b746f;
  --whisper:#9ba39e;

  --primary:        var(--sage-600);
  --primary-hover:  var(--sage-700);
  --primary-soft:   var(--sage-50);
  --bg:             var(--cream);
  --fg:             var(--ink);

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(45, 60, 50, 0.06);
  --shadow-md:  0 4px 14px rgba(45, 60, 50, 0.08);
  --shadow-lg:  0 12px 32px -8px rgba(45, 60, 50, 0.16);
  --shadow-xl:  0 24px 48px -12px rgba(45, 60, 50, 0.20);
  --shadow-glow:0 8px 24px rgba(61, 110, 81, 0.25);

  /* Radii — slightly fluid */
  --r-sm: clamp(0.4rem, 0.35rem + 0.2vw, 0.5rem);
  --r-md: clamp(0.75rem, 0.6rem + 0.4vw, 1rem);
  --r-lg: clamp(1rem, 0.8rem + 0.6vw, 1.5rem);
  --r-xl: clamp(1.5rem, 1.2rem + 0.8vw, 2rem);
  --r-pill: 9999px;

  /* ===================== Fluid typography (16px viewport → 1920px+) =====
     clamp(min, fluid, max) — scales smoothly without breakpoint jumps. */
  --fs-xs:    clamp(0.75rem,   0.71rem + 0.18vw, 0.8125rem);
  --fs-sm:    clamp(0.8125rem, 0.78rem + 0.20vw, 0.9375rem);
  --fs-base:  clamp(0.9375rem, 0.90rem + 0.25vw, 1.0625rem);
  --fs-md:    clamp(1rem,      0.95rem + 0.30vw, 1.125rem);
  --fs-lg:    clamp(1.0625rem, 1.00rem + 0.40vw, 1.25rem);
  --fs-xl:    clamp(1.1875rem, 1.10rem + 0.55vw, 1.5rem);
  --fs-2xl:   clamp(1.375rem,  1.25rem + 0.75vw, 1.875rem);
  --fs-3xl:   clamp(1.625rem,  1.40rem + 1.10vw, 2.25rem);
  --fs-4xl:   clamp(1.95rem,   1.65rem + 1.50vw, 3rem);
  --fs-5xl:   clamp(2.4rem,    1.95rem + 2.25vw, 4rem);
  --fs-6xl:   clamp(2.75rem,   2.10rem + 3.25vw, 5rem);
  --fs-7xl:   clamp(3rem,      2.05rem + 4.75vw, 6.25rem);
  --fs-8xl:   clamp(3.5rem,    2.20rem + 6.50vw, 8rem);

  /* ===================== Fluid spacing scale ===================== */
  --space-2xs: clamp(0.25rem, 0.22rem + 0.15vw, 0.375rem);
  --space-xs:  clamp(0.5rem,  0.45rem + 0.25vw, 0.75rem);
  --space-sm:  clamp(0.75rem, 0.65rem + 0.50vw, 1rem);
  --space-md:  clamp(1rem,    0.85rem + 0.75vw, 1.5rem);
  --space-lg:  clamp(1.5rem,  1.20rem + 1.50vw, 2.25rem);
  --space-xl:  clamp(2rem,    1.50rem + 2.50vw, 3.5rem);
  --space-2xl: clamp(3rem,    2.00rem + 5.00vw, 6rem);
  --space-3xl: clamp(4rem,    2.50rem + 7.50vw, 9rem);

  /* ===================== Fluid layout ===================== */
  --container-px: clamp(1rem, 0.5rem + 2.5vw, 3rem);
  --container-max: min(1440px, calc(100vw - 2 * var(--container-px)));
  --container-wide: min(1680px, calc(100vw - 2 * var(--container-px)));

  /* ===================== Touch target sizes (always finger-friendly) === */
  --tap: 44px;
}

/* ==================================================================== Base */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Prevents iOS Safari font-boost on landscape rotation */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Fluid root keeps everything in proportion across breakpoints */
  font-size: clamp(15px, 0.8rem + 0.25vw, 17px);
}

html:focus-within { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  font-size: var(--fs-base);
  line-height: 1.6;
  /* Avoid horizontal overflow on any viewport */
  overflow-x: hidden;
  /* Better dynamic viewport handling on mobile (address bar collapse) */
  min-height: 100vh;
  min-height: 100dvh;
}

::selection { background: var(--sage-200); color: var(--sage-900); }

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

.font-display {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.022em;
  font-weight: 800;
}

.font-serif {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 50, "WONK" 0;
}

.font-serif-italic {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 80, "WONK" 0;
}

/* Display headlines — automatically fluid (override Tailwind size classes) */
.display-xl {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-size: var(--fs-7xl);
  text-wrap: balance;
}

@media (max-width: 380px) {
  .display-xl { letter-spacing: -0.025em; line-height: 1.05; }
}

/* Override Tailwind's static text-* sizes on hero headlines for true fluidity.
   These have higher specificity than utilities applied alongside them.       */
.display-xl.text-5xl,
.display-xl.text-6xl,
.display-xl.text-7xl,
h1.display-xl { font-size: var(--fs-7xl); }

/* ============================================================ Layout ===== */
.container-x {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--container-px);
}

/* Wider container variant for ultra-wide displays where useful */
.container-wide {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--container-px);
}

@media (min-width: 1700px) {
  .container-x { max-width: 1440px; }
}
@media (min-width: 2200px) {
  .container-x { max-width: 1560px; }
}

.section-y {
  padding-block: var(--space-2xl);
}

/* ============================================================ Colors ===== */
.bg-cream         { background-color: var(--cream); }
.bg-cream-soft    { background-color: var(--cream-soft); }
.bg-pearl         { background-color: var(--pearl); }
.bg-linen         { background-color: var(--linen); }
.bg-sage-50       { background-color: var(--sage-50); }
.bg-sage-100      { background-color: var(--sage-100); }
.bg-sage-600      { background-color: var(--sage-600); }
.bg-sage-700      { background-color: var(--sage-700); }
.bg-sage-800      { background-color: var(--sage-800); }
.bg-sage-900      { background-color: var(--sage-900); }
.bg-ink           { background-color: var(--ink); }
.bg-gold          { background-color: var(--gold); }

.text-sage-600    { color: var(--sage-600); }
.text-sage-700    { color: var(--sage-700); }
.text-sage-800    { color: var(--sage-800); }
.text-sage-900    { color: var(--sage-900); }
.text-ink         { color: var(--ink); }
.text-slate-warm  { color: var(--slate); }
.text-muted-warm  { color: var(--muted); }
.text-cream       { color: var(--cream); }
.text-gold        { color: var(--gold); }
.text-gold-deep   { color: var(--gold-deep); }

.border-sage-200  { border-color: var(--sage-200); }
.border-sage-600  { border-color: var(--sage-600); }
.border-cream     { border-color: var(--linen); }

/* ====================================================== Backgrounds ====== */
.bg-cream-gradient {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-soft) 50%, var(--pearl) 100%);
}

.bg-sage-gradient {
  background: linear-gradient(135deg, var(--sage-800) 0%, var(--sage-600) 50%, var(--sage-500) 100%);
}

.bg-hero-mesh {
  background-color: var(--cream);
  background-image:
    radial-gradient(at 18% 22%, rgba(156, 196, 168, 0.35) 0px, transparent 55%),
    radial-gradient(at 82% 18%, rgba(229, 212, 167, 0.40) 0px, transparent 50%),
    radial-gradient(at 50% 95%, rgba(110, 165, 130, 0.18) 0px, transparent 50%),
    radial-gradient(at 8% 78%, rgba(241, 235, 225, 0.80) 0px, transparent 60%);
}

.bg-noise {
  position: relative;
}
.bg-noise::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* ============================================================ Buttons ==== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.75rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: -0.01em;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.18s ease,
              color 0.18s ease,
              border-color 0.18s ease;
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
  /* Always touch-friendly */
  min-height: var(--tap);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--sage-600);
  outline-offset: 3px;
}

/* On very small phones, allow buttons to wrap text instead of overflowing */
@media (max-width: 380px) {
  .btn { white-space: normal; padding: 0.85rem 1.25rem; font-size: 0.875rem; }
  .btn-lg { padding: 1rem 1.5rem; font-size: 0.9375rem; }
}

.btn-primary {
  background: var(--sage-600);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background: var(--sage-700); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(61, 110, 81, 0.4); }

.btn-ghost {
  background: rgba(255,255,255,0.7);
  color: var(--sage-800);
  border: 2px solid var(--sage-200);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--sage-600); background: #fff; }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(201, 169, 97, 0.3);
}
.btn-gold:hover { background: var(--gold-deep); color: #fff; transform: translateY(-2px); }

.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover { background: var(--slate); transform: translateY(-2px); }

.btn-lg { padding: 1.1rem 2rem; font-size: var(--fs-base); }
.btn-xl { padding: 1.3rem 2.5rem; font-size: var(--fs-md); }

/* ============================================================ Cards ====== */
.card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: clamp(1.25rem, 1rem + 1.25vw, 2rem);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(26, 32, 29, 0.04);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  position: relative;
  /* Container query context — lets card-internal sizing react to card width */
  container-type: inline-size;
  container-name: card;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(26, 32, 29, 0.06); }

.card-flat {
  background: #fff;
  border-radius: var(--r-lg);
  padding: clamp(1rem, 0.85rem + 0.75vw, 1.5rem);
  box-shadow: 0 0 0 1px var(--linen);
}

.card-feature {
  background: linear-gradient(180deg, #fff 0%, var(--cream-soft) 100%);
  border-radius: var(--r-lg);
  padding: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(26, 32, 29, 0.04);
}

/* ============================================================ Forms ====== */
.input, .select, .textarea {
  width: 100%;
  background: #fff;
  border: 2px solid var(--linen);
  border-radius: var(--r-md);
  padding: 0.9rem 1.1rem;
  font-size: var(--fs-base);
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  min-height: var(--tap);
  /* Prevent iOS zoom on focus when input < 16px */
  -webkit-text-size-adjust: 100%;
}
@media (max-width: 640px) {
  .input, .select, .textarea { font-size: max(16px, var(--fs-base)); }
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--sage-500);
  box-shadow: 0 0 0 4px rgba(110, 165, 130, 0.15);
}
.input::placeholder, .textarea::placeholder { color: var(--whisper); }
.textarea { min-height: 140px; resize: vertical; }

.label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--slate); margin-bottom: 0.5rem; }

/* ============================================================ Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--sage-100);
  color: var(--sage-800);
  padding: 0.35rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-gold {
  background: rgba(201, 169, 97, 0.15);
  color: var(--gold-deep);
}

.badge-cream {
  background: var(--cream-soft);
  color: var(--slate);
  border: 1px solid var(--linen);
}

/* ============================================================ Eyebrow ==== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--sage-700);
}
.eyebrow::before {
  content: '';
  width: clamp(20px, 1.5vw, 32px);
  height: 1px;
  background: var(--sage-600);
  flex-shrink: 0;
}

/* ========================================================= Navigation ==== */
.nav-link {
  position: relative;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--slate);
  padding: 0.5rem 0;
  transition: color 0.2s;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.nav-link:hover, .nav-link.active { color: var(--sage-700); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  height: 2px; border-radius: 2px;
  background: var(--sage-600);
}

/* ========================================================= Floating CTA == */
.floating-call {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0));
  right: max(1.25rem, env(safe-area-inset-right, 0));
  z-index: 60;
  background: var(--sage-600);
  color: #fff;
  padding: 0.95rem 1.25rem;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 14px 30px rgba(61, 110, 81, 0.45);
  text-decoration: none;
  animation: pulseSoft 2.6s ease-in-out infinite;
  min-height: var(--tap);
}
.floating-call:hover { background: var(--sage-700); }

@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 14px 30px rgba(61, 110, 81, 0.45); }
  50%      { box-shadow: 0 18px 40px rgba(61, 110, 81, 0.55), 0 0 0 8px rgba(61, 110, 81, 0.08); }
}

@media (min-width: 1024px) { .floating-call { display: none; } }

/* ========================================================= Animations ==== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

.reveal-delay-1.in-view { transition-delay: 0.08s; }
.reveal-delay-2.in-view { transition-delay: 0.16s; }
.reveal-delay-3.in-view { transition-delay: 0.24s; }
.reveal-delay-4.in-view { transition-delay: 0.32s; }

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

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee { animation: marquee 28s linear infinite; }

/* ========================================================= Utilities ==== */
.divider-leaf {
  position: relative;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--linen) 30%, var(--linen) 70%, transparent);
}
.divider-leaf::after {
  content: '✦';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--cream);
  padding: 0 1rem;
  color: var(--gold);
  font-size: 0.9rem;
}

.kbd-shadow {
  box-shadow:
    0 1px 2px rgba(26,32,29,0.06),
    0 0 0 1px rgba(26,32,29,0.05),
    inset 0 -2px 0 rgba(26,32,29,0.04);
}

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.aspect-photo  { aspect-ratio: 4 / 5; }
.aspect-card   { aspect-ratio: 3 / 4; }
.aspect-wide   { aspect-ratio: 16 / 10; }

/* On phones, photos in 4:5 aspect can dominate the fold — slightly squarer */
@media (max-width: 480px) {
  .aspect-card  { aspect-ratio: 4 / 5; }
}

/* ========================================================= Accordion ==== */
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(1rem, 0.85rem + 0.75vw, 1.25rem) clamp(1.1rem, 0.95rem + 0.75vw, 1.5rem);
  background: #fff;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink);
  border: 1px solid var(--linen);
  transition: border-color 0.2s, background 0.2s;
  min-height: var(--tap);
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { border-color: var(--sage-300); }
.faq-item[open] summary { border-color: var(--sage-500); border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--sage-50); }
.faq-item summary .chev { transition: transform 0.25s; flex-shrink: 0; }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-body {
  padding: clamp(1rem, 0.85rem + 0.75vw, 1.25rem) clamp(1.1rem, 0.95rem + 0.75vw, 1.5rem) clamp(1.25rem, 1rem + 1vw, 1.5rem);
  background: var(--sage-50);
  border: 1px solid var(--sage-500);
  border-top: 0;
  border-radius: 0 0 var(--r-md) var(--r-md);
  color: var(--slate);
  font-size: var(--fs-base);
  line-height: 1.7;
}

/* ========================================================= Stars ==== */
.stars { display: inline-flex; gap: 0.15rem; color: var(--gold); }

/* ========================================================= Mobile Nav ==== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 70;
  padding: 5rem 1.5rem 2rem;
  padding-top: max(5rem, calc(env(safe-area-inset-top, 0) + 4rem));
  padding-bottom: max(2rem, calc(env(safe-area-inset-bottom, 0) + 1.5rem));
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Use dynamic viewport height — accounts for mobile address bar */
  height: 100vh;
  height: 100dvh;
}
.mobile-menu.open { transform: translateX(0); }

/* ========================================================= Hero image ==== */
.hero-frame {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.hero-frame::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(26, 32, 29, 0.25) 100%);
  pointer-events: none;
}

/* On landscape phones, hero images shrink to keep CTA above the fold */
@media (max-height: 600px) and (orientation: landscape) {
  .hero-frame { max-height: 70vh; }
}

/* ========================================================= Card grids === */
/* Auto-fluid grid: cards size themselves, no breakpoint juggling required.
   Use these wrappers when you want a "fits as many as possible" layout.    */
.grid-fluid-sm { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.grid-fluid-md { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-fluid-lg { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

/* ========================================================= Container queries
   On narrow card widths, switch internal layouts (titles smaller, etc).    */
@container card (max-width: 320px) {
  .card h3 { font-size: var(--fs-lg); }
  .card .badge { font-size: 0.7rem; }
}

/* ========================================================= Promo bar ==== */
.promo-bar {
  font-size: var(--fs-xs);
}
@media (max-width: 380px) {
  .promo-bar .container-x { padding-block: 0.5rem; }
  .promo-bar p { font-size: 0.7rem; line-height: 1.3; }
}

/* ========================================================= Print ======== */
@media print {
  nav, footer, .promo-bar, .floating-call, .no-print, button, .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: underline; }
  .container-x { max-width: 100%; padding: 0; }
  h1, h2, h3 { break-after: avoid; }
  img { max-width: 60% !important; }
}

/* ========================================================= Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================== Tablet-specific tuning ===
   Tablets are the trickiest viewport — too wide to feel "phone", too narrow
   to feel "desktop". A few targeted nudges keep things feeling just right. */
@media (min-width: 640px) and (max-width: 1023px) {
  /* Slightly tighter section padding so tablet portrait feels generous     */
  .section-y { padding-block: clamp(3rem, 5vw, 5rem); }
}

/* ============================================== Ultra-wide (1920px+) ===== */
@media (min-width: 1920px) {
  body { font-size: clamp(16px, 0.9rem + 0.2vw, 18px); }
}

/* ============================================== Tiny phones (≤340px) ==== */
@media (max-width: 340px) {
  :root { --container-px: 0.875rem; }
  .btn { padding: 0.75rem 1.1rem; }
  .card { padding: 1rem; }
  .hero-frame { border-radius: var(--r-md); }
}

/* ============================================== Foldable / very narrow === */
@media (max-width: 280px) {
  html { font-size: 14px; }
  .display-xl { font-size: 2rem; }
}

/* ============================================== Extra-tall hero on very
   tall narrow screens (foldables, 21:9 phones) — keeps balance ============ */
@media (min-aspect-ratio: 9/19) and (max-width: 480px) {
  .section-y { padding-block: var(--space-xl); }
}

/* ============================================== Field-error helper ====== */
.field-error:empty { display: none; }

/* ============================================== Nav elevated state ====== */
[data-nav].nav-elevated {
  box-shadow: 0 4px 24px -8px rgba(45,60,50,0.12);
  border-color: transparent;
}

/* ============================================== Image fluid sizing helper
   Use on any <img> that should always behave well                         */
.img-fluid { width: 100%; height: auto; max-width: 100%; object-fit: cover; }

/* ============================================== Long-word safety ========
   Prevents extremely long words/URLs from breaking layouts on small screens */
h1, h2, h3, h4, p, li, a {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Don't hyphenate display headlines — keeps brand presentation crisp       */
h1, .display-xl, .font-display { hyphens: manual; }

/* ============================================== Scrollbar polish ======= */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--cream-soft); }
  ::-webkit-scrollbar-thumb {
    background: var(--sage-300);
    border-radius: 6px;
    border: 3px solid var(--cream-soft);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--sage-500); }
}

/* =========================================================================
   MOBILE-FIRST POLISH
   Specific overrides for phone-sized viewports. Forces inline Tailwind
   utility classes to defer to the fluid system (defined above).
   ========================================================================= */

/* --- Force fluid hero headlines, beating any inline text-* utility ------- */
h1.display-xl,
.display-xl[class*="text-5xl"],
.display-xl[class*="text-6xl"],
.display-xl[class*="text-7xl"] {
  font-size: var(--fs-7xl) !important;
  line-height: 1.02;
}

/* --- Tighter section gaps on phones ------------------------------------- */
@media (max-width: 640px) {
  .section-y { padding-block: clamp(2.5rem, 8vw, 4rem); }

  /* Reduce huge gap on grid sections */
  .gap-12 { gap: clamp(1.5rem, 5vw, 2.5rem) !important; }
  .gap-14 { gap: clamp(1.75rem, 5vw, 2.5rem) !important; }

  /* Service / feature grid spacing */
  .lg\:grid-cols-3 > *,
  .lg\:grid-cols-4 > * { min-width: 0; }

  /* Hero buttons stack and span full width on tiny phones */
  .btn-lg { width: 100%; max-width: 360px; }

  /* Cards never break out of viewport */
  .card, .card-flat, .card-feature { max-width: 100%; min-width: 0; }

  /* Hero photo doesn't dominate the viewport */
  .hero-frame { max-height: 70vh; max-height: 70dvh; }

  /* Stat blocks stack 2x2 instead of 4x1 — already implicit via grid-cols-2 */

  /* Floating call button is smaller and tucked tighter */
  .floating-call {
    padding: 0.75rem 1.05rem;
    font-size: 0.875rem;
    bottom: max(1rem, env(safe-area-inset-bottom, 0));
    right: max(0.875rem, env(safe-area-inset-right, 0));
  }

  /* Promo bar text shrinks gracefully */
  .promo-bar p { font-size: 0.75rem; }
  .promo-bar p span:not(:first-child) { display: inline; }

  /* Navigation: phone CTA and logo balance */
  nav .container-x { padding-block: 0.875rem; }

  /* Eyebrow shouldn't break — center if its parent is centered */
  .eyebrow { font-size: 0.7rem; letter-spacing: 0.13em; }

  /* Form quote-card on home doesn't overshoot */
  form { width: 100%; }

  /* Stars sized down */
  .stars svg { width: 16px; height: 16px; }

  /* FAQ summary tighter on mobile */
  .faq-item summary { padding: 0.875rem 1rem; font-size: 0.9375rem; }
  .faq-body { padding: 0.875rem 1rem 1.1rem; font-size: 0.9375rem; }

  /* Footer lists smaller */
  footer .container-x { gap: 1.5rem; }
}

/* --- Very small phones (320–380px) --------------------------------------- */
@media (max-width: 380px) {
  .container-x { padding-inline: 1rem; }

  /* Hide decorative chips that would clutter the hero */
  .float-y { display: none !important; }

  /* Trust bar collapses to 2 columns visually */
  .grid-cols-2 { gap: 0.75rem; }

  /* Hero stat-bar — vertical stacking */
  .grid.grid-cols-2.lg\:grid-cols-4 > * { padding: 0.75rem; }
  .grid.grid-cols-2.lg\:grid-cols-4 .text-4xl,
  .grid.grid-cols-2.lg\:grid-cols-4 .text-5xl { font-size: 1.85rem !important; }
}

/* --- Landscape phones — keep hero usable -------------------------------- */
@media (max-height: 600px) and (orientation: landscape) and (max-width: 950px) {
  .section-y { padding-block: clamp(1.5rem, 4vh, 3rem); }
  .hero-frame { aspect-ratio: 16 / 10; max-height: 60vh; }
  .display-xl { font-size: clamp(2rem, 4.5vw, 3rem) !important; }
  .floating-call { padding: 0.6rem 0.9rem; font-size: 0.8125rem; }
}

/* --- Tablets (portrait + landscape iPad) -------------------------------- */
@media (min-width: 640px) and (max-width: 1023px) {
  /* Hero on tablet: balanced 2-col when room allows */
  .lg\:col-span-6 { grid-column: span 6 / span 6; }

  /* Service grid: 2 cols on tablet, not 1 (Tailwind's md:grid-cols-2 already does this) */

  /* Section padding feels right at tablet sizes */
  .container-x { padding-inline: clamp(1.5rem, 3vw, 2.5rem); }
}

/* --- Very tall narrow viewports (Galaxy Fold cover, etc) ---------------- */
@media (max-width: 320px) {
  html { font-size: 14px; }
  .display-xl { font-size: clamp(1.75rem, 9vw, 2.25rem) !important; }
  .container-x { padding-inline: 0.875rem; }
  .btn { padding: 0.7rem 1rem; font-size: 0.8125rem; }
  .card { padding: 1rem; border-radius: 1rem; }
  .floating-call { padding: 0.65rem 0.9rem; font-size: 0.75rem; }
}

/* --- Dark-OS preview: respect any user preference for darker UIs --------
   We're not implementing a full dark mode, but elements that have stark
   white/cream backgrounds get a subtle warm tint to feel less harsh.       */
@media (prefers-color-scheme: dark) {
  /* No-op for now — site stays light-theme by design.
     Add specific dark mode here later if requested.                        */
}

/* --- Print-friendly checklist page (when downloaded as PDF) ------------- */
@media print {
  .display-xl { font-size: 24pt !important; }
  .section-y { padding-block: 1rem; }
  .hero-frame { box-shadow: none; }
}

/* --- Image optimization helpers ---------------------------------------- */
img[loading="lazy"] { content-visibility: auto; }

/* Skip-to-main-content link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; top: 0; }
