/* v7 chrome: the nav bar, its menus, the mobile menu and the footer. The markup is written into every
   page by tools/sync-chrome.py; the behaviour is js/v7/nav.js.

   SELF-CONTAINED ON PURPOSE. Until a page is ported it still runs on css/v4, which is dark and shares
   token names with v7, so this sheet binds only to --lt-* tokens, carries its own wrap and button
   classes, and never relies on css/v7/site.css. On those pages the chrome carries data-tone="dark",
   which restates every token on the chrome's own elements; on ported pages it inherits the light root.

   The lockup's cursor blinks, as it did on the v4 site: the owner's call, over brand.md's static row for
   nav and chrome. It is still the brand's blink (a hard cut, 600ms on and 600ms off, nothing eases) and it
   holds still for a reader who asks for reduced motion, which brand.md allows no exception to. */

/* The gutter is site.css's, so the chrome lines up with the page; a page still on css/v4 has no
   --gutter, so the chrome carries the same value itself rather than falling to no gutter at all */
.nav, .mnav, .footer {
  --ch-gutter: var(--gutter, max(20px, env(safe-area-inset-left, 0px), min(40px, 4vw)));
  --ch-gutter-r: var(--gutter-r, max(20px, env(safe-area-inset-right, 0px), min(40px, 4vw)));
  font-family: var(--lt-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* The resets carry no weight (:where), so every class below wins over them */
:where(.nav, .mnav, .footer) * { box-sizing: border-box; }
:where(.nav, .mnav, .footer) a { color: inherit; text-decoration: none; }
:where(.nav, .mnav, .footer) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.nav, .mnav, .footer) :focus-visible { outline: 2px solid var(--lt-outline-focus); outline-offset: 2px; border-radius: 6px; }
:where(.nav, .mnav, .footer) .ico { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.nav__wrap, .footer__wrap {
  position: relative;
  width: 100%;
  max-width: calc(1200px + 2 * 40px);
  margin-inline: auto;
  padding-left: var(--ch-gutter);
  padding-right: var(--ch-gutter-r);
}

.lockup { display: block; height: 15px; width: auto; color: var(--lt-foreground-primary-strong); }
.lockup__cursor { fill: var(--lt-foreground-quaternary); animation: lt-caret 1.2s step-end infinite; }
@keyframes lt-caret { 0% { opacity: 1; } 50% { opacity: 0; } }
/* ── Buttons: the design system's Medium primary and tertiary ─────────────── */

.nav__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding-inline: var(--lt-space-5);
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.nav__btn::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; transition: background-color 120ms ease; }
.nav__btn--primary { background: var(--lt-foreground-secondary); color: var(--lt-container-base); }
.nav__btn--primary:hover { background: var(--lt-foreground-secondary-strong); }
.nav__btn--primary:active { background: var(--lt-foreground-primary); }
.nav__btn--tertiary { border-color: var(--lt-outline-default); color: var(--lt-foreground-secondary); }
.nav__btn--tertiary:hover { border-color: var(--lt-outline-interactive); color: var(--lt-foreground-primary); }
.nav__btn--tertiary:hover::after { background: var(--lt-container-hover); }
.nav__btn--tertiary:active::after { background: var(--lt-container-selected); }

/* ── The bar ──────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  color: var(--lt-foreground-primary);
  background: color-mix(in srgb, var(--lt-background-canvas) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.nav.is-scrolled, .nav.is-open { border-bottom-color: var(--lt-outline-subtle); }

/* Logo left, pages centred on the bar, actions right */
.nav__bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; height: 56px; gap: 16px; }
.nav__logo { display: inline-flex; align-items: center; height: 32px; justify-self: start; }
.nav__links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding-inline: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--lt-foreground-secondary);
  transition: color 120ms ease, background-color 120ms ease;
}
.nav__link:hover, .nav__link[aria-expanded='true'] { color: var(--lt-foreground-primary); background: var(--lt-container-hover); }
.nav__link[aria-current] { color: var(--lt-foreground-primary); }
.nav__link .ico { width: 14px; height: 14px; color: var(--lt-foreground-quaternary); transition: transform 150ms ease; }
.nav__link[aria-expanded='true'] .ico { transform: rotate(180deg); }
/* On a menu that is also a page, the chevron is its own target */
.nav__chev { display: inline-flex; align-items: center; margin: -6px -6px -6px -2px; padding: 6px; border-radius: 6px; }
.nav__chev:hover { background: var(--lt-container-hover); }
.nav__actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
/* A 44px target with the glyph's right edge on the gutter */
.nav__burger { display: none; width: 44px; height: 44px; margin-right: -11px; border-radius: 8px; align-items: center; justify-content: center; color: var(--lt-foreground-primary); }
.nav__burger:hover { background: var(--lt-container-hover); }
.nav__burger .ico { width: 22px; height: 22px; }
.nav__burger .ico--close { display: none; }
.nav.is-mobile-open .nav__burger .ico--menu { display: none; }
.nav.is-mobile-open .nav__burger .ico--close { display: block; }

