/* =========================================================
   SHARED NAVBAR
   Used by index.html and team.html
========================================================= */


/* =========================================================
   GLOBAL BOX SIZING
========================================================= */

* {
  box-sizing: border-box;
}


/* =========================================================
   GLASS NAVIGATION BAR
========================================================= */

.topbar {
  position: fixed;
  top: 35px;
  left: 0;
  right: 0;

  z-index: 100;

  display: flex;
  justify-content: center;

  padding: 0 24px;

  pointer-events: none;
}


/* =========================================================
   GLASS NAVIGATION BAR
========================================================= */

.navbar {
  /* Hug the links instead of stretching across the page. */
  width: fit-content;
  max-width: calc(100% - 40px);

  min-height: 76px;

  display: grid;

  grid-template-columns: 1fr auto 1fr;

  gap: 34px;

  padding: 12px 32px;

  /* Glass pill: space either side of the text (em) and its gap from
     the navbar edge (px). */
  --pill-pad-x: 1.1;
  --pill-inset: 7;

  align-items: center;

  position: relative;

  overflow: hidden;

  border: 1px solid transparent;

  border-radius: 999px;

  /* Clear liquid glass: a light tint, not a frosted panel. */
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12),
      rgba(255, 255, 255, 0.03) 48%,
      rgba(255, 255, 255, 0.06)
    );

  backdrop-filter:
    blur(10px)
    saturate(185%)
    brightness(1.08);

  -webkit-backdrop-filter:
    blur(10px)
    saturate(185%)
    brightness(1.08);

  box-shadow:
    /* Lift off the page */
    0 14px 40px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.18),

    /* Thick-glass edge: bright top, soft bottom bounce */
    inset 0 1.5px 1px rgba(255, 255, 255, 0.55),
    inset 0 -1.5px 1px rgba(255, 255, 255, 0.2),

    /* Light caught inside the glass body */
    inset 0 10px 18px -8px rgba(255, 255, 255, 0.18),
    inset 0 -12px 20px -10px rgba(170, 190, 255, 0.16);

  pointer-events: auto;
}

/* Real refraction where the browser supports SVG backdrop filters
   (Chrome / Edge). The filter is built by /common/liquid-glass.js. */
.liquid-glass .navbar {
  backdrop-filter: url(#liquid-glass-filter);
  -webkit-backdrop-filter: url(#liquid-glass-filter);
}

.navbar > * {
  position: relative;
  z-index: 1;
}


/* =========================================================
   LIQUID GLASS PILL
   Sits behind the current page link and slides between
   links (positioned by /common/liquid-glass.js). The Team
   page division bar uses the same pill (team.js).
========================================================= */

:is(.navbar, .division-nav) > .nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;

  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0.07) 55%,
      rgba(255, 255, 255, 0.12)
    );

  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -1px 1px rgba(255, 255, 255, 0.22),
    inset 0 0 12px rgba(255, 255, 255, 0.08);

  opacity: 0;

  transition: opacity 0.3s ease;

  pointer-events: none;

  transform-origin: 0 0;
  will-change: transform;
}

:is(.navbar, .division-nav) > .nav-pill.visible {
  opacity: 1;
}

/* Specular rim on the pill */
:is(.navbar, .division-nav) > .nav-pill::before {
  content: "";

  position: absolute;
  inset: 0;

  padding: 1px;

  border-radius: inherit;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.1) 35%,
      rgba(255, 255, 255, 0.05) 60%,
      rgba(255, 255, 255, 0.55)
    );

  -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;
}

/* The pill replaces the underline once it is active. */
.has-nav-pill .nav-link::after {
  display: none;
}

.has-nav-pill .nav-link:hover {
  transform: none;
}


/* =========================================================
   GLASS SPECULAR RIM
   Light hits the top-left and bottom-right edges.
========================================================= */

.navbar::before {
  content: "";

  position: absolute;

  inset: -1px;

  padding: 1.2px;

  border-radius: inherit;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.85),
      rgba(255, 255, 255, 0.12) 22%,
      rgba(255, 255, 255, 0.04) 50%,
      rgba(255, 255, 255, 0.12) 78%,
      rgba(255, 255, 255, 0.6)
    );

  -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;

  pointer-events: none;
}


/* =========================================================
   GLASS SHEEN
   Soft curved highlight across the top of the glass.
========================================================= */

.navbar::after {
  content: "";

  position: absolute;

  inset: 0;

  border-radius: inherit;

  background:
    radial-gradient(
      120% 90% at 50% -20%,
      rgba(255, 255, 255, 0.16),
      rgba(255, 255, 255, 0.04) 45%,
      transparent 60%
    );

  pointer-events: none;
}


/* =========================================================
   NAVIGATION GROUPS
========================================================= */

.nav-left,
.nav-right {
  display: flex;

  align-items: center;

  gap: clamp(34px, 3.2vw, 46px);
}

/* Both sides get equal width so the logo stays centred. Any spare room
   on the shorter side goes between its links, not at the outer edge,
   so the first and last links sit the same distance from the ends. */
.nav-left,
.nav-right {
  justify-content: space-between;
}


/* =========================================================
   NAVIGATION LINKS
   Font comes from the shared font stack in common.css
========================================================= */

.nav-link {
  position: relative;

  color: #ffffff;

  text-decoration: none;

  font-size: clamp(1.25rem, 1.6vw, 1.5rem);

  font-weight: 500;

  letter-spacing: -0.02em;

  white-space: nowrap;

  transition:
    color 0.3s ease,
    transform 0.3s ease;
}


.nav-link:hover {
  color: #ffffff;

  transform: translateY(-2px);
}


/* =========================================================
   NAVIGATION UNDERLINE
========================================================= */

.nav-link::after {
  content: "";

  position: absolute;

  left: 0;

  bottom: -6px;

  width: 0;

  height: 1px;

  background: #ffffff;

  transition: width 200ms ease;
}


.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: #ffffff;
}

.nav-link.active::after {
  width: 100%;
}


/* =========================================================
   CENTER DRONE LOGO
========================================================= */

.logo-link {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 56px;
  height: 56px;

  border-radius: 50%;

  text-decoration: none;

  transition:
    transform 220ms ease,
    background 220ms ease;
}


.logo-link:hover {
  transform: scale(1.08);

  background: rgba(255, 255, 255, 0.08);
}


.drone-logo {
  width: 42px;
  height: 42px;

  object-fit: contain;

  display: block;
}


/* =========================================================
   FALLBACK LOGO
========================================================= */

.logo-fallback {
  display: none;

  color: #ffffff;

  font-size: 1.5rem;

  font-weight: 700;
}
