/* MANACA header and menu, round 4.
   Header: no bar and no chips. Floating pieces (menu / wordmark / search, log in, bag). nav.js tells every piece the
   tone of the page at its own top edge (data-top), at its centre (data-tone) and, while a section boundary is passing
   through it, where that boundary is (--cut, px from the piece's top).
   Every label, the menu bars and the wordmark are drawn twice: layer A in the ink of the upper tone, clipped above
   --cut, layer B in the ink of the lower tone, clipped below it. So a tone change wipes through each piece exactly
   where the page changes under it.
   Halo: each layer carries a feathered glow of its own ground colour that follows its silhouette (text-shadow on
   labels, drop-shadow on the wordmark and bars). On plain ground it is the ground and cannot be seen; over a photo
   or passing type it is what keeps the piece readable. Over the film there is also the soft wash Shiva approved.
   Menu: a panel that hangs under the Menu control, which becomes Close in place. One group open at a time. */

@property --cut {
  syntax: "<length>";
  inherits: true;
  initial-value: 400px;
}

html {
  scrollbar-gutter: stable;
}

html:has(.nav-dialog[open]),
body:has(.nav-dialog[open]) {
  overflow: hidden;
}

/* ---------- tone ---------- */
#hdr,
.hdr-piece,
.nav-help-trigger {
  --t-ink: #0e0e0d;
  --t-ground: 239 239 234;
  --t-line: rgb(14 14 13 / .18);
  --t-pulse: 14 14 13;
}

#hdr[data-tone="dark"],
.hdr-piece[data-tone="dark"],
.nav-help-trigger[data-tone="dark"] {
  --t-ink: #f4f5ef;
  --t-ground: 12 12 11;
  --t-line: rgb(244 245 239 / .24);
  --t-pulse: var(--led);
}

/* A is the tone at the piece's top edge, B the other one */
.hdr-piece {
  --a-ink: #0e0e0d;
  --a-halo: 239 239 234;
  --b-ink: #f4f5ef;
  --b-halo: 12 12 11;
  --cut: 400px;
}

.hdr-piece[data-top="dark"] {
  --a-ink: #f4f5ef;
  --a-halo: 12 12 11;
  --b-ink: #0e0e0d;
  --b-halo: 239 239 234;
}

html[data-nav-tone="dark"] .skip {
  background: #f4f5ef;
  color: #0e0e0d;
}

/* ---------- trust strip: part of the page top, steps aside once you scroll ---------- */
.trust {
  transition: transform .5s var(--ease);
}

html[data-nav-strip="off"] .trust {
  transform: translateY(-100%);
}

html[data-nav-strip="off"] .trust-track,
.trust:hover .trust-track {
  animation-play-state: paused;
}

/* without JS nothing can read the tone under the header, so the strip and the header stay at the top of the page and scroll away with it */
html:not(.js) .trust,
html:not(.js) #hdr {
  position: absolute;
}

/* ---------- header: pieces, not a bar ---------- */
#hdr {
  padding-inline: max(calc(var(--gut) - 12px), env(safe-area-inset-left)) max(calc(var(--gut) - 12px), env(safe-area-inset-right));
  pointer-events: none;
  transition: transform .5s var(--ease);
}

html[data-nav-strip="off"] #hdr {
  transform: translateY(calc(-1 * var(--trust)));
}

/* over the film only: a wash of the ground so 12px type keeps its contrast. Gone once the film is behind you. */
#hdr::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 -36px;
  background: linear-gradient(rgb(239 239 234 / .8), rgb(239 239 234 / .7) 56%, rgb(239 239 234 / 0));
  pointer-events: none;
  transition: opacity .35s var(--ease);
}

#hdr[data-tone="dark"]::after {
  background: linear-gradient(rgb(14 14 13 / .8), rgb(14 14 13 / .7) 56%, rgb(14 14 13 / 0));
}

#hdr[data-ground="page"]::after {
  opacity: 0;
}

.hdr-piece {
  position: relative;
  z-index: 0;   /* one stacking context per piece: all of its fog lies under all of its labels */
  display: flex;
  align-items: stretch;
  height: 44px;
  color: var(--t-ink);
  pointer-events: auto;
  transition: opacity .4s var(--ease);
}