/* ── Desktop menus ────────────────────────────────────────────────────────────
   A window inside a window: the shell is one step down (Background/Sunken) and holds the raised
   panel 6px in, 16 outside and 10 inside, so the corners nest. Only the outermost layer carries the
   overlay shadow. */

.menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: none;
  padding: 6px;
  border: 1px solid var(--lt-outline-default);
  border-radius: 16px;
  background: var(--lt-background-sunken);
  box-shadow: var(--lt-shadow-overlay);
  transform-origin: top left;
}
.menu__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px 248px;
  padding: 8px;
  border: 1px solid var(--lt-outline-subtle);
  border-radius: 10px;
  background: var(--lt-container-raised);
}
.menu.is-open { display: block; animation: menu-in 150ms ease both; }
.menu.is-swap { animation: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu__items { display: grid; grid-template-columns: repeat(2, 272px); align-content: start; gap: 4px 8px; padding: 6px; }
.menu__item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; border-radius: 10px; transition: background-color 120ms ease; }
.menu__item:hover, .menu__item:focus-visible { background: var(--lt-container-hover); }
.menu__icon { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--lt-outline-subtle); background: var(--lt-background-sidebar); display: flex; align-items: center; justify-content: center; color: var(--lt-foreground-tertiary); transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease; }
.menu__item:hover .menu__icon { color: var(--lt-foreground-primary); border-color: var(--lt-outline-default); background: var(--lt-container-raised); }
.menu__icon .ico { width: 18px; height: 18px; }
.menu__title { display: block; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--lt-foreground-primary); }
.menu__desc { display: block; margin-top: 1px; font-size: 13px; line-height: 18px; color: var(--lt-foreground-tertiary); }
.menu__rule { background: var(--lt-outline-subtle); margin-block: 10px; }
.menu__side { display: flex; flex-direction: column; padding: 14px 8px 6px 20px; }
.menu__eyebrow { display: block; margin-bottom: 8px; font-family: var(--lt-font-mono); font-size: 12px; line-height: 16px; color: var(--lt-foreground-quaternary); }
.menu__more { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 2px; }
.menu__more a { display: inline-flex; align-items: center; gap: 4px; height: 26px; font-size: 14px; color: var(--lt-foreground-secondary); transition: color 120ms ease; }
.menu__more a:hover { color: var(--lt-foreground-primary); }
/* An external link in a More list (Status) opens in a new tab and carries the footer's small external mark */
:is(.menu__more, .mnav__more) a .ico { width: 14px; height: 14px; }

/* Feature card: a thumbnail of the thing it points at, then the line and the link */
.menu__card { margin-top: auto; display: grid; gap: 12px; padding: 8px 8px 12px; border-radius: 12px; background: var(--lt-background-sidebar); border: 1px solid var(--lt-outline-subtle); transition: border-color 120ms ease, background-color 120ms ease; }
.menu__card:hover { border-color: var(--lt-outline-default); background: var(--lt-container-raised); }
.menu__thumb { position: relative; height: 96px; border-radius: 8px; border: 1px solid var(--lt-outline-subtle); background: var(--lt-container-raised); overflow: hidden; display: grid; place-items: center; color: var(--lt-foreground-primary); }
.menu__thumb-chrome { position: absolute; top: 0; left: 0; right: 0; height: 16px; border-bottom: 1px solid var(--lt-outline-subtle); display: flex; gap: 3px; align-items: center; padding-left: 6px; }
.menu__thumb-chrome i { width: 4px; height: 4px; border-radius: 50%; background: var(--lt-container-chip); }
.menu__thumb-play { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--lt-container-raised); border: 1px solid var(--lt-outline-default); display: grid; place-items: center; box-shadow: var(--lt-shadow-raised); }
.menu__thumb-play::before { content: ''; margin-left: 2px; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--lt-foreground-primary); }
.menu__thumb-seal { width: 40px; height: 40px; border-radius: 10px; background: var(--lt-background-sunken); display: grid; place-items: center; color: var(--lt-foreground-secondary); }
.menu__thumb-seal .ico { width: 22px; height: 22px; }
/* The Leo matrix, still: square marks on an even pitch in the quietest foreground, fading out to the
   right. Squares, never circles. The conic gradient paints one 3px square in each 12px cell. */
