/* Stable header + layout — no enter animations on multi-page navigation */

html {
  scrollbar-gutter: stable;
}

body {
  overflow-y: scroll;
}

.mmr-page-shell {
  padding-top: 4rem;
}

@media (min-width: 640px) {
  .mmr-page-shell {
    padding-top: 5rem;
  }
}

.mmr-page-shell > header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  transform: translateZ(0);
  backface-visibility: hidden;
}

header nav a {
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Desktop header: clear logo–menu separation, tighter nav item spacing */
@media (min-width: 1024px) {
  header .container-x {
    justify-content: flex-start !important;
    gap: 2.5rem;
  }

  header .container-x > a + div {
    margin-left: auto;
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  header .container-x nav {
    gap: 0.625rem !important;
  }

  header .container-x nav a.rounded-full,
  header .container-x > div > a.rounded-full {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 1280px) {
  header .container-x {
    gap: 3.5rem;
  }
}

/* Inner pages: tighter gap between banner and content on mobile */
@media (max-width: 639px) {
  .mmr-page-hero .container-x {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .mmr-page-hero .display-lg + p,
  .mmr-page-hero h1 + p {
    margin-top: 0.75rem;
  }

  .mmr-page-hero + section.bg-background {
    padding-top: 0;
    padding-bottom: 2.5rem;
  }

  .mmr-page-hero + section.bg-background .container-x {
    padding-top: 1.5rem !important;
  }

  /* Legacy export markup before re-build */
  section.bg-background.py-24 {
    padding-top: 0;
    padding-bottom: 2.5rem;
  }

  section.bg-background.py-24 .container-x,
  main > section.bg-background .container-x[class*="pt-20"],
  main > section.bg-background .container-x[class*="pt-28"] {
    padding-top: 1.5rem !important;
  }

  #mmr-hero .container-x {
    min-height: min(22rem, 72svh);
    padding-bottom: 4rem;
  }
}

.mmr-reveal-item,
.mmr-reveal-section {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--mmr-delay, 0s);
  will-change: opacity, transform;
}

.mmr-page-hero,
.mmr-page-hero.mmr-reveal-section {
  opacity: 1 !important;
  transform: none !important;
}

.mmr-reveal-item.is-visible,
.mmr-reveal-section.is-visible {
  opacity: 1;
  transform: none;
}

/* Service/card grids: visible even if reveal script has not run yet */
.grid-cards-3 > .h-full,
.grid-cards-4 > .h-full,
.grid-cards-3-sm > .h-full {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .mmr-reveal-item,
  .mmr-reveal-section {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Hero carousel */
#mmr-hero:not([data-started="true"]) .absolute.inset-0.z-0 > img {
  opacity: 1 !important;
  transition: none;
}

#mmr-hero .mmr-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#mmr-hero .mmr-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease-in-out;
  transform: scale(1);
  will-change: opacity, transform;
}

#mmr-hero .mmr-hero-img.is-active {
  opacity: 1;
  z-index: 1;
}

#mmr-hero[data-started="true"] .mmr-hero-img-a.is-active:first-of-type {
  transition: none;
}

#mmr-hero .mmr-hero-img.mmr-hero-zoom-in.is-active {
  animation: mmrHeroZoomIn 8s linear forwards;
}

#mmr-hero .mmr-hero-img.mmr-hero-zoom-out.is-active {
  animation: mmrHeroZoomOut 8s linear forwards;
}

@keyframes mmrHeroZoomIn {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.18);
  }
}

@keyframes mmrHeroZoomOut {
  from {
    transform: scale(1.18);
  }
  to {
    transform: scale(1);
  }
}

#mmr-hero .mmr-hero-tint {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: opacity 1s ease-in-out;
  pointer-events: none;
}

#mmr-hero .mmr-hero-content {
  opacity: 1;
  transform: none;
  animation: none;
}

#mmr-hero .mmr-hero-content.mmr-hero-content-in {
  animation: mmrHeroContentIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#mmr-hero .mmr-hero-content.mmr-hero-content-in.mmr-hero-content-skip {
  animation: none;
}

@keyframes mmrHeroContentIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#mmr-hero .mmr-hero-dot {
  cursor: pointer;
  border: none;
  padding: 0;
}

/* Mobile navigation drawer */
body.mmr-mobile-nav-open {
  overflow: hidden;
}

.mmr-mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.8);
  animation: mmrFadeIn 0.25s ease;
}

.mmr-mobile-nav-overlay[hidden] {
  display: none !important;
}

.mmr-mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: min(100vw, 24rem);
  max-width: 24rem;
  height: 100dvh;
  border-left: 1px solid var(--border, #e2e8f0);
  background: var(--background, #fff);
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.12);
  animation: mmrSlideInRight 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mmr-mobile-nav-drawer[hidden] {
  display: none !important;
}

@keyframes mmrFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes mmrSlideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.mmr-mobile-nav-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 1.25rem 1.5rem;
}

.mmr-mobile-nav-title {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ink, #0f172a);
}

.mmr-mobile-nav-tagline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
}

.mmr-mobile-nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--ink, #0f172a);
  cursor: pointer;
}

.mmr-mobile-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.mmr-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mmr-mobile-nav-list > li + li {
  margin-top: 0.25rem;
}

.mmr-mobile-nav-top,
.mmr-mobile-nav-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink, #0f172a);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}

.mmr-mobile-nav-top:hover,
.mmr-mobile-nav-toggle:hover {
  background: var(--surface, #f8fafc);
}

.mmr-mobile-nav-top.is-active,
.mmr-mobile-nav-link.is-active {
  background: var(--primary, #16a34a);
  color: var(--primary-foreground, #fff);
}

.mmr-mobile-nav-chevron {
  transition: transform 0.2s ease;
  color: #64748b;
}

.mmr-mobile-nav-group.is-open .mmr-mobile-nav-chevron {
  transform: rotate(180deg);
}

.mmr-mobile-nav-sub {
  display: none;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0 0 0 1rem;
  border-left: 1px solid var(--border, #e2e8f0);
}

.mmr-mobile-nav-group.is-open .mmr-mobile-nav-sub {
  display: block;
}

.mmr-mobile-nav-link {
  display: block;
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
  text-decoration: none;
}

.mmr-mobile-nav-link:hover {
  background: var(--surface, #f8fafc);
  color: var(--primary, #16a34a);
}

.mmr-mobile-nav-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border, #e2e8f0);
  padding: 1rem;
}

.mmr-mobile-nav-cta {
  width: 100%;
  justify-content: center;
}

/* Footer: single divider before copyright (fixes stacked borders on live HTML) */
footer .mmr-footer-section {
  border: none !important;
}

footer .container-x > .border-t.border-white\/10:not(:last-child) {
  border-top: none !important;
}

@media (min-width: 1024px) {
  .mmr-mobile-nav-overlay,
  .mmr-mobile-nav-drawer {
    display: none !important;
  }

  .mmr-footer-section summary {
    display: none;
  }

  .mmr-footer-section .mmr-footer-section-body {
    display: block !important;
  }
}
