/* ==========================================================================
   VibeMagic — nav.css
   Header bar, side menu and theme toggle. Vanilla ports of 21st.dev components:
     · "Morphing Scroll Navbar" by Kiki (@laziekiki)      header morph + progress + scroll-spy
     · "Menu Toggle Icon" by Efferd                       burger ⇄ X via stroke-dash
     · "Curved Menu" by Shamsudheen (@ishamsu)            side panel with a liquid SVG edge
     · "Animated Theme Toggler" (Magic UI pattern, port by Arunachalam)
                                                          View Transitions circular reveal
   Brand axis: gradients run yellow (left) → purple (right), never mirrored.
   ========================================================================== */

/* ---------- Header shell ---------- */
.nav {
  --nav-spring: cubic-bezier(.34, 1.32, .5, 1);
  --nav-spring-soft: cubic-bezier(.34, 1.2, .5, 1);
  --nav-glass: rgba(255, 255, 255, .76);
  --nav-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 6px -2px rgba(10, 6, 18, .08), 0 24px 50px -26px rgba(80, 10, 120, .4);
  --nav-ring: linear-gradient(90deg, rgba(250, 165, 6, .95) 0%, rgba(253, 201, 103, .45) 16%, rgba(10, 10, 11, .07) 34%, rgba(10, 10, 11, .07) 66%, rgba(230, 150, 249, .55) 84%, rgba(200, 5, 254, .85) 100%);
  --nav-btn: rgba(255, 255, 255, .62);
  --nav-btn-h: #fff;
  --nav-btn-line: rgba(10, 10, 11, .1);
  --nav-link: var(--text-2);
  --nav-hover: rgba(10, 10, 11, .045);
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: var(--z-nav);
  display: flex;
  justify-content: center;
  /* physical sides: clear a landscape notch / rounded corners (viewport-fit=cover) */
  padding-left: max(clamp(10px, 2vw, 24px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(10px, 2vw, 24px), env(safe-area-inset-right, 0px));
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transition: transform .6s var(--ease-out);
}
[data-theme="dark"] .nav {
  --nav-glass: rgba(13, 7, 22, .62);
  --nav-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 2px 8px -2px rgba(0, 0, 0, .6), 0 24px 60px -26px rgba(0, 0, 0, .9), 0 0 46px -22px rgba(200, 5, 254, .55);
  --nav-ring: linear-gradient(90deg, rgba(255, 166, 0, .85) 0%, rgba(203, 146, 3, .4) 16%, rgba(255, 255, 255, .08) 34%, rgba(255, 255, 255, .08) 66%, rgba(167, 3, 215, .55) 84%, rgba(215, 41, 255, .95) 100%);
  --nav-btn: rgba(255, 255, 255, .045);
  --nav-btn-h: rgba(255, 255, 255, .1);
  --nav-btn-line: rgba(255, 255, 255, .12);
  --nav-hover: rgba(255, 255, 255, .05);
}
/* hidden on fast scroll-down: travel past the pill's own shadow */
.nav.is-hidden { transform: translate3d(0, calc(-100% - 64px), 0); }

.nav__pill {
  position: relative;
  pointer-events: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  width: 100%;
  max-width: var(--container);
  height: 84px;
  margin-top: 0;
  padding-inline: var(--gutter);
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: transparent;
  transition:
    max-width .62s var(--nav-spring),
    height .45s var(--nav-spring-soft),
    margin-top .45s var(--ease-out),
    padding .45s var(--ease-out),
    background-color .4s ease,
    box-shadow .5s ease,
    -webkit-backdrop-filter .45s ease,
    backdrop-filter .45s ease;
}
/* gradient hairline ring (poster 3 neon frame: gold on the left end, violet on the right) */
.nav__pill::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: var(--nav-ring);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

.nav.is-floating .nav__pill {
  max-width: 1100px;
  height: 62px;
  margin-top: 12px;
  padding-inline: 22px 10px;
  background-color: var(--nav-glass);
  box-shadow: var(--nav-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}
.nav.is-floating .nav__pill::before { opacity: 1; }
.nav.is-compact .nav__pill {
  max-width: 620px;
  height: 56px;
  padding-inline: 18px 7px;
}

/* ---------- Logo (FLIP target of the intro: never transform #site-logo itself) ---------- */
.nav__logo {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 44px;
  color: var(--text);
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.nav__logo .logo {
  width: calc(30px * 1502 / 541);
  height: 30px;
  fill: currentColor;
  overflow: visible;
  transform-origin: 100% 50%;
  transition: transform .45s var(--nav-spring-soft);
}
.nav.is-compact .nav__logo .logo { transform: scale(.88); }
/* split glow (poster 3): gold behind the hand + "vibe", violet behind "MAGIC".
   An HTML-level aura (an SVG filter on the sprite groups is clipped to a 10% bbox margin). */
.nav__logo { position: relative; isolation: isolate; }
.nav__logo::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 6px -12px 4px -8px;
  background:
    radial-gradient(34% 58% at 22% 58%, rgba(214, 150, 3, .9), transparent 74%),
    radial-gradient(44% 52% at 72% 50%, rgba(167, 3, 215, .95), transparent 74%);
  filter: blur(10px);
  opacity: calc(.7 * var(--glow-a));
  pointer-events: none;
  transform-origin: 100% 50%;
  transition: opacity .5s ease, transform .45s var(--nav-spring-soft);
}
.nav.is-compact .nav__logo::before { transform: scale(.88); }
[data-theme="dark"] .nav__logo .logo { filter: drop-shadow(0 0 6px rgba(255, 242, 220, .22)); }
/* desktop: a mark with some presence next to the giant hero type ("MAGIC" was ~10px tall) */
@media (min-width: 1024px) {
  .nav__logo { height: 52px; }
  .nav__logo .logo { width: calc(40px * 1502 / 541); height: 40px; }
  .nav.is-compact .nav__logo .logo,
  .nav.is-compact .nav__logo::before { transform: scale(.82); }
}

/* ---------- Links (center, desktop only) ---------- */
.nav__links {
  grid-column: 2;
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 2px;
  max-width: 760px;
  padding-inline: 6px;
  overflow: hidden;
  transition:
    max-width .55s var(--nav-spring-soft),
    padding .4s ease,
    opacity .35s ease .08s,
    transform .45s var(--ease-out),
    visibility 0s;
}
.nav.is-compact .nav__links {
  max-width: 0;
  padding-inline: 0;
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  pointer-events: none;
  visibility: hidden;
  transition:
    max-width .45s var(--nav-spring-soft),
    padding .4s ease,
    opacity .2s ease,
    transform .3s ease,
    visibility 0s linear .45s;
}
.nav__links a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  color: var(--nav-link);
  transition: color .25s ease, background-color .25s ease, text-shadow .3s ease;
}
.nav__links a[aria-current] { color: var(--text); }
[data-theme="dark"] .nav__links a[aria-current] { text-shadow: 0 0 14px rgba(215, 41, 255, .55); }
@media (hover: hover) {
  .nav__links a:hover { color: var(--text); background-color: var(--nav-hover); }
  .nav__links a[aria-current]:hover { background-color: transparent; }
}

/* "Tubelight" lamp behind the active link (slides with a spring).
   Dark: neon tube + glow cone. Light: poster-1 highlighter block. */
.nav__lamp {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 0;
  width: var(--lw, 0px);
  height: 38px;
  margin-top: -19px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(var(--lx, 0px), 0, 0);
  transition: transform .6s var(--ease-spring), width .6s var(--ease-spring), opacity .35s ease;
}
.nav__lamp.is-on { opacity: 1; }
.nav__lamp::before,
.nav__lamp::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
[data-theme="dark"] .nav__lamp {
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}
[data-theme="dark"] .nav__lamp::before {
  top: -6px;
  left: 50%;
  width: 30px;
  height: 3px;
  margin-left: -15px;
  border-radius: 3px;
  background: var(--grad-brand);
  box-shadow: -6px 0 12px 1px rgba(255, 166, 0, .5), 6px 0 14px 2px rgba(200, 5, 254, .6);
}
[data-theme="dark"] .nav__lamp::after {
  top: -4px;
  left: 50%;
  width: 64px;
  height: 30px;
  margin-left: -32px;
  background: radial-gradient(50% 60% at 50% 0%, rgba(215, 41, 255, .42), rgba(255, 166, 0, .08) 55%, transparent 75%);
  filter: blur(3px);
}
[data-theme="light"] .nav__lamp::after {
  inset: 9px 7px 8px;
  border-radius: .32em;
  background: var(--hl-yellow);
  filter: blur(1.5px);
}

/* ---------- Actions (inline-end = left) ---------- */
.nav__actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav__wa {
  --btn-pad-y: 0px;
  --btn-pad-x: 17px;
  height: 40px;
  font-size: .92rem;
  gap: .45em;
}
.nav__wa .i { width: 1.2em; height: 1.2em; }

.theme-toggle,
.burger {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  background-color: var(--nav-btn);
  border: 1px solid var(--nav-btn-line);
  transition: background-color .3s ease, border-color .3s ease, transform .45s var(--ease-out), opacity .35s ease, visibility 0s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .theme-toggle:hover,
  .burger:hover { background-color: var(--nav-btn-h); border-color: var(--line-strong); }
}
.theme-toggle:active,
.burger:active { transform: scale(.92); }
/* touch screens: 44px targets (the WhatsApp button keeps its label width above 720px) */
@media (pointer: coarse) {
  .theme-toggle,
  .burger { width: 44px; height: 44px; }
  .nav__wa { height: 44px; }
}

/* ---------- Burger ("Menu Toggle Icon" by Efferd: exact dash values on the original path) ---------- */
.burger svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  transition: transform .5s ease-in-out;
}
.burger__loop {
  stroke-dasharray: 12 63;
  stroke-dashoffset: 0;
  transition: stroke-dasharray .5s ease-in-out, stroke-dashoffset .5s ease-in-out;
}
.burger[aria-expanded="true"] svg { transform: rotate(-45deg); }
.burger[aria-expanded="true"] .burger__loop { stroke-dasharray: 20 300; stroke-dashoffset: -32.42px; }

