/* Custom rules that Tailwind utilities can't express cleanly, or that need
   mobile-safe hover handling (Tailwind's hover: only fires on pointer:fine). */

:root {
  --color-ivory: #faf7f1;
  --color-ivory-alt: #f1ede4;
  --color-navy: #101f33;
  --color-navy-soft: #2c3e54;
  --color-teal: #2e6b62;
  --color-teal-dark: #1f4a44;
  --color-gold: #a9834a;
  --color-line: #e3ddce;
}

html.lenis {
  height: auto;
}

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

body {
  background-color: var(--color-ivory);
  color: var(--color-navy);
}

/* Editorial heading font */
.font-serif-display {
  font-family: "Fraunces", ui-serif, Georgia, serif;
}

/* Hover-only micro-interactions, gated so touch devices never get a
   sticky :hover state after tap (the "tailwind hover on mobile" bug). */
@media (hover: hover) and (pointer: fine) {
  .hover-lift:hover {
    transform: translateY(-4px);
    border-color: var(--color-teal);
  }

  .hover-underline-grow::after {
    width: 100%;
  }

  .nav-link:hover {
    color: var(--color-navy);
  }

  .nav-link:hover .nav-link-underline {
    transform: scaleX(1);
  }
}

.hover-lift {
  transition:
    transform 0.35s ease,
    border-color 0.35s ease;
}

.nav-link {
  position: relative;
  padding: 0.35rem 0.05rem;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-navy-soft);
  transition: color 0.3s ease;
}

.nav-link.is-active {
  color: var(--color-navy);
}

.nav-link-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background-color: var(--color-teal);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s ease;
}

.nav-link.is-active .nav-link-underline {
  transform: scaleX(1);
}

/* Header gains weight once the page scrolls past the hero */
#site-header.is-scrolled {
  box-shadow: 0 8px 24px -18px rgba(16, 31, 51, 0.35);
}

/* Reveal-on-scroll base state; GSAP flips these via ScrollTrigger */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced-motion regardless of GSAP settings */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* "Smoke appear" text effect — add class="smoke-in" to any heading/text
   block and main.js auto-animates it into focus on scroll. No per-instance
   JS wiring needed, same as .reveal. */
.smoke-in {
  opacity: 0;
  filter: blur(16px);
  transform: translateY(18px) scale(1.04);
  will-change: opacity, filter, transform;
}

.smoke-in-visible {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .smoke-in {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* Lottie placeholder slots keep their box size before the JS/JSON loads,
   so there is no layout shift. */
.lottie-icon {
  width: 56px;
  height: 56px;
}

/* Thin architectural divider used between eyebrow and heading */
.eyebrow-rule::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background-color: var(--color-teal);
  margin-right: 10px;
  vertical-align: middle;
}

/* Mobile menu open state */
.mobile-nav {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.mobile-nav.is-open {
  max-height: 480px;
}

/* Quick business enquiry modal (navbar CTA) */
.modal-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-panel {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal-panel {
    transition: none;
  }
}

/* Focus visibility for keyboard users (WCAG) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

/* =========================================================
   HERO SPLASH MASK IMAGE
========================================================= */

.hero-splash-mask {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 680 / 650;

  /*
    Replace this URL with your transparent
    splash-pattern WebP file.
  */
  -webkit-mask-image: url("../img/mask-3.webp");
  mask-image: url("../img/mask-3.webp");

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-size: contain;
  mask-size: contain;
}

.hero-splash-main-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center bottom;
}

/* =========================================================
   SERVICES JOURNEY
========================================================= */

.services-journey {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.services-journey-track {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  pointer-events: none;
}

.services-journey-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.services-journey-path-base,
.services-journey-path-progress {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.services-journey-path-base {
  stroke: rgba(227, 221, 206, 0.95);
  stroke-width: 2;
}

.services-journey-path-progress {
  stroke: url("#services-journey-gradient");
  stroke-width: 3;
  filter: drop-shadow(0 0 10px rgba(46, 107, 98, 0.16));
}

.services-journey-node-ring {
  fill: rgba(46, 107, 98, 0.12);
  stroke: rgba(46, 107, 98, 0.32);
  stroke-width: 1.25;
}

.services-journey-node-dot {
  fill: var(--color-teal-dark);
}

.service-journey-card {
  position: relative;
  z-index: 1;
  min-height: 100%;
  border-radius: 0.4rem;
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0.99), rgba(246, 241, 233, 0.99)),
    var(--color-ivory);
  box-shadow:
    0 18px 38px -34px rgba(16, 31, 51, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background-color 0.35s ease;
}

.service-journey-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.service-journey-card-glow {
  position: absolute;
  top: -3rem;
  right: -2rem;
  width: 8rem;
  height: 8rem;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgba(169, 131, 74, 0.12) 0%,
    rgba(169, 131, 74, 0.05) 32%,
    rgba(169, 131, 74, 0) 72%
  );
  pointer-events: none;
}

.service-journey-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(46, 107, 98, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 237, 228, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px -24px rgba(16, 31, 51, 0.28);
}

.service-journey-card-copy {
  margin-top: 1rem;
  max-width: 30ch;
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(44, 62, 84, 0.9);
}

.service-journey-card-cta {
  width: fit-content;
  border-bottom: 1px solid rgba(16, 31, 51, 0.18);
  padding-bottom: 0.2rem;
  transition:
    color 0.35s ease,
    border-color 0.35s ease,
    transform 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
  .service-journey-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-teal);
    box-shadow:
      0 24px 52px -36px rgba(16, 31, 51, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .service-journey-card:hover .service-journey-card-cta {
    color: var(--color-teal-dark);
    border-color: rgba(31, 74, 68, 0.4);
    transform: translateX(2px);
  }

  .service-journey-card:hover .service-journey-card-icon {
    border-color: rgba(46, 107, 98, 0.22);
  }
}

@media (min-width: 1024px) {
  .services-journey {
    padding-top: 5rem;
    padding-bottom: 5.5rem;
  }

  .service-journey-card {
    opacity: 0;
    transform: translateY(42px) scale(0.97);
    will-change: opacity, transform;
  }

  .services-journey-grid {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-journey-card {
    opacity: 1;
    transform: none;
  }
}
