/* ============================================================
   SITE MENU OVERLAY — the full hamburger-menu experience.

   Everything (icons, connector lines, the Safety wordmark, and
   all four labels) is one flattened SVG, exported directly from
   Figma. It's referenced via native SVG <image>/<mask>/<clipPath>
   rather than layered HTML <img> + CSS background-image — that
   was causing a "double image" ghosting effect, because two
   independent rasterizations of the same vector art (one via
   <img>, one via CSS background) don't sub-pixel-align perfectly.

   Now there's exactly one render pass per pixel:
   - The base artwork is masked so the 4 clickable regions are
     real transparent holes in it — not covered by anything.
   - Each of those 4 regions is its OWN <g>, clipped to just that
     rectangle, filling the hole exactly. On hover it scales up
     from its own center — since it's the only thing ever drawn
     there, there's nothing for it to double up against.

   The bear+fish and diver+frog are just part of the static base
   artwork — no hotspot, no hover, not clickable, per Avi's spec.
   ============================================================ */

.site-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #DBF3CB; /* fallback shown until the background tool's iframe finishes loading, or if it fails */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.35s ease;
  overflow: hidden;
}

.site-menu.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.site-menu-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  z-index: 0;
}

.site-menu-close {
  position: fixed;
  top: calc(var(--nav-h) / 2);
  right: clamp(20px, 4vw, 56px);
  transform: translateY(-50%);
  z-index: 310;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  padding: 0;
}

.site-menu-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 2px;
  background: var(--black);
}

.site-menu-close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.site-menu-close span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---------- THE CANVAS ----------
   Locked to the artwork's own aspect ratio (1140:718), contain-
   fit and centered — sized to ~82% of the viewport on its
   constrained axis, which is what gives the generous breathing
   room around the whole composition instead of it running
   edge-to-edge. */

.site-menu-links {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82vw;
  height: 82vh;
  max-width: calc(82vh * 1140 / 718);
  max-height: calc(82vw * 718 / 1140);
  aspect-ratio: 1140 / 718;
  z-index: 5;
}

.menu-graphic {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible; /* so hover-scaled clusters aren't clipped by the SVG's own box */
}

.menu-hotspot-g {
  transition: transform 0.2s ease;
  cursor: pointer;
}

.site-menu-links a,
.site-menu-links--mobile a {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none;
}

a:hover .menu-hotspot-g,
a:focus-visible .menu-hotspot-g {
  transform: scale(1.17);
  outline: none;
}

.site-menu-links--mobile {
  display: none;
}

@media (max-width: 700px) {
  .site-menu-links {
    display: none;
  }

  .site-menu-links--mobile {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 86vw;
    height: 86vh;
    max-width: calc(86vh * 939 / 1646);
    max-height: calc(86vw * 1646 / 939);
    aspect-ratio: 939 / 1646;
    z-index: 5;
  }
}