/* ---------- Theme toggle (sun in dark = "go light", moon in light = "go dark") ---------- */
.theme-toggle .i,
.theme-ico .i {
  grid-area: 1 / 1;
  width: 19px;
  height: 19px;
  transition: opacity .3s var(--ease-out), transform .65s var(--ease-spring);
}
.theme-ico { display: inline-grid; place-items: center; position: relative; }
[data-theme="dark"] .theme-toggle__moon { opacity: 0; transform: rotate(-100deg) scale(.4); }
[data-theme="light"] .theme-toggle__sun { opacity: 0; transform: rotate(100deg) scale(.4); }
@media (hover: hover) {
  [data-theme="dark"] .theme-toggle:hover .theme-toggle__sun,
  [data-theme="dark"] .menu__theme:hover .theme-toggle__sun { transform: rotate(45deg); }
  [data-theme="light"] .theme-toggle:hover .theme-toggle__moon,
  [data-theme="light"] .menu__theme:hover .theme-toggle__moon { transform: rotate(-18deg) scale(1.06); }
}
/* the "spell" ring that leaves the button with the reveal */
.theme-toggle.is-casting::after,
.menu__theme.is-casting .theme-ico::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(90deg, #FFA600, #F7ACE2, #C805FE) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  animation: vm-cast .75s var(--ease-out) forwards;
}
.menu__theme.is-casting .theme-ico::after { inset: -8px; }
@keyframes vm-cast {
  from { transform: scale(.7); opacity: 1; }
  to { transform: scale(2.4); opacity: 0; }
}

