/* Bottom-up canvas menu — embed-safe component.
   All custom props are scoped to .canvas-menu so nothing leaks to the host page.
   Reveal is driven by `body.menu-open` (toggled by the page's hamburger). */

.canvas-menu {
  --orange: #FD5918;
  --warm: #FC932E;
  --teal: #5A94A5;
  --espresso: #351707;
  --cream: #FFF6E8;
  --navy: #093956;
  --white: #FFFFFF;
  --ease: cubic-bezier(.2, .8, .2, 1);

  position: fixed;
  inset: 0;
  z-index: 1700;
  overflow: hidden;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .5s var(--ease);
  /* Real frosted glass: a light navy wash over a blurred view of the live page.
     Kept intentionally low-opacity so the actual page stays the dominant thing
     seen through the panel — just softened, not covered. The inset box-shadow
     adds a top light-sheen + hairline border so it reads as a glass sheet. */
  background: linear-gradient(180deg, rgba(9, 57, 86, .26), rgba(9, 57, 86, .18));
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: var(--cream);
  font-family: Inter, Arial, sans-serif;
}

.canvas-menu * {
  box-sizing: border-box;
}

body.menu-open .canvas-menu {
  pointer-events: auto;
  clip-path: inset(0 0 0 0);
}

body.menu-open .site-header { z-index: 1800; }
body.menu-open .custom-scrollbar-track { pointer-events: none; }
.canvas-menu canvas,
.canvas-menu .menu-shade,
.canvas-menu .menu-canvas { pointer-events: none !important; }
.canvas-menu .menu-layout,
.canvas-menu .menu-top { position: relative; z-index: 2; }

body.menu-open {
  overflow: hidden;
}

/* Menu-as-page-transition: on arrival via a canvas-menu link the panel covers the
   page instantly (transitions frozen for one frame → fast, no flicker), then
   slowly peels away top-to-bottom to reveal the freshly loaded page. Wiring lives
   in bottom-up-menu.js. */
body.menu-nav-cover .canvas-menu,
body.menu-nav-cover .canvas-menu * {
  transition: none !important;
}

/* Slow curtain peel: keep the menu content in place (menu-open stays on) and drive
   only the panel's clip-path closed, top-to-bottom, over a longer, eased beat — so
   the whole frosted panel + content peels away as one. */
body.menu-nav-wipe.menu-open .canvas-menu {
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.15s cubic-bezier(.45, 0, .15, 1);
}

/* Hide the host page's cloned dropdown on any page that carries the canvas menu.
   The second selector out-specifies styles.css's desktop `body.menu-open
   .intro-stage .mobile-menu{display:flex!important}` reveal. */
body:has(.canvas-menu) .mobile-menu,
body.menu-open:has(.canvas-menu) .intro-stage .mobile-menu {
  display: none !important;
}

.canvas-menu .logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.canvas-menu .logo img {
  height: clamp(38px, 5vw, 54px);
  width: auto;
  display: block;
}

.menu-canvas {
  /* Hidden so the frosted panel shows the real page behind it, not an opaque fill. */
  display: none;
}

.menu-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 85% at 12% 8%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, rgba(255, 246, 232, .05), rgba(9, 57, 86, .12));
}

.menu-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: clamp(18px, 4vw, 42px);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .32s var(--ease) .08s, transform .32s var(--ease) .08s;
}

body.menu-open .menu-top {
  opacity: 1;
  transform: translateY(0);
}

.close-menu {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(255, 246, 232, .3);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(255, 246, 232, .08);
  cursor: pointer;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  backdrop-filter: blur(14px);
}

.menu-layout {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  justify-items: start;
  text-align: left;
  gap: clamp(22px, 4vw, 54px);
  padding: 0 clamp(18px, 4vw, 54px) clamp(28px, 5vw, 68px);
}

.menu-intro {
  max-width: 540px;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .34s var(--ease) .1s, transform .34s var(--ease) .1s;
}

body.menu-open .menu-intro {
  opacity: 1;
  transform: translateY(0);
}

