/* Mentes — mobile menu (hamburger + right-side slide-in panel).
 *
 * Pairs with /assets/mobile-nav.js which auto-builds the panel by cloning
 * the existing `.nav__links` items. Any page that has the marketing nav gets
 * the mobile menu for free — no per-page markup needed.
 *
 * Stacking — we go ABOVE the page's intro loader (z-index 999) so the X
 * stays clickable even if the loader's hit-test box lingers:
 *   .nav__drawer-backdrop  z-index: 1040  (translucent dim, taps close)
 *   .nav__drawer           z-index: 1050  (the right-side panel)
 *   .nav__menu-btn         z-index: 1100  (stays on top of everything)
 */

/* ── Hamburger button ─────────────────────────────────────────────── */
.nav__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(12, 12, 13, 0.55);
  border: 1px solid rgba(245, 243, 238, 0.16);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color .2s, background-color .2s, transform .25s ease;
}
.nav__menu-btn:hover { border-color: rgba(255, 149, 0, 0.5); }
.nav__menu-btn:focus-visible { outline: 2px solid #FF9500; outline-offset: 2px; }

.nav__menu-btn span {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: #F5F3EE;
  border-radius: 1px;
  transition: transform .35s cubic-bezier(.7,0,.2,1),
              opacity .2s ease;
  transform-origin: center;
}
.nav__menu-btn span:nth-child(1) { top: 15px; }
.nav__menu-btn span:nth-child(2) { top: 21px; }
.nav__menu-btn span:nth-child(3) { top: 27px; }

.nav__menu-btn.is-open span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
  background: #FF9500;
}
.nav__menu-btn.is-open span:nth-child(2) { opacity: 0; }
.nav__menu-btn.is-open span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
  background: #FF9500;
}

/* On mobile: show hamburger, hide the desktop "Start a project" pill,
   and PIN the button to the viewport top-right so it stays above the
   sliding panel (otherwise its X gets buried under the drawer). */
@media (max-width: 760px) {
  .nav .nav__cta { display: none; }
  .nav__menu-btn {
    display: inline-flex;
    position: fixed;
    top: 18px;
    right: var(--gut, 20px);
    z-index: 1100;
  }
}

/* ── Backdrop (translucent dim behind the panel) ───────────────────── */
.nav__drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.nav__drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Right-side slide-in panel ─────────────────────────────────────── */
.nav__drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 380px);
  background: rgba(8, 8, 8, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  z-index: 1050;
  transform: translateX(100%);
  transition: transform .45s cubic-bezier(.7,0,.2,1);
  display: flex;
  flex-direction: column;
  padding: 84px 26px 28px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-left: 1px solid rgba(245, 243, 238, 0.08);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.45);
}
.nav__drawer.is-open {
  transform: translateX(0);
}

.nav__drawer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.nav__drawer-links li {
  border-bottom: 1px solid rgba(245, 243, 238, 0.08);
}
.nav__drawer-links li:last-child { border-bottom: none; }
.nav__drawer-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #F5F3EE;
  text-decoration: none;
  transition: color .2s, transform .2s;
}
.nav__drawer-links a:hover { color: #FF9500; }
.nav__drawer-links a::after {
  content: "→";
  font-family: inherit;
  font-size: 18px;
  color: rgba(245, 243, 238, 0.35);
  transition: transform .25s ease, color .2s;
}
.nav__drawer-links a:hover::after {
  color: #FF9500;
  transform: translateX(4px);
}

/* ── Footer: language toggle row, then full-width CTA ──────────────── */
.nav__drawer-footer {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nav__drawer-lang {
  display: flex;
  justify-content: center;
}
/* Bump the lang toggle so it's not lost next to the big CTA pill */
.nav__drawer-lang .lang-toggle {
  transform: scale(1.15);
  transform-origin: center;
}

.nav__drawer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 26px;
  background: #FF9500;
  color: #060606;
  border-radius: 999px;
  font-family: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .2s, transform .2s;
}
.nav__drawer-cta:hover { background: #ffae33; transform: translateY(-1px); }
.nav__drawer-cta::after { content: "→"; }

/* Hide drawer + backdrop entirely on desktop — the desktop nav is the source of truth */
@media (min-width: 761px) {
  .nav__drawer,
  .nav__drawer-backdrop { display: none !important; }
}

/* Lock body scroll when drawer is open */
body.nav-open {
  overflow: hidden;
  touch-action: none;
}

/* Very short viewport — tighten typography so everything fits without scrolling */
@media (max-width: 760px) and (max-height: 700px) {
  .nav__drawer { padding-top: 72px; }
  .nav__drawer-links a { padding: 12px 0; font-size: 18px; }
  .nav__drawer-footer { gap: 14px; padding-top: 18px; }
}
