/* ==========================================================================
   Home Nav — the landing top navigation.
   At the very top it is fully transparent, full-width and borderless. As you
   scroll, glass-nav.js writes a 0→1 progress onto `.site-chrome` as `--p`
   (over the first ~130px of scroll); EVERY property below is derived from --p,
   so the bar is *scrubbed* — it smoothly shrinks into a compact, centered
   glass pill and the items (brand · links · actions) converge toward the
   middle, tracking the scroll instead of snapping at a threshold.
   No CSS transitions on the morph: the smoothness comes from the scroll itself.
   ========================================================================== */

.site-chrome {
  --p: 0;                       /* default; JS overrides this inline on scroll */
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  will-change: transform;
}

.home-nav {
  box-sizing: border-box;
  /* width converges from full-width to a centered ~760px pill */
  width: calc(100% - var(--p, 0) * (100% - 760px));
  max-width: calc(100% - 24px);
  margin: calc(var(--p, 0) * 14px) auto 0;
  padding: calc(22px - var(--p, 0) * 13px) 0;          /* 22px → 9px */
  border-radius: calc(var(--p, 0) * 999px);            /* 0 → capsule */
  border: 1px solid rgba(21, 20, 15, calc(var(--p, 0) * 0.08)) !important;
  background: rgba(255, 255, 255, 0);
  background: rgba(255, 255, 255, calc(var(--p, 0) * 0.72)) !important; /* fully transparent at start, glass capsule when scrolled */
  box-shadow:
    inset 0 0 2px 1px  rgba(255, 255, 255, calc(var(--p, 0) * 0.55)),
    inset 0 0 10px 4px rgba(255, 255, 255, calc(var(--p, 0) * 0.22)),
    0 1px 3px rgba(17, 17, 26, calc(var(--p, 0) * 0.04)),
    0 12px 40px rgba(17, 17, 26, calc(var(--p, 0) * 0.06 * var(--p, 0))) !important;
}

/* Ensure that when not condensed at the top of the scroll, the bar is completely transparent, borderless and shadowless */
.site-chrome:not(.is-condensed) .home-nav {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* plain frost, fading in with --p — gated on is-condensed so there is NO
   backdrop-filter at all (not even blur(0)) while the bar is fully open. */
.site-chrome.is-condensed .home-nav {
  -webkit-backdrop-filter: blur(calc(var(--p, 0) * 9px)) saturate(calc(1 + var(--p, 0) * 0.45)) !important;
  backdrop-filter: blur(calc(var(--p, 0) * 9px)) saturate(calc(1 + var(--p, 0) * 0.45)) !important;
}
/* near the end of the scrub, swap the plain frost for the liquid-glass filter
   (its id is exposed by glass-nav.js as --glass-filter). */
.site-chrome.nav-liquid .home-nav {
  /* Old iOS (no unprefixed backdrop-filter): static glassy frost. */
  -webkit-backdrop-filter: blur(14px) saturate(1.8) brightness(1.05) !important;
  /* glass-nav.js sets `--glass-filter` per engine: the url() refraction on
     Chromium/Gecko, a tuned frost on WebKit/iOS (where url() can't render and
     would otherwise paint as fully transparent). The fallback here covers the
     brief window before the script runs. */
  backdrop-filter: var(--glass-filter, blur(14px) saturate(1.8) brightness(1.05)) !important;
}

/* ---- inner layout: brand | links | actions ----------------------------- */
/* The 1fr/auto/1fr grid keeps the links dead-centered while the side columns
   shrink as the bar narrows, pulling brand & actions toward the middle. */
.home-nav-inner {
  width: 100%;
  box-sizing: border-box;
  padding: 0 calc(12px + var(--p, 0) * 14px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.home-nav .brand {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; justify-self: start; text-decoration: none;
  color: var(--fg-1, #1C1B1F) !important;
}
.home-nav .mark {
  width: calc(30px - var(--p, 0) * 4px);
  height: calc(30px - var(--p, 0) * 4px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(8px - var(--p, 0) * 2px);
  background: var(--fg-1, #1C1B1F) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}
.home-nav .mark svg {
  width: calc(16px - var(--p, 0) * 2px) !important;
  height: calc(16px - var(--p, 0) * 2px) !important;
}
.home-nav .wordmark {
  font-size: calc(19px - var(--p, 0) * 2px);
  color: var(--fg-1, #1C1B1F) !important;
  font-weight: 800 !important;
}

.home-nav-links { display: flex; align-items: center; gap: 4px; justify-self: center; }
.home-nav .tb-link {
  font: 600 14.5px/1 var(--font-sans);
  color: var(--fg-2, #4b5563) !important;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.home-nav .tb-link:hover {
  color: var(--fg-1, #1C1B1F) !important;
  background: rgba(28, 27, 31, 0.05) !important;
}

.home-nav-side { display: flex; align-items: center; gap: 10px; justify-self: end; }

/* Keep elements elegant, dark and high-contrast from the start */
.home-nav .btn-ghost {
  color: var(--fg-1, #1C1B1F) !important;
  border: 1px solid rgba(28, 27, 31, 0.15) !important;
  font-weight: 600 !important;
  background: transparent !important;
}
.home-nav .btn-ghost:hover {
  background: rgba(28, 27, 31, 0.05) !important;
  border-color: rgba(28, 27, 31, 0.25) !important;
}

/* keep the hero clear of the fixed bar */
.land { padding-top: 80px; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 760px) {
  .home-nav-inner { grid-template-columns: 1fr auto; gap: 12px; }
  .home-nav-links { display: none; }
  .land { padding-top: 68px; }
}
@media (max-width: 420px) {
  .home-nav-side .btn-ghost { display: none; }
}
