/*
 * The access page hero (SPEC.md 6, issue 351): the live shiftmed.com homepage hero, with the work
 * email form in place of its two buttons. Only the access page and a link's email step load this
 * file (renderAccessPage), never a microsite, so its keyframes can't meet an upload's. Keyframe
 * names still carry the smx- prefix. Sizes, positions and timings are the live hero's.
 *
 * Text pairs: Charcoal and Purple on the White to Gray Warm to Lavender Wash fade, Charcoal and
 * Purple on the White cards, and White on the Purple Bright to Purple to Purple Dark pill, all in
 * tests/unit/text-color-pairs.ts. Purple Bright, Lavender Mist and the Lilac glow are never text.
 */

.smx-home-hero {
  position: relative;
  overflow: hidden;
  padding-bottom: var(--sm-space-24);
  background: linear-gradient(
    180deg,
    var(--sm-white),
    var(--sm-gray-warm) 55%,
    var(--sm-lavender-wash)
  );
  color: var(--sm-charcoal);
}

/* The soft glow at the top right, as live. */
.smx-home-hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 56%;
  height: 150%;
  background: radial-gradient(closest-side, var(--sm-lilac-glow), transparent);
  pointer-events: none;
}

/*
 * The live container (Bootstrap's, as on shiftmed.com), the one definition for the hero, the
 * access header's row (issue 354) and the access footer's rows (issue 364), so the logos and the
 * footer's first column start where the hero text starts and the pill and the footer's content
 * end where it ends: full width with 16px gutters, then 540, 720, 960, 1140 and 1320px wide from
 * 576, 768, 992, 1200 and 1400px, with 12px gutters.
 */
.smx-home-hero-inner,
.smx-header-access .smx-mainnav,
.smx-footer-access .smx-footer-inner {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 576px) {
  .smx-home-hero-inner,
  .smx-header-access .smx-mainnav,
  .smx-footer-access .smx-footer-inner {
    max-width: 540px;
    padding-inline: 0.75rem;
  }
}

@media (min-width: 768px) {
  .smx-home-hero-inner,
  .smx-header-access .smx-mainnav,
  .smx-footer-access .smx-footer-inner {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .smx-home-hero-inner,
  .smx-header-access .smx-mainnav,
  .smx-footer-access .smx-footer-inner {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .smx-home-hero-inner,
  .smx-header-access .smx-mainnav,
  .smx-footer-access .smx-footer-inner {
    max-width: 1140px;
  }
}

@media (min-width: 1400px) {
  .smx-home-hero-inner,
  .smx-header-access .smx-mainnav,
  .smx-footer-access .smx-footer-inner {
    max-width: 1320px;
  }
}

/*
 * The access footer's logo on phones (issue 364). Below 576px the 16px gutter would leave the
 * footer logo's clear space (the "M" height, 37.14 of the file's 95.64 units, so 20.7px at the
 * logo's 167px width, `--sm-logo-footer-width`) about 1.2px past the band's left edge, since the
 * artwork starts 6.32 of the file's 300 units in. The logo moves in by that shortfall, rounded up
 * to whole pixels (2px), so the brand rule holds while the link columns stay on the hero's edge.
 * Browsers without round() keep the first declaration, the same 2px in rem.
 */
@media (max-width: 575.98px) {
  .smx-footer-access .smx-footer-brand {
    padding-left: 0.125rem;
    padding-left: round(up, calc(var(--sm-logo-footer-width) * (37.14 - 6.32) / 300 - 1rem), 1px);
  }
}

/* The live grid: copy on the left, the map on the right. */
.smx-home-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(640px, 46vw));
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  min-height: 520px;
  padding-top: 2.625rem;
  padding-bottom: 0.75rem;
}

