/* Desktop-specific behavior for the GroMatrix theme */
@media (min-width: 981px) {
  body,
  .services-page {
    overflow-x: hidden;
  }

  .navbar {
    height: 90px;
    padding: 0 24px;
  }

  .navbar-inner {
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    padding: 0 64px;
  }

  .nav-menu {
    display: flex !important;
    align-items: center;
  }

  .nav-menu > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 56px;
  }

  .nav-menu > ul > li {
    list-style: none;
  }

  .nav-menu > ul > li > a {
    display: inline-flex;
    align-items: center;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-0);
    text-decoration: none;
    transition: opacity 0.25s ease, color 0.25s ease;
  }

  .nav-menu > ul > li > a:hover {
    opacity: 0.7;
  }

  .nav-menu > ul > .current-menu-item > a,
  .nav-menu > ul > .current_page_item > a,
  .nav-menu > ul > .current_page_parent > a,
  .nav-menu > ul > .current_page_ancestor > a,
  .nav-menu > ul > .current-menu-ancestor > a,
  .nav-menu > ul > .current-menu-parent > a {
    color: var(--accent);
  }

  .nav-right {
    justify-self: end;
  }

  .nav-call {
    display: inline-flex !important;
  }

  .nav-toggle {
    display: none !important;
  }

  .mobile-menu {
    display: none !important;
    pointer-events: none;
  }

  body.menu-open {
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Fail-safe only when reveal JS is not active */
  body:not(.gm-reveal-ready) .blog-hero .hero-inner {
    opacity: 1 !important;
    transform: none !important;
  }

  body:not(.gm-reveal-ready) .blog-listing .blog-card {
    opacity: 1 !important;
    transform: none !important;
  }

  body:not(.gm-reveal-ready) .services-list .service-block .reveal,
  body:not(.gm-reveal-ready) .services-list .service-block .reveal-list li {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (min-width: 901px) {
  .hw-section,
  .hw-timeline,
  .hw-timeline-item {
    max-width: 100%;
    overflow-x: hidden;
  }

  .hw-content {
    max-width: 100%;
    box-sizing: border-box;
  }

  .hw-timeline-item.left .hw-content {
    transform: translateX(-110%);
  }

  .hw-timeline-item.right .hw-content {
    transform: translateX(110%);
  }

  @keyframes hwInLeft {
    0% { opacity: 0; transform: translateX(-110%); }
    70% { opacity: 1; transform: translateX(12px); }
    100% { opacity: 1; transform: translateX(0); }
  }

  @keyframes hwInRight {
    0% { opacity: 0; transform: translateX(110%); }
    70% { opacity: 1; transform: translateX(-12px); }
    100% { opacity: 1; transform: translateX(0); }
  }
}

/* How We Work: enforce natural height and page-level scrolling */
.hw-section--auto,
.hw-section--auto .hw-timeline--auto,
.hw-section--auto .hw-timeline-item,
.hw-section--auto .hw-content {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-y: visible !important;
}

/* First viewport consistency across all pages (desktop) */
@media (min-width: 981px) {
  .services-page > section.services-hero:first-child {
    position: relative;
    isolation: isolate;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    box-sizing: border-box;
    padding: clamp(120px, 18vh, 180px) 6vw clamp(64px, 10vh, 110px) !important;
    overflow: hidden !important;
  }

  .services-page > section.services-hero:first-child::before {
    content: "";
    position: absolute;
    inset: -6%;
    background:
      radial-gradient(980px 520px at 14% 24%, rgba(5, 175, 161, 0.20), transparent 65%),
      radial-gradient(920px 520px at 86% 76%, rgba(15, 23, 42, 0.10), transparent 68%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 251, 249, 0.92));
    filter: blur(26px);
    transform: scale(1.06);
    z-index: 0;
    pointer-events: none;
  }

  .services-page > section.services-hero:first-child::after {
    z-index: 1;
  }

  .services-page > section.services-hero:first-child > * {
    position: relative;
    z-index: 2;
  }

  .services-page > section.services-hero:first-child .hero-inner {
    margin-top: clamp(32px, 4.4vh, 64px) !important;
  }

  .home .services-page > section.services-hero:first-child {
    padding-top: clamp(72px, 10.5vh, 106px) !important;
  }

  .home .services-page > section.services-hero:first-child .hero-inner {
    margin-top: clamp(24px, 3vh, 44px) !important;
  }

  .home .services-page > section.services-hero:first-child h2 {
    margin: 0;
    font-size: clamp(36px, 4.6vw, 64px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-0);
  }

  .home .services-page > section.services-hero:first-child .hero-desc {
    margin: 0;
    max-width: 1120px;
    font-size: clamp(16px, 1.6vw, 21px);
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-1);
  }
}
