/* BMOS landing — shared header (nav) and footer.
   Tokens only (see /DESIGN.md). Markup lives in site/_partials/; run scripts/sync-partials.mjs after edits. */

/* ---------- skip link ---------- */
.nv-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 60;
  background: var(--n9);
  color: var(--n0);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease);
}
.nv-skip:focus { top: 10px; color: var(--n0); }
.nv-skip { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- bar ---------- */
.nv {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  border-bottom: 1px solid var(--n2);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}
.nv-row { height: 100%; display: flex; align-items: center; gap: var(--s-6); }
.nv-nav { flex: 1; min-width: 0; }
.nv-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--s-1); }
.nv-list>li { position: relative; }
.nv-login { margin-left: auto; }
.nv-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 40px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--t-14);
  font-weight: 500;
  color: var(--n6);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.nv-link:hover { color: var(--n9); }
.nv-link:active, .nv-main a:active, .nv-more a:active { background: var(--n1); }
.nv-link[aria-current="page"] { color: var(--n9); font-weight: 600; }
.nv-chev { transition: transform var(--dur-fast) var(--ease); }
.nv-cta { flex-shrink: 0; }
.nv-menu { display: none; }
.nv-sheet-cta { display: none; }

/* ---------- Product dropdown: hover, keyboard (:focus-within) and tap (.open via JS) ---------- */
.nv-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: -12px;
  width: 440px;
  padding: var(--s-2);
  background: var(--white);
  border: 1px solid var(--n2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease) .15s;
}
.nv-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }

/* Opens on hover (desktop) or on the button (click / Enter / Space → .open). Focus alone does not open it,
   so Tab walks Product → Pricing without detouring through six hidden links. */
.nv-dd.open .nv-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.nv-dd.open .nv-chev { transform: rotate(180deg); }
.nv-dd.open .nv-ddbtn { color: var(--n9); }
@media (hover: hover) and (min-width:861px) {
  .nv-dd:not(.closed):hover .nv-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  }
  .nv-dd:hover .nv-chev { transform: rotate(180deg); }
  .nv-dd:hover .nv-ddbtn { color: var(--n9); }
}
.nv-panel ul { list-style: none; margin: 0; padding: 0; }
.nv-main a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--n9);
}
.nv-main a b { font-size: var(--t-14); font-weight: 600; }
.nv-main a span { font-size: var(--t-14); color: var(--n6); }
.nv-main a:hover, .nv-more a:hover { background: var(--n1); color: var(--n9); }
.nv-main a[aria-current="page"] { background: var(--brand-bg); }
.nv-more {
  display: flex;
  gap: var(--s-1);
  margin-top: var(--s-1) !important;
  padding-top: var(--s-1) !important;
  border-top: 1px solid var(--n2);
}
.nv-more a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--t-14);
  font-weight: 500;
  color: var(--n6);
  text-decoration: none;
}
.nv-more a[aria-current="page"] { color: var(--n9); font-weight: 600; }

/* ---------- mobile: one menu button, sheet under the bar ---------- */
@media (max-width: 860px) {
  .nv { height: 60px; }
  .nv-row { gap: var(--s-2); }
  .nv-cta { margin-left: auto; min-height: 44px; padding: 0 var(--s-3); }
  /* The button precedes the sheet in the DOM (disclosure pattern: Tab goes button → sheet links); it sits last visually. */
  .nv-menu {
    order: 3;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -8px;
    border: 0;
    background: none;
    border-radius: var(--r-md);
    cursor: pointer;
    color: var(--n9);
  }
  .nv-menu span,
  .nv-menu span::before,
  .nv-menu span::after {
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
    border-radius: var(--r-sm);
    transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
  }
  .nv-menu span { position: relative; }
  .nv-menu span::before, .nv-menu span::after { content: ''; position: absolute; left: 0; }
  .nv-menu span::before { top: -6px; }
  .nv-menu span::after { top: 6px; }
  .nv.open .nv-menu span { background: transparent; }
  .nv.open .nv-menu span::before { transform: translateY(6px) rotate(45deg); }
  .nv.open .nv-menu span::after { transform: translateY(-6px) rotate(-45deg); }
  .nv-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: var(--n0);
    border-top: 1px solid var(--n2);
    padding: var(--s-2) var(--s-4) var(--s-6);
  }
  .nv.open .nv-nav { display: block; }

  /* backdrop-filter makes the bar a containing block for fixed children; drop it while the sheet is open */
  .nv.open { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--n0); }
  .nv-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nv-list>li { border-bottom: 1px solid var(--n2); }
  .nv-login { margin-left: 0; }
  .nv-link {
    width: 100%;
    min-height: 52px;
    padding: 0 var(--s-1);
    font-size: var(--t-18);
    font-weight: 600;
    color: var(--n9);
    border-radius: 0;
  }
  .nv-ddbtn { justify-content: space-between; }
  .nv-panel {
    position: static;
    width: auto;
    padding: 0 0 var(--s-3);
    border: 0;
    box-shadow: none;
    background: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .nv-dd:not(.open) .nv-panel { display: none; }
  .nv-panel::before { display: none; }
  .nv-main a { padding: var(--s-2) var(--s-1); min-height: 44px; }
  .nv-main a b { font-size: var(--t-18); }
  .nv-more { border-top: 0; margin-top: 0 !important; padding-top: 0 !important; }
  .nv-more a { padding: 0 var(--s-1); font-size: var(--t-16); min-height: 44px; }
}
/* Narrowest phones (< 360): logo + menu button only; the CTA moves to the bottom of the sheet. */
@media (max-width: 359px) {
  .nv-cta { display: none; }
  .nv-menu { margin-left: auto; }
  .nv-list > li.nv-sheet-cta { display: block; border-bottom: 0; padding-top: var(--s-5); }
  .nv-sheet-cta .btn { width: 100%; min-height: 52px; font-size: var(--t-16); }
}

html.nv-lock { overflow: hidden; }

/* ---------- footer ---------- */
.nf {
  margin-top: 0;
  border-top: 1px solid var(--n2);
  background: var(--white);
  padding: var(--s-7) 0 var(--s-6);
  font-size: var(--t-14);
}
.nf-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: var(--s-6); }
.nf-brand p { margin-top: var(--s-3); color: var(--n6); max-width: 300px; line-height: 1.5; }
.nf-col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.nf-col b { font-size: var(--t-14); font-weight: 600; color: var(--n9); margin-bottom: var(--s-1); }
.nf-col a { color: var(--n6); text-decoration: none; min-height: 32px; min-width: 44px; display: inline-flex; align-items: center; }
.nf-col a:hover { color: var(--n9); }
.nf-legal {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--n2);
  color: var(--n5);
  font-size: var(--t-14);
}
@media (max-width: 860px) {
  .nf { padding: var(--s-6) 0 var(--s-5); }
  .nf-grid { grid-template-columns: 1fr 1fr; gap: var(--s-5) var(--s-4); }
  .nf-brand { grid-column: 1/-1; }
  .nf-col a { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .nv-panel, .nv-chev, .nv-menu span, .nv-menu span::before, .nv-menu span::after, .nv-skip { transition: none; }
}