/* View Transitions circular reveal: scoped to our own theme switch (html.vm-vt) */
html.vm-vt::view-transition-old(root),
html.vm-vt::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
/* while the new theme is captured, freeze colour transitions so the reveal shows the final colours */
html.vm-theming body,
html.vm-theming body *:not(.theme-toggle__sun):not(.theme-toggle__moon) { transition: none !important; }

/* ---------- Progress line (reading progress on the pill's bottom edge, RTL: grows from the right) ---------- */
.nav__progress {
  position: absolute;
  inset-inline: 30px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
  filter: drop-shadow(0 0 calc(4px * var(--glow-a)) rgba(221, 84, 253, calc(.9 * var(--glow-a))));
}
.nav__progress::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-brand);
  transform: translate3d(calc((1 - var(--p, 0)) * 100%), 0, 0);
  will-change: transform;
}
[data-theme="light"] .nav__progress::before { background: linear-gradient(90deg, #E89100 0%, #F29A1F 26%, #EE5FA8 48%, #C82AE8 70%, #9B00D6 100%); }
.nav.is-floating .nav__progress { opacity: 1; }

/* ---------- Menu open: header keeps only the logo + the X above the panel ---------- */
html.menu-open .nav {
  z-index: calc(var(--z-menu) + 1);
  transform: none;
}
html.menu-open .nav .nav__pill {
  background-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
html.menu-open .nav .nav__pill::before,
html.menu-open .nav .nav__progress { opacity: 0; }
html.menu-open .nav__links,
html.menu-open .nav__wa,
html.menu-open .theme-toggle {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}
html.menu-open .burger { background-color: var(--surface); }

/* entrance + first-frame helpers */
.nav--instant,
.nav--instant * { transition: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1179.98px) {
  .nav__links { display: none; }
  .nav.is-floating .nav__pill { max-width: 680px; }
  .nav.is-compact .nav__pill { max-width: 560px; }
}
@media (max-width: 720px) {
  .nav {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }
  .nav__pill,
  .nav.is-floating .nav__pill,
  .nav.is-compact .nav__pill { max-width: 100%; }
  .nav__pill { height: 64px; padding-inline: 6px; column-gap: 8px; }
  .nav.is-floating .nav__pill,
  .nav.is-compact .nav__pill { height: 56px; margin-top: 8px; padding-inline: 16px 7px; }
  .nav__logo .logo { width: calc(26px * 1502 / 541); height: 26px; }
  .nav.is-compact .nav__logo .logo { transform: none; }
  .nav__actions { gap: 6px; }
  .nav__wa { --btn-pad-x: 0px; width: 40px; padding: 0; }
  .nav__wa .i { width: 21px; height: 21px; }
  .nav__wa span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .nav__progress { inset-inline: 26px; }
}
/* phones: the icon-only WhatsApp circle matches the 44px touch buttons */
@media (max-width: 720px) and (pointer: coarse) {
  .nav__wa { width: 44px; }
}

/* ==========================================================================
   Side menu ("Curved Menu" by Shamsudheen): enters from the LEFT edge (RTL end, where the burger is)
   ========================================================================== */
.menu {
  --menu-ease: cubic-bezier(.76, 0, .24, 1);
  --menu-scrim: rgba(251, 247, 254, .5);
  --menu-edge-shadow: 34px 0 90px -34px rgba(80, 10, 120, .35);
  --menu-pad-x: clamp(24px, 5vw, 60px);
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  overflow: hidden;
}
[data-theme="dark"] .menu {
  --menu-scrim: rgba(4, 2, 7, .6);
  --menu-edge-shadow: 40px 0 120px -40px rgba(109, 4, 160, .6);
}

.menu__scrim {
  position: absolute;
  inset: 0;
  background: var(--menu-scrim);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  opacity: 0;
  cursor: pointer;
  transition: opacity .7s var(--ease-out);
}
.menu.is-open .menu__scrim { opacity: 1; }

.menu__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 560px);
  background: var(--surface);
  transform: translate3d(calc(-100% - 100px), 0, 0);
  transition: transform .8s var(--menu-ease), box-shadow .8s ease;
  will-change: transform;
}
.menu.is-open .menu__panel {
  transform: translate3d(0, 0, 0);
  box-shadow: var(--menu-edge-shadow);
}
/* ambient glows live on the far (left) side so the liquid edge stays one flat colour */
.menu__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(75% 42% at 0% 0%, rgba(203, 146, 3, .2), transparent 72%),
    radial-gradient(85% 55% at 0% 100%, rgba(200, 5, 254, .28), transparent 72%),
    radial-gradient(40% 30% at 18% 62%, rgba(109, 4, 160, .16), transparent 75%);
}
[data-theme="light"] .menu__panel::before {
  background:
    radial-gradient(70% 40% at 0% 0%, rgba(255, 226, 165, .95), transparent 72%),
    radial-gradient(80% 50% at 0% 100%, rgba(245, 201, 252, .9), transparent 72%),
    radial-gradient(40% 26% at 10% 58%, rgba(254, 230, 172, .55), transparent 75%);
}
/* a big soft sparkle peeking from the outer edge */
.menu__panel::after {
  content: '';
  position: absolute;
  left: -84px;
  bottom: 27%;
  width: 230px;
  aspect-ratio: 1;
  pointer-events: none;
  background: var(--grad-sparkle);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C53 33 67 47 100 50C67 53 53 67 50 100C47 67 33 53 0 50C33 47 47 33 50 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C53 33 67 47 100 50C67 53 53 67 50 100C47 67 33 53 0 50C33 47 47 33 50 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .16;
  transform: rotate(-12deg) scale(.6);
  transition: transform 1.4s var(--ease-out) .25s, opacity 1s ease .25s;
}
[data-theme="light"] .menu__panel::after { opacity: .42; }
.menu.is-open .menu__panel::after { transform: rotate(0deg) scale(1); }