.smx-home-hero-title {
  max-width: 620px;
  margin: 0;
  color: var(--sm-charcoal);
  font-family: var(--sm-font-head);
  font-size: clamp(1.8125rem, 3.2vw, 3.125rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  /* A link's email step shows the site title here, so long unbroken words must wrap. */
  overflow-wrap: anywhere;
}

.smx-home-hero-title strong,
.smx-home-hero-savings strong {
  color: var(--sm-purple);
  font-weight: inherit;
}

.smx-home-hero-rotator-lead {
  max-width: 35rem;
  margin: 1.625rem 0 0;
  font-family: var(--sm-font-body);
  font-size: clamp(0.9375rem, 1.3vw, 1.1875rem);
  font-weight: 400;
  line-height: 1.5;
}

/* The phrases slide up one at a time inside a one-line window. */
.smx-home-hero-rotator-window {
  height: 1.35em;
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: clamp(1.4375rem, 2.1vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.005em;
}

.smx-home-hero-rotator-list {
  display: flex;
  flex-direction: column;
  animation: smx-home-hero-rotate 11s cubic-bezier(0.7, 0, 0.2, 1) infinite;
}

.smx-home-hero-rotator-list span {
  display: block;
  height: 1.35em;
  line-height: 1.35em;
  white-space: nowrap;
}

.smx-home-hero-savings {
  margin: 1.625rem 0 0;
  color: var(--sm-charcoal);
  font-family: var(--sm-font-head);
  font-size: clamp(1.1875rem, 1.7vw, 1.5625rem);
  font-weight: 600;
  line-height: 1.2;
}

.smx-home-hero-small {
  max-width: 580px;
  margin: 0.5rem 0 0;
  font-size: 0.84375rem;
  font-weight: 400;
  line-height: 1.6;
}

/* Hidden from sight but read by assistive technology: the rotator's phrases, once each. */
.smx-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * The email box, where the live hero has its two buttons: the "Work email" label above one White
 * pill that holds the field and the Continue pill. The label is laid out with display: contents,
 * so its text and the field it wraps sit in the box's grid; the pill's outline is the row's
 * ::before, under the field and the button.
 */
.smx-home-hero-signin {
  max-width: 34rem;
  margin-top: 1.625rem;
}

.smx-home-hero-signin .smx-access-intro {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
}

.smx-home-hero-signin .smx-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.375rem 0.25rem;
}

.smx-home-hero-signin .smx-access-row::before {
  content: "";
  grid-row: 2;
  grid-column: 1 / -1;
  align-self: stretch;
  border: 2px solid var(--sm-purple-mid);
  border-radius: 999px;
  background: var(--sm-white);
}

.smx-home-hero-signin .smx-access-field {
  display: contents;
}

.smx-home-hero-signin .smx-access-label {
  grid-row: 1;
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.smx-home-hero-signin .smx-access-input {
  grid-row: 2;
  grid-column: 1;
  height: 52px;
  margin-left: 0.375rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

/* The live primary pill: the Purple Bright gradient, the arrow circle and the lift on hover. */
.smx-home-hero-signin .smx-access-submit,
.smx-home-hero-signin .smx-access-continue-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(
    150deg,
    var(--sm-purple-bright),
    var(--sm-purple) 55%,
    var(--sm-purple-dark)
  );
  box-shadow: var(--sm-hero-pill-shadow);
  color: var(--sm-white);
  font-size: 1rem;
  font-weight: 600;
  transition:
    transform 0.2s var(--sm-ease),
    box-shadow 0.2s;
}

.smx-home-hero-signin .smx-access-submit {
  grid-row: 2;
  grid-column: 2;
  height: 52px;
  margin: 0.25rem;
  padding: 0 0.875rem 0 1.875rem;
}

.smx-home-hero-signin .smx-access-continue-link {
  min-height: 52px;
  padding: 0.75rem 1.875rem;
}

.smx-home-hero-signin
  :is(.smx-access-submit, .smx-access-continue-link):is(:hover, :focus-visible) {
  box-shadow: var(--sm-hero-pill-shadow-hover);
  transform: translateY(-2px);
}

.smx-home-hero-pill-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sm-hero-pill-icon);
  transition: transform 0.25s var(--sm-ease);
}

/* The chevron, drawn with two borders. */
.smx-home-hero-pill-icon::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border: solid currentcolor;
  border-width: 2px 2px 0 0;
  transform: translateX(-1px) rotate(45deg);
}

.smx-access-submit:is(:hover, :focus-visible) .smx-home-hero-pill-icon {
  transform: translateX(4px);
}

.smx-home-hero-signin .smx-access-continue {
  margin-bottom: 0;
}

.smx-home-hero-signin .smx-access-other {
  margin: 1.25rem 0 0.75rem;
}

