/* The glass has a clear centre and a convex, light-catching perimeter.
   Only the material samples the backdrop; the labels occupy a separate layer. */
html {
  --nav-anchor-offset: 105px;
  scroll-padding-top: var(--nav-anchor-offset);
}
/* The about section provides the space beneath the fixed header itself.
   Align its background with the viewport so the previous scene clears it. */
#about {
  scroll-margin-top: calc(0px - var(--nav-anchor-offset));
  padding-block-start: calc(var(--nav-anchor-offset) + 5px);
}

body > header:has(> .right-glass) {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 24px;
}

body.below-scene > header:has(> .right-glass) {
  background: linear-gradient(to bottom, rgb(3 8 17 / 42%), transparent);
  box-shadow: none;
}

header > .right-glass {
  --glass-backdrop: blur(3px) saturate(1.27);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-self: end;
  box-sizing: border-box;
  width: clamp(362px, 32vw, 486px);
  padding: 4px 8px;
  gap: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow:
    0 10px 30px -15px rgb(0 2 9 / 76%),
    0 2px 5px rgb(0 4 14 / 25%);
  color: #f5f8ff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .045em;
}

header > .right-glass::before {
  background:
    linear-gradient(114deg, rgb(230 246 255 / 10%), transparent 34%, rgb(0 10 26 / 9%) 63%, rgb(229 242 255 / 7%)),
    rgb(19 36 56 / 15%);
  box-shadow:
    inset 0 2px 4px -2px rgb(255 255 255 / 46%),
    inset 0 -3px 5px -3px rgb(165 210 246 / 40%);
}

/* Vary the rim's brightness with the surface normal. */
header > .right-glass::after {
  padding: 1px;
  background: linear-gradient(151deg,
    rgb(230 248 255 / 80%) 0%, rgb(208 236 255 / 29%) 21%,
    rgb(188 219 249 / 9%) 42%, rgb(194 226 253 / 17%) 66%,
    rgb(239 251 255 / 65%) 89%, rgb(219 243 255 / 37%) 100%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow: none;
}

header > .right-glass > a,
header > .right-glass .navtrigger {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 6px;
  font: inherit;
  text-shadow: 0 1px 4px rgb(0 4 15 / 65%);
}

header > .right-glass .partners-chevron {
  display: block;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.25px 1.25px 0;
  transform: translateY(-1px) rotate(45deg);
}

header > .right-glass .navgroup {
  display: flex;
  align-items: center;
  justify-content: center;
}
header > .right-glass .arrival-partners {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 6px 1px;
  white-space: nowrap;
  color: inherit;
}
header > .right-glass .arrival-partners:focus-visible {
  outline: 2px solid #bbd4e4;
  outline-offset: 1px;
  border-radius: 4px;
}
header > .right-glass .navtrigger {
  flex: 0 0 28px;
  min-width: 28px;
  width: 28px;
  padding: 0;
}
header > .right-glass [aria-current="location"]::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: calc(50% - 6px);
  width: 12px;
  height: 1px;
  background: #ffc18a;
}

header > .right-glass .navtrigger[aria-expanded="true"] .partners-chevron {
  transform: translateY(2px) rotate(225deg);
}

header > .right-glass .glass-nav-lens {
  top: 4px;
  height: calc(100% - 8px);
}

header > .right-glass .navpanel {
  left: 50%;
  right: auto;
  translate: -50% 0;
  width: min(330px, 68vw);
}

@media (min-width: 601px) and (max-width: 840px) {
  body > header:has(> .right-glass) { column-gap: 10px; padding-inline: 20px; }
  header > .right-glass { width: clamp(300px, 49vw, 394px); font-size: 13px; }
}

@media (max-width: 600px) {
  html { --nav-anchor-offset: calc(116px + env(safe-area-inset-top, 0px)); }
  body > header:has(> .right-glass) {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }
  header > .right-glass {
    width: min(100%, 330px);
    padding: 2px 5px;
    font-size: 13px;
    letter-spacing: .025em;
  }
  header > .right-glass .glass-nav-lens { top: 2px; height: calc(100% - 4px); }
  header > .right-glass .navpanel { inset-inline: 16px; width: auto; translate: none; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header > .right-glass::before { background: #162538; }
}
@media (prefers-contrast: more), (prefers-reduced-transparency: reduce) {
  header > .right-glass::before { background: #152438; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (forced-colors: active) {
  header > .right-glass { border: 1px solid ButtonText; }
}

/* On a short phone in landscape both controls fit on one line, leaving the
   left-aligned hero lettering and the cabinet clear below the header. */
@media (min-width: 480px) and (max-width: 600px) and (max-height: 480px) and (orientation: landscape) {
  html { --nav-anchor-offset: calc(70px + env(safe-area-inset-top, 0px)); }
  body > header:has(> .right-glass) {
    height: calc(56px + env(safe-area-inset-top, 0px));
    grid-template: 1fr / max-content minmax(0, 1fr);
    column-gap: 8px;
  }
  header > .right-glass {
    grid-area: 1 / 2;
    width: min(100%, 285px);
  }
  header > .right-glass .navpanel {
    top: calc(60px + env(safe-area-inset-top, 0px));
    max-height: calc(100dvh - 70px - env(safe-area-inset-top, 0px));
  }
}
