/* Core runtime, smooth scroll, load reveal, navbar, and back-to-top */
html.lenis,
html.lenis body {
  height: auto;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {

  html,
  body {
    overflow-x: clip;
  }
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.site-header {
  position: fixed;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, top 0.3s ease;
  will-change: transform;
}

.site-header.is-hidden {
  transform: translateY(calc(-100% - 30px));
}

.site-header .header-inner {
  transition: background-color 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.site-header.is-scrolled {
  top: 10px;
}

.site-header.is-scrolled .header-inner {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.main-nav>a {
  position: relative;
}

.main-nav>a::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  left: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.main-nav>a:hover::after,
.main-nav>a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(5, 6, 7, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  content: "";
  opacity: 1;
  transform: scale(1.025);
  transition: opacity 1.2s ease, backdrop-filter 1.2s ease, transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero.is-loaded::after {
  opacity: 0;
  transform: scale(1);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  pointer-events: none;
}

/* Keep the call and estimate shortcuts visible while the page scrolls. */
.floating-contact {
  position: fixed;
  z-index: 18;
  right: 22px;
  bottom: 84px;
}

.back-to-top {
  position: fixed;
  z-index: 18;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

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

.back-to-top:hover {
  box-shadow: 0 10px 28px rgba(188, 134, 45, 0.38);
}

/* A nearly imperceptible ambient gradient keeps static areas feeling alive. */
.section {
  position: relative;
}

.section::before {
  position: absolute;
  z-index: -1;
  top: 8%;
  right: 2%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 134, 45, 0.055), transparent 68%);
  content: "";
  pointer-events: none;
  animation: ambient-float 10s ease-in-out infinite alternate;
}

@keyframes ambient-float {
  to {
    transform: translate3d(-18px, 14px, 0) scale(1.06);
  }
}

/* One-time section, item, divider, image, and mask reveals */
.motion-ok [data-reveal] {
  opacity: 0;
  will-change: opacity, transform, clip-path;
  transition: opacity 0.78s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), clip-path 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.motion-ok [data-reveal=fade-up] {
  transform: translate3d(0, 34px, 0);
}

.motion-ok [data-reveal=fade-left] {
  transform: translate3d(-38px, 0, 0);
}

.motion-ok [data-reveal=fade-right] {
  transform: translate3d(38px, 0, 0);
}

.motion-ok [data-reveal=zoom-in] {
  transform: scale(0.98);
}

.motion-ok [data-reveal=scale-reveal] {
  transform: translate3d(0, 20px, 0) scale(0.985);
}

.motion-ok [data-reveal=clip-reveal] {
  clip-path: inset(0 0 12% 0 round 8px);
  transform: translate3d(0, 22px, 0);
}

.motion-ok [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

.motion-ok .reveal-item {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.64s ease var(--reveal-delay, 0ms), transform 0.72s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms), box-shadow 0.4s ease, border-color 0.4s ease;
}

.motion-ok .is-visible .reveal-item {
  opacity: 1;
  transform: none;
}

main>section {
  position: relative;
}


main>section.is-visible:not(.hero)::after {
  transform: scaleX(1);
}

.motion-ok .image-reveal {
  clip-path: inset(0 0 12% 0 round 8px);
  filter: saturate(0.88);
  opacity: 0.35;
  transform: scale(1.035);
  transition: clip-path 0.95s cubic-bezier(0.22, 1, 0.36, 1), filter 0.9s ease, opacity 0.75s ease, transform 1s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

.motion-ok .image-reveal.is-revealed {
  clip-path: inset(0 0 0 0 round 8px);
  filter: saturate(1);
  opacity: 1;
  transform: scale(1);
  will-change: auto;
}

.motion-ok .paragraph-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.motion-ok .paragraph-reveal.is-text-visible {
  opacity: 1;
  transform: none;
}

/* Image-only hover motion, arrows, and button feedback */
.service-grid img,
.door-track img,
.gallery-grid img,
.blog-grid img,
.intro-image {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease !important;
}

.service-grid img:hover,
.door-track img:hover,
.gallery-grid img:hover,
.blog-grid img:hover,
.intro-image:hover {
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.035) !important;
}

.service-grid a b,
.blog-grid a,
.title-row>a,
.pill span,
.pill b {
  display: inline-block;
}

.premium-button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.38s ease, background-color 0.38s ease, color 0.38s ease !important;
}

button.back-to-top {
  position: fixed;
}

.premium-button:hover {
  box-shadow: 0 9px 24px rgba(188, 134, 45, 0.23);
}

.premium-button:active {
  transform: scale(0.97);
}

.button-ripple {
  position: absolute !important;
  z-index: -1;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  transform: scale(0);
  animation: button-ripple 0.65s ease-out forwards;
}

@keyframes button-ripple {
  to {
    opacity: 0;
    transform: scale(24);
  }
}

/* Fine-pointer cursor follower and hover indicator */
.cursor-dot,
.cursor-ring {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}

.cursor-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--gold);
}

.cursor-ring {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 1px solid rgba(188, 134, 45, 0.72);
  transition: width 0.24s ease, height 0.24s ease, margin 0.24s ease, background-color 0.24s ease, border-color 0.24s ease;
}

.cursor-active .cursor-dot,
.cursor-active .cursor-ring {
  opacity: 1;
}

.cursor-ring.is-hovering {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-color: rgba(188, 134, 45, 0.35);
  background: rgba(188, 134, 45, 0.09);
}

/* Accessibility and device-specific performance safeguards */
@media (hover: none),
(pointer: coarse) {

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }

}

@media (max-width: 760px) {
  .site-header.is-scrolled {
    top: 8px;
  }

  .floating-contact {
    right: 14px;
    bottom: 68px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
  }

  .section::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal],
  .reveal-item,
  .image-reveal,
  .paragraph-reveal {
    opacity: 1 !important;
    clip-path: none !important;
    transform: none !important;
    filter: none !important;
  }

  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}