/* The map (the live hero's right column): sized from its own width. */
.smx-home-hero-map {
  position: relative;
  container-type: inline-size;
  width: 100%;
}

.smx-home-hero-map-stage {
  position: relative;
  height: min(520px, 86cqi);
}

.smx-home-hero-map-canvas {
  position: absolute;
  top: -3%;
  left: -5%;
  width: 110%;
  max-width: none;
  height: 106%;
  object-fit: contain;
  opacity: 0.5;
  filter: blur(3px);
  /* It reaches past the stage, over the pause control, so it never takes a click. */
  pointer-events: none;
}

.smx-home-hero-hub {
  position: absolute;
  z-index: 2;
  top: 51%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /*
   * Live is min(132px, 22cqi). Here it is 144px wherever it shows (768px and up), so the logo
   * below fits with its clear space inside the circle (issue 18).
   */
  width: 144px;
  height: 144px;
  border: 2px solid var(--sm-purple);
  border-radius: 50%;
  background: var(--sm-white);
  box-shadow: var(--sm-hero-hub-shadow);
  transform: translate(-50%, -50%);
  animation:
    smx-home-hero-pump 1.9s ease-in-out infinite,
    smx-home-hero-ring 1.9s ease-out infinite;
}

/*
 * The official color logo file in the hub (issue 18). The brand minimum of 100px applies to the
 * artwork, which fills 287.35 of the file's 300 units (decision 18), so the image must be at
 * least 104.4px wide: it is 105px, 75% of the hub's 140px content box (live is 72%). Its artwork
 * is then 100.6px wide, and with the height of the "M" as clear space on every side it reaches
 * about 68px from the centre, inside the circle's 70px inner radius. Its aspect ratio and the
 * rest of its box come from the shell's logo rules (.smx-body .smx-logo-img), whose min-width
 * this rule must outrank: same specificity, loaded later.
 */
.smx-body .smx-home-hero-hub-logo {
  width: 75%;
  min-width: 105px;
}

.smx-home-hero-node {
  position: absolute;
  z-index: 1;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--sm-lavender-mist);
  border-radius: 16px;
  background: var(--sm-white);
  box-shadow: var(--sm-hero-card-shadow);
  text-align: center;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: smx-home-hero-float 4.4s ease-in-out infinite;
}

