/* site-mobile.css - the page header at EVERY width, plus the phone page guards. ONE file linked from every page.

   Linked by apply_mobile_nav.py (run it with --check; it exits 1 when a page lacks the link or carries
   it twice). Behavior lives in site-mobile.js. The header MARKUP is generated by pipelines/site_chrome.py;
   this file only decides how that one markup is laid out at each width.

   WHY THIS EXISTS (Chris, 2026-10-25, with a screenshot of /help/ on an iPhone): "the mobile site is
   really bad I can't see the menu at all and the buttons look like shit". Round 1 fixed the phone. Round 2
   (the same day) found the same fault on a LAPTOP: the full bar needs about 1465px of room and the page
   column only gives it 1192px at 1366 wide, so "Sign in" wrapped to two lines and "Book a call" ended at
   x=1490 on a 1366px screen, off the edge. Measured with hh.mjs over 13 widths from 320 to 2560.

   THE FOUR LAYOUTS (one rule each, the numbers are the measured ones):
       1840px and up   the full bar, exactly as it always was (needs 1465px of room; the column gives 1497 at 1840)
       1280 to 1839    the SAME bar made smaller: 15px text, tighter pills, tighter gaps (measured: about 1130px; the column gives 1192 at 1280)
       1279 and down   the menu: wordmark, theme switch, a 44px menu button, and the sheet that opens under it.
                       From 700px up the sheet is a panel on the right and "Book a call" stays in the bar.
       899 and down    the "Still in development" strip shrinks to one short line (the long label needs 745px)
       768 and down    the phone page guards (buttons that never wrap, the chat button, topic rows)
   The same numbers are in site-mobile.js (MENU) and in the audit harness; change them together.

   Colors, radii and fonts all come from tokens.css, so light and dark both follow the theme. */

/* ---- things the menu layout adds; invisible on a wide screen -------------------------------- */
.vn-bigbtn__short { display: none; }
.vn-sheet__foot { display: none; }

/* ---- never squeezed, at any width: the bar is laid out to FIT, so a button that shrinks is a bug ---- */
.nav .nav__logo, .nav .nav__act > * { flex: 0 0 auto; }
.nav .nav__act .btn { white-space: nowrap; }
.nav .nav__links { flex-wrap: nowrap; }

/* The pages with a "On this page" side list (privacy, terms, accessibility, FAQ and the guides) narrow EVERY .shell on
   the page to the room beside the list, header included: at 1366 the bar's box was 1096px wide instead of 1240 and the
   bar spilled out of it (5 pages, found by the slack check in the width sweep). The header spans the whole screen, the
   list sits under it, so the header's own box keeps the normal width. At 1840 and up the two widths are equal. */
@media (max-width: 1839px) {
  html.has-side .nav .nav__in { max-width: var(--shell); }
}

/* ================================================================================================
   LAPTOP: 1280 to 1839. The same bar, one size down so all of it fits inside the page column.
   ================================================================================================ */
@media (min-width: 1280px) and (max-width: 1839px) {
  /* MEASURED with real Inter at 1280 (the narrowest width that shows the bar): these numbers leave about 60px
     of slack inside the 1192px column; the first attempt (12px pills, 16px gaps) left 2px and was thrown out. */
  .nav .nav__in { gap: 14px; }
  .nav .nav__logo { font-size: 1.15rem; }
  .nav .nav__links { gap: 4px; }
  .nav .nav__links > a:not(.nav__links-cta), .nav .nav__links .vn-menu > summary {
    font-size: .9375rem; padding: 8px 10px;
  }
  .nav .nav__act { margin-left: 12px; gap: 8px; }
  .nav .nav__act .btn { font-size: .9375rem; padding: 11px 16px; }
}

/* ================================================================================================
   TABLET AND PHONE: 1279 and down. The bar holds the wordmark, the theme switch and the menu button.
   ================================================================================================ */
