/* ════════════════════════════════════════════════════════════════════
   Capacoty canonical partials CSS
   Header (md-header) + login dropdown + account dropdown + footer
   Tokens use var(--token, fallback) so this stylesheet is self-sufficient
   even on pages that don't define the project's design tokens.
   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   STACK SANS TEXT — local, weight 400.
   Loaded here (not per-page) so every marketing page can render H1
   page titles in the same family as the homepage hero. Files live
   at /fonts/ and were committed in the cache-bumped Stack Sans push.
   ════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'Stack Sans Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/stack-sans-text-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Stack Sans Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/stack-sans-text-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Global page-title typography — every H1 across every marketing page
   renders in Stack Sans Text 400 (matches the homepage hero).
   !important is intentional: per-page styles already declare their own
   font-family / font-weight on h1 selectors with class-level
   specificity, and we want the site-wide typography rule to win
   regardless. Per-page font-size, letter-spacing and line-height are
   unaffected. */
h1 {
  font-family: 'Stack Sans Text', -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol" !important;
  font-weight: 400 !important;
}

/* ─── Container helper (ensures footer container exists) ─────────── */
.cap-footer .container,
footer .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px, 3.5vw, 48px);
}

/* ─── Floating header ────────────────────────────────────────────── */
.md-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 20px;
  position: fixed;
  top: 36px; left: 12px; right: 12px;   /* sits further down — was 22px */
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(10,10,10,0.07);
  z-index: 9999;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.md-header.is-scrolled {
  background: rgba(255,255,255,0.68);
  border-color: rgba(10,10,10,0.09);
  box-shadow: 0 4px 24px -8px rgba(10,10,10,0.10);
}
.md-header-logo { display: flex; align-items: center; justify-self: start; }
.md-header-logo img { max-width: 130px; height: auto; display: block; }