/* the liquid leading edge: a 100px SVG glued to the panel's right side, mirrored so the
   quadratic bulge points outward; JS tweens the control point -100 (bulge) → 100 (flat) */
.menu__curve {
  position: absolute;
  top: 0;
  left: calc(100% - 1px);
  width: 100px;
  height: 100%;
  fill: var(--surface);
  overflow: visible;
  transform: scaleX(-1);
  pointer-events: none;
  max-width: none;
}

.menu__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-block: calc(var(--nav-h) + clamp(22px, 3.4vh, 44px)) clamp(20px, 3.6vh, 40px);
  padding-inline: var(--menu-pad-x);
  /* home indicator + landscape notch (the panel is anchored to the left edge) */
  padding-bottom: calc(clamp(20px, 3.6vh, 40px) + env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--menu-pad-x), env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.menu__inner::-webkit-scrollbar { display: none; }

.menu__inner > .eyebrow {
  display: block;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: right;
  font-size: .7rem;
}

/* staggered entrance (the items ride in with the panel) */
.menu__inner > .eyebrow,
.menu__links > li,
.menu__cta,
.menu__foot {
  opacity: 0;
  transform: translate3d(-48px, 0, 0);
  transition: opacity .3s ease, transform .4s var(--ease-out), box-shadow .5s var(--ease-out);
}
.menu.is-open .menu__inner > .eyebrow,
.menu.is-open .menu__links > li,
.menu.is-open .menu__cta,
.menu.is-open .menu__foot {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity .6s ease, transform 1s var(--ease-out), box-shadow .5s var(--ease-out);
  transition-delay: calc(.26s + var(--mi, 0) * 55ms), calc(.26s + var(--mi, 0) * 55ms), 0s;
}