.smx-home-hero-node-value {
  display: block;
  color: var(--sm-purple);
  font-family: var(--sm-font-head);
  font-size: clamp(1.0625rem, 3.6cqi, 1.625rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.smx-home-hero-node-label {
  display: block;
  margin-top: 0.25rem;
  font-size: clamp(0.53125rem, 1.7cqi, 0.71875rem);
  font-weight: 500;
  line-height: 1.3;
}

.smx-home-hero-node-1 {
  top: 14%;
  left: 18%;
  animation-delay: -0.4s;
}

.smx-home-hero-node-2 {
  top: 12%;
  left: 76%;
  animation-delay: -1.2s;
}

.smx-home-hero-node-3 {
  top: 48%;
  left: 88%;
  animation-delay: -2s;
}

.smx-home-hero-node-4 {
  top: 52%;
  left: 12%;
  animation-delay: -2.8s;
}

.smx-home-hero-node-5 {
  top: 88%;
  left: 26%;
  animation-delay: -3.6s;
}

.smx-home-hero-node-6 {
  top: 86%;
  left: 74%;
  animation-delay: -4.4s;
}

/*
 * The health-system logo strip under the hero (issue 352), as live: a White band, the heading,
 * then three copies of the logo list side by side on one line (live has two). Each moves left by
 * its own width each loop. The lists are equal, so the second ends where the first began and the
 * restart doesn't show, and the third keeps the right edge covered on screens wider than one list.
 * The strip stops on hover and while focus is inside it. Text pair: Gray Text on White; the live
 * heading's 65% Charcoal fails AA contrast.
 */
.smx-logo-strip {
  padding: 1.875rem 0 2rem;
  background: var(--sm-white);
  text-align: center;
}

.smx-logo-strip-heading {
  margin: 0 0 2.125rem;
  padding: 0 1.5rem;
  color: var(--sm-gray-text);
  font-family: var(--sm-font-head);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/*
 * The live logos sit in a 59px row, about 8px clear above and below. The lists start at the left
 * edge, never centred, however wide the screen.
 */
.smx-logo-strip-track {
  padding: 0.5rem 0;
  text-align: start;
  overflow-x: hidden;
  white-space: nowrap;
}

.smx-logo-strip-list {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  vertical-align: top;
  animation: smx-logo-strip-scroll 42s linear infinite;
}

.smx-logo-strip-track:is(:hover, :focus-within) .smx-logo-strip-list {
  animation-play-state: paused;
}

.smx-logo-strip-item {
  flex: none;
  max-width: 12rem;
  margin: 0 2.5rem;
}

/* The width and height attributes hold each logo's fitted size, so nothing shifts as it loads. */
.smx-logo-strip-img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 2.75rem;
  object-fit: contain;
}

/*
 * The pause control (WCAG 2.2.2), under the map at the right: a native checkbox, so it needs no
 * script and its state is its checked state. While it is checked, every animation on the page
 * stops where it is, the logo strip's included (issue 352). The selector's specificity (0,3,0) is
 * above every animation rule here.
 */
.smx-motion-toggle {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  /* A 24px target without relying on the spacing exception (WCAG 2.2 2.5.8). */
  min-height: 24px;
  justify-content: flex-end;
  gap: 0.5rem;
  width: fit-content;
  margin: 0.5rem 0 0 auto;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.smx-motion-pause {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--sm-purple);
  cursor: pointer;
}

.smx-body:has(.smx-motion-pause:checked) *,
.smx-body:has(.smx-motion-pause:checked) *::before,
.smx-body:has(.smx-motion-pause:checked) *::after {
  animation-play-state: paused;
}

@keyframes smx-home-hero-rotate {
  0%,
  21% {
    transform: translateY(0);
  }

  25%,
  46% {
    transform: translateY(-20%);
  }

  50%,
  71% {
    transform: translateY(-40%);
  }

  75%,
  96% {
    transform: translateY(-60%);
  }

  100% {
    transform: translateY(-80%);
  }
}

@keyframes smx-home-hero-float {
  0%,
  100% {
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) translateY(-9px) scale(1.045);
  }
}

@keyframes smx-home-hero-pump {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* The ring fades out as it grows; transparent is the ring color at 0% in premultiplied mixing. */
@keyframes smx-home-hero-ring {
  0% {
    box-shadow:
      var(--sm-hero-hub-shadow),
      0 0 0 0 var(--sm-hero-hub-ring);
  }

  70% {
    box-shadow:
      var(--sm-hero-hub-shadow),
      0 0 0 24px transparent;
  }

  100% {
    box-shadow:
      var(--sm-hero-hub-shadow),
      0 0 0 0 transparent;
  }
}

/* The logo strip's loop: from where the list starts to one list's width to the left. */
@keyframes smx-logo-strip-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/* As live: one column below 1200px, with the map under the copy. */
@media (max-width: 1199.98px) {
  .smx-home-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 2.5rem;
    min-height: 0;
  }
}

/* As live: on phones the cards stand still in a two-column grid, without the hub. */
@media (max-width: 767.98px) {
  .smx-home-hero-inner {
    gap: 1.625rem;
    padding-top: 1.625rem;
    padding-bottom: 0.5rem;
  }

  .smx-home-hero-title {
    font-size: 1.9375rem;
  }

  /* Live is 1.3125rem; capped by the width so the longest phrase fits at 320px, any font size. */
  .smx-home-hero-rotator-window {
    font-size: min(1.3125rem, 6.5vw);
  }

  .smx-home-hero-map {
    max-width: 440px;
    margin-inline: auto;
  }

  .smx-home-hero-map-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.625rem;
    height: auto;
    padding: 1.625rem 0 1.875rem;
    isolation: isolate;
  }

  .smx-home-hero-map-canvas {
    z-index: -1;
    top: -22%;
    left: -14%;
    width: 128%;
    height: 144%;
    opacity: 0.46;
    filter: none;
  }

  .smx-home-hero-hub {
    display: none;
  }

  .smx-home-hero-node {
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem;
    border-radius: 14px;
    background: var(--sm-hero-card-phone);
    white-space: normal;
    transform: none;
    animation: none;
    backdrop-filter: blur(2px);
  }

  .smx-home-hero-node-value {
    font-size: 1.375rem;
  }

  .smx-home-hero-node-label {
    font-size: 0.6875rem;
  }
}

