/* Nav: a white notch pinned to the top of the window, measured off the owner's reference (Catalis):
   a 12px white band across the top, a centred white bar with only its bottom corners rounded (24px), and
   two 24px inward-curved corners that flare it into the band. Once the page scrolls the band folds away
   and the notch hangs from the top edge. Under 1240px the links fold into a white menu card (the full bar
   needs 1147px plus its margins). */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; pointer-events: none; }
.nav-space { height: 12px; background: var(--bg); transition: height 200ms ease; }
.nav.is-scrolled .nav-space { height: 0; }
.nav-row { display: flex; justify-content: center; padding: 0 var(--gutter); }

.nav-notch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 8px 8px 8px 24px;
  border-radius: 0 0 24px 24px;
  background: var(--bg);
  pointer-events: auto;
}
/* the two inward corners: shapes cut by a mask, filled with the page colour (no colour of their own) */
.nav-notch::before,
.nav-notch::after {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--bg);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.nav-notch::before {
  right: 100%;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M24 0H0A24 24 0 0 1 24 24Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M24 0H0A24 24 0 0 1 24 24Z'/%3E%3C/svg%3E");
}
.nav-notch::after {
  left: 100%;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M0 0H24A24 24 0 0 0 0 24Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M0 0H24A24 24 0 0 0 0 24Z'/%3E%3C/svg%3E");
}

.nav-logo { display: inline-flex; align-items: center; flex: none; }
.nav-logo img { height: 22px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
/* links in Gray 1 at regular weight (owner, 05.11: the black read as an eyesore); black on hover */
.nav-links a { font-size: 15px; font-weight: 400; color: var(--fg-soft); white-space: nowrap; transition: color var(--hover) ease; }
.nav-links a:hover { color: var(--fg); }
.nav-cta { flex: none; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--pill);
  background: var(--press);
  color: var(--on-press);
  flex: none;
  transition: background-color var(--hover) ease;
}
.nav-toggle:hover { background: var(--press-hover); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .when-open { display: none; }
.nav-toggle[aria-expanded="true"] .when-open { display: block; }
.nav-toggle[aria-expanded="true"] .when-closed { display: none; }
.nav-panel { display: none; }

/* phones: the hero card sits 8px in, so the band matches it */
@media (max-width: 860px) { .nav-space { height: 8px; } }

@media (max-width: 1239px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-notch { gap: 40px; padding: 8px 8px 8px 20px; }
  .nav-panel.is-open {
    display: block;
    width: min(420px, calc(100% - 24px));
    margin: 10px auto 0;
    padding: 8px 20px 20px;
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: var(--card-shadow);
    pointer-events: auto;
  }
  .nav-panel a:not(.btn) { display: block; padding: 13px 2px; font-size: 16px; font-weight: 400; color: var(--fg-soft); border-bottom: 1px solid var(--line); transition: color var(--hover) ease; }
  .nav-panel a:not(.btn):hover { color: var(--fg); }
  .nav-panel .btn { display: flex; width: 100%; margin-top: 18px; }
}
/* the smallest phones: a little less room between the logo and the menu button, so the button stays round */
@media (max-width: 374px) { .nav-notch { gap: 32px; } }
