/* ─── NEXLANE MOBILE NAV — StaggeredMenu (vanilla JS port) ──────
   Hamburger trigger lives inside the pill nav.
   Panel + prelayers are a fixed full-viewport overlay (.sm-root).
   Visible only at ≤768px (trigger) — panel itself is JS-driven.
─────────────────────────────────────────────────────────────────── */

/* ── Trigger button ─────────────────────────────────────────────── */
.sm-trigger {
  display: none; /* desktop: hidden */
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #e0e2f0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 6px;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
  min-height: 44px;
  min-width: 44px;
  justify-content: flex-end;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.sm-trigger:focus-visible {
  outline: 2px solid var(--sm-accent, #2563ff);
  outline-offset: 4px;
  border-radius: 4px;
}

/* text cycling label */
.sm-trigger-label {
  position: relative;
  display: inline-block;
  height: 1em;
  overflow: hidden;
  white-space: nowrap;
}

.sm-trigger-label-inner {
  display: flex;
  flex-direction: column;
  line-height: 1;
  will-change: transform;
}

.sm-trigger-line {
  display: block;
  height: 1em;
  line-height: 1;
}

/* +/× icon */
.sm-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.sm-icon-h,
.sm-icon-v {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  will-change: transform;
}

.sm-icon-h { transform: translate(-50%, -50%); }
.sm-icon-v { transform: translate(-50%, -50%) rotate(90deg); }

/* ── Mobile breakpoint: show trigger, hide desktop nav items ─────── */
@media (max-width: 768px) {
  .sm-trigger { display: inline-flex; }

  /* hide desktop CTA — the panel provides navigation */
  .nav-inner > .btn,
  .nav-inner > a.btn,
  .nav-inner > .btn-nav,
  .nav-inner > .btn-primary { display: none !important; }

  /* hide nav-links (hamburger replaces them) */
  .nav-links { display: none !important; }
}

/* ── Overlay root ────────────────────────────────────────────────── */
.sm-root {
  position: fixed;
  inset: 0;
  z-index: 90; /* below nav (100) so trigger stays on top */
  pointer-events: none;
  overflow: hidden;
}

.sm-root[data-open] {
  pointer-events: auto;
}

/* ── Prelayers (swoosh animation layers) ─────────────────────────── */
.sm-prelayers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sm-prelayer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* ── Main panel ──────────────────────────────────────────────────── */
.sm-panel {
  position: absolute;
  inset: 0;
  background: #07080f;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* top padding clears the pill nav (≈70px) + comfortable breathing room */
  padding-top:  max(128px, calc(env(safe-area-inset-top, 0px) + 110px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
  padding-left:  max(32px, env(safe-area-inset-left, 0px));
  padding-right: max(32px, env(safe-area-inset-right, 0px));
  will-change: transform;
  /* start off screen — JS sets xPercent: 100 immediately */
}

.sm-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 520px;
}

/* ── Reset page-level nav styles that bleed into the panel ──────── */
.sm-panel nav {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  z-index: auto;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ── Nav list ────────────────────────────────────────────────────── */
.sm-panel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sm-panel-item-wrap {
  overflow: hidden;
  line-height: 1;
}

.sm-panel-item {
  position: relative;
  display: inline-block;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.9rem, 8.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-decoration: none;
  text-transform: uppercase;
  padding: 0.1em 1.4em 0.1em 0;
  display: block;
  transition: color 0.2s ease;
}

.sm-panel-item:hover,
.sm-panel-item:focus-visible {
  color: var(--sm-accent, #2563ff);
  outline: none;
}

.sm-panel-item-label {
  display: inline-block;
  will-change: transform;
  transform-origin: 50% 100%;
}

/* counter numbering */
.sm-panel-list[data-numbering] { counter-reset: smItem; }

.sm-panel-list[data-numbering] .sm-panel-item::after {
  counter-increment: smItem;
  content: counter(smItem, decimal-leading-zero);
  position: absolute;
  top: 0.15em;
  right: 0;
  font-size: clamp(0.55rem, 2vw, 0.7rem);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--sm-accent, #2563ff);
  pointer-events: none;
  user-select: none;
  opacity: var(--sm-num-opacity, 0);
  transition: opacity 0.3s;
}

/* ── Socials ─────────────────────────────────────────────────────── */
.sm-socials {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sm-socials-title {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sm-accent, #2563ff);
}

.sm-socials-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.sm-socials-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.sm-socials-link:hover,
.sm-socials-link:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  outline: none;
}

/* ── Body scroll lock (set by JS on open) ────────────────────────── */
body.sm-open {
  overflow: hidden;
  touch-action: none;
}

/* ── Nav: merge into panel when open (removes the visible pill shape) */
body.sm-open nav {
  background: rgba(7, 8, 15, 0.97);
  border-color: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

/* ── Reduced motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sm-panel,
  .sm-prelayer { transition: none !important; }

  /* skip GSAP timelines — just show/hide instantly */
  .sm-root[data-open] .sm-panel,
  .sm-root[data-open] .sm-prelayer {
    transform: none !important;
  }
}