.menu__thumb-matrix {
  position: absolute;
  inset: 0;
  background: conic-gradient(at 3px 3px, transparent 75%, var(--lt-foreground-quaternary) 0) 6px 6px / 12px 12px;
  -webkit-mask-image: linear-gradient(90deg, black 20%, transparent 95%);
  mask-image: linear-gradient(90deg, black 20%, transparent 95%);
}
.menu__card-text { padding-inline: 6px; }
.menu__card-title { display: block; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--lt-foreground-primary); margin-bottom: 8px; }
.menu__card-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--lt-foreground-secondary); }
.menu__card-cta .ico { width: 16px; height: 16px; transition: transform 150ms ease; }
.menu__card:hover .menu__card-cta { color: var(--lt-foreground-primary); }
.menu__card:hover .menu__card-cta .ico { transform: translateX(2px); }

/* ── Mobile menu: full screen under the bar, sections expand in place, actions pinned ── */

.mnav {
  position: fixed;
  inset: calc(56px + env(safe-area-inset-top, 0px)) 0 0;
  z-index: 49;
  display: none;
  flex-direction: column;
  color: var(--lt-foreground-primary);
  background: var(--lt-background-canvas);
}
.mnav.is-open { display: flex; animation: mnav-in 150ms ease both; }
@keyframes mnav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.mnav__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-left: var(--ch-gutter); padding-right: var(--ch-gutter-r); }
.mnav__row { border-bottom: 1px solid var(--lt-outline-subtle); }
.mnav__head { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 56px; font-size: 17px; font-weight: 500; color: var(--lt-foreground-primary); text-align: left; }
.mnav__head .ico { width: 16px; height: 16px; color: var(--lt-foreground-quaternary); transition: transform 150ms ease; }
.mnav__head[aria-expanded='true'] .ico { transform: rotate(180deg); }
.mnav__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 150ms ease; }
.mnav__panel.is-open { grid-template-rows: 1fr; }
.mnav__panel > div { overflow: hidden; }
.mnav__list { list-style: none; margin: 0; padding: 0 0 8px 16px; display: grid; gap: 4px; }
.mnav__list a { display: block; padding: 8px 0; }
.mnav__list .menu__title { font-size: 15px; }
/* The quieter links wrap as a row of 40px targets, so none is ever cut at the edge */
.mnav__more { display: flex; flex-wrap: wrap; column-gap: 20px; margin: 0; padding: 0 0 12px 16px; font-size: 14px; line-height: 22px; color: var(--lt-foreground-tertiary); }
.mnav__more a { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--lt-foreground-secondary); white-space: nowrap; }
.mnav__more a:hover { color: var(--lt-foreground-primary); }
.mnav__more > span { display: none; }
.mnav__actions {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: var(--ch-gutter);
  padding-right: var(--ch-gutter-r);
  border-top: 1px solid var(--lt-outline-subtle);
  background: var(--lt-background-canvas);
}
.mnav__actions .nav__btn { height: 48px; border-radius: 10px; font-size: 15px; }
@media (min-width: 561px) { .mnav__actions { grid-template-columns: 1fr 1fr; } }
/* While the menu is open its own pinned actions carry the trial, so the bar does not repeat it */
.nav.is-mobile-open .nav__actions .nav__btn--primary { visibility: hidden; }

/* The root alone: a locked body would become the scroller and carry the sticky bar off screen */
html.is-locked { overflow: hidden; }

