/* --- Navbar ---
   Overlaid on top of the page (transparent) and scrolls away with the
   content instead of sticking. A floating scroll-to-top button (.scroll-top)
   takes over once the bar leaves the viewport. */
#nav-placeholder {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  z-index: 1030;
}

.navbar-telamorph {
  position: relative; /* anchor for the bar-wide cursor streak (::before) */
  /* The bar's height tracks the logo so a growing mark never spills over the
     top edge. --nav-pad-y is the breathing room above and below the logo:
     the top of the bar sits --nav-pad-y above the logo and the bottom streak
     sits --nav-pad-y below it. Kept tight so the bar doesn't outgrow the
     top clearance pages reserve for it (var(--nav-height) + ~25px), which
     was letting the logo clip into hero content on shorter viewports. */
  --nav-logo-size: clamp(80px, 40px + 4.2vw, 120px);
  --nav-pad-y: 8px;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  padding: 0;
  min-height: calc(var(--nav-logo-size) + var(--nav-pad-y) * 2);
  display: flex;
  align-items: center;
}

.navbar-telamorph .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Brand / Logo
   Pinned to the viewport so the logo stays in the upper-left at every scroll
   position, while the rest of the bar (centered tabs + hamburger) keeps its
   original scroll-away behaviour. `top`/`height` reproduce the brand's spot in
   the bar: the placeholder sits at top:4px and the bar is --nav-height tall,
   so a matching fixed box with align-items:center lands the logo identically.
   z-index sits just above the bar (1030) but below the offcanvas (1040+), so
   the open side menu still covers it. */
.navbar-telamorph .navbar-brand {
  position: fixed;
  top: 4px;
  left: 1rem;
  /* Same height as the bar (both anchored at top:6px), so the logo centers
     inside it with --nav-pad-y clearance top and bottom. */
  height: calc(var(--nav-logo-size) + var(--nav-pad-y) * 2);
  z-index: 1031;
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: 700;
  /* Fluid instead of a hard breakpoint switch: shrinks continuously across
     the mid range (where it meets the floor/ceiling) so it never visibly snaps
     mid-shrink and overlaps the centered .product-tabs just above 992px.
     Tuned so the floor (≤~900px) and the tight 992px zone match the previous
     sizing — the extra ~50% growth only unlocks on wide screens (~1920px hits
     ~3.75rem, capping at 3.9rem ≥~1985px) where there's horizontal room. */
  font-size: clamp(1.35rem, -0.75rem + 3.75vw, 3.9rem);
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.6);
}

@media (min-width: 992px) {
  .navbar-telamorph .navbar-brand {
    left: 1.5rem; /* match container px-lg-4 */
  }
}

/* Brand is now fixed (out of the bar's flex flow); keep the hamburger pinned
   to the right rather than collapsing to the left. */
.navbar-telamorph .hamburger-btn {
  margin-left: auto;
}

.navbar-telamorph .navbar-brand .brand-text {
  color: #fff;
}

.navbar-telamorph .navbar-brand:hover {
  color: var(--accent);
}

.navbar-telamorph .navbar-brand:hover .brand-text {
  color: var(--accent);
}

/* Wraps just the logo + wordmark (not the taller fixed .navbar-brand box,
   which carries extra --nav-pad-y clearance for positioning) so the scroll
   scrim below hugs the visible mark tightly instead of the padded box. */
.navbar-telamorph .brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  border-radius: 6px;
  object-fit: contain;
  /* Matches the brand text: holds the previous 80px below ~960px (small
     screens stay exactly as before), then grows with width up to 120px
     (+50%) at ~1920px where the hero has vertical room for the taller mark.
     The bar's height is derived from this same --nav-logo-size (above), so the
     logo always sits fully inside the bar as it grows. */
  width: var(--nav-logo-size);
  height: var(--nav-logo-size);
  position: relative;
  z-index: 1; /* above the scroll scrim (.brand-mark::before) */
}

/* Scroll scrim — a soft dark halo that fades in behind the logo + wordmark
   once the page starts scrolling, so they stay legible over whatever imagery
   passes beneath them. Sized in fixed px (not %) so it stays a tight, even
   rectangle around the mark at every logo size, never a hard plate. */
.navbar-telamorph .brand-mark::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  z-index: 0;
  pointer-events: none;
  border-radius: var(--radius-lg);
  background: rgba(17, 18, 21, 0.55);
  filter: blur(14px);
  opacity: 0;
  transition: opacity 0.45s ease;
}

/* The brand text sits above the scrim too. */
.navbar-telamorph .navbar-brand .brand-text {
  position: relative;
  z-index: 1;
}

html.nav-scrolled .navbar-telamorph .brand-mark::before {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .navbar-telamorph .brand-mark::before {
    transition: none;
  }
}