/* a tone change that arrives without a boundary to follow (the film changing under the header, a jump) still wipes */
.hdr-piece.wipe {
  transition: opacity .4s var(--ease), --cut .34s cubic-bezier(.4, 0, .2, 1);
}

#hdr .hdr-l {
  justify-self: start;
}

#hdr .hdr-r {
  justify-self: end;
}

.hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: inherit;
  font: 500 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

/* the fog: behind every control, an oval of the ground it is standing on, feathered away to nothing on all sides.
   Whatever scrolls under a control dissolves into it instead of tangling with the label. Two layers, like the ink. */
#hdr .hdr-btn,
#hdr .hdr-mark {
  position: relative;
  --fx: 20px;
  --fy: 13px;
}

/* over the film the wash is the separation; the fog waits */
#hdr[data-ground="film"] :is(.hdr-btn, .hdr-mark)::before,
#hdr[data-ground="film"] :is(.hdr-btn, .hdr-mark)::after {
  opacity: 0;
}

#hdr .hdr-btn::before,
#hdr .hdr-btn::after,
#hdr .hdr-mark::before,
#hdr .hdr-mark::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: calc(-1 * var(--fy)) calc(-1 * var(--fx));
  background: rgb(var(--h) / .88);
  --fog: radial-gradient(closest-side, #000 46%, rgb(0 0 0 / .88) 57%, rgb(0 0 0 / .58) 69%, rgb(0 0 0 / .25) 82%, rgb(0 0 0 / .07) 92%, transparent);
  -webkit-mask-image: var(--fog);
  mask-image: var(--fog);
  transition: opacity .35s var(--ease);
  pointer-events: none;
}

#hdr .hdr-btn::before,
#hdr .hdr-mark::before {
  --h: var(--a-halo);
  clip-path: inset(0 0 calc(100% - var(--cut) - var(--fy)) 0);
}

#hdr .hdr-btn::after,
#hdr .hdr-mark::after {
  --h: var(--b-halo);
  clip-path: inset(calc(var(--cut) + var(--fy)) 0 0 0);
}

/* the two layers. Boxes are the full height of the piece, so --cut means the same thing in each of them. */
.hdr-txt[data-t],
.hdr-bars {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  margin-right: -.14em;   /* the tracking after the last letter is not part of the word */
  color: transparent;
}

.hdr-txt[data-t]::before,
.hdr-txt[data-t]::after {
  content: attr(data-t);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.hdr-bars {
  width: 22px;
  margin-right: 0;
}

.hdr-bars::before,
.hdr-bars::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--c), var(--c)) 0 calc(50% - 3.5px) / 100% 2px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 calc(50% + 3.5px) / 55% 2px no-repeat;
  filter: drop-shadow(0 0 2px rgb(var(--h) / .9)) drop-shadow(0 0 7px rgb(var(--h) / .8));
  transition: background-size .3s var(--ease);
}

.hdr-txt[data-t]::before,
.hdr-bars::before {
  --c: var(--a-ink);
  --h: var(--a-halo);
  clip-path: inset(-200px -200px calc(100% - var(--cut)) -200px);
}

.hdr-txt[data-t]::after,
.hdr-bars::after {
  --c: var(--b-ink);
  --h: var(--b-halo);
  clip-path: inset(var(--cut) -200px -200px -200px);
}

.hdr-txt[data-t]::before,
.hdr-txt[data-t]::after {
  color: var(--c);
  text-shadow: 0 0 1px rgb(var(--h) / .7), 0 0 4px rgb(var(--h) / .9), 0 0 9px rgb(var(--h) / .8);
}

.hdr-wide,
html.js .hdr-nojs,
html:not(.js) :is(#menuBtn, #navSearchBtn, #bagBtn) {
  display: none;
}

/* the wordmark: present at the top of the page and on the way back up, condensed while reading */
#hdr .hdr-mark {
  --mh: 30px;
  --s: 1;
  --l: calc(22px + (var(--cut) - 22px) / var(--s));
  display: grid;
  place-items: center;
  padding-inline: 12px;
  border-radius: 12px;
}

#hdr .hdr-mark img {
  grid-area: 1 / 1;
  box-sizing: border-box;
  width: calc(var(--mh) * 140 / 57);
  height: 44px;
  padding-block: calc((44px - var(--mh)) / 2);
  object-fit: contain;
  transform: scale(var(--s));
  transition: transform .55s var(--ease);
}