@media (max-width: 1080px) {
  .nav__actions .nav__btn--tertiary { display: none; }
  .nav__burger { display: inline-flex; }
  .nav__bar { grid-template-columns: auto minmax(0, 1fr); }
  .nav__bar > nav { display: none; }
  .menu { display: none !important; }
}
@media (min-width: 1081px) { .mnav { display: none !important; } }
/* A phone's bar carries the logo and the menu alone; the trial waits in the menu's pinned actions */
@media (max-width: 760px) {
  .nav__actions .nav__btn--primary { display: none; }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.footer { margin-top: auto; color: var(--lt-foreground-primary); background: var(--lt-background-sidebar); border-top: 1px solid var(--lt-outline-subtle); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 32px; padding-block: 64px 48px; }
.footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.footer__brand p { margin: 0; font-size: 14px; line-height: 20px; color: var(--lt-foreground-tertiary); max-width: 260px; }
/* The ISO 27001 badge is Tempo's own artwork, shown as supplied and linked to the certificate Tempo hosts */
.badge-iso { display: inline-block; line-height: 0; border-radius: 4px; transition: opacity 140ms ease; }
.badge-iso:hover { opacity: 0.85; }
.badge-iso img { display: block; width: 132px; height: auto; }
/* A column is a <details> written open, so with no script it is a heading over its links. Above a phone
   its summary is a plain heading: no marker, no pointer, and js/v7/nav.js keeps it open. */
.footer__col > summary { display: block; list-style: none; cursor: default; }
.footer__col > summary::-webkit-details-marker { display: none; }
.footer__col h2 { margin: 0 0 12px; font-size: 13px; line-height: 20px; font-weight: 600; color: var(--lt-foreground-primary); }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer__col a, .footer__linkbtn { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 20px; color: var(--lt-foreground-tertiary); text-align: left; transition: color 120ms ease; }
.footer__col a:hover, .footer__linkbtn:hover { color: var(--lt-foreground-primary); }
.footer__col a .ico { width: 14px; height: 14px; }
.footer__legal { margin: 0; border-top: 1px solid var(--lt-outline-subtle); padding-block: 20px 28px; font-size: 12px; line-height: 18px; color: var(--lt-foreground-quaternary); }
:is(.nav, .mnav, .footer) .vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; padding-block: 48px 32px; }
}
/* Touch: every footer link is a 40px row on a 44px pitch */
@media (max-width: 960px) {
  .footer__col ul { gap: 4px; }
  .footer__col a, .footer__linkbtn { min-height: 40px; }
  .footer__brand > a:first-child { display: inline-flex; align-items: center; min-height: 44px; }
}

/* No transition while the bar takes its first tone, so a dark page never flashes a light bar */
.nav.is-instant { transition: none; }
/* A closed section's links stay out of the tab order */
.mnav__panel > div { visibility: hidden; transition: visibility 0s 150ms; }
.mnav__panel.is-open > div { visibility: visible; transition: none; }

/* ── Mobile menu between a phone and the desktop bar (761 to 1080) ────────────
   The rows keep the gutter but stop at a reading width, aligned left under the logo, and the two
   actions stop with them. */
@media (min-width: 761px) and (max-width: 1080px) {
  .mnav__row { max-width: 600px; }
  .mnav__actions { grid-template-columns: repeat(2, minmax(0, 295px)); }
}
/* The actions follow the list rather than pinning to the foot of a tall screen with the groups closed;
   once open groups outgrow the screen, the list scrolls and the actions stay in view under it */
@media (max-width: 1080px) {
  .mnav__scroll { flex: 0 1 auto; min-height: 0; }
  .mnav__row:last-child { border-bottom: 0; }
}

/* ── Footer on a phone: each column folds into a 44px row, closed until tapped ── */
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .footer__brand { margin-bottom: 32px; }
  .footer__col { border-top: 1px solid var(--lt-outline-subtle); }
  .footer__col > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; cursor: pointer; }
  .footer__col > summary::after { content: ''; width: 7px; height: 7px; margin: -4px 4px 0 0; border-right: 1.5px solid var(--lt-foreground-quaternary); border-bottom: 1.5px solid var(--lt-foreground-quaternary); transform: rotate(45deg); transition: transform 150ms ease; }
  .footer__col[open] > summary::after { margin-top: 4px; transform: rotate(225deg); }
  .footer__col h2 { margin: 0; font-size: 14px; }
  .footer__col ul { padding-bottom: 12px; }
}