/* ---------- Menu links: big numbered Heebo 900 ---------- */
.menu__links {
  list-style: none;
  margin: clamp(6px, 1.4vh, 14px) 0 0;
  padding: 0;
}
.menu__links > li {
  position: relative;
  border-bottom: 1px solid var(--line);
}
/* gradient hairline that sweeps in from the right on hover/active (poster 4 list rule) */
.menu__links > li::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 1px;
  background: var(--grad-hairline);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .7s var(--ease-out);
}
[data-theme="light"] .menu__links > li::after { background: var(--grad-swoosh); }

.menu__links a {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2vw, 22px);
  padding-block: clamp(5px, 1vh, 12px);
  font-weight: 900;
  font-size: clamp(1.85rem, min(7.6vw, 4.6vh), 3.25rem);
  line-height: 1.12;
  letter-spacing: -.01em;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.menu__links a:focus-visible { outline-offset: -2px; border-radius: 10px; }

.menu__no {
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 2.2em;
  padding-top: 1.05em;
  font-family: var(--font-latin);
  font-weight: 400;
  font-size: max(.72rem, .24em);
  letter-spacing: .14em;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  transition: color .35s ease;
}
.menu__no::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F524FD;
  box-shadow: 0 0 calc(10px * var(--glow-a)) #F524FD, 0 0 calc(20px * var(--glow-a)) rgba(245, 36, 253, .6);
  transform: scale(0);
  transition: transform .5s var(--ease-spring);
}