/* the ink mark carries a light halo, the white mark a dark one */
#hdr .hdr-mark img:not(.hdr-mark-inv) {
  filter: drop-shadow(0 0 2px rgb(239 239 234 / .9)) drop-shadow(0 0 7px rgb(239 239 234 / .85));
}

#hdr .hdr-mark-inv {
  filter: drop-shadow(0 0 2px rgb(12 12 11 / .9)) drop-shadow(0 0 7px rgb(12 12 11 / .85));
}

#hdr .hdr-mark:not([data-top="dark"]) img:not(.hdr-mark-inv),
#hdr .hdr-mark[data-top="dark"] .hdr-mark-inv {
  clip-path: inset(-200px -200px calc(100% - var(--l)) -200px);
}

#hdr .hdr-mark:not([data-top="dark"]) .hdr-mark-inv,
#hdr .hdr-mark[data-top="dark"] img:not(.hdr-mark-inv) {
  clip-path: inset(var(--l) -200px -200px -200px);
}

#hdr[data-compact] .hdr-mark {
  --s: .72;
}

#hdr.sign-on .hdr-mark:focus-visible {
  opacity: 1;
}

/* the bag: a numeral beside the word; it becomes a solid counter once something is in it */
#hdr .bag-btn {
  gap: 10px;
}

#hdr .bag-count {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 9px;
  height: 20px;
  border-radius: 10px;
  color: var(--t-ink);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  text-shadow: 0 0 4px rgb(var(--t-ground) / .9), 0 0 9px rgb(var(--t-ground) / .8);
  transition: background-color .2s linear, color .2s linear;
}

#hdr .bag-count.on {
  min-width: 20px;
  margin-right: -3px;
  padding: 0 6px;
  background: var(--t-ink);
  box-shadow: 0 0 9px 2px rgb(var(--t-ground) / .7);
  color: rgb(var(--t-ground));
  text-shadow: none;
}

#hdr .bag-count.tick {
  animation: nav-tick .5s var(--ease);
}

#hdr .bag-count.tick::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: nav-pulse .7s ease-out both;
  pointer-events: none;
}

:where(#hdr, .nav-dialog, .nav-help-trigger) :focus-visible,
.nav-help-trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
  border-radius: 12px;
}

@media (min-width: 901px) {
  #hdr .hdr-btn,
  #hdr .hdr-mark {
    --fx: 28px;
  }

  #hdr .hdr-mark {
    --mh: 40px;
  }

  #hdr[data-compact] .hdr-mark {
    --s: .68;
  }

  html.js .hdr-wide,
  html:not(.js) a.hdr-wide {
    display: inline-flex;
  }

  /* while reading, Log in steps out; Menu, Search and Bag stay. It is back the moment you scroll up or tab in. */
  #navLogin {
    transition: opacity .3s linear, transform .5s var(--ease), visibility 0s;
  }

  #hdr[data-compact]:not(:focus-within) #navLogin {
    opacity: 0;
    transform: translateX(14px);
    visibility: hidden;
    transition: opacity .2s linear, transform .4s var(--ease), visibility 0s .2s;
  }
}

@media (hover: hover) {
  .hdr-btn:hover .hdr-txt::before,
  .hdr-btn:hover .hdr-txt::after,
  .mn-tab:hover .hdr-txt {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
  }

  .menu-btn:hover .hdr-bars::before,
  .menu-btn:hover .hdr-bars::after {
    background-size: 100% 2px, 100% 2px;
  }
}

#hdr[data-compact] .hdr-mark {
  --fx: 4px;
}

/* the Menu control hands over to the menu's own Close, which sits exactly on it */
#menuBtn {
  transition: opacity .12s linear;
}

#menuBtn[aria-expanded="true"] {
  opacity: 0;
}

html:has(.nav-menu.closing) #menuBtn {
  opacity: 1;
}

/* ---------- dialogs: shared ---------- */
.nav-dialog {
  position: fixed;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: var(--panel);
  overscroll-behavior: contain;
}

.nav-dialog[open] {
  display: flex;
  flex-direction: column;
}

.nav-dialog::backdrop {
  background: rgb(14 14 13 / .42);
  animation: nav-reveal 200ms var(--ease) both;
}

