/* ──────────────────────────────────────────────────────────────
   5D — Shared mobile-nav stylesheet
   --------------------------------------------------------------
   Hamburger button + full-screen dropdown menu.
   Only appears at ≤ 720px. On desktop these rules do nothing.
   ────────────────────────────────────────────────────────── */

/* Hamburger button — hidden on desktop, shown on mobile.
   Deliberately understated: no chrome, just two hairlines of
   unequal length that settle into an X when open. */
.nav-hamburger {
  display: none;
  position: relative;
  z-index: 1000;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  opacity: 0.85;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.25s ease;
}
.nav-hamburger:hover,
.nav-hamburger.open { opacity: 1; }
.nav-hamburger:focus-visible {
  outline: 1px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
  border-radius: 6px;
}
.nav-hamburger span {
  display: block;
  position: absolute;
  right: 8px;
  height: 1px;
  background: #fff;
  transform-origin: center;
  transition:
    transform 0.45s cubic-bezier(0.65, 0, 0.35, 1),
    width 0.45s cubic-bezier(0.65, 0, 0.35, 1),
    top 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-hamburger span:nth-child(1) { top: 16px; width: 24px; }
.nav-hamburger span:nth-child(2) { top: 23px; width: 14px; }
.nav-hamburger:hover span:nth-child(2) { width: 24px; }
.nav-hamburger.open span:nth-child(1) { top: 19.5px; width: 22px; transform: rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { top: 19.5px; width: 22px; transform: rotate(-45deg); }

/* Full-screen dropdown panel */
.nav-mobile-panel {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15,15,15,0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  font-family: 'Alexandria', sans-serif;
  /* Defeat any page-level reveal rule that touches body > * */
  transform: none !important;
}
.nav-mobile-panel.open {
  opacity: 1 !important;
  pointer-events: auto;
}

.nav-mobile-panel a {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(12px);
}
.nav-mobile-panel.open a {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    color 0.2s ease;
}
.nav-mobile-panel.open a:nth-child(1) { transition-delay: 0.08s; }
.nav-mobile-panel.open a:nth-child(2) { transition-delay: 0.14s; }
.nav-mobile-panel.open a:nth-child(3) { transition-delay: 0.20s; }
.nav-mobile-panel.open a:nth-child(4) { transition-delay: 0.26s; }
.nav-mobile-panel.open a:nth-child(5) { transition-delay: 0.32s; }

.nav-mobile-panel a:hover,
.nav-mobile-panel a.active { color: #fff; }
.nav-mobile-panel a.active::after {
  content: '';
  display: block;
  width: 22px;
  height: 1px;
  background: rgba(255,255,255,0.55);
  margin: 8px auto 0;
}

.nav-mobile-panel a.contact-btn {
  font-size: 17px;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  padding: 12px 30px;
  color: #fff;
  margin-top: 14px;
  transition:
    opacity 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 0.25s ease,
    background 0.25s ease;
}
.nav-mobile-panel a.contact-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.06);
}
.nav-mobile-panel a.contact-btn::after { display: none; }

/* Footer of the panel — close hint */
.nav-mobile-panel .nm-close-hint {
  position: absolute;
  bottom: 32px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  font-weight: 300;
}

/* When the panel is open, hide any peer floating widgets (cart FAB,
   sticky CTA) so they don't poke through. They have their own z-indexes
   that vary per page, so we just gate them on body class. */
body.nav-panel-open .cart-fab,
body.nav-panel-open .sticky-cta {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease;
}

/* ── Mobile only: show hamburger, hide inline nav links ── */
@media (max-width: 720px) {
  /* Force the nav back to a single row so logo + hamburger sit side by side
     — overrides per-page mobile rules that switch nav to flex-column. */
  nav {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }
  nav .nav-links { display: none !important; }
  .nav-hamburger { display: block; }

  /* Hero runs edge to edge instead of sitting in a framed tile.
     Pages pad <body>, so the hero breaks out horizontally with
     negative margins and the top padding is dropped. */
  body:has(> .hero) { padding-top: 0 !important; }
  body > .hero {
    width: 100vw !important;
    max-width: none !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    border: none !important;
    border-radius: 0 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    box-shadow: none !important;
  }
  body > .hero .hero-bg { border-radius: 0 !important; }

  /* Long intro copy swaps for a one-line summary on phones */
  body > .hero .hero-text p.hero-full { display: none; }
  body > .hero .hero-text p.hero-short { display: block; }

  /* Hero copy — the hero ends halfway down the screen, with room
     for the nav at the top and the text in normal flow at the
     bottom, so the two never overlap. */
  body > .hero {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    height: 50vh !important;
    height: 50svh !important;
    min-height: 300px !important;
    aspect-ratio: auto !important;
    padding: 108px 24px 30px;
  }
  body > .hero .vignette {
    background:
      linear-gradient(to top, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.2) 45%, transparent 75%),
      linear-gradient(to bottom, rgba(10,10,10,0.3) 0%, transparent 30%) !important;
  }
  body > .hero .hero-text {
    position: relative;
    inset: auto;
  }
  body > .hero .hero-text h1 {
    font-size: clamp(22px, 6.4vw, 27px);
    line-height: 1.12;
    letter-spacing: -0.005em;
    text-wrap: balance;
  }
  body > .hero .hero-text p {
    margin-top: 10px;
    max-width: 34ch;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: 0.005em;
    opacity: 0.82;
    text-wrap: pretty;
  }
}

/* ── Tablet (721–1024px): the desktop 16:6 hero is too shallow at
   these widths for the logo, headline and intro to share it, so
   the hero grows taller and the text sits in flow below the nav. ── */
@media (min-width: 721px) and (max-width: 1024px) {
  body > .hero {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: clamp(460px, 58vw, 580px) !important;
    padding: 150px 44px 48px;
  }
  body > .hero .hero-text {
    position: relative;
    inset: auto;
  }
  body > .hero .hero-text h1 {
    font-size: clamp(34px, 4.8vw, 46px);
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-wrap: balance;
  }
  body > .hero .hero-text p {
    margin-top: 14px;
    max-width: 48ch;
    font-size: clamp(15px, 1.9vw, 18px);
    line-height: 1.55;
    text-wrap: pretty;
  }
}

/* On desktop, force the panel hidden in case JS ran but viewport resized.
   IMPORTANT: this is scoped via media query so it never affects mobile. */
@media (min-width: 721px) {
  .nav-mobile-panel { display: none !important; }
  .hero-text .hero-short { display: none !important; }
}

/* The panel is appended to <body> at runtime. On pages that use a
   reveal-on-scroll rule like `body > *:not(...) { opacity: 0; transform: ... }`
   the panel inherits a fade-out that breaks our open state. Belt-and-braces
   override here — these rules win on specificity AND !important. */
.nav-mobile-panel,
.nav-mobile-panel.open {
  transform: none !important;
}
.nav-mobile-panel.open {
  opacity: 1 !important;
}
/* Same fix for the hamburger button itself */
.nav-hamburger {
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .nav-mobile-panel,
  .nav-mobile-panel a,
  .nav-hamburger span {
    transition: none !important;
  }
}


/* ── 5D logo: one size site-wide, matching the home page ── */
nav .logo img { height: 90px !important; width: auto !important; display: block; }
@media (max-width: 720px) { nav .logo img { height: 56px !important; } }
@media (max-width: 460px) { nav .logo img { height: 48px !important; } }