@media (max-width: 1279px) {

  :root { --vn-strip: 62px; --vn-bar: 56px; }

  /* The page sits below the pinned header. LAYOUT_JS re-measures this on load and resize; this value
     is only what shows for the first frame, so it matches the measured result. */
  body { padding-top: calc(var(--vn-strip) + var(--vn-bar) + 1px); }
  html.vn-menu-open { overflow: hidden; }

  /* ---- the bar: wordmark left; theme switch and menu button right ------------------------------ */
  .nav .nav__in { height: var(--vn-bar); gap: 10px; }
  .nav .nav__logo { font-size: 1.15rem; letter-spacing: .05em; }
  .nav .nav__act { margin-left: auto; gap: 10px; }
  /* Sign in and Book a call MOVE INTO THE MENU; they are not in the bar on a phone. */
  .nav .nav__act > a { display: none; }

  .nav .nav__burger {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    flex: 0 0 auto; width: 44px; height: 44px; margin: 0; padding: 0;
    border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow-s);
    color: var(--ink); cursor: pointer;
  }
  .nav .nav__burger:hover { border-color: var(--accent); }
  .nav .nav__burger:focus-visible, .nav .nav__links a:focus-visible, .nav .nav__links summary:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
  }
  .nav .nav__burger span { display: block; width: 20px; height: 2px; margin: 0; border-radius: 2px; background: var(--ink);
    transition: transform .2s ease, opacity .15s ease; }
  .nav .nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav .nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav .nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---- the menu: a full-width sheet under the bar ---------------------------------------------- */
  .nav .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; width: auto; max-width: none; height: auto;
    max-height: calc(100vh - var(--vn-head, 98px)); max-height: calc(100dvh - var(--vn-head, 98px));
    box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 6px 16px calc(24px + env(safe-area-inset-bottom, 0px));
    background: var(--bg); border-top: 1px solid var(--line); box-shadow: var(--shadow-m);
    transform: none; opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, visibility 0s linear .18s; z-index: 100;
  }
  .nav .nav__links.nav__links--open {
    transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    transition: opacity .18s ease, visibility 0s;
  }
  .nav .nav__close { display: none; }

  /* Rows: 48px, one per group, a chevron on the right for the groups that open. */
  .nav .nav__links > a:not(.nav__links-cta):not(.nav__links-signin),
  .nav .nav__links .vn-menu > summary {
    display: flex; align-items: center; justify-content: space-between; box-sizing: border-box;
    width: 100%; min-height: 48px; margin: 0; padding: 0 4px;
    border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0;
    background: none; box-shadow: none; font-size: 1.0625rem; font-weight: var(--w-medium);
    color: var(--ink); line-height: 1.25; white-space: normal;
  }
  .nav .nav__links .vn-menu { display: block; width: 100%; }
  .nav .nav__links .vn-menu > summary::after { width: 8px; height: 8px; margin-right: 4px; opacity: .7; transition: transform .2s ease; }
  .nav .nav__links .vn-menu[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .nav .nav__links .vn-menu[open] > summary { border-bottom-color: transparent; }

  /* What a group holds: the same links the desktop menu offers, stacked. */
  .nav .nav__links .vn-pop {
    position: static; min-width: 0; margin: 0 0 8px; padding: 0 0 6px 10px; border: 0; border-radius: 0;
    background: none; box-shadow: none; display: grid; gap: 4px;
    border-left: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); margin-left: 4px;
  }
  .nav .nav__links .vn-pop--co a {
    display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 12px;
    font-size: 1rem; line-height: 1.25;
  }
  .nav .nav__links .vn-pop--co a b { font-weight: var(--w-regular, 400); font-size: 1rem; }
  .nav .nav__links .vn-pop .vn-prod { width: 100%; box-sizing: border-box; }
  .nav .nav__links .vn-pop .vn-prod a.vn-prod__link { min-height: 0; padding: 2px 0; }
  .nav .nav__links .vn-pop .vn-prod a.nav-demo { min-height: 36px; padding: 0 16px; white-space: nowrap; }

  /* The bottom of the sheet: the demos button, then Sign in and Book a call as two clear buttons. */
  .nav .vn-sheet__foot {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-top: 20px; padding: 0;
  }
  .nav .vn-sheet__foot a {
    display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-height: 48px; margin: 0; padding: 0 12px; width: 100%;
    border: 1px solid var(--line); border-radius: var(--radius-pill); box-shadow: none;
    font-size: 1rem; font-weight: var(--w-medium); line-height: 1.2; white-space: nowrap; text-decoration: none;
  }
  .nav .vn-sheet__foot .vn-sheet__demo {
    display: flex; grid-column: 1 / -1; background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  }
  .nav .vn-sheet__foot .vn-sheet__signin { background: var(--bg); color: var(--ink); }
  .nav .vn-sheet__foot .vn-sheet__book { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  /* the header's own copies of these two stay in the markup for a wide screen; in the menu layout the sheet's copies are the ones shown */
  .nav .nav__links > .nav__links-signin, .nav .nav__links > .nav__links-cta { display: none; }

  /* The dimmed page behind the sheet; a tap on it closes the menu. Starts under the bar. */
  .nav .nav__overlay { top: var(--vn-head, 98px); z-index: 90; }

  @media (prefers-reduced-motion: reduce) {
    .nav .nav__burger span, .nav .nav__links, .nav .nav__links .vn-menu > summary::after { transition: none; }
  }

  /* The chat button steps aside while the menu is open (the sheet is the job) and while a form field
     has focus (it sat on top of the field and the keyboard). */
  html.vn-menu-open .vd-ask, html.vn-menu-open .vd-panel, html.vn-typing .vd-ask { display: none; }
}