.nav-dialog.closing,
.nav-dialog.closing::backdrop {
  animation: nav-out 130ms linear both;
}

.nav-dialog [hidden],
.nav-help-trigger[hidden] {
  display: none;
}

.nav-dialog-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 22px;
  border-bottom: 1px solid var(--line);
}

.nav-dialog-head h2 {
  font: 800 34px/1 var(--display);
  font-stretch: 66%;
  font-variation-settings: "wdth" 66;
  text-transform: uppercase;
}

.nav-close {
  flex: 0 0 44px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-soon {
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 3px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 500 12px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
}

/* ---------- the menu: a pocket poured out of the Menu control ----------
   nav.js writes --tab-l/-t/-w/-h (where the Menu control sits) before the dialog opens. */
.nav-menu {
  --m-panel: #f8f8f4;
  --m-ink: #0e0e0d;
  --m-mute: #5b5a54;
  --m-line: rgb(14 14 13 / .12);
  --m-edge: rgb(14 14 13 / .1);
  --m-wash: rgb(var(--led) / .62);
  --m-mark: #0e0e0d;
  --m-glow: none;
  --m-halo: 239 239 234;
  --m-r: 20px;
  --m-top: calc(var(--tab-t, 44px) + var(--tab-h, 44px) + 2px);
  inset: var(--m-top) auto auto var(--tab-l, 8px);
  width: calc(100% - 2 * var(--tab-l, 8px));
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: visible;
  background: none;
  color: var(--m-ink);
}

.nav-menu[data-tone="dark"] {
  --m-panel: #171716;
  --m-ink: #f4f5ef;
  --m-mute: #a9aaa1;
  --m-line: rgb(244 245 239 / .14);
  --m-edge: rgb(var(--led) / .9);
  --m-wash: rgb(var(--led) / .09);
  --m-mark: rgb(var(--led));
  --m-glow: 0 0 12px 1px rgb(var(--led) / .7);
  --m-halo: 12 12 11;
}

/* the page stays in view: a light veil, never a blackout */
.nav-menu::backdrop {
  background: rgb(14 14 13 / .2);
}

.nav-menu[data-tone="dark"]::backdrop {
  background: rgb(0 0 0 / .38);
}

/* the shadow lives outside the pour, so the clip cannot cut it */
.nav-menu::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: var(--m-r);
  box-shadow: 0 34px 60px -30px rgb(14 14 13 / .5), 0 3px 14px rgb(14 14 13 / .07);
  pointer-events: none;
  animation: nav-reveal 180ms 110ms linear both;
}

/* Close: sits exactly on the Menu control and is drawn like it (ink of the page tone, same halo), no surface */
.mn-tab {
  position: absolute;
  left: 0;
  bottom: calc(100% + 2px);
  min-width: var(--tab-w, 104px);
  height: var(--tab-h, 44px);
  justify-content: flex-start;
  color: var(--m-ink);
  text-shadow: 0 0 1px rgb(var(--m-halo) / .7), 0 0 4px rgb(var(--m-halo) / .95), 0 0 9px rgb(var(--m-halo) / .9), 0 0 16px rgb(var(--m-halo) / .75), 0 0 26px rgb(var(--m-halo) / .5);
}

.hdr-glyph {
  display: grid;
  width: 22px;
  filter: drop-shadow(0 0 2px rgb(var(--m-halo) / .9)) drop-shadow(0 0 7px rgb(var(--m-halo) / .8));
}

.hdr-glyph i {
  height: 2px;
  background: currentColor;
}

.mn-tab .hdr-glyph {
  gap: 0;
  height: 2px;
}

.mn-tab .hdr-glyph i {
  grid-area: 1 / 1;
  transform-origin: center;
  transform: rotate(45deg);
  animation: mn-x1 220ms var(--ease) backwards;
}

.mn-tab .hdr-glyph i:last-child {
  transform: rotate(-45deg);
  animation-name: mn-x2;
}

.mn-panel {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(68vh, calc(100vh - var(--m-top) - 12px));
  max-height: min(68svh, calc(100svh - var(--m-top) - 12px));
  overflow: hidden;
  border-radius: var(--m-r);
  background: var(--m-panel);
  animation: mn-pour 220ms var(--ease);
}

/* the hidden strip under the top lip, and the light it drops down the plaster */
.mn-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 96px;
  background: linear-gradient(var(--m-wash), transparent);
  pointer-events: none;
}