.menu__txt {
  position: relative;
  z-index: 0;
  display: inline-block;
  min-width: 0;
}
/* light theme: poster-1 highlighter sweeping in from the right behind the word */
.menu__txt::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: .2em -.16em .1em;
  border-radius: .28em;
  background: var(--hl-yellow);
  filter: blur(1.5px);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .6s var(--ease-out);
}
[data-theme="dark"] .menu__txt::before { display: none; }

/* per-letter ripple (Curved Menu: word shifts, letters spring back with a stagger), mirrored for RTL */
.menu__split,
.menu__ch {
  display: inline-block;
  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), color .35s ease, text-shadow .35s ease;
}
.menu__w { display: inline-block; white-space: nowrap; }

@media (hover: hover) and (pointer: fine) {
  .menu__links a:hover .menu__split { transform: translate3d(-14px, 0, 0); }
  .menu__links a:hover .menu__ch {
    transform: translate3d(14px, 0, 0);
    transition-delay: calc(90ms + var(--i, 0) * 42ms), calc(var(--i, 0) * 42ms), calc(var(--i, 0) * 42ms);
  }
  .menu__links > li:hover::after { transform: scaleX(1); }
  .menu__links a:hover .menu__no { color: var(--accent); }
  .menu__links a:hover .menu__txt::before { transform: scaleX(1); }
  [data-theme="dark"] .menu__links a:hover .menu__ch {
    color: var(--c, var(--text));
    text-shadow: 0 0 22px color-mix(in srgb, var(--c, #D729FF) 50%, transparent);
  }
}
/* keyboard focus gets the same sweep (no motion) */
.menu__links a:focus-visible .menu__txt::before { transform: scaleX(1); }
[data-theme="dark"] .menu__links a:focus-visible .menu__ch { color: var(--c, var(--text)); }

/* active section */
.menu__links a[aria-current] .menu__no { color: var(--accent); }
.menu__links a[aria-current] .menu__no::after { transform: scale(1); }
.menu__links > li:has(> a[aria-current])::after { transform: scaleX(1); }
[data-theme="dark"] .menu__links a[aria-current] .menu__ch { color: var(--c, var(--text)); }
[data-theme="light"] .menu__links a[aria-current] .menu__txt::before {
  background: var(--hl-lilac);
  transform: scaleX(1);
  filter: blur(.6px);
}

/* ---------- CTA + footer row ---------- */
.menu__cta {
  align-self: flex-start;
  margin-top: clamp(18px, 3.4vh, 38px);
}
.menu__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: clamp(18px, 2.8vh, 32px);
}
.menu__social {
  display: flex;
  gap: 8px;
  margin-inline-end: auto;
}
/* desktop: socials on their own row, the two switches under them */
@media (hover: hover) and (pointer: fine) {
  .menu__social { flex: 1 0 100%; }
}
.menu__social a,
.menu__theme,
.menu__wand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: color .3s ease, border-color .3s ease, background-color .3s ease, transform .4s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.menu__social a { width: 44px; }
.menu__social .i { width: 18px; height: 18px; }
.menu__theme,
.menu__wand {
  gap: 9px;
  padding-inline: 15px 17px;
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
}
.menu__theme .i,
.menu__wand .i { width: 18px; height: 18px; }
.menu__wand[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent-strong) 45%, transparent);
  background: color-mix(in srgb, var(--accent-strong) 9%, transparent);
}
.menu__wand[aria-pressed="true"] .i { color: var(--accent-gold); filter: drop-shadow(0 0 calc(6px * var(--glow-a)) rgba(255, 166, 0, .7)); }
@media (hover: hover) {
  .menu__social a:hover,
  .menu__theme:hover,
  .menu__wand:hover { color: var(--text); border-color: var(--line-strong); }
  .menu__social a:hover { transform: translate3d(0, -2px, 0); }
}
.menu__social a:active,
.menu__theme:active,
.menu__wand:active { transform: scale(.95); }
/* the wand drives a cursor trail: meaningless on touch screens */
@media (hover: none), (pointer: coarse) {
  .menu__wand { display: none; }
}

@media (max-width: 720px) {
  .menu__inner { padding-top: calc(var(--nav-h) + 26px); }
  .menu__cta { font-size: .95rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .nav,
  .nav *,
  .menu,
  .menu * { transition-duration: .001ms !important; transition-delay: 0s !important; }
  .menu__panel::after { transform: none; }
}
