/*
 * Navigation glass surface.
 * Ported from the supplied React Bits GlassSurface component without runtime
 * framework dependencies. The visual filter parameters remain data-driven.
 */
.glass-surface {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.26s ease-out;
  isolation: isolate;
  --glass-frost: 0.08;
  --glass-saturation: 1.35;
}

.glass-surface__filter {
  width: 100%;
  height: 100%;
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: -1;
}

.glass-surface__content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: inherit;
  position: relative;
  z-index: 1;
}

.glass-surface--svg {
  background: rgba(0, 0, 0, var(--glass-frost, 0));
  background: light-dark(
    hsl(0 0% 100% / var(--glass-frost, 0)),
    hsl(0 0% 0% / var(--glass-frost, 0))
  );
  box-shadow:
    0 0 2px 1px light-dark(color-mix(in oklch, black, transparent 85%), color-mix(in oklch, white, transparent 65%)) inset,
    0 0 10px 4px light-dark(color-mix(in oklch, black, transparent 90%), color-mix(in oklch, white, transparent 85%)) inset,
    0 4px 16px rgba(17, 17, 26, 0.05),
    0 8px 24px rgba(17, 17, 26, 0.05),
    0 16px 56px rgba(17, 17, 26, 0.05),
    0 4px 16px rgba(17, 17, 26, 0.05) inset,
    0 8px 24px rgba(17, 17, 26, 0.05) inset,
    0 16px 56px rgba(17, 17, 26, 0.05) inset;
}

.glass-surface--svg[data-glass-id="welcome-navigation"] {
  -webkit-backdrop-filter: url(#glass-filter-welcome-navigation) saturate(var(--glass-saturation, 1));
  backdrop-filter: url(#glass-filter-welcome-navigation) saturate(var(--glass-saturation, 1));
}

.glass-surface--svg[data-glass-id="main-navigation"] {
  -webkit-backdrop-filter: url(#glass-filter-main-navigation) saturate(var(--glass-saturation, 1));
  backdrop-filter: url(#glass-filter-main-navigation) saturate(var(--glass-saturation, 1));
}

.glass-surface--fallback {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.2);
  backdrop-filter: blur(12px) saturate(1.8) brightness(1.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: light) {
  .glass-surface--fallback {
    background: rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
    backdrop-filter: blur(12px) saturate(1.8) brightness(1.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
      0 8px 32px 0 rgba(31, 38, 135, 0.2),
      0 2px 16px 0 rgba(31, 38, 135, 0.1),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.4),
      inset 0 -1px 0 0 rgba(255, 255, 255, 0.2);
  }
}

@supports not (backdrop-filter: blur(10px)) {
  .glass-surface--fallback {
    background: rgba(0, 0, 0, 0.4);
    box-shadow:
      inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
      inset 0 -1px 0 0 rgba(255, 255, 255, 0.1);
  }

  .glass-surface--fallback::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: inherit;
    z-index: -1;
  }

  @media (prefers-color-scheme: light) {
    .glass-surface--fallback {
      background: rgba(255, 255, 255, 0.4);
      box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 0 rgba(255, 255, 255, 0.3);
    }

    .glass-surface--fallback::before {
      background: rgba(255, 255, 255, 0.15);
    }
  }
}

.glass-surface:focus-visible {
  outline: 2px solid light-dark(#007aff, #0a84ff);
  outline-offset: 2px;
}

/* Permanent top navigation behavior.
   The complete React Bits glass surface remains fixed at the top of the
   viewport while the document scrolls. The main page mobile two-row layout
   stays inside the same fixed surface, so both rows move as one unit. */
[data-scroll-navigation] {
  position: fixed;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  transform-origin: 50% 0;
  opacity: 1;
  pointer-events: auto;
  will-change: auto;
}