/* Centre nav */
.md-nav-center { display: flex; align-items: center; gap: 2px; justify-self: center; }
.md-nav-link {
  font-size: 15px;
  color: var(--ink, #0a0a0a);
  padding: 8px 14px; border-radius: 999px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
}
.md-nav-link:hover { background: rgba(10,10,10,0.06); }
.md-nav-link.active { background: rgba(10,10,10,0.07); font-weight: 600; }
.md-nav-caret { font-size: 9px; color: rgba(10,10,10,0.38); }

/* Right-side actions */
.md-header-actions { display: flex; align-items: center; gap: 14px; justify-self: end; }
/* Sign-in button — outline pill that matches the hero's Interactive Demo button */
.md-header-login {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  font-size: 15px;
  color: var(--ink, #0a0a0a);
  text-decoration: none;
  white-space: nowrap;
  padding: 0 20px;
  height: 38px;
  background: transparent;
  border: 1.5px solid rgba(10,10,10,.28);
  border-radius: 10px;
  display: inline-flex; align-items: center;
  cursor: pointer;
  position: relative; overflow: hidden; isolation: isolate; z-index: 1;
  transition: color .35s ease, border-color .35s ease;
}
.md-header-login::before {
  content: ''; position: absolute; inset: 0;
  background: #0c1a2e;
  transform: translateX(101%);
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  z-index: -1;
}
.md-header-login:hover::before { transform: translateX(0); }
.md-header-login:hover { color: #fff; border-color: #0c1a2e; }

/* Header CTA — navy default + brand-orange slide on hover (text stays white) */
.md-btn {
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  font-size: 15px; font-weight: 500;
  padding: 0 20px;
  background: #0c1a2e; color: #ffffff;
  border: none; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  white-space: nowrap; height: 38px; min-width: 148px;
  position: relative; overflow: hidden; z-index: 1;
  transition: box-shadow 0.3s;
}
.md-btn::before {
  content: "";
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: #2a50f3;
  transition: left 0.45s cubic-bezier(.4,0,.2,1);
  z-index: -1; border-radius: 10px;
}
.md-btn:hover { color: #ffffff; box-shadow: 0 4px 16px rgba(42,80,243,0.42); }
.md-btn:hover::before { left: 0; }
.md-btn svg { width: 15px; height: 15px; stroke-width: 2; position: relative; z-index: 2; flex-shrink: 0; }

/* ─── Login dropdown (guest state) ───────────────────────────────── */
.login-wrap { position: relative; }
/* The .login-dropdown panel lives at body level (not inside .login-wrap)
   so it isn't trapped in the header's transform/backdrop-filter containing
   block. Desktop position is set inline by partials.js (positionLoginDropdown)
   to anchor it under the Sign-in trigger button. */
.login-dropdown {
  display: none; position: fixed;
  /* top/right/left set by JS on desktop; overridden by mobile media query below */
  top: 76px; right: 24px;
  width: 310px;
  max-width: calc(100vw - 28px);
  background: #fff;
  border: 1px solid var(--hair, rgba(10,10,10,.09));
  border-radius: var(--r-lg, 20px);
  box-shadow: 0 24px 60px -20px rgba(22,24,29,.22), 0 8px 18px -10px rgba(22,24,29,.08);
  padding: 22px;
  z-index: 9996;
}
.login-dropdown.open {
  display: block;
  animation: capDropdownIn .18s cubic-bezier(.34,1.2,.64,1) both;
}
@keyframes capDropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* Mobile: render login-dropdown as a centred popup modal — drawer-triggered */
@media (max-width: 920px) {
  .login-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100vw - 32px));
    max-width: none;
    z-index: 9996; /* above drawer */
    padding: 24px 22px;
    border-radius: 18px;
    box-shadow: 0 24px 80px -10px rgba(10,12,16,.40), 0 8px 18px -10px rgba(10,12,16,.20);
  }
  .login-dropdown.open {
    display: block;
    animation: capLoginModalIn .22s cubic-bezier(.34,1.2,.64,1) both;
  }
  @keyframes capLoginModalIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
  /* Larger title on mobile to fill the modal nicely */
  .login-dropdown-title {
    font-size: 19px;
    margin-bottom: 18px;
    padding-right: 32px; /* room for close button */
  }
  /* Larger inputs (16px = no iOS zoom on focus) */
  .login-input {
    padding: 14px 16px;
    font-size: 16px;
  }
  .login-submit {
    padding: 14px;
    font-size: 15px;
    margin-top: 4px;
  }
  /* Close button — appears only on mobile */
  .login-close {
    display: flex;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--hair-2, rgba(10,10,10,.16));
    background: #fff;
    color: var(--ink, #0a0a0a);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .15s;
    -webkit-tap-highlight-color: transparent;
  }
  .login-close:hover { background: var(--accent-tint, #e6e9f7); border-color: var(--accent-bd, rgba(42,80,243,.28)); }
  .login-close:active { transform: scale(.94); }
}
@media (min-width: 921px) {
  /* Close button is mobile-only */
  .login-close { display: none; }
}

/* Login backdrop — visible on every viewport now. Sits below the dropdown
   (z-9996) and below the floating header (z-9999), so the header stays
   visible while the rest of the page is dimmed. */
.md-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9994;
  background: rgba(10,12,16,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
body.md-login-open .md-login-overlay {
  opacity: 1;
  pointer-events: auto;
}
.login-dropdown-title {
  font-size: 18px; font-weight: 600;
  color: var(--ink, #0a0a0a);
  margin-bottom: 16px; letter-spacing: -.015em;
}
.login-field-wrap { margin-bottom: 10px; }
.login-input {
  width: 100%;
  border: 1px solid var(--hair-2, rgba(10,10,10,.16));
  border-radius: var(--r-pill, 999px);
  padding: 11px 16px; font-size: 14px;
  font-family: inherit; outline: none;
  background: var(--bg, #fbfaf6); color: var(--ink, #0a0a0a);
  transition: border-color .2s;
}
.login-input:focus { border-color: var(--ink, #0a0a0a); }
.login-error {
  font-size: 12px; color: #b44141;
  min-height: 14px; margin-bottom: 8px; padding-left: 4px;
}
.login-submit {
  width: 100%;
  background: var(--accent, #2a50f3); color: #fff;
  border: none; border-radius: var(--r-pill, 999px);
  padding: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .2s;
}
.login-submit:hover { background: var(--accent-deep, #1a3fd9); }
.login-submit:disabled { opacity: .6; cursor: default; }
.login-links {
  display: flex; gap: 10px; align-items: center;
  margin-top: 14px; font-size: 12.5px; padding-left: 4px;
}
.login-links a {
  color: var(--muted, rgba(10,10,10,.62));
  transition: color .2s; cursor: pointer; text-decoration: none;
}
.login-links a:hover { color: var(--ink, #0a0a0a); }
.login-divider { color: var(--hair-2, rgba(10,10,10,.16)); }

/* ─── Features dropdown ─────────────────────────────────────────────
   Same architectural pattern as the login dropdown: panel lives at body
   level (after the header) so it isn't trapped by the header's transform
   / backdrop-filter containing block. Desktop position is set inline by
   partials.js anchored under #md-nav-features-btn. The .md-features-overlay
   dims the page while the floating header stays crisp on top. */
.md-nav-features-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.md-nav-features-btn {
  background: transparent; border: none; cursor: pointer;
  font-family: inherit;
  /* Inherit visual sizing from .md-nav-link — only adjust gap for the caret. */
  gap: 6px;
}
.md-nav-features-btn[aria-expanded="true"] { background: rgba(10,10,10,0.07); }
.md-nav-features-caret {
  color: rgba(10,10,10,0.55);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.md-nav-features-btn[aria-expanded="true"] .md-nav-features-caret {
  transform: rotate(180deg);
}

.md-features-dropdown {
  display: none; position: fixed;
  /* top/left set by JS on desktop; overridden by mobile media query below */
  top: 76px; left: 24px;
  width: 220px;
  max-width: calc(100vw - 28px);
  background: #fff;
  border: 1px solid var(--hair, rgba(10,10,10,.09));
  border-radius: var(--r-lg, 20px);
  box-shadow: 0 24px 60px -20px rgba(22,24,29,.22), 0 8px 18px -10px rgba(22,24,29,.08);
  padding: 8px;
  z-index: 9996;
}
.md-features-dropdown.open {
  display: block;
  animation: capDropdownIn .18s cubic-bezier(.34,1.2,.64,1) both;
}
.md-features-item {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink, #0a0a0a);
  font-size: 16px; font-weight: 500; letter-spacing: -.01em;
  line-height: 1.3;
  transition: background .15s;
}
.md-features-item + .md-features-item { margin-top: 1px; }
.md-features-item:hover { background: rgba(10,10,10,.05); }
.md-features-item:focus-visible {
  outline: 2px solid var(--accent, #2a50f3);
  outline-offset: 2px;
}

/* Backdrop — sits below the dropdown (z-9996) and below the floating header
   (z-9999), so the header stays visible while the rest of the page dims.
   Pattern mirrors .md-login-overlay exactly. */
.md-features-overlay {
  position: fixed;
  inset: 0;
  z-index: 9994;
  background: rgba(10,12,16,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
body.md-features-open .md-features-overlay {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 920px) {
  /* Mobile: nav-center is hidden, so the desktop trigger and dropdown are
     irrelevant. Force the dropdown hidden in case it was opened on a larger
     viewport before a resize. */
  .md-features-dropdown,
  .md-features-overlay { display: none !important; }
  body.md-features-open { /* no-op on mobile */ }
}

/* ─── Account dropdown (logged-in state) ─────────────────────────── */
.cap-user-wrap { position: relative; }
/* Circular yellow avatar showing the user's first initial.
   Replaces the previous full "My account" pill. The dropdown is
   unchanged — only the trigger and its accompanying backdrop are new. */
#nav-user-btn {
  display: none; align-items: center; justify-content: center;
  box-sizing: border-box;
  width: 45px; height: 45px;
  font-size: 15px; font-weight: 700;
  color: #0a0a0a;
  /* Hardcoded — some pages (eg. /assessments/) re-theme --warm darker,
     but the header is global chrome and should look identical everywhere. */
  background: #d4f564;
  border: none; border-radius: 50%;
  cursor: pointer; font-family: inherit;
  letter-spacing: -.01em; line-height: 1;
  position: relative;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
#nav-user-btn.visible { display: inline-flex; }
#nav-user-btn:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(168,201,55,.45); }
#nav-user-btn[aria-expanded="true"] { transform: scale(1.04); box-shadow: 0 4px 16px rgba(168,201,55,.45); }
#nav-user-name { display: inline-block; pointer-events: none; }

/* Backdrop — matches md-login-overlay pattern. Header (z-9999) stays
   crisp above the dim; user-dropdown inherits the header stacking
   context (z-300 within the header) so it stays above the overlay. */
.md-user-overlay {
  position: fixed; inset: 0; z-index: 9994;
  background: rgba(10,12,16,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
body.md-user-open .md-user-overlay {
  opacity: 1; pointer-events: auto;
}

.nav-user-dropdown {
  display: none; position: absolute;
  top: calc(100% + 10px); right: 0;
  width: 380px; max-width: calc(100vw - 24px);
  background: #fff;
  border: 1.5px solid var(--hair-2, rgba(10,10,10,.16));
  border-radius: var(--r-xl, 28px);
  box-shadow: 0 20px 56px -8px rgba(22,24,29,.22);
  overflow: hidden; z-index: 300;
}
.nav-user-dropdown.open {
  display: block;
  animation: capDropdownIn .18s cubic-bezier(.34,1.2,.64,1) both;
}

/* Header band — plan identity */
.nud-header {
  padding: 18px 20px 16px;
  background: var(--bg, #fbfaf6);
  border-bottom: 1px solid var(--hair, rgba(10,10,10,.09));
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.nud-plan-identity { display: flex; flex-direction: column; gap: 6px; }
.nud-plan-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nud-plan-name {
  font-size: 16px; font-weight: 700;
  color: var(--ink, #0a0a0a);
  letter-spacing: -.015em;
}
.nud-plan-interval {
  font-size: 12px;
  color: var(--muted, rgba(10,10,10,.62));
  font-weight: 500;
}
.nud-go-app {
  font-size: 12px; font-weight: 600;
  color: var(--accent, #2a50f3);
  padding: 5px 12px; border-radius: var(--r-pill, 999px);
  border: 1.5px solid var(--accent-bd, rgba(42,80,243,.28));
  background: #fff;
  text-decoration: none; white-space: nowrap;
  cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s; flex-shrink: 0;
}
.nud-go-app:hover {
  background: var(--accent-dim, rgba(42,80,243,.10));
  border-color: var(--accent, #2a50f3);
}

/* Status pill */
.sub-status {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 3px 10px; border-radius: var(--r-pill, 999px);
}
.sub-status.active { background: var(--accent-tint, #e6e9f7); color: var(--accent-deep, #1a3fd9); }
.sub-status.trial  { background: var(--warm-tint, #f0f8d8); color: var(--warm-deep, #7a9420); }
.sub-status.past_due { background: #f5dada; color: var(--danger, #9a3b3b); }

/* Meta info grid */
.nud-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--hair, rgba(10,10,10,.09));
  border-bottom: 1px solid var(--hair, rgba(10,10,10,.09));
}
.nud-meta-cell {
  background: #fff; padding: 12px 20px;
  display: flex; flex-direction: column; gap: 3px;
}
.nud-meta-cell.full { grid-column: 1 / -1; }
.nud-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--soft, rgba(10,10,10,.42));
}
.nud-val {
  font-size: 13px; font-weight: 600;
  color: var(--ink, #0a0a0a);
  line-height: 1.3;
}
.nud-val.muted {
  color: var(--muted, rgba(10,10,10,.62));
  font-weight: 400;
}
.nud-meta.warm .nud-label { color: var(--warm-deep, #7a9420); }
.nud-meta.warm .nud-val   { color: var(--warm-deep, #7a9420); }
.sub-discount-note {
  font-size: 11.5px;
  color: var(--accent-deep, #1a3fd9);
  font-weight: 500; margin-left: 5px;
}

/* Usage bar */
.nud-usage { padding: 14px 20px; border-bottom: 1px solid var(--hair, rgba(10,10,10,.09)); }
.nud-usage-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nud-usage-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--soft, rgba(10,10,10,.42));
}
.nud-usage-count {
  font-size: 13px; font-weight: 700;
  color: var(--ink, #0a0a0a);
  font-variant-numeric: tabular-nums;
}
.nud-usage-count span {
  font-weight: 400;
  color: var(--muted, rgba(10,10,10,.62));
}
.nud-bar {
  height: 6px;
  background: var(--card, #e8e7e4);
  border-radius: 999px; overflow: hidden;
}
.nud-fill {
  height: 100%;
  background: var(--accent, #2a50f3);
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.nud-fill.warn { background: var(--warm-deep, #7a9420); }

/* Actions */
.nud-actions {
  padding: 14px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.nud-btn-primary {
  width: 100%; padding: 11px 16px;
  border-radius: var(--r-pill, 999px);
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: var(--accent, #2a50f3);
  border: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; line-height: 1.2; text-align: center;
  position: relative; overflow: hidden; isolation: isolate;
  transition: box-shadow .3s, transform .15s;
}
.nud-btn-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--navy, #0c1a2e);
  transform: translateX(101%);
  transition: transform .55s cubic-bezier(.4,0,.2,1);
  z-index: -1;
}
.nud-btn-primary:hover::before { transform: translateX(0); }
.nud-btn-primary:hover { box-shadow: 0 6px 20px -4px rgba(12,26,46,.35); transform: translateY(-1px); }

.nud-secondary-row { display: flex; gap: 6px; }
.nud-btn-ghost {
  flex: 1; padding: 9px 10px;
  border-radius: var(--r-pill, 999px);
  font-size: 12px; font-weight: 600;
  color: var(--muted, rgba(10,10,10,.62));
  background: transparent;
  border: 1.5px solid var(--hair-2, rgba(10,10,10,.16));
  cursor: pointer; font-family: inherit; text-align: center;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.nud-btn-ghost:hover {
  color: var(--ink, #0a0a0a);
  border-color: var(--hair-2, rgba(10,10,10,.16));
  background: var(--card, #e8e7e4);
}
.nud-btn-danger {
  flex: 1; padding: 9px 10px;
  border-radius: var(--r-pill, 999px);
  font-size: 12px; font-weight: 600;
  color: var(--danger, #9a3b3b);
  background: transparent;
  border: 1.5px solid rgba(154,59,59,.18);
  cursor: pointer; font-family: inherit; text-align: center;
  transition: color .15s, border-color .15s, background .15s;
  white-space: nowrap;
}
.nud-btn-danger:hover {
  background: rgba(154,59,59,.06);
  border-color: rgba(154,59,59,.3);
}

/* ─── Header transitions (so it can hide smoothly when drawer opens) ─── */
.md-header {
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease,
              top 0.3s cubic-bezier(.4,0,.2,1), opacity 0.22s ease;
}
/* When the drawer is open, slide the header up out of view via `top`.
   IMPORTANT: we deliberately animate `top` here, NOT `transform`. A
   transformed ancestor becomes the containing block for any `position:
   fixed` descendant — which would break the centred login modal that's
   nested inside the header. Animating `top` keeps the header free of
   transforms so the modal continues to centre against the viewport.
   Mobile-only because the drawer can only open at <=920px anyway. */
@media (max-width: 920px) {
  body.md-drawer-locked .md-header {
    top: -120px;
    opacity: 0;
    pointer-events: none;
  }
}

/* ─── Burger button (mobile-only) ────────────────────────────────── */
.md-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 132px;                /* 3x as long as the previous 44px */
  height: 44px;
  margin-left: auto;           /* push to the far right of header actions */
  border: 1px solid rgba(10,10,10,0.07);
  background: rgba(255,255,255,0.45);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s, border-color .18s;
  -webkit-tap-highlight-color: transparent;
}
.md-burger:hover { background: rgba(255,255,255,0.75); }
.md-burger:active { background: rgba(255,255,255,0.95); }
.md-burger:focus-visible { outline: 2px solid var(--accent, #2a50f3); outline-offset: 2px; }
.md-burger span {
  display: block;
  width: 18px;
  height: 1.75px;
  background: var(--ink, #0a0a0a);
  border-radius: 2px;
  transform-origin: center;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s;
}
.md-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.75px) rotate(45deg); }
.md-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.md-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.75px) rotate(-45deg); }

/* ─── Header behaviour at narrow widths ──────────────────────────── */
/* < 920px: hide centre nav + user button + login link, show burger.
   The CTA pill stays as a quick "Start trial" affordance until 480px,
   below which the burger alone owns the right side.
   The login-dropdown still works on mobile — it re-styles as a bottom
   sheet (see rules above) and is opened from the drawer's "Sign in". */
@media (max-width: 920px) {
  .md-nav-center { display: none; }
  #nav-user-btn { display: none !important; }
  .nav-user-dropdown { display: none !important; }
  .md-header-login { display: none; }
  .md-burger { display: flex; }
  /* Force header-actions into grid col 3 — nav-center is display:none, so by
     default the actions container falls into col 2 (auto), pushing the burger
     into the middle of the header instead of the right edge. */
  .md-header-actions { grid-column: 3; justify-self: end; }
}
@media (max-width: 620px) {
  .md-header { padding: 6px 14px; }
  .md-header-logo img { max-width: 115px; }
  .md-btn { min-width: auto; padding: 0 14px; height: 40px; }
  .md-btn-label { display: none; }
  .md-header-actions { gap: 10px; }
}
@media (max-width: 480px) {
  .md-btn { display: none; } /* burger is enough; CTA also lives in drawer */
  .md-header { padding: 6px 12px; }
  .md-header-logo img { max-width: 108px; }
}

/* ─── Mobile drawer overlay ──────────────────────────────────────── */
.md-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(10,12,16,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.md-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Mobile drawer panel ────────────────────────────────────────── */
.md-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 86vw);
  max-width: 100vw;
  background: linear-gradient(180deg, #fbf7ee 0%, var(--bg, #fbfaf6) 100%);
  border-left: 1px solid var(--hair, rgba(10,10,10,.09));
  box-shadow: -24px 0 60px -20px rgba(10,12,16,.25);
  z-index: 9995;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top, 0)) 22px max(24px, env(safe-area-inset-bottom, 0)) 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
}
.md-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.md-drawer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--hair-2, rgba(10,10,10,.16));
  background: #fff;
  color: var(--ink, #0a0a0a);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-close:hover { background: var(--accent-tint, #e6e9f7); border-color: var(--accent-bd, rgba(42,80,243,.28)); }
.md-drawer-close:active { transform: scale(.95); }
.md-drawer-close:focus-visible { outline: 2px solid var(--accent, #2a50f3); outline-offset: 2px; }

.md-drawer-greeting {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-deep, #1a3fd9);
  padding: 4px 0 14px;
  margin-top: 38px; /* clear close button */
  border-bottom: 1px solid var(--hair, rgba(10,10,10,.09));
  margin-bottom: 14px;
}

.md-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 38px; /* clears close button when no greeting */
}
.md-drawer-greeting:not([hidden]) ~ .md-drawer-nav { margin-top: 0; }

.md-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink, #0a0a0a);
  letter-spacing: -.01em;
  border-radius: 12px;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-link:hover { background: rgba(10,10,10,.04); }
.md-drawer-link:active { background: rgba(10,10,10,.07); }
.md-drawer-link.active {
  background: var(--accent-tint, #e6e9f7);
  border-color: var(--accent-bd, rgba(42,80,243,.28));
  color: var(--accent-deep, #1a3fd9);
  font-weight: 600;
}
.md-drawer-arrow {
  font-size: 16px;
  color: var(--soft, rgba(10,10,10,.42));
  transition: transform .2s, color .2s;
}
.md-drawer-link:hover .md-drawer-arrow { transform: translateX(3px); color: var(--ink, #0a0a0a); }
.md-drawer-link.active .md-drawer-arrow { color: var(--accent, #2a50f3); }

/* Drawer Features subgroup — collapsed by default; the Features
   toggle button expands an inline sublist of anchor links. */
.md-drawer-features {
  display: flex; flex-direction: column;
  gap: 2px;
}
.md-drawer-features-toggle {
  /* Match .md-drawer-link styling so it sits as a peer in the nav */
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  font-size: 17px; font-weight: 500;
  color: var(--ink, #0a0a0a);
  letter-spacing: -.01em;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}
.md-drawer-features-toggle:hover  { background: rgba(10,10,10,.04); }
.md-drawer-features-toggle:active { background: rgba(10,10,10,.07); }
.md-drawer-features-chev {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--soft, rgba(10,10,10,.42));
  transition: transform .25s ease, color .2s;
}
.md-drawer-features.open .md-drawer-features-chev {
  transform: rotate(180deg);
  color: var(--ink, #0a0a0a);
}
/* Sublist is hidden by default (max-height: 0) and animates open
   when the parent .md-drawer-features carries .open. 400px is well
   above the natural height of 5 sublinks (~320px) but tight enough
   that the close transition feels snappy rather than dragging out. */
.md-drawer-features-sublist {
  display: flex; flex-direction: column;
  gap: 2px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-bottom: 0;
  transition: max-height .28s ease, opacity .2s ease, padding-bottom .25s ease;
}
.md-drawer-features.open .md-drawer-features-sublist {
  max-height: 400px;
  opacity: 1;
  padding-bottom: 6px;
}
.md-drawer-sublink {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 12px 24px;
  font-size: 16px; font-weight: 500;
  color: var(--ink, #0a0a0a);
  letter-spacing: -.01em;
  border-radius: 12px;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: background .15s;
  font-family: inherit;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-sublink:hover { background: rgba(10,10,10,.04); }
.md-drawer-sublink:active { background: rgba(10,10,10,.07); }
.md-drawer-subarrow {
  font-size: 15px;
  color: var(--soft, rgba(10,10,10,.42));
  transition: transform .2s, color .2s;
}
.md-drawer-sublink:hover .md-drawer-subarrow { transform: translateX(3px); color: var(--ink, #0a0a0a); }

.md-drawer-divider {
  height: 1px;
  background: var(--hair, rgba(10,10,10,.09));
  margin: 16px 4px;
}

.md-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: auto; /* push foot to bottom */
}

.md-drawer-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #0a0a0a);
  background: #fff;
  border: 1.5px solid var(--hair-2, rgba(10,10,10,.16));
  border-radius: 12px;
  cursor: pointer;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  transition: border-color .18s, background .18s;
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-signin:hover { border-color: var(--ink, #0a0a0a); }
.md-drawer-signin:focus-visible { outline: 2px solid var(--accent, #2a50f3); outline-offset: 2px; }

.md-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #0c1a2e;
  border-radius: 12px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: box-shadow .25s, transform .15s;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #2a50f3;
  transform: translateX(101%);
  transition: transform .55s cubic-bezier(.4,0,.2,1);
  z-index: -1;
}
.md-drawer-cta:hover::before { transform: translateX(0); }
.md-drawer-cta:hover { color: #ffffff; box-shadow: 0 8px 24px -6px rgba(42,80,243,.45); }
.md-drawer-cta:active { transform: translateY(1px); }
.md-drawer-cta svg { width: 16px; height: 16px; flex-shrink: 0; }

.md-drawer-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--hair, rgba(10,10,10,.09));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.md-drawer-foot-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft, rgba(10,10,10,.42));
}
.md-drawer-scale {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10,10,10,.04);
  border: 1px solid var(--hair, rgba(10,10,10,.09));
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
}
.md-drawer-scale-btn,
.md-drawer-scale-reset {
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--ink, #0a0a0a);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-scale-btn { width: 34px; padding: 0; }
.md-drawer-scale-reset { padding: 0 12px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, rgba(10,10,10,.62)); }
.md-drawer-scale-btn:hover,
.md-drawer-scale-reset:hover { background: rgba(10,10,10,.07); color: var(--ink, #0a0a0a); }
.md-drawer-scale-btn:focus-visible,
.md-drawer-scale-reset:focus-visible { outline: 2px solid var(--accent, #2a50f3); outline-offset: 2px; }
.md-drawer-scale-btn:disabled { opacity: .35; cursor: not-allowed; background: transparent; }
.md-drawer-scale-down { font-size: 13px; }
.md-drawer-scale-up { font-size: 17px; }
.md-drawer-foot-link {
  font-size: 13px;
  color: var(--muted, rgba(10,10,10,.62));
  text-decoration: none;
  padding: 6px 0;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.md-drawer-foot-link:hover { color: var(--ink, #0a0a0a); }

/* Body scroll lock when drawer is open */
body.md-drawer-locked {
  overflow: hidden;
  /* Keep the position so we don't jump when restoring */
  position: fixed;
  left: 0; right: 0;
  width: 100%;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .md-drawer { transition: transform .15s ease; }
  .md-drawer-overlay { transition: opacity .15s ease; }
  .md-burger span { transition: none; }
  .md-drawer-cta::before { transition: none; }
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.cap-footer {
  background: var(--ink, #0a0a0a);
  padding: 80px 0 calc(40px + env(safe-area-inset-bottom, 0px));
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
}
.cap-footer .foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 56px;
  margin-bottom: 64px;
}
.cap-footer .foot-brand { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.cap-footer .foot-logo  { display: flex; align-items: center; }
.cap-footer .foot-tagline {
  font-size: 16px; line-height: 1.5;
  color: rgba(255,255,255,.55);
  max-width: 22ch;
  margin: 0;
}
.cap-footer .foot-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2a50f3; color: #ffffff;
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, transform .15s, box-shadow .2s;
  margin-top: 8px;
}
.cap-footer .foot-cta:hover {
  background: #1a3fd9;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(42,80,243,.5);
}
.cap-footer .foot-col { display: flex; flex-direction: column; align-items: flex-start; }
.cap-footer .foot-col-stack { gap: 36px; }
.cap-footer .foot-col-stack > div { display: flex; flex-direction: column; align-items: flex-start; }
.cap-footer .foot-col-label {
  font-size: 19px; font-weight: 700;
  letter-spacing: -.015em;
  color: #ffffff;
  margin-bottom: 18px;
  text-transform: none;
}
.cap-footer .foot-col a {
  display: block;
  font-size: 17px;
  color: rgba(255,255,255,.65);
  padding: 6px 0;
  transition: color .15s;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: -.005em;
  -webkit-tap-highlight-color: transparent;
}
.cap-footer .foot-col a:hover,
.cap-footer .foot-col a:focus-visible { color: #ffffff; }
.cap-footer .foot-col a:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 4px; border-radius: 4px; }
.cap-footer .foot-bottom {
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: rgba(255,255,255,.45);
  flex-wrap: wrap; gap: 12px;
}
@media (max-width: 900px) {
  .cap-footer { padding: 56px 0 calc(32px + env(safe-area-inset-bottom, 0px)); }
  .cap-footer .foot-grid { grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 48px; }
}
@media (max-width: 580px) {
  .cap-footer { padding: 44px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
  .cap-footer .foot-grid { grid-template-columns: 1fr; gap: 32px; margin-bottom: 36px; }
  .cap-footer .foot-bottom { flex-direction: column; text-align: center; }
  .cap-footer .foot-tagline { max-width: 100%; }
  .cap-footer .foot-col a { padding: 10px 0; font-size: 17px; } /* bigger tap targets */
  .cap-footer .foot-col-label { margin-bottom: 14px; font-size: 18px; }
}


/* ════════════════════════════════════════════════════════════════════
   STRATEGY C — Design tokens + user-controllable scale
   Loaded site-wide. Defines the rem-based token system and the
   --scale knob that drives html font-size. Visual scaling activates
   as page styles migrate from raw px to these tokens (see splitting
   handover doc for migration plan).
   ════════════════════════════════════════════════════════════════════ */
:root {
  /* The scale knob — controlled by JS / A·A buttons, persisted in
     localStorage. Default: 0.9 (90% of baseline). Range: 0.6–1.4. */
  --scale: 0.9;

  /* Typography scale — rem-based, scales with --scale */
  --text-xs:    0.6875rem;   /* 11px @ scale 1 */
  --text-sm:    0.8125rem;   /* 13px */
  --text-base:  1rem;        /* 16px */
  --text-md:    1.125rem;    /* 18px */
  --text-lg:    1.375rem;    /* 22px */
  --text-xl:    1.625rem;    /* 26px */
  --text-2xl:   2rem;        /* 32px */
  --text-3xl:   2.75rem;     /* 44px */
  --text-4xl:   3.5rem;      /* 56px */

  /* Spacing scale — rem-based, scales with --scale */
  --space-xs:   0.25rem;     /* 4px @ scale 1 */
  --space-sm:   0.5rem;      /* 8px */
  --space-md:   1rem;        /* 16px */
  --space-lg:   1.5rem;      /* 24px */
  --space-xl:   2rem;        /* 32px */
  --space-2xl:  3rem;        /* 48px */
  --space-3xl:  5rem;        /* 80px */
  --space-4xl:  7.5rem;      /* 120px */
}

/* The scaling mechanism. One line; everything in rem responds to --scale.
   Existing px-based CSS won't scale until migrated — see handover doc. */
/* html font-size handled by zoom in site.css */

/* ── Scale controls — A·A buttons next to the logo ────────────── */
.md-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
}
.cap-scale-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: rgba(10,10,10,0.04);
  border: 1px solid rgba(10,10,10,0.07);
  border-radius: 999px;
}
.cap-scale-btn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: rgba(10,10,10,0.62);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI Variable Display","Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol";
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.cap-scale-btn:hover {
  background: rgba(10,10,10,0.07);
  color: #0a0a0a;
}
.cap-scale-btn:focus-visible {
  outline: 2px solid #2a50f3;
  outline-offset: 2px;
}
.cap-scale-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cap-scale-btn:disabled:hover {
  background: transparent;
  color: rgba(10,10,10,0.62);
}
.cap-scale-down { font-size: 11px; }
.cap-scale-up   { font-size: 16px; }

/* On narrow viewports, hide the scale controls — header is too crowded */
@media (max-width: 720px) {
  .cap-scale-controls { display: none; }
}