/* Product category tabs (desktop) — hidden by default, shown from 700px up.
   Absolutely centered on the full-width bar (not the flex space between the
   logo and hamburger) so the tabs sit at true screen centre. */
.product-tabs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 0.1rem;
  white-space: nowrap;
}

.product-tab {
  color: var(--text-primary);
  text-decoration: none;
  /* Dynamic scaling between 600px and ~1900px viewport widths — larger now
     that the bar floats over the hero rather than sitting in a solid strip */
  font-size: clamp(0.95rem, 0.6rem + 0.8vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 1.35rem clamp(0.5rem, 0.9vw, 1.5rem);
  position: relative;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  transition:
    color var(--transition),
    text-shadow var(--transition);
  white-space: nowrap;
}

/* Reveal top tabs and hide mobile product list at ≥860px; below that the
   product categories collapse into the hamburger menu */
@media (min-width: 860px) {
  .product-tabs {
    display: flex;
  }
  .menu-products-mobile {
    display: none !important;
  }
}

/* When mobile products section is hidden, remove the gap before Company */
@media (min-width: 860px) {
  .menu-products-mobile + .menu-heading {
    margin-top: 0;
  }
}

/* Shrink tabs between 600–991px so the three tabs fit (brand text already
   shrinks continuously via its own clamp() above) */
@media (max-width: 991.98px) {
  .product-tab {
    font-size: clamp(0.78rem, 0.4rem + 1.4vw, 1.05rem);
    padding: 1.35rem clamp(0.3rem, 0.7vw, 0.7rem);
  }
  .product-tabs {
    gap: 0;
  }
}

.product-tab:hover,
.product-tab:focus-visible,
.product-tab.active {
  color: var(--accent);
}

/* Hamburger button — borderless, no background shift on hover; the bars react */
.hamburger-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 26px;
}

.hamburger-icon span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 1px;
  transform-origin: right center;
  transition:
    transform var(--transition),
    background-color var(--transition);
}

/* On hover the bars glow accent and stagger into a right-aligned chevron */
.hamburger-btn:hover .hamburger-icon span,
.hamburger-btn:focus-visible .hamburger-icon span {
  background: var(--accent);
}

.hamburger-btn:hover .hamburger-icon span:nth-child(1),
.hamburger-btn:focus-visible .hamburger-icon span:nth-child(1) {
  transform: scaleX(0.68);
}

.hamburger-btn:hover .hamburger-icon span:nth-child(3),
.hamburger-btn:focus-visible .hamburger-icon span:nth-child(3) {
  transform: scaleX(0.45);
}

/* Offcanvas side menu — frosted glass: translucent gradient + backdrop blur,
   a soft accent glow up top, and the cursor streak along the top edge. */
.offcanvas-telamorph {
  --bs-offcanvas-bg: transparent;
  --bs-offcanvas-color: var(--text-primary);
  color: var(--text-primary) !important;
  background-color: transparent !important;
  background-image: linear-gradient(
    160deg,
    rgba(37, 39, 48, 0.72) 0%,
    rgba(17, 18, 21, 0.92) 100%
  );
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: -24px 0 70px -30px rgba(0, 0, 0, 0.85);
  max-width: 360px;
}

/* Keep content above the top-edge streak (::before sits at z-index 1) */
.offcanvas-telamorph .offcanvas-header,
.offcanvas-telamorph .offcanvas-body {
  position: relative;
  z-index: 2;
}

.offcanvas-telamorph .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1.5rem;
}

.offcanvas-telamorph .offcanvas-title {
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.menu-heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  margin: 1.7rem 0 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.menu-heading:first-child {
  margin-top: 0;
}

.menu-heading::after {
  content: "";
  flex: 1;
  min-width: 2rem;
  height: 1px;
  background: linear-gradient(90deg, var(--border-light), transparent);
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.65rem;
}

.menu-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  padding: 0.62rem 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1.25;
  border-radius: var(--radius-sm);
  transition:
    color var(--transition),
    background-color var(--transition),
    text-shadow var(--transition);
}

.menu-list li a::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  opacity: 0;
  transform: translateX(-0.35rem) rotate(45deg);
  transition:
    opacity var(--transition),
    transform var(--transition);
  order: 2;
}

.menu-list li a:hover,
.menu-list li a:focus-visible {
  color: var(--accent);
}

.menu-list li a:hover::before,
.menu-list li a:focus-visible::before {
  opacity: 0.85;
  transform: rotate(45deg);
}

@media (max-width: 699.98px) {
  .menu-heading {
    margin-top: 1.45rem;
  }

  /* Clean text rows (no boxes) — just a comfortable tap target; the shared
     hover fill + underline streak provide the interaction. */
  .menu-list li a {
    min-height: 46px;
    padding: 0.7rem 0.8rem;
  }

  .menu-list li + li {
    margin-top: 0.15rem;
  }
}