.mn-panel::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: var(--m-edge);
  box-shadow: var(--m-glow);
  transform-origin: left;
  pointer-events: none;
  animation: mn-sweep 320ms var(--ease) backwards;
}

/* phones: search lives here, one tap from the bar */
.mn-find {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  margin-inline: 16px;
  border-bottom: 1px solid var(--m-line);
  color: var(--m-mute);
  font: 500 16px/1 var(--body);
  text-align: left;
  animation: nav-reveal 150ms 50ms linear backwards;
}

.mn-find svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--m-ink);
  stroke-width: 1.6;
  stroke-linecap: round;
}

@media (min-width: 901px) {
  .mn-find {
    display: none;
  }
}

.mn-nav,
.mn-foot {
  animation: nav-reveal 150ms 50ms linear backwards;
}

.mn-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* five names set as one block of type. The open one is inked and gets the lip. */
.mn-groups {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0 14px;
  padding: 8px 16px 4px;
}

.mn-group {
  position: relative;
  min-width: 44px;
  min-height: 46px;
  padding: 0 1px;
  color: var(--m-mute);
  font: 800 clamp(26px, 8.7vw, 34px)/46px var(--display);
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  letter-spacing: -.005em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .15s linear, font-variation-settings .2s var(--ease);
}

.mn-group::after {
  content: "";
  position: absolute;
  inset: auto 1px 2px;
  height: 3px;
  background: var(--m-mark);
  box-shadow: var(--m-glow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s var(--ease);
}

.mn-group[aria-expanded="true"] {
  color: var(--m-ink);
}

.mn-group[aria-expanded="true"]::after {
  transform: none;
}

.mn-links {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  /* on a short phone the list scrolls: a soft edge says there is more, and lifts off at the end */
  background:
    linear-gradient(transparent, var(--m-panel) 75%) center bottom / 100% 26px no-repeat local,
    linear-gradient(transparent, var(--m-line)) center bottom / 100% 12px no-repeat scroll;
}

.mn-links.morph {
  overflow: hidden;
  transition: height .18s var(--ease);
}

.mn-sub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 14px;
  padding: 2px 16px 4px;
}

.mn-sub a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: 6px;
  color: var(--m-ink);
  font: 500 15px/1.25 var(--body);
  text-decoration: none;
}

.mn-sub .mn-all,
.mn-sub .mn-head {
  font: 500 12px/1.3 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mn-sub .mn-all {
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--m-line);
}

