.ts-footer {
  position: relative;
}

.ts-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 30px,
      rgb(201 162 39 / 3%) 30px,
      rgb(201 162 39 / 3%) 31px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 30px,
      rgb(201 162 39 / 3%) 30px,
      rgb(201 162 39 / 3%) 31px
    );
  pointer-events: none;
  z-index: 0;
}

.ts-footer > * {
  position: relative;
  z-index: 1;
}

.page-depth {
  position: relative;
  background-color: var(--tiller-bg-darkest, #000000);
  background-image:
    radial-gradient(circle at 50% 18%, rgb(0 225 132 / 8%), transparent 42%),
    radial-gradient(circle at 20% 70%, rgb(212 175 55 / 6%), transparent 45%),
    radial-gradient(circle at 80% 40%, rgb(217 220 224 / 5%), transparent 50%);
  perspective: 1400px;
  transform-style: preserve-3d;
}

.page-depth::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgb(212 175 55 / 2%) 1px, transparent 1px),
    linear-gradient(0deg, rgb(0 225 132 / 2%) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 12%;
  pointer-events: none;
  z-index: 0;
}

.parallax-layer {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transform: translateZ(var(--parallax-z, 0)) translateY(var(--parallax-y, 0));
}

.parallax-layer--back {
  --parallax-z: -80px;
  --parallax-y: -6px;

  opacity: 92%;
}

.parallax-layer--mid {
  --parallax-z: -40px;
  --parallax-y: -2px;
}

.parallax-layer--front {
  --parallax-z: 40px;
  --parallax-y: 2px;
}

.hero-3d {
  position: relative;
  perspective: 1600px;
  transform-style: preserve-3d;
  overflow: hidden; /* clip visual bleed from translateZ children */
}

.hero-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 60% 20%, rgb(0 225 132 / 8%), transparent 45%),
    radial-gradient(circle at 30% 70%, rgb(212 175 55 / 6%), transparent 50%);
  filter: blur(18px);
  opacity: 40%;
  pointer-events: none;
  z-index: 0;
}

.hero-3d .hero__content,
.hero-3d .crosshatch-hero__content,
.hero-3d .ts-hero__inner {
  position: relative;
  z-index: 2;
  transform: translateZ(64px);
  filter: drop-shadow(0 12px 36px rgb(0 0 0 / 40%));
}

/* Removed duplicate hero styles - now in components/hero.css */

.hero-3d .hero__crosshatch-pattern,
.hero-3d .crosshatch-hero__pattern {
  transform: translateZ(-40px);
  opacity: 70%;
}

.btn-3d,
.card-3d {
  position: relative;
  transform-style: preserve-3d;
  transition:
    transform 0.25s var(--tiller-ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)),
    box-shadow 0.25s var(--tiller-ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
  will-change: transform, box-shadow;
}

.btn-3d:hover,
.btn-3d:focus-visible,
.card-3d:hover,
.card-3d:focus-within {
  transform: translateZ(14px) translateY(-2px);
  box-shadow:
    0 10px 24px rgb(0 0 0 / 40%),
    0 0 22px var(--tiller-color-emerald-glow, rgb(0 225 132 / 70%)),
    0 0 18px rgb(212 175 55 / 55%);
}

.btn-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgb(255 255 255 / 12%) 45%, transparent 80%);
  mix-blend-mode: screen;
  opacity: 0%;
  transition: opacity 0.25s var(--tiller-ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
  pointer-events: none;
}

.btn-3d:hover::after,
.btn-3d:focus-visible::after {
  opacity: 100%;
}

.card-3d {
  background: linear-gradient(180deg, rgb(22 22 22 / 92%), rgb(0 0 0 / 88%));
  border: 1px solid var(--tiller-border-color-light, rgb(212 175 55 / 10%));
  box-shadow:
    0 8px 24px rgb(0 0 0 / 35%),
    0 0 18px rgb(0 225 132 / 25%);
}

