/* Site header (markup: src/build_nav.py, behaviour: header-nav.js).
   Light bar, angled navy logo cap, red only on Subscribe. */
.snav {
  --sn-ink: #0f1923; --sn-text: #1f2937; --sn-muted: #4b5563; --sn-faint: #6b7280;
  --sn-line: #e2e0db; --sn-soft: #f5f4f1; --sn-cap: #0f1923; --sn-red: #dc2626; --sn-red-hi: #b91c1c;
  --sn-ease: cubic-bezier(.22, 1, .36, 1);
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--sn-line);
  font-family: 'Inter', system-ui, sans-serif; color: var(--sn-text);
  -webkit-font-smoothing: antialiased;
}
.snav *, .snav *::before, .snav *::after { box-sizing: border-box; }
:where(.snav) a { color: inherit; text-decoration: none; }
:where(.snav) button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; margin: 0; }
.snav :focus-visible { outline: 2px solid var(--sn-red); outline-offset: 2px; border-radius: 4px; }
.snav summary { list-style: none; }
.snav summary::-webkit-details-marker { display: none; }

/* ---------- bar ---------- */
.snav-bar { display: flex; align-items: center; height: 64px; padding-right: max(16px, calc((100vw - 1280px) / 2 + 24px)); }
.snav-logo {
  position: relative; display: block; flex-shrink: 0; height: 64px; width: calc(max(16px, (100vw - 1280px) / 2 + 24px) + 232px);
  background: var(--sn-cap); margin-right: 18px; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
}
/* Logo.svg has wide built-in padding; crop to the wordmark */
.snav-logo img {
  position: absolute; width: 236px; height: auto; top: calc(50% + 10px); transform: translateY(-50%);
  right: 22px; user-select: none; transition: opacity .2s;
}
.snav-logo:hover img { opacity: .8; }
.snav-links { display: flex; align-items: center; gap: 2px; height: 100%; }
.snav-lnk {
  position: relative; display: inline-flex; align-items: center; gap: 5px; height: 44px; padding: 0 12px;
  font-size: 15px; font-weight: 600; color: var(--sn-text); border-radius: 8px; white-space: nowrap;
  transition: color .2s, background .2s;
}
.snav-lnk svg { width: 12px; height: 12px; transition: transform .25s var(--sn-ease); }
.snav-lnk:hover, .snav-lnk[aria-expanded="true"] { color: var(--sn-ink); background: var(--sn-soft); }
.snav-lnk[aria-expanded="true"] svg { transform: rotate(180deg); }
/* current section: a short red rule under the label */
.snav-lnk.on { color: var(--sn-ink); }
.snav-lnk.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -10px; height: 2px; background: var(--sn-red); border-radius: 2px; }
.snav-sp { flex: 1; }
.snav-acts { display: flex; align-items: center; gap: 8px; }

.snav-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: 8px; font-size: 14.5px; font-weight: 650; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--sn-ease);
}
.snav-btn:active { transform: scale(.98); }
.snav .snav-btn-red { background: var(--sn-red); color: #fff; }
.snav .snav-btn-red:hover { background: var(--sn-red-hi); }
.snav .snav-btn-line { border: 1px solid var(--sn-line); color: var(--sn-ink); background: #fff; }
.snav .snav-btn-line:hover { border-color: var(--sn-ink); }
.snav-burger { display: none; width: 44px; height: 44px; place-items: center; border-radius: 8px; color: var(--sn-ink); }
.snav-burger:hover { background: var(--sn-soft); }
.snav-burger svg { width: 22px; height: 22px; }

/* ---------- mega panels ---------- */
.snav-panel, .snav-drawer {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5;
  background: #fff; border-bottom: 1px solid var(--sn-line);
  box-shadow: 0 24px 40px -28px rgba(15, 25, 35, .35);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .22s var(--sn-ease), transform .22s var(--sn-ease), visibility 0s .22s;
  max-height: calc(100dvh - 64px); overflow: auto;
}
.snav-panel.show, .snav-drawer.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* bridge the gap between the link and the panel so hover doesn't drop */
.snav-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.snav-pin { max-width: 1280px; margin: 0 auto; padding: 24px; display: grid; gap: 28px; }
.snav-news { grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); }
.snav-split { grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
.snav-col h4 {
  margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--sn-line);
  font: 700 11.5px/1.2 'Inter', sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--sn-muted);
}
.snav-item { display: block; padding: 9px 10px; margin: 0 -10px; border-radius: 8px; transition: background .15s; }
.snav-item b { display: block; font-size: 15px; font-weight: 650; color: var(--sn-ink); }
.snav-item span { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--sn-muted); }
.snav-item:hover { background: var(--sn-soft); }
.snav-item:hover b { color: var(--sn-red); }
.snav-states { display: grid; }
.snav-st { display: block; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; font-size: 14px; color: var(--sn-text); transition: background .15s, color .15s; }
.snav-st:hover { background: var(--sn-soft); color: var(--sn-ink); }
.snav-feat { background: var(--sn-soft); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.snav-feat > b { font: 700 11.5px/1 'Inter', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--sn-red-hi); }
.snav-feat p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sn-muted); }
.snav-feat .snav-big { font: 500 26px/1.1 'Martian Mono', monospace; color: var(--sn-ink); letter-spacing: -.02em; }
.snav-feat .snav-feat-h { font-size: 19px; font-weight: 750; line-height: 1.2; color: var(--sn-ink); letter-spacing: -.01em; }
.snav-feat-acts { display: flex; align-items: center; gap: 16px; margin-top: 6px; flex-wrap: wrap; }
.snav-textlink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--sn-ink); }
.snav-textlink svg { width: 14px; height: 14px; transition: transform .2s var(--sn-ease); }
.snav-textlink:hover { color: var(--sn-red); }
.snav-textlink:hover svg { transform: translateX(3px); }