/* On narrow phones the email box stacks: the field, then a full-width Continue pill. */
@media (max-width: 575.98px) {
  .smx-home-hero-title {
    font-size: 1.8125rem;
  }

  .smx-home-hero-signin .smx-access-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .smx-home-hero-signin .smx-access-row::before {
    display: none;
  }

  .smx-home-hero-signin .smx-access-input {
    margin: 0;
    border: 2px solid var(--sm-purple-mid);
    background: var(--sm-white);
  }

  .smx-home-hero-signin .smx-access-submit {
    grid-row: 3;
    grid-column: 1;
    margin: 0;
  }

  .smx-home-hero-signin .smx-access-continue-link {
    width: 100%;
  }
}

/*
 * The access page's header (issue 354), the `smx-header-access` variant of the shell's header:
 * the access page and a link's email step only, never a microsite. It matches the live
 * shiftmed.com nav over the homepage hero.
 * - Its row is in the hero's container (the shared rules at the top of this file), so the logo
 *   starts at the hero text's left edge (72 px at 1440 px) and the pill ends at its right edge, at
 *   every width. The live site's 48 px nav padding from 992 px is left out: it moves the live logo
 *   16 px right of the hero text at 1024 px.
 * - A soft shadow instead of the bottom border, .875rem row padding, and the live menu labels and
 *   pill padding.
 * - Below 62rem the toggler is the live 28 px hamburger icon: three Purple bars, no border. Its
 *   "Menu" text stays as its accessible name, visually hidden, and site-nav.js works unchanged.
 *   The open panel floats below the header at the right, as the live menu does (see below).
 * This file loads after shell.css, so these rules win over the chrome guard's rules of the same
 * specificity.
 */
.smx-header-access {
  border-bottom: 0;
  box-shadow: var(--sm-shadow-nav);
}

.smx-header-access .smx-mainnav {
  column-gap: var(--sm-space-16);
  padding-block: 0.875rem;
}

@media (min-width: 992px) {
  .smx-header-access .smx-menu-list {
    gap: 0;
  }

  .smx-header-access .smx-menu-list > li {
    margin-inline: 0.4rem;
  }

  .smx-header-access .smx-menu-label {
    padding: 0.625rem 0.375rem;
  }
}

/* Menu labels: Poppins 600 14px as before, with the live spacing and a 10px chevron. */
.smx-header-access .smx-menu-label {
  gap: 0.375rem;
  line-height: 1.5;
}

.smx-header-access .smx-menu-label::after {
  width: 0.4375rem;
  height: 0.4375rem;
}

.smx-header-access .smx-actions .smx-button {
  padding: 0.5625rem 1.125rem;
  line-height: 1.5;
  white-space: nowrap;
}

/* The toggler's visible text is hidden, but stays its accessible name ("Menu"). */
.smx-header-access .smx-nav-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/*
 * The live icon (28 by 16 px, 3 px bars with round ends): a long middle bar, and two short bars
 * offset to the left at the top and to the right at the bottom. The middle bar is ::before; the
 * top bar is ::after, and its box shadow draws the bottom bar. The bars take the button's Purple.
 * Every size is in rem, like the button, so the icon scales with it.
 */
.smx-header-access .smx-nav-toggle-icon {
  position: relative;
  width: 1.75rem;
  height: 1rem;
  background: none;
  box-shadow: none;
}

.smx-header-access .smx-nav-toggle-icon::before,
.smx-header-access .smx-nav-toggle-icon::after {
  content: "";
  position: absolute;
  height: 0.1875rem;
  border-radius: 0.09375rem;
  background: currentcolor;
}

.smx-header-access .smx-nav-toggle-icon::before {
  top: 0.40625rem;
  left: 0.03125rem;
  width: 1.6875rem;
}

.smx-header-access .smx-nav-toggle-icon::after {
  top: 0.03125rem;
  left: 0.28125rem;
  width: 0.875rem;
  box-shadow: 0.25rem 0.75rem 0 currentcolor;
}

/*
 * Below 62rem: the bare icon in a 28 px square target (WCAG 2.2 2.5.8), on the logo's row at the
 * container's right edge. The chrome guard keeps its Purple color and White background.
 */
