/* Site nav — bevel-style glass pill, CENTERED + compact (no logo, per user).
   Static <link> so backdrop-filter survives Lightning CSS. Transparent + light text at the
   top; on scroll it becomes a translucent white glass pill + dark text. A full-screen frosted
   veil (.site-nav-blur) flashes over the page whenever a tab jumps to its section. */

.site-nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 20px);
  height: 50px;
  max-width: calc(100vw - 28px);
  padding: 0 8px 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  font-family: -apple-system, system-ui, "Inter", "Segoe UI", sans-serif;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background .35s ease, -webkit-backdrop-filter .35s ease,
    backdrop-filter .35s ease, border-color .35s ease, box-shadow .35s ease, color .35s ease;
}

/* scrolled = more transparent glass (per user: "trong suốt hơn") */
.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 8px 30px -20px rgba(17, 24, 39, 0.3);
  color: #222326;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 20px);
}
.site-nav__link {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: inherit;
  background: none;
  border: none;
  padding: 6px 4px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.site-nav__link:hover { opacity: 1; }

/* CTA pill: white over the dark hero (top) → bevel dark once the bar is glass (scrolled) */
.site-nav__cta {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 8px 18px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: #fff;
  color: #1f2025;
  transition: transform 0.2s ease, background 0.3s ease, color 0.3s ease;
}
.site-nav.is-scrolled .site-nav__cta { background: #1f2025; color: #ebf0f8; }
.site-nav__cta:hover { transform: translateY(-1px); }

/* sound toggle — an animated equalizer (tech vibe). Bars dance while sound is on, sit dim + still
   when off. Uses currentColor so it follows the nav text (white at top → dark when glass). */
.site-nav__sound {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: none;
}
.site-nav__sound .site-nav__bar {
  width: 2.5px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: center bottom;
  transition: opacity 0.3s ease;
}
.site-nav__sound.is-on .site-nav__bar {
  opacity: 0.95;
  animation: navEq 1s ease-in-out infinite;
}
.site-nav__sound.is-on .site-nav__bar:nth-child(1) { animation-delay: -0.4s; }
.site-nav__sound.is-on .site-nav__bar:nth-child(2) { animation-delay: -0.1s; }
.site-nav__sound.is-on .site-nav__bar:nth-child(3) { animation-delay: -0.65s; }
.site-nav__sound.is-on .site-nav__bar:nth-child(4) { animation-delay: -0.25s; }
@keyframes navEq {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.55); }
}
@media (prefers-reduced-motion: reduce) {
  .site-nav__sound.is-on .site-nav__bar { animation: none; }
}

/* full-screen frosted veil — fades in over the whole screen (incl. the nav, z above it) while a
   tab click jumps to its section under the blur, then fades out to reveal the destination */
.site-nav-blur {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  opacity: 0;
  background: rgba(244, 247, 251, 0.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.05);
  backdrop-filter: blur(22px) saturate(1.05);
  transition: opacity 0.6s ease; /* slower, more deliberate blur transition (per user) */
}
.site-nav-blur.is-active { opacity: 1; }

@media (max-width: 720px) {
  .site-nav { height: 44px; padding: 0 6px 0 12px; gap: 8px; top: 10px; max-width: calc(100vw - 16px); }
  .site-nav__links { gap: 6px; }
  .site-nav__link { font-size: 13px; padding: 6px 4px; white-space: nowrap; }
  .site-nav__cta { font-size: 13px; padding: 7px 12px; }
  .site-nav__sound { width: 28px; height: 28px; }
}

@media (max-width: 380px) {
  .site-nav { gap: 6px; padding: 0 5px 0 9px; }
  .site-nav__link { font-size: 12px; padding: 6px 3px; }
  .site-nav__cta { padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav, .site-nav__cta, .site-nav-blur { transition: none; }
}

/* ============================================================================
   SOCIAL DROPDOWN — round share button on the pill + a liquid-glass menu that
   bounces open (Apple spring). The wrap is a static flex item (holds the button
   in the row); the menu is position:absolute so it drops from under the pill
   (positioning context = .site-nav, which is transformed). Static <link> so the
   backdrop-filter + mask ring survive Lightning CSS.
   ========================================================================== */
.site-nav__social-wrap { display: inline-flex; align-items: center; flex: none; }

/* trigger — mirrors the sound toggle: currentColor glyph (white at top, dark on glass) */
.site-nav__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: none;
  transition: background 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.site-nav__social svg { width: 18px; height: 18px; display: block; }
.site-nav__social:hover { background: rgba(127, 127, 127, 0.14); }
.site-nav__social.is-open {
  transform: scale(0.94);
  background: rgba(127, 127, 127, 0.2);
}

/* the glass panel — position:fixed, JS sets top/left (rendered OUTSIDE the nav so
   iOS Safari can blur the page behind it; no `filter` here, since `filter` + own
   `backdrop-filter` cancels the blur on WebKit). */
.site-nav__social-menu {
  position: fixed;
  z-index: 100;
  width: 250px;
  padding: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: 0 18px 50px rgba(15, 18, 32, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  /* closed base state + FAST non-bouncing close transition (transform + opacity only) */
  opacity: 0;
  transform: translateY(-6px) scale(0.55);
  transform-origin: top right;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.22s ease-in, opacity 0.18s ease-in, visibility 0s linear 0.22s;
}
/* bright bevel ring (masked, border box only) */
.site-nav__social-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.35));
  -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, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* OPEN — Apple spring bounce (the 1.56 overshoot), transform + opacity only */
.site-nav__social-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s ease-out,
    visibility 0s;
}

/* rows */
.site-nav__social-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: #16171a;
  /* closed base + fast close (no delay) */
  opacity: 0;
  transform: translateY(-10px) scale(0.9);
  transition: opacity 0.16s ease-in, transform 0.18s ease-in, background 0.2s ease;
}
.site-nav__social-menu.is-open .site-nav__social-item {
  opacity: 1;
  transform: none;
  transition: opacity 0.28s ease-out, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s ease;
}
.site-nav__social-menu.is-open .site-nav__social-item:nth-child(1) { transition-delay: 0.06s; }
.site-nav__social-menu.is-open .site-nav__social-item:nth-child(2) { transition-delay: 0.12s; }
.site-nav__social-menu.is-open .site-nav__social-item:nth-child(3) { transition-delay: 0.18s; }
.site-nav__social-item:hover { background: rgba(20, 22, 28, 0.06); }

.site-nav__social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: rgba(20, 22, 28, 0.08);
  color: #16171a;
  transition: background 0.2s ease;
}
.site-nav__social-item:hover .site-nav__social-icon { background: rgba(20, 22, 28, 0.14); }
.site-nav__social-icon svg { width: 18px; height: 18px; display: block; }

.site-nav__social-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.site-nav__social-txt b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.site-nav__social-txt i {
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: rgba(22, 23, 26, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .site-nav__social { width: 30px; height: 30px; }
  .site-nav__social svg { width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__social,
  .site-nav__social-menu,
  .site-nav__social-item { transition: none; }
}