/* ---------- mobile drawer ---------- */
.snav-drawer { padding: 4px 16px 20px; }
.snav-drawer > details > summary, .snav-top {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  font-weight: 650; font-size: 16px; color: var(--sn-ink); border-bottom: 1px solid var(--sn-line); cursor: pointer;
}
.snav-drawer summary svg { width: 14px; height: 14px; transition: transform .25s var(--sn-ease); }
.snav-drawer details[open] > summary svg { transform: rotate(180deg); }
.snav-inner { padding: 4px 0 12px 8px; }
.snav-sub > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14.5px; color: var(--sn-ink); cursor: pointer; }
.snav-plain { display: flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 15px; font-weight: 550; color: var(--sn-muted); }
.snav-drawer .snav-states { grid-template-columns: 1fr 1fr; }
.snav-drawer .snav-st { padding: 10px 8px; font-size: 14.5px; }
.snav-drow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 16px; }
.snav-drow .snav-btn { min-height: 48px; }

@media (max-width: 1100px) { .snav-news { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) {
  .snav-links, .snav-panel { display: none; }
  .snav-burger { display: grid; }
}
@media (min-width: 1024px) { .snav-drawer { display: none; } }
@media (max-width: 640px) {
  .snav-demo, .snav-subscribe { display: none; }
  .snav-logo { width: 196px; margin-right: 8px; }
  .snav-logo img { width: 180px; right: 18px; top: calc(50% + 8px); }
}
@media (prefers-reduced-motion: reduce) { .snav *, .snav-panel, .snav-drawer { transition-duration: .01ms !important; } }

/* Demo booking popup, built by header-nav.js on pages that have no #demoModal */
.snav-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 25, 35, .6); opacity: 0; visibility: hidden; transition: opacity .2s, visibility 0s .2s; }
.snav-modal.show { opacity: 1; visibility: visible; transition-delay: 0s; }
.snav-modal-box { position: relative; width: 100%; max-width: 760px; max-height: calc(100dvh - 32px); overflow: auto; background: #fff; border-radius: 10px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.snav-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e2e0db; font: 700 16px 'Inter', sans-serif; color: #0f1923; }
.snav-modal-x { width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; font-size: 22px; line-height: 1; color: #4b5563; cursor: pointer; }
.snav-modal-x:hover { background: #f5f4f1; color: #0f1923; }

/* Newsletter popup */
.snav-nl { max-width: 460px; }
.snav-nl-body { padding: 20px 22px 22px; font-family: 'Inter', sans-serif; }
.snav-nl-body h3 { margin: 0 0 6px; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; color: #0f1923; }
.snav-nl-body p { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: #4b5563; }
.snav-nl-body label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: #374151; }
.snav-nl-row { display: flex; gap: 8px; }
.snav-nl-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid #d1cec8; border-radius: 8px; font: 15px 'Inter', sans-serif; color: #0f1923; }
.snav-nl-row input:focus { outline: none; border-color: #0f1923; box-shadow: 0 0 0 3px rgba(15, 25, 35, .12); }
.snav-nl-row .snav-btn { min-height: 44px; border: 0; cursor: pointer; }
.snav-nl-row .snav-btn:disabled { opacity: .7; cursor: default; }
.snav-nl-body .snav-nl-msg { margin: 10px 0 0; font-size: 13px; min-height: 0; }
.snav-nl-body .snav-nl-msg:empty { display: none; }
.snav-nl-msg.ok { color: #15803d; }
.snav-nl-msg.err { color: #b91c1c; }
.snav-nl-body .snav-nl-fine { margin: 10px 0 0; font-size: 11.5px; color: #6b7280; }
@media (max-width: 420px) { .snav-nl-row { flex-direction: column; } }
.snav-modal .snav-btn-red { background: #dc2626; color: #fff; font-family: 'Inter', sans-serif; }
.snav-modal .snav-btn-red:hover { background: #b91c1c; }

/* Calendly's booking popup (opened by every Book a Demo, see header-nav.js).
   On phones Calendly pins it to the bottom edge, but its base rule's
   "max-height:700px!important" beats its own phone rule, leaving the page showing
   underneath. widget.css loads after this file, so the override needs the extra
   "body" to win. */
@media (max-width: 975px) {
  body .calendly-overlay .calendly-popup { max-height: none !important; background: #fff; }
}