@media (max-width: 61.98rem) {
  .smx-header-access .smx-mainnav {
    position: relative;
  }

  .smx-header-access .smx-nav-toggle:not([hidden]) {
    position: relative;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: var(--sm-radius-4);
  }

  /*
   * The live mobile menu: once site-nav.js runs, the open panel floats below the header, 12px
   * from the row's right edge, as a White card (16px radius, a Gray Light border, the menu
   * shadow) at least 252px wide and never wider than the row. The minimum gives way to the row
   * (issue 374), so a large default font on a narrow screen can't push the card past the left
   * edge. It scrolls inside itself on a short screen. Without the script it stays open in the
   * page, as on every other page.
   */
  .smx-header-access .smx-nav-toggle:not([hidden])[aria-expanded="true"] + .smx-nav-panel {
    position: absolute;
    z-index: 1;
    top: 100%;
    right: var(--sm-space-12);
    gap: 0.625rem;
    min-width: min(15.75rem, 100% - 2 * var(--sm-space-12));
    max-width: calc(100% - 2 * var(--sm-space-12));
    max-height: calc(100dvh - 7.5rem);
    margin: 0;
    padding: var(--sm-space-8);
    border: 1px solid var(--sm-gray-light);
    border-radius: 1rem;
    background-color: var(--sm-white);
    box-shadow: var(--sm-shadow-menu);
  }

  /*
   * With the panel open and focus past the header (in the main content or the footer), the
   * floating panel would cover the focused control (WCAG 2.2 2.4.11), so it hides until focus
   * comes back to the header, and the header, now just its row, stays stuck at the top.
   */
  .smx-header-access:has(.smx-nav-toggle:not([hidden])[aria-expanded="true"]):has(~ :focus-within) {
    position: sticky;
  }

  .smx-header-access:has(~ :focus-within)
    .smx-nav-toggle:not([hidden])[aria-expanded="true"]
    + .smx-nav-panel {
    display: none;
  }

  /* The live menu rows: 50px labels split by Gray Wash rules, 46px links, 10px radii. */
  .smx-header-access .smx-menu-list {
    gap: 0;
  }

  .smx-header-access .smx-menu-list > li:not(:last-child) {
    border-bottom: 1px solid var(--sm-gray-wash);
  }

  .smx-header-access .smx-menu-label {
    justify-content: space-between;
    min-height: 3.125rem;
    padding: 0 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
  }

  .smx-header-access .smx-menu[open] > .smx-menu-label {
    font-weight: 700;
  }

  .smx-header-access .smx-menu-items {
    margin-top: 0;
    padding: 0 0 var(--sm-space-8);
  }

  .smx-header-access .smx-menu-items li + li {
    margin-top: 0;
  }

  .smx-header-access .smx-menu-items a {
    display: flex;
    align-items: center;
    min-height: 2.875rem;
    padding: 0 0.875rem 0 1.625rem;
    border-radius: 0.625rem;
    font-size: 0.90625rem;
    font-weight: 500;
  }

  .smx-header-access .smx-menu-items a:hover,
  .smx-header-access .smx-menu-items a:focus-visible {
    background-color: var(--sm-lavender-wash);
  }

  /* The live menu's own "Request Free Consultation": a full-width Purple pill. */
  .smx-header-access .smx-actions .smx-button {
    display: block;
    width: 100%;
    background-color: var(--sm-purple);
    color: var(--sm-white);
    text-align: center;
  }
}

/*
 * With forced colors the button has no border, so the bars must stay: they keep their background
 * and shadow, in the button's forced text color.
 */
@media (forced-colors: active) {
  .smx-header-access .smx-nav-toggle-icon::before,
  .smx-header-access .smx-nav-toggle-icon::after {
    forced-color-adjust: none;
  }
}

/*
 * Reduced motion: nothing in the hero or the logo strip moves (as live), so the pause control
 * isn't needed. The strip shows its first logos, from the left.
 */
@media (prefers-reduced-motion: reduce) {
  .smx-home-hero-rotator-list,
  .smx-home-hero-hub,
  .smx-home-hero-node,
  .smx-logo-strip-list {
    animation: none;
  }

  .smx-motion-toggle {
    display: none;
  }
}