.mn-all::after {
  content: "";
  flex: 0 0 8px;
  height: 8px;
  margin-inline-end: 4px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

.mn-sub .mn-head {
  color: var(--m-mute);
}

.mn-foot {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 20px;
  padding: 0 16px 6px;
  border-top: 1px solid var(--m-line);
}

.mn-direct,
.mn-util {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

.mn-direct {
  flex: 1 1 100%;
  justify-content: space-between;
  gap: 0 10px;
}

.mn-direct a {
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 46px;
  color: var(--m-ink);
  font: 750 15px/1 var(--display);
  font-stretch: 78%;
  font-variation-settings: "wdth" 78;
  letter-spacing: .03em;
  text-decoration: none;
  text-transform: uppercase;
}

.mn-util :is(a, button) {
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--m-mute);
  font: 500 13px/1 var(--body);
  text-decoration: none;
}

@media (min-width: 901px) {
  .nav-menu {
    --m-r: 24px;
    width: min(1180px, calc(100% - 2 * var(--tab-l, 36px)));
  }

  .mn-panel {
    max-height: calc(100vh - var(--m-top) - 20px);
    max-height: calc(100svh - var(--m-top) - 20px);
  }

  .mn-groups {
    gap: 0 clamp(16px, 2.1vw, 32px);
    padding: 14px 30px 4px;
  }

  .mn-group {
    min-height: 62px;
    font-size: clamp(32px, 3.6vw, 52px);
    line-height: 62px;
  }

  .mn-group::after {
    bottom: 4px;
  }

  /* the open name widens on Archivo's width axis: the light and the weight both move to it */
  .mn-group[aria-expanded="true"] {
    font-stretch: 84%;
    font-variation-settings: "wdth" 84;
  }

  .mn-sub {
    display: flex;
    align-items: flex-start;
    gap: clamp(24px, 3.6vw, 56px);
    padding: 6px 30px 10px;
  }

  .mn-sub .mn-all {
    flex: 0 0 196px;
    border-bottom: 0;
    box-shadow: inset 0 -1px var(--m-line);
  }

  .mn-col {
    flex: 0 1 400px;
    min-width: 0;
  }

  .mn-col ul {
    columns: 2;
    column-gap: 28px;
  }

  .mn-col li {
    break-inside: avoid;
  }

  .mn-col.plain {
    flex: 0 1 190px;
  }

  .mn-col.plain ul {
    columns: 1;
  }

  .mn-foot {
    padding: 2px 30px 8px;
  }

  .mn-direct {
    flex: 0 1 auto;
    justify-content: flex-start;
    gap: 0 30px;
  }

  .mn-direct a {
    font-size: 17px;
  }

  .mn-util {
    gap: 0 22px;
  }
}

@media (hover: hover) {
  .mn-group:hover {
    color: var(--m-ink);
  }

  .mn-sub a:hover,
  .mn-direct a:hover,
  .mn-util :is(a, button):hover {
    color: var(--m-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
  }
}

.nav-line-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-line-link::after {
  content: "";
  flex: 0 0 8px;
  height: 8px;
  margin-inline-end: 4px;
  border: solid currentColor;
  border-width: 1px 1px 0 0;
  transform: rotate(45deg);
}

.nav-search {
  --nav-search-top: max(8px, env(safe-area-inset-top));
  inset: var(--nav-search-top) 0 auto;
  width: min(740px, calc(100% - 20px));
  max-width: none;
  max-height: min(calc(100dvh - var(--nav-search-top) - 12px),
    calc(var(--nav-visual-height, 100dvh) - var(--nav-search-top) - 12px));
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 24px 70px -22px rgb(14 14 13 / .4);
}

.nav-search[open],
.nav-help[open] {
  animation: nav-sheet-in 190ms var(--ease) both;
}

.nav-search-head {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.nav-search-form {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: 53px;
  margin: 0;
  padding-left: 13px;
  border-radius: 9px;
  background: var(--field, #fff);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-search-form:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.nav-search-form > svg,
.nav-help-trigger svg {
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-search-form input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 8px;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: 600 20px/1.2 var(--body);
  appearance: none;
}

.nav-search-form input:focus-visible {
  outline: none;
}

.nav-search-form input::placeholder {
  color: var(--mute);
  opacity: 1;
}

.nav-search-form input::-webkit-search-cancel-button {
  appearance: none;
}

.nav-search-clear {
  flex: 0 0 44px;
  margin-right: 3px;
}

.nav-search-scroll {
  padding: 16px;
}

.nav-label {
  color: var(--mute);
  font: 500 12px/1.5 var(--mono);
}

.nav-results {
  display: grid;
  margin-top: 6px;
}

.nav-product {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.nav-product-photo {
  display: grid;
  place-items: center;
  width: 50px;
  height: 60px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--well);
}

.nav-product-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-product-details {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-block: 3px;
  overflow-wrap: anywhere;
}

.nav-product-details strong {
  font: 700 14px/1.2 var(--display);
  font-stretch: 90%;
}

.nav-product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.nav-product-meta > :first-child {
  font-weight: 650;
}

.nav-product-meta > :not(:first-child),
.nav-search-message {
  color: var(--mute);
}

.nav-search-message {
  margin-top: 7px;
}

.nav-search-browse {
  margin-top: 19px;
}

.nav-search-browse ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.nav-search-browse a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}

.nav-search-footer {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
}

.nav-search-footer a {
  min-height: 44px;
  padding-inline: 12px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  text-decoration: none;
  font-weight: 650;
}

.nav-search-footer a:focus-visible {
  outline-color: rgb(var(--led));
}

@media (min-width: 700px) {
  .nav-search {
    --nav-search-top: max(calc(var(--trust) + var(--hdr) + 12px), env(safe-area-inset-top));
  }

  .nav-search-head,
  .nav-search-footer {
    padding-inline: 20px;
  }

  .nav-search-scroll {
    padding: 16px 20px 20px;
  }

  .nav-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }
}


/* ---------- help: a small mark in the left gutter on wide screens (it never sits on a size button),
   a link in the menu everywhere else ---------- */
.nav-help-trigger {
  position: fixed;
  z-index: 35;
  left: calc((var(--gut) - 44px) / 2);
  bottom: max(10px, env(safe-area-inset-bottom));
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--t-ink);
  font: 500 14px/1 var(--mono);
}

.nav-help-trigger span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgb(var(--t-ground) / .86);
  box-shadow: inset 0 0 0 1px var(--t-line), 0 0 12px 2px rgb(var(--t-ground) / .6);
  transition: background-color .25s linear, color .25s linear;
}

@media (min-width: 1280px) {
  .nav-help-trigger:not([hidden]) {
    display: grid;
  }
}

body:has(dialog[open], [role="dialog"][aria-modal="true"]:not([aria-hidden="true"]):not([hidden]), #toast.on) .nav-help-trigger,
html:not(.js) .nav-help-trigger {
  display: none;
}

.nav-help {
  inset: auto auto max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  width: min(340px, calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  margin: 0;
  border-radius: 20px;
  box-shadow: 0 20px 60px -18px rgb(14 14 13 / .5);
}

.nav-help .nav-dialog-head h2 {
  font-size: 26px;
}

.nav-help-links {
  padding: 4px 18px 10px;
  overflow: auto;
  overscroll-behavior: contain;
}

.nav-help-links li + li {
  border-top: 1px solid var(--line);
}

.nav-help-links a {
  min-height: 50px;
  padding-inline: 4px;
  text-decoration: none;
  font-weight: 600;
}

@media (hover: hover) {
  .nav-search-browse a:hover {
    background: rgb(var(--led));
  }

  .nav-help-links a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .nav-help-trigger:hover span {
    background: var(--t-ink);
    color: rgb(var(--t-ground));
  }

  .nav-product:hover {
    background: var(--field, #fff);
  }

  .nav-search-footer a:hover {
    color: rgb(var(--led));
  }
}

/* search and help over the dark half: the same sheet in the night tokens (nav.js copies the page tone on open) */
.nav-search[data-tone="dark"],
.nav-help[data-tone="dark"] {
  --ground: #0b0b0a; --panel: #161614; --well: #20201d; --ink: #f1f2ea; --mute: #a5a49b; --line: rgb(241 242 234 / .15); --field: #0b0b0a;
  color-scheme: dark;
  box-shadow: 0 0 0 1px rgb(241 242 234 / .12), 0 24px 70px -18px #000;
}
.nav-dialog[data-tone="dark"] .icon-btn:hover { background: rgb(241 242 234 / .08); }
.nav-dialog[data-tone="dark"] :focus-visible { outline-color: rgb(var(--led)); }
@media (hover: hover) { .nav-dialog[data-tone="dark"] .nav-search-browse a:hover { color: #0e0e0d; } }

@keyframes nav-reveal {
  from { opacity: 0; }
}

@keyframes nav-out {
  to { opacity: 0; }
}

@keyframes nav-sheet-in {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes nav-tick {
  from { transform: scale(.55); }
  45% { transform: scale(1.12); }
}

@keyframes nav-pulse {
  from { box-shadow: 0 0 0 0 rgb(var(--t-pulse) / .85); }
  to { box-shadow: 0 0 0 14px rgb(var(--t-pulse) / 0); }
}

@keyframes mn-pour {
  from { clip-path: inset(0 calc(100% - var(--tab-w, 104px)) 100% 0 round var(--m-r)); }
  to { clip-path: inset(0 0 0 0 round var(--m-r)); }
}

@keyframes mn-sweep {
  from { transform: scaleX(0); }
}

@keyframes mn-x1 {
  from { transform: translateY(-3.5px); }
}

@keyframes mn-x2 {
  from { transform: translateY(3.5px) scaleX(.55); }
}

@media (prefers-reduced-motion: reduce) {
  .trust,
  #hdr,
  #hdr::after,
  #hdr *,
  #hdr *::before,
  #hdr *::after,
  .hdr-piece,
  .nav-dialog,
  .nav-dialog::before,
  .nav-dialog *,
  .nav-dialog *::before,
  .nav-dialog *::after,
  .nav-dialog::backdrop,
  .nav-help-trigger,
  .nav-help-trigger * {
    animation: none !important;
    transition: none !important;
  }
}
