/* Dream Bezier — Auto-hide + glass reveal navigation v2
   Home + Coming Soon, desktop/tablet/mobile.
   - At the absolute top: clean transparent header, no glass.
   - Scroll down: header hides.
   - Scroll up: full header reveals over a frosted-glass strip.
   - Desktop: moving the pointer to the top edge also reveals it.
   - Returning to the page top removes the glass automatically. */

.top-nav {
  will-change: transform, opacity, background-color, backdrop-filter;
  transition:
    transform .28s cubic-bezier(.22,.61,.36,1),
    opacity .22s ease,
    background-color .24s ease,
    backdrop-filter .24s ease,
    -webkit-backdrop-filter .24s ease !important;
}

/* Kill legacy bars, dividers and shadows. The clean top state stays truly clean. */
.top-nav,
.top-nav.is-scrolled,
body.inner-page .top-nav {
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Frosted-glass strip ONLY when the nav is revealed away from the top. */
.top-nav.db-nav-scrolled:not(.is-hidden) {
  background: rgba(15, 15, 13, .56) !important;
  -webkit-backdrop-filter: blur(18px) saturate(128%) !important;
  backdrop-filter: blur(18px) saturate(128%) !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Very subtle internal sheen, not a divider line. */
.top-nav.db-nav-scrolled:not(.is-hidden)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.045) 0%,
    rgba(255,255,255,.012) 42%,
    rgba(255,255,255,0) 100%
  );
  border: 0;
}

.top-nav.is-hidden {
  transform: translate3d(0, calc(-100% - 18px), 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.top-nav:not(.is-hidden) {
  transform: translate3d(0,0,0) !important;
  opacity: 1 !important;
}

/* Preserve the original breathing room; legacy .is-scrolled must not compact it. */
.top-nav.is-scrolled {
  padding-top: 1.4rem !important;
  padding-bottom: 1.4rem !important;
}

@media (max-width: 768px) {
  .top-nav.is-scrolled {
    padding-top: 1.1rem !important;
    padding-bottom: 1.1rem !important;
  }

  /* Slightly denser glass on touch devices for readability over imagery. */
  .top-nav.db-nav-scrolled:not(.is-hidden) {
    background: rgba(15, 15, 13, .62) !important;
    -webkit-backdrop-filter: blur(16px) saturate(125%) !important;
    backdrop-filter: blur(16px) saturate(125%) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-nav { transition: none !important; }
}