/* ================================================================================================
   TABLET: 700 to 1279. The sheet is a panel on the right, the bar keeps "Book a call", the bar is taller.
   ================================================================================================ */
@media (min-width: 700px) and (max-width: 1279px) {
  :root { --vn-bar: 64px; }
  .nav .nav__logo { font-size: 1.25rem; }
  .nav .nav__links {
    left: auto; right: 0; width: min(460px, 100%);
    border-left: 1px solid var(--line); border-radius: 0 0 0 20px;
  }
  .nav .nav__act { gap: 12px; }
  .nav .nav__act > a.btn--primary {
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-height: 44px; padding: 0 22px; font-size: .9375rem; line-height: 1.2;
  }
  /* "Book a call" is in the bar here, so the sheet does not repeat it: Sign in takes the row. */
  .nav .vn-sheet__foot .vn-sheet__book { display: none; }
  .nav .vn-sheet__foot .vn-sheet__signin { grid-column: 1 / -1; }
}

/* ================================================================================================
   899 and down: the "Still in development" strip is ONE short line, never a slab.
   ================================================================================================ */
@media (max-width: 899px) {
  :root { --vn-strip: 41px; }
  .nav .vn-dev {
    flex-wrap: nowrap; justify-content: space-between; align-items: center;
    gap: 10px; padding: 5px 12px; min-height: var(--vn-strip); box-sizing: border-box; overflow: hidden;
  }
  .nav .vn-dev__tag { font-size: .6875rem; letter-spacing: .05em; line-height: 1.2; white-space: nowrap; }
  .nav .vn-bigbtn {
    flex: 0 0 auto; white-space: nowrap; padding: 6px 14px; font-size: .8125rem; line-height: 1.2;
    box-shadow: none; max-width: 100%;
  }
  .nav .vn-bigbtn__long { display: none; }
  .nav .vn-bigbtn__short { display: inline; }
}
/* On a wide strip the long label sits on one line: it never wraps, whatever the width. */
.nav .vn-bigbtn { white-space: nowrap; }
.nav .vn-dev__tag { white-space: nowrap; }

/* ================================================================================================
   768 and down: the phone page guards (not the header).
   ================================================================================================ */
@media (max-width: 768px) {

  /* ---- the chat button: smaller, in the corner, and out of the way ------------------------------ */
  html .vd-ask {
    right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; font-size: 9px; gap: 1px;
  }
  html .vd-ask svg { width: 20px; height: 20px; }
  /* So the last line of the footer is never under the button. */
  .vn-foot { padding-bottom: 88px; }

  /* ---- page guards found by running every page at 360px ---------------------------------------- */
  img, video, svg, iframe { max-width: 100%; }
  /* A button is one line. It keeps its size and the row around it wraps instead of squeezing it. */
  .btn { white-space: nowrap; flex-shrink: 0; padding-inline: 22px; }
  .hero__band .hero__cta .btn { font-size: 1rem; padding: 14px 20px; }
  .head { flex-wrap: wrap; align-items: flex-start; }
  /* The contact panel's grid track was "1fr", which is minmax(auto, 1fr): the two fields inside could not shrink
     below their default width, so at 320 the track grew to 294px inside a 266px box and the whole page scrolled
     sideways (body scroll width 337, found by the width sweep 2026-10-25). minmax(0, 1fr) lets the track shrink and
     the fields shrink with it. */
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail__form input { min-width: 0; }
  /* The row of topic buttons under a page title (built by the page script): the buttons WRAP onto more rows and each
     keeps its label on one line, so nothing is hidden off the side and no word sits against the box border. It was a
     row that scrolled sideways inside itself, and the standing hugging-box rule refused the 2026-10-25 deploy on four
     solution pages at 390 px because a tab cut off by the scroll edge read as a word touching the border. */
  .vn-tabs { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding: 2px 0 8px; }
  .vn-tab { flex: 0 1 auto; white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: center; }
}

/* Very narrow phones (320 and 340): the strip label and the buttons shrink a step instead of clipping. */
@media (max-width: 345px) {
  .btn, .hero__band .hero__cta .btn { font-size: .875rem; padding-inline: 14px; }
  .nav .vn-dev { gap: 6px; padding-inline: 8px; }
  .nav .vn-dev__tag { font-size: .625rem; letter-spacing: .03em; }
  .nav .vn-bigbtn { padding-inline: 10px; font-size: .75rem; }
}