.card-3d::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgb(217 220 224 / 12%);
  box-shadow: inset 0 0 18px rgb(212 175 55 / 14%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .page-depth,
  .hero-3d,
  .parallax-layer,
  .btn-3d,
  .card-3d {
    perspective: none;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .page-depth::before,
  .hero-3d::after,
  .btn-3d::after {
    display: none;
  }
}

.footer-compliance::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--tiller-color-emerald, #10b981);
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: trust-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgb(16 185 129 / 40%);
}

@keyframes trust-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgb(16 185 129 / 40%);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 8px 4px rgb(16 185 129 / 20%);
  }
}

.ts-grout-divider {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(201 162 39 / 20%) 10%,
    rgb(201 162 39 / 50%) 30%,
    rgb(16 185 129 / 60%) 50%,
    rgb(201 162 39 / 50%) 70%,
    rgb(201 162 39 / 20%) 90%,
    transparent 100%
  );
  margin: 0 auto;
  max-width: 80%;
  position: relative;
}

.ts-grout-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--tiller-color-emerald, #10b981);
  border-radius: 50%;
  border: 2px solid var(--tiller-bg-darker, #121414);
  box-shadow:
    0 0 0 2px rgb(201 162 39 / 40%),
    0 0 12px rgb(16 185 129 / 50%);
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background-image: url('/assets/img/patterns/sacred-tile.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom right;
  opacity: 8%;
  pointer-events: none;
}

.home-cta .container {
  position: relative;
}

.home-cta .container::before,
.home-cta .container::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background-image: url('/assets/img/patterns/flower-of-life.svg');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 8%;
  pointer-events: none;
}

.home-cta .container::before {
  top: -20px;
  left: -20px;
}

.home-cta .container::after {
  bottom: -20px;
  right: -20px;
  transform: rotate(180deg);
}

.btn--primary {
  position: relative;
  overflow: hidden;
}

.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgb(255 255 255 / 20%) 50%, transparent 100%);
  transition: left 0.3s ease;
}

.btn--primary:hover::after {
  left: 100%;
}

.service-card .service-icon {
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  filter: drop-shadow(0 0 12px rgb(16 185 129 / 60%));
}

.card--review::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-size: 4rem;
  font-family: Georgia, serif;
  color: var(--tiller-color-gold, #c9a227);
  opacity: 20%;
  line-height: 1;
  pointer-events: none;
}

.footer-contact-phone::before,
.footer-contact-email::before {
  display: inline-block;
  margin-right: 0.5rem;
  opacity: 70%;
  transition: opacity 0.3s ease;
}

.footer-contact-phone:hover::before,
.footer-contact-email:hover::before {
  opacity: 100%;
}

.footer-contact-phone a::before {
  content: '📞';
}

.footer-contact-email a::before {
  content: '✉️';
}

.hero-facts .fact-item {
  position: relative;
  padding-left: 1.5rem;
}

.hero-facts .fact-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--tiller-color-emerald, #10b981);
  border-radius: 2px;
  box-shadow: 0 0 8px rgb(16 185 129 / 50%);
}

.hero-highlights .highlight-icon {
  color: var(--tiller-color-emerald, #10b981);
  font-weight: bold;
  text-shadow: 0 0 8px rgb(16 185 129 / 50%);
}

.footer-social a {
  position: relative;
}

.footer-social a::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgb(16 185 129 / 0%);
  transition: all 0.3s ease;
  z-index: -1;
}

.footer-social a:hover::after {
  background: rgb(16 185 129 / 20%);
  box-shadow: 0 0 16px rgb(16 185 129 / 40%);
}

@supports (animation-timeline: scroll()) {
  .service-card,
  .card--review,
  .highlight-item {
    animation: fade-slide-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }

  @keyframes fade-slide-up {
    from {
      opacity: 0%;
      transform: translateY(20px);
    }

    to {
      opacity: 100%;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-compliance::before,
  .btn--primary::after {
    animation: none;
    transition: none;
  }

  .service-card,
  .card--review,
  .highlight-item {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .home-hero::after {
    width: 100px;
    height: 15%;
  }

  .home-cta .container::before,
  .home-cta .container::after {
    width: 50px;
    height: 50px;
    opacity: 5%;
  }

  .ts-grout-divider {
    max-width: 90%;
  }
}