.menu-intro small {
  color: var(--warm);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.menu-intro h2 {
  margin: 16px 0 0;
  font-size: clamp(48px, 9vw, 132px);
  line-height: .82;
  letter-spacing: -.08em;
}

.menu-intro p {
  margin: 24px 0 0;
  color: rgba(255, 246, 232, .74);
  line-height: 1.65;
}

.menu-links {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-links a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  width: fit-content;
  color: var(--cream);
  text-decoration: none;
  font-size: clamp(28px, 4.2vw, 56px);
  line-height: 1.02;
  letter-spacing: -.075em;
  font-weight: 900;
  opacity: 0;
  transform: translateY(34px);
  /* Match the site branding speed (footer/social icons use .25s var(--ease)) —
     was .58s, which lagged behind the rest of the brand reveal. */
  transition: color .12s var(--ease), opacity .25s var(--ease), transform .25s var(--ease);
}

/* Close animation: mirror the open reveal — links retract bottom-to-top as the
   panel wipes shut. These base-state delays only apply on close; the
   `body.menu-open` rules below override them for the open reveal. */
.menu-links li:nth-child(6) a { transition-delay: 0s, .02s, .02s; }
.menu-links li:nth-child(5) a { transition-delay: 0s, .05s, .05s; }
.menu-links li:nth-child(4) a { transition-delay: 0s, .08s, .08s; }
.menu-links li:nth-child(3) a { transition-delay: 0s, .11s, .11s; }
.menu-links li:nth-child(2) a { transition-delay: 0s, .14s, .14s; }
.menu-links li:nth-child(1) a { transition-delay: 0s, .17s, .17s; }

.menu-links a:hover {
  color: var(--teal);
}

/* Scoped to the leading NUMBER span only (direct first child of the link).
   Using a bare `.menu-links span` here leaked this tiny 14px style onto the
   per-letter wave spans injected by link-wave.js, shrinking the whole word. */
.menu-links a > span:first-child {
  min-width: 42px;
  color: var(--warm);
  font-size: 14px;
  letter-spacing: .12em;
  font-weight: 900;
}

body.menu-open .menu-links li:nth-child(1) a { transition-delay: .06s; }
body.menu-open .menu-links li:nth-child(2) a { transition-delay: .10s; }
body.menu-open .menu-links li:nth-child(3) a { transition-delay: .14s; }
body.menu-open .menu-links li:nth-child(4) a { transition-delay: .18s; }
body.menu-open .menu-links li:nth-child(5) a { transition-delay: .22s; }
body.menu-open .menu-links li:nth-child(6) a { transition-delay: .26s; }

body.menu-open .menu-links a {
  opacity: 1;
  transform: translateY(0);
}

.social-rail {
  /* Pinned to the true vertical centre of the overlay (the grid cell sat below
     centre because the logo row pushes the layout down). Still clipped by the
     panel's clip-path, so it reveals/hides with the menu. */
  position: fixed;
  top: 50%;
  right: clamp(16px, 4vw, 46px);
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.social-rail a {
  position: relative;
  overflow: hidden;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 246, 232, .26);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(255, 246, 232, .08);
  box-shadow: 0 8px 18px rgba(9, 57, 86, .18);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateX(12px);
  /* Match the site branding speed (footer icons use .25s var(--ease)). */
  transition: transform .15s var(--ease), opacity .25s var(--ease);
}

/* Orange hover fill that grows from the pencil nib. --mx/--my are the pointer
   coordinates inside the icon (set in bottom-up-menu.js); the circle expands
   from that exact point to flood the whole button. Falls back to centre when
   the vars are unset (e.g. keyboard focus). */
.social-rail a::before {
  content: "";
  position: absolute;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(253, 89, 24, .82);
  transform: translate(-50%, -50%);
  transition: width .4s var(--ease), height .4s var(--ease);
  pointer-events: none;
  z-index: 0;
}

body.menu-open .social-rail a:hover::before {
  width: 240%;
  height: 240%;
}

/* Subtle lift on hover. Scoped to the open state so it out-specifies
   `body.menu-open .social-rail a`'s reveal transform. */
body.menu-open .social-rail a:hover {
  transform: translateY(-3px);
}

.social-rail svg {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor;
}

body.menu-open .social-rail a {
  opacity: 1;
  transform: translateX(0);
}

body.menu-open .social-rail a:nth-child(1) { transition-delay: .06s; }
body.menu-open .social-rail a:nth-child(2) { transition-delay: .10s; }
body.menu-open .social-rail a:nth-child(3) { transition-delay: .14s; }
body.menu-open .social-rail a:nth-child(4) { transition-delay: .18s; }

.menu-bottom {
  position: absolute;
  z-index: 3;
  left: clamp(18px, 4vw, 54px);
  right: clamp(18px, 4vw, 54px);
  bottom: clamp(16px, 3vw, 26px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.menu-note {
  color: rgba(255, 246, 232, .68);
  font-size: 14px;
}

.whatsapp {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  color: var(--cream);
  background: var(--orange);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(253, 89, 24, .28);
  pointer-events: auto;
}

@media (max-width: 880px) {
  .menu-layout {
    grid-template-columns: 1fr 40px;
    align-items: center;
  }
}

@media (max-width: 620px) {
  .menu-top {
    padding: 18px;
  }

  .menu-layout {
    min-height: calc(100vh - 92px);
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 16px;
    padding: 0 16px 92px;
  }

  .menu-links a {
    font-size: clamp(38px, 14vw, 66px);
  }

  .menu-links a > span:first-child {
    min-width: 30px;
  }

  .social-rail a {
    width: 30px;
    height: 30px;
  }

  .menu-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}
