body {
  background-color: var(--color-old-lace);
  color: var(--color-carbon-black);
}

html,
body {
  width: 100%;
}

/* Keep horizontal overflow clipped without breaking sticky descendants in Chromium. */
body {
  overflow-x: hidden;
}

main {
  overflow: visible;
}

.hero-pattern {
  background-image: radial-gradient(
    var(--color-lime-moss) 1px,
    transparent 1px
  );
  background-size: 30px 30px;
  opacity: 0.15;
}

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.services-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='1' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* Trust Badge Marquee */
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee-scroll 22s linear infinite;
}

.marquee-container {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-duration: 80s; }
}

/* Blob Animations */
@keyframes float {
  0% {
    transform: translate(0px, 0px);
  }
  50% {
    transform: translate(10px, -20px);
  }
  100% {
    transform: translate(0px, 0px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Normalized quote styling across service subpages */
.service-quote {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0;
  font-kerning: none;
  font-feature-settings:
    "liga" 0,
    "calt" 0,
    "kern" 0;
}

/* Blog TOC sticky behavior (desktop) */
.blog-toc-aside {
  position: relative;
}

.blog-toc-sticky {
  position: static;
  height: fit-content;
}

.blog-toc-link {
  position: relative;
  display: block;
}

.blog-toc-link.is-active {
  color: var(--color-fiery-terracotta);
  border-left-color: var(--color-fiery-terracotta);
}

@media (min-width: 1024px) {
  .blog-toc-grid {
    align-items: stretch;
  }

  .blog-toc-aside {
    align-self: stretch;
    overflow: visible;
  }

  .blog-toc-sticky {
    position: sticky;
    top: var(--blog-toc-top, calc(var(--header-offset, 0px) + 1rem));
    max-height: var(
      --blog-toc-max-height,
      calc(100vh - var(--header-offset, 0px) - 2rem)
    );
    overflow-y: auto;
  }
}

/* Hide default browser disclosure arrow on <details>/<summary> (Safari iOS) */
summary {
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}

/* FAQ card expansion animation for unified FAQ blocks */
details > div.px-6.pb-6.text-gray-600 {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  will-change: max-height, opacity, padding-bottom, margin-bottom;
  transition:
    max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    padding-bottom 320ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

details
  > summary.flex.items-center.justify-between.p-6.cursor-pointer.list-none.font-bold.text-pine-teal {
  transition: padding-bottom 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

details[open] > div.px-6.pb-6.text-gray-600 {
  max-height: var(--faq-content-max, 0px);
  opacity: 1;
  padding-bottom: 2.75rem;
  margin-bottom: 1rem;
}

details[open]
  > summary.flex.items-center.justify-between.p-6.cursor-pointer.list-none.font-bold.text-pine-teal {
  padding-bottom: 0.75rem;
  margin-bottom: 0rem;
}

details[data-faq-closing]
  > summary.flex.items-center.justify-between.p-6.cursor-pointer.list-none.font-bold.text-pine-teal {
  padding-bottom: 1.5rem;
}

details[data-faq-closing] > div.px-6.pb-6.text-gray-600 {
  max-height: 0;
  opacity: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

details[data-faq-closing] summary i {
  transform: rotate(0deg);
}

@media (prefers-reduced-motion: reduce) {
  details > div.px-6.pb-6.text-gray-600 {
    transition: none;
  }

  details
    > summary.flex.items-center.justify-between.p-6.cursor-pointer.list-none.font-bold.text-pine-teal {
    transition: none;
  }
}

/* Top-bar collapse transition */
#top-bar {
  transition: all 0.25s ease;
}
.topbar-hidden #top-bar {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-translate, 30px))
    scale(var(--reveal-scale, 1));
  filter: var(--reveal-filter, none);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease,
    filter 0.9s ease !important;
  will-change: opacity, transform, filter;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}
.reveal--fade-in {
  --reveal-translate: 0px;
}
.reveal--fade-right {
  --reveal-translate: 0px;
  transform: translateX(-32px) scale(var(--reveal-scale, 1));
}
.reveal--fade-left {
  --reveal-translate: 0px;
  transform: translateX(32px) scale(var(--reveal-scale, 1));
}
.reveal--scale-up {
  --reveal-scale: 0.96;
}
.reveal--blur-in {
  --reveal-filter: blur(6px);
  --reveal-scale: 0.98;
}

/* ===== Mobile / Tablet: disable decorative animations for performance ===== */
/* Excludes: nav/header (inline styles in loader.js), contact forms             */
@media (max-width: 1023px) {
  /* Show scroll-reveal elements immediately — no fade-in jank while scrolling */
  .reveal,
  .reveal--fade-in,
  .reveal--fade-right,
  .reveal--fade-left,
  .reveal--scale-up,
  .reveal--blur-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  /* Stop ambient floating blob/background animations */
  .animate-float {
    animation: none !important;
  }
}

/* Touch devices: disable hover-triggered transforms on page content           */
/* (hover fires on tap on touch — causes layout shift / looks unintentional)   */
/* header and form elements are intentionally excluded so their states persist  */
@media (hover: none) and (pointer: coarse) {
  main *:hover,
  footer *:hover {
    transform: none !important;
  }
}

/* Service subpage hero: fill below the fixed header on phones without
   leaving the false top/bottom gaps caused by min-h-screen + justify-center. */
.service-subpage-hero {
  position: relative;
  overflow: hidden;
}

@media (max-width: 639px) {
  .service-subpage-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2rem;
  }
}

@media (min-width: 640px) {
  .service-subpage-hero {
    min-height: 0;
    display: block;
    padding-top: 0;
    overflow: visible;
  }
}

/* Top-bar collapse transition */
#top-bar {
  transition: all 0.25s ease;
}
.topbar-hidden #top-bar {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

/* Scroll reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-translate, 30px))
    scale(var(--reveal-scale, 1));
  filter: var(--reveal-filter, none);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease,
    filter 0.9s ease !important;
  will-change: opacity, transform, filter;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}
.reveal--fade-in {
  --reveal-translate: 0px;
}
.reveal--fade-right {
  --reveal-translate: 0px;
  transform: translateX(-32px) scale(var(--reveal-scale, 1));
}
.reveal--fade-left {
  --reveal-translate: 0px;
  transform: translateX(32px) scale(var(--reveal-scale, 1));
}
.reveal--scale-up {
  --reveal-scale: 0.96;
}
.reveal--blur-in {
  --reveal-filter: blur(6px);
  --reveal-scale: 0.98;
}

/* ===== Mobile / Tablet: disable decorative animations for performance ===== */
/* Excludes: nav/header (inline styles in loader.js), contact forms             */
@media (max-width: 1023px) {
  /* Show scroll-reveal elements immediately — no fade-in jank while scrolling */
  .reveal,
  .reveal--fade-in,
  .reveal--fade-right,
  .reveal--fade-left,
  .reveal--scale-up,
  .reveal--blur-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  /* Stop ambient floating blob/background animations */
  .animate-float {
    animation: none !important;
  }
}

/* Touch devices: disable hover-triggered transforms on page content           */
/* (hover fires on tap on touch — causes layout shift / looks unintentional)   */
/* header and form elements are intentionally excluded so their states persist  */
@media (hover: none) and (pointer: coarse) {
  main *:hover,
  footer *:hover {
    transform: none !important;
  }
}
