/* Festive Manchester · the site header, on every page
   A thin fringe of pine along the top edge, the name on the left, and the
   menu as photo ornaments hanging from the pine at one even spacing. "More"
   opens a panel of further ornaments (site.js). The bar keeps the height the
   pages already allow for. Loaded after base.css; header.ui.php draws it
   from navigation.config.php. Sizes are in rem on desktop so the header
   grows with the rest of the design; tablet and phone tiers use px. */

:root {
  --hdr-h: 4.875rem;
  --hdr-gutter: var(--gutter);
  --hdr-logo-w: 12.25rem;
  /* Distance from one ornament to the next, centre to centre. */
  --hdr-pitch: 8rem;
  --hdr-ball: 2.25rem;
  --hdr-thread: 0.5rem;
  --hdr-label: 1rem;
  --hdr-foot: 0.3125rem;
  --hdr-garland-h: 3rem;
  --hdr-garland-top: -1.5rem;
  /* The tools at the right: the two icons and the gold button. */
  --hdr-icon: 2.5rem;
  --hdr-action-w: 9.375rem;
  --hdr-action-gap: 0.625rem;
}

/* Name on the left, the ornaments in the space between, tools on the right. */
.site-header__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  max-width: var(--container);
  height: var(--hdr-h);
  margin: 0 auto;
  padding: 0 var(--hdr-gutter);
}

/* ---------- Garland ---------- */

.site-header__garland {
  position: absolute;
  top: var(--hdr-garland-top);
  left: 0;
  right: 0;
  height: var(--hdr-garland-h);
  background: url("../img/header-garland-v1.webp") 50% 0 / auto 100% repeat-x;
  pointer-events: none;
}

/* ---------- Name ---------- */

.site-header__name {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  display: block;
  width: var(--hdr-logo-w);
  margin-top: 0.3125rem;
  color: inherit;
  text-decoration: none;
}

.site-header--festive .site-header__logo {
  width: 100%;
  height: auto;
}

/* "Festive" in italic with a star for the dot of its i; "Manchester" in
   light gold. The name is read at about 20 to 30px, so both words use the
   font's sturdier small-size cut ("opsz" 48) and a little more weight: left
   to itself the browser picks the thin display cut, which is hard to read
   this small. */
.brand-logo .brand-logo__festive,
.brand-logo .brand-logo__manchester {
  font-variation-settings: "opsz" 48;
}

.brand-logo .brand-logo__festive {
  font-size: 200px;
  font-style: italic;
  font-weight: 460;
  letter-spacing: -0.012em;
}

.brand-logo .brand-logo__manchester {
  fill: url("#brand-gold");
  font-size: 168px;
  font-weight: 510;
  letter-spacing: 0.004em;
}

.brand-logo .brand-logo__star {
  fill: var(--gold-2);
  transform-box: fill-box;
  transform-origin: center;
  animation: star-breathe 3.6s ease-in-out infinite;
}

/* ---------- Ornaments (the menu) ---------- */

.ornaments {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
}

.ornaments__list {
  display: flex;
}

/* Every ornament gets the same width, so the balls sit at one spacing
   however long their names are. */
.ornaments__list > li {
  display: flex;
  flex: 0 0 var(--hdr-pitch);
  justify-content: center;
  min-width: 0;
}

.ornament {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 var(--hdr-foot);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* Thread, cap and ball: it swings from where the thread meets the pine. */
.ornament__swing {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0;
}

/* One element draws the gold thread and, at its foot, the cap. */
.ornament__swing::before {
  content: "";
  width: 0.4375rem;
  height: calc(var(--hdr-thread) + 0.25rem);
  border-radius: 0.0625rem 0.0625rem 0.125rem 0.125rem;
  background:
    linear-gradient(180deg, #f6e2b3, #b98d3f) 50% 100% / 100% 0.25rem no-repeat,
    linear-gradient(180deg, rgba(217, 178, 106, 0.55), var(--gold)) 50% 0 / 0.0625rem 100% no-repeat;
}

.ornament__ball {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--hdr-ball);
  height: var(--hdr-ball);
  overflow: hidden;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 0.09375rem var(--gold), 0 0.375rem 0.875rem -0.375rem rgba(0, 0, 0, 0.7);
  transition: box-shadow 0.3s;
}

.ornament__ball img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

/* Cut-out trees stand whole inside the ball, on paper. */
.ornament__ball--cutout img {
  width: 74%;
  height: 84%;
  margin-top: 6%;
  object-fit: contain;
}

.ornament__ball--berry {
  background: radial-gradient(circle at 35% 28%, #8c2438, var(--berry) 62%, var(--berry-deep));
}

.ornament__ball--pine {
  background: radial-gradient(circle at 35% 28%, #24543d, var(--evergreen-2) 62%, var(--evergreen));
}

.ornament__ball svg {
  width: 54%;
  height: 54%;
  fill: var(--gold-2);
}

.ornament__ball .ornament__ink {
  fill: var(--paper);
}

/* A mark drawn on the paper part of an icon (the calendar's star). */
.ornament__ball .ornament__mark {
  fill: var(--berry);
}

/* Glass: a soft highlight top left and a shade along the lower rim. */
.ornament__ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 34%);
  box-shadow: inset 0 -0.25rem 0.4375rem -0.1875rem rgba(40, 22, 6, 0.5), inset 0 0 0 0.0625rem rgba(255, 244, 214, 0.35);
  pointer-events: none;
}

.ornament__label {
  margin-top: 0.25rem;
  font-size: var(--hdr-label);
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0.92;
  transition: color 0.25s, opacity 0.25s;
}

.ornament:hover .ornament__label,
.ornament:focus-visible .ornament__label,
.ornament[aria-current="true"] .ornament__label,
.ornament[aria-expanded="true"] .ornament__label {
  color: var(--gold-2);
  opacity: 1;
}

.ornament:hover .ornament__ball,
.ornament:focus-visible .ornament__ball,
.ornament[aria-current="true"] .ornament__ball,
.ornament[aria-expanded="true"] .ornament__ball {
  box-shadow: 0 0 0 0.125rem var(--gold-2), 0 0 1rem 0.0625rem rgba(241, 213, 155, 0.5), 0 0.375rem 0.875rem -0.375rem rgba(0, 0, 0, 0.7);
}

.ornament:hover .ornament__ball img {
  transform: scale(1.08);
}

/* More lights up while one of its own sections is on screen. */
.ornaments__more:has(.more-panel [aria-current="true"]) > .ornament .ornament__label {
  color: var(--gold-2);
  opacity: 1;
}

.ornaments__more:has(.more-panel [aria-current="true"]) > .ornament .ornament__ball {
  box-shadow: 0 0 0 0.125rem var(--gold-2), 0 0 1rem 0.0625rem rgba(241, 213, 155, 0.5), 0 0.375rem 0.875rem -0.375rem rgba(0, 0, 0, 0.7);
}

/* The one flourish: an ornament sways when it is pointed at. The script
   gives it is-swaying on the way in and takes it off when the swing has
   ended (not when the pointer leaves), so a sway never stops short.
   Without the script the pointer itself has to do. */
.ornament.is-swaying .ornament__swing,
html:not(.js) .ornament:hover .ornament__swing {
  animation: ornament-swing 1.9s cubic-bezier(0.36, 0, 0.3, 1);
}

.ornament:focus-visible {
  outline-offset: -0.125rem;
  border-radius: 0.5rem;
}

@keyframes ornament-swing {
  0% {
    transform: rotate(0deg);
  }

  18% {
    transform: rotate(9deg);
  }

  40% {
    transform: rotate(-6.5deg);
  }

  60% {
    transform: rotate(4deg);
  }

  78% {
    transform: rotate(-2deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* Where the header arrives with the page (a header marked data-arrive, as
   the homepage's opening will be), each ornament comes down whole, the ball
   and its name together, left to right; the ball sways once on its thread as
   it lands. Other pages show the header as it is. */
html.js .site-header--festive[data-arrive] .ornaments__list > li > .ornament {
  animation: ornament-arrive 1.5s cubic-bezier(0.3, 0.9, 0.3, 1) both;
  animation-delay: calc(0.45s + var(--i, 0) * 0.1s);
}

/* The sway as it lands is the very swing a pointer gives it: same keyframes,
   same length, same easing, starting as the ball reaches its place
   (0.55s into the drop). */
html.js .site-header--festive[data-arrive] .ornaments__list > li > .ornament .ornament__swing {
  animation: ornament-settle 1.9s cubic-bezier(0.36, 0, 0.3, 1) both;
  animation-delay: calc(1s + var(--i, 0) * 0.1s);
}

html.js .site-header--festive[data-arrive]:not(.is-in) .ornaments__list > li > .ornament {
  animation: none;
  opacity: 0;
}

/* The sway is added beside the settling, not in its place: swapping one for
   the other would play the arrival again each time the pointer leaves. */
html.js .site-header--festive[data-arrive] .ornaments__list > li > .ornament.is-swaying .ornament__swing {
  animation: ornament-settle 1.9s cubic-bezier(0.36, 0, 0.3, 1) both, ornament-swing 1.9s cubic-bezier(0.36, 0, 0.3, 1);
  animation-delay: calc(1s + var(--i, 0) * 0.1s), 0s;
}

.ornaments__list > li:nth-child(2) {
  --i: 1;
}

.ornaments__list > li:nth-child(3) {
  --i: 2;
}

.ornaments__list > li:nth-child(4) {
  --i: 3;
}

/* The whole ornament, ball and name, coming down. */
@keyframes ornament-arrive {
  0% {
    opacity: 0;
    transform: translate3d(0, -110%, 0);
  }

  12% {
    opacity: 1;
  }

  42%,
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* The ball alone, swaying on its thread as it lands: the same swing as
   ornament-swing, under its own name so the script can tell the landing
   from a pointer's sway. Keep the two alike. */
@keyframes ornament-settle {
  0% {
    transform: rotate(0deg);
  }

  18% {
    transform: rotate(9deg);
  }

  40% {
    transform: rotate(-6.5deg);
  }

  60% {
    transform: rotate(4deg);
  }

  78% {
    transform: rotate(-2deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* ---------- Sign in, basket and the action button ---------- */

/* The tools keep the width of both icons and the button even on a page that
   has no button (the tree chooser), so the menu sits in the same place on
   every page; what is there lines up at the right. */
.site-header__tools {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
  min-width: calc(2 * var(--hdr-icon) + 0.25rem + var(--hdr-action-gap) + var(--hdr-action-w));
  margin-top: 0.3125rem;
}

.site-header__icon {
  display: grid;
  place-items: center;
  width: var(--hdr-icon);
  height: var(--hdr-icon);
  border-radius: 50%;
  color: inherit;
  transition: color 0.2s, background-color 0.2s;
}

.site-header__icon svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header__icon:hover,
.site-header__icon[aria-current="page"] {
  color: var(--gold-2);
}

.site-header__icon:hover {
  background: rgba(247, 240, 228, 0.1);
}

/* ---------- The basket's count ----------
   A berry bauble with a gold cap, hung by its own thread from the pine along
   the top of the header like the ornaments in the menu, wearing the number
   of trees in the basket (the header's script puts it there, from a cookie
   the basket leaves). It hangs in front of the bag's corner; the bag fills
   with a little gold.
   At rest a warm halo breathes behind the glass, a star glints on it, and
   now and then it stirs on its thread. Pointed at, it sways (the script
   lets the sway finish, so nothing blinks when the pointer leaves) and a
   gold star rises out of the bag (below). When the number has
   gone up it is lowered from the pine, lands, swings wide and settles, the
   old number rolls away for the new one, and stars and snow fly off it
   while the bag gives a hop. Only transform and opacity ever move. */

.site-header__icon--basket {
  position: relative;
}

.site-header__icon--basket.has-count svg path:first-child {
  fill: rgba(241, 213, 155, 0.2);
}

.site-header__icon--basket svg {
  transition: transform 0.3s var(--ease);
}

.site-header__icon--basket.has-count:hover svg {
  transform: translateY(-0.0625rem) rotate(-4deg);
}

/* Where it hangs. --thread is the way up to the pine, set for each layout.
   The arrival plays here, apart from the swaying inside, so that pointing
   at the icon can never start it again. */
.basket-count {
  --thread: 1.375rem;
  position: absolute;
  top: -0.125rem;
  right: -0.3125rem;
  /* In front of the gold button beside it, which it may brush as it swings. */
  z-index: 1;
  width: 1.25rem;
  height: 1.625rem;
  pointer-events: none;
  animation: basket-in 0.5s var(--ease) 0.15s both;
}

/* Thread, cap and glass: all of it turns about where the thread meets the pine. */
.basket-count__swing {
  position: absolute;
  inset: 0;
  transform-origin: 50% calc(-1 * var(--thread));
  animation: basket-idle 9s ease-in-out 4s infinite;
}

.basket-count__swing::before {
  content: "";
  position: absolute;
  bottom: calc(100% - 0.1875rem);
  left: 50%;
  width: 1px;
  height: calc(var(--thread) + 0.1875rem);
  margin-left: -0.5px;
  background: linear-gradient(180deg, rgba(233, 201, 131, 0.5) 0%, #e9c983 100%);
}

.basket-count__cap {
  position: absolute;
  top: 0.125rem;
  left: 50%;
  width: 0.375rem;
  height: 0.28125rem;
  margin-left: -0.1875rem;
  border-radius: 0.0625rem 0.0625rem 0 0;
  background: linear-gradient(90deg, #b98a3e 0%, #fbeec9 45%, #c99a4a 100%);
}

/* The loop the thread is tied to. */
.basket-count__cap::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 0.1875rem;
  height: 0.125rem;
  margin-left: -0.09375rem;
  border: 1px solid #e9c983;
  border-bottom: 0;
  border-radius: 0.125rem 0.125rem 0 0;
  box-sizing: border-box;
}

.basket-count__ball {
  position: absolute;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  /* The shine is small and out at the shoulder, and the glass is at its
     deepest red behind the number, so nothing bright sits beside the digits. */
  background:
    radial-gradient(circle at 21% 19%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 12%),
    radial-gradient(circle at 26% 22%, #ee7889 0%, #c42b46 30%, #a01c36 52%, #7d1329 80%, #5f0f20 100%);
  box-shadow:
    0 0 0 1px rgba(241, 213, 155, 0.95),
    inset 0 -0.125rem 0.25rem rgba(60, 6, 18, 0.55),
    0 0.1875rem 0.5rem rgba(0, 0, 0, 0.55);
}

/* The warm halo behind the glass. */
.basket-count__ball::before {
  content: "";
  position: absolute;
  inset: -0.4375rem;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 110, 0.75) 0%, rgba(255, 150, 120, 0.3) 45%, rgba(255, 150, 120, 0) 70%);
  opacity: 0.45;
  animation: basket-halo 3.6s ease-in-out 1s infinite;
}

/* The number: one line showing. When it has gone up, the old number sits
   above the new one and both roll up a line. */
.basket-count__num {
  height: 0.75rem;
  overflow: hidden;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
  /* A dark edge all round the digits, so they stand off the glass. */
  text-shadow:
    0 0 0.125rem rgba(60, 6, 18, 0.95),
    0 0 0.25rem rgba(60, 6, 18, 0.7),
    0 1px 1px rgba(60, 6, 18, 0.9);
}

.basket-count.is-wide .basket-count__num {
  height: 0.625rem;
  font-size: 0.625rem;
}

.basket-count__roll,
.basket-count__roll b {
  display: block;
}

.basket-count__roll b {
  height: 1em;
  font-weight: inherit;
}

.basket-count__roll.is-rolling {
  transform: translateY(-50%);
}

/* A four-pointed star of light on the rim of the glass, clear of the number. */
.basket-count__glint {
  position: absolute;
  top: 0.1875rem;
  left: -0.3125rem;
  width: 0.5rem;
  height: 0.5rem;
  background: #fff8e2;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
  animation: basket-glint 5s ease-in-out 2.4s infinite;
}

/* Pointed at: the sway is added beside what is already playing, never in
   place of it, and the script takes the class away when the sway is done. */
.site-header__icon--basket.is-swaying .basket-count__swing {
  animation:
    basket-idle 9s ease-in-out 4s infinite,
    basket-sway 1.1s ease-in-out;
}

/* What flies off it: stars and snow, from the middle of the glass. */
.basket-count__sparks {
  position: absolute;
  bottom: 0.625rem;
  left: 50%;
  width: 0;
  height: 0;
}

.basket-count__sparks i {
  position: absolute;
  top: -0.21875rem;
  left: -0.21875rem;
  width: 0.4375rem;
  height: 0.4375rem;
  background: #ffe7b0;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
}

/* Every third one is a flake of snow. */
.basket-count__sparks i:nth-child(3n) {
  top: -0.09375rem;
  left: -0.09375rem;
  width: 0.1875rem;
  height: 0.1875rem;
  border-radius: 50%;
  background: #ffffff;
  clip-path: none;
}

.basket-count__sparks i:nth-child(1) { --dx: -1.25rem; --dy: -0.4375rem; --turn: 120deg; }
.basket-count__sparks i:nth-child(2) { --dx: -0.5625rem; --dy: -1.25rem; --turn: -90deg; }
.basket-count__sparks i:nth-child(3) { --dx: 0.3125rem; --dy: -1.375rem; --turn: 0deg; }
.basket-count__sparks i:nth-child(4) { --dx: 1.125rem; --dy: -0.875rem; --turn: 140deg; }
.basket-count__sparks i:nth-child(5) { --dx: 1.375rem; --dy: 0.1875rem; --turn: -120deg; }
.basket-count__sparks i:nth-child(6) { --dx: 0.75rem; --dy: 1.0625rem; --turn: 0deg; }
.basket-count__sparks i:nth-child(7) { --dx: -0.4375rem; --dy: 1.1875rem; --turn: 100deg; }
.basket-count__sparks i:nth-child(8) { --dx: -1.1875rem; --dy: 0.5rem; --turn: -140deg; }

/* ----- A number that has just gone up ----- */

.site-header__icon--basket.is-new .basket-count {
  animation: basket-lower 0.9s cubic-bezier(0.3, 1.35, 0.5, 1) 0.4s both;
}

.site-header__icon--basket.is-new .basket-count__swing {
  animation:
    basket-idle 9s ease-in-out 6s infinite,
    basket-settle 1.8s ease-in-out 1.15s;
}

.site-header__icon--basket.is-new.is-swaying .basket-count__swing {
  animation:
    basket-idle 9s ease-in-out 6s infinite,
    basket-settle 1.8s ease-in-out 1.15s,
    basket-sway 1.1s ease-in-out;
}

.site-header__icon--basket.is-new .basket-count__ball::before {
  animation:
    basket-flash 1s ease-out 1.15s,
    basket-halo 3.6s ease-in-out 2.15s infinite;
}

.site-header__icon--basket.is-new .basket-count__roll.is-rolling {
  animation: basket-roll 0.55s cubic-bezier(0.3, 1.3, 0.5, 1) 1.35s both;
}

.site-header__icon--basket.is-new svg {
  animation: basket-hop 0.6s var(--ease) 1.1s;
}

.site-header__icon--basket.is-new .basket-count__sparks i {
  animation: basket-spark 0.9s ease-out 1.2s both;
}

.site-header__icon--basket.is-new .basket-count__sparks i:nth-child(even) {
  animation-delay: 1.3s;
}

/* ----- The star that rises out of the bag -----
   Pointed at, a gold star rises out of the bag, twinkles there, and sinks
   back when the pointer goes; when the number has just gone up it rises on
   its own for a moment, as the bag hops. It lives in a window that ends at
   the bag's rim, so it is only ever seen above the rim, behind the handle. */

.basket-star {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1rem;
  /* Down to the rim: the bag is centred, and its rim is 8.6/24 of the way down it. */
  height: calc(50% - 0.142 * 1.5rem);
  margin-left: -0.5rem;
  overflow: hidden;
  pointer-events: none;
}

.basket-star svg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1rem;
  height: 1rem;
  overflow: visible;
  fill: none;
  stroke: none;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.basket-star__twinkle {
  transform-box: fill-box;
  transform-origin: center;
}

.site-header__icon--basket:hover .basket-star svg,
.site-header__icon--basket:focus-visible .basket-star svg {
  transform: translateY(0.0625rem);
}

.site-header__icon--basket:hover .basket-star__twinkle,
.site-header__icon--basket:focus-visible .basket-star__twinkle {
  animation: basket-star-twinkle 1.5s ease-in-out 0.45s infinite;
}

.site-header__icon--basket.is-new .basket-star svg {
  /* Held down during the wait, let go afterwards so a pointer can still raise it. */
  animation: basket-star-rise 2.6s cubic-bezier(0.3, 1.4, 0.5, 1) 1.15s backwards;
}

.site-header__icon--basket.is-new .basket-star__twinkle {
  animation: basket-star-twinkle 1.5s ease-in-out 1.6s 1;
}

@keyframes basket-star-rise {
  0%,
  100% {
    transform: translateY(100%);
  }

  18%,
  80% {
    transform: translateY(0.0625rem);
  }
}

@keyframes basket-star-twinkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(0.72) rotate(22deg);
  }
}

@media (max-width: 1023.98px) {
  .basket-star {
    height: calc(50% - 0.142 * 23px);
  }
}

@media (max-width: 599.98px) {
  .basket-star {
    height: calc(50% - 0.142 * 22px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .basket-star__twinkle {
    animation: none !important;
  }
}

/* The Basket link in the More panel, where the icons have no room. */
.more-panel__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.125rem;
  height: 1.125rem;
  margin-left: 0.375rem;
  padding: 0 0.25rem;
  border-radius: 62.4375rem;
  background: radial-gradient(circle at 34% 28%, #f08c9a 0%, #c9304a 32%, #8d1930 100%);
  box-shadow: 0 0 0 1px rgba(241, 213, 155, 0.9);
  color: #fffaf0;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.0625rem;
}

/* On a tablet or phone the icons sit close under the pine, so the thread is
   short and the bauble a touch smaller. */
@media (max-width: 1023.98px) {
  .basket-count {
    --thread: 6px;
    top: -4px;
    right: -3px;
    width: 18px;
    height: 23px;
  }

  .basket-count__ball {
    width: 18px;
    height: 18px;
  }

  .basket-count__num {
    height: 11px;
    font-size: 11px;
  }

  .basket-count__glint {
    top: 2px;
    left: -5px;
  }

  .basket-count.is-wide .basket-count__num {
    height: 9px;
    font-size: 9px;
  }
}

/* Where the icons are folded into the More panel altogether (short screens,
   below), the More ornament itself wears the number, so it is never out of
   sight. */
[data-more-toggle] .ornament__swing {
  position: relative;
}

.more-count {
  position: absolute;
  right: -7px;
  bottom: calc(var(--hdr-ball) - 11px);
  display: none;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 62.4375rem;
  background: radial-gradient(circle at 34% 28%, #f08c9a 0%, #c9304a 32%, #8d1930 100%);
  box-shadow: 0 0 0 1px rgba(241, 213, 155, 0.9), 0 2px 5px rgba(0, 0, 0, 0.5);
  color: #fffaf0;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

@media (min-width: 600px) and (max-width: 1023.98px) and (max-height: 820px) {
  .more-count {
    display: grid;
  }
}

@keyframes basket-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Lowered from the pine on its thread. */
@keyframes basket-lower {
  0% { opacity: 0; transform: translateY(-2.25rem); }
  25% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

/* Landed: a wide swing that dies away. */
@keyframes basket-settle {
  0%, 100% { transform: rotate(0); }
  14% { transform: rotate(13deg); }
  32% { transform: rotate(-10deg); }
  50% { transform: rotate(7deg); }
  68% { transform: rotate(-4deg); }
  84% { transform: rotate(2deg); }
}

@keyframes basket-sway {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(10deg); }
  45% { transform: rotate(-8deg); }
  68% { transform: rotate(5deg); }
  86% { transform: rotate(-2deg); }
}

/* Still for most of the time, then a small stir, as in a draught. */
@keyframes basket-idle {
  0%, 78%, 100% { transform: rotate(0); }
  84% { transform: rotate(4deg); }
  90% { transform: rotate(-3deg); }
  95% { transform: rotate(1.5deg); }
}

@keyframes basket-halo {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 0.85; transform: scale(1.15); }
}

@keyframes basket-flash {
  0% { opacity: 0.4; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1.9); }
  100% { opacity: 0.4; transform: scale(0.9); }
}

@keyframes basket-roll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@keyframes basket-hop {
  0%, 100% { transform: none; }
  30% { transform: translateY(-0.1875rem) rotate(-7deg); }
  60% { transform: translateY(0.0625rem) rotate(4deg); }
}

@keyframes basket-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.3) rotate(0); }
  15% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--turn)); }
}

@keyframes basket-glint {
  0%, 80%, 100% { opacity: 0; transform: scale(0.3) rotate(0); }
  88% { opacity: 1; transform: scale(1) rotate(45deg); }
  96% { opacity: 0; transform: scale(0.5) rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .basket-count,
  .basket-count__swing,
  .basket-count__ball::before,
  .basket-count__roll,
  .basket-count__glint,
  .basket-count__sparks i,
  .site-header__icon--basket svg {
    animation: none !important;
    transition: none;
  }
}

/* Wide enough for its longest label, so the icons beside it never shift
   when the label changes. */
.site-header__action {
  flex: none;
  min-width: var(--hdr-action-w);
  margin-left: var(--hdr-action-gap);
  font-size: 0.9375rem;
}

/* The label cross-fades when the section on screen changes. */
.site-header__action [data-header-cta-label] {
  transition: opacity 0.18s;
}

.site-header__action.is-swapping [data-header-cta-label] {
  opacity: 0;
}

/* ---------- More panel ---------- */

/* Sits behind the header's surface, so it unrolls from under the hem and the
   bulbs hang in front of its top edge. */
.more-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: -2;
  width: min(60rem, calc(100% - 2 * var(--hdr-gutter)));
  padding: 0 2rem 1.5rem;
  border: 0.0625rem solid rgba(217, 178, 106, 0.42);
  border-top: 0;
  border-radius: 0 0 1.75rem 1.75rem;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(36, 84, 61, 0.55), rgba(15, 36, 27, 0) 70%),
    linear-gradient(180deg, #0c1d15, #0f241b 55%, #0b1a13);
  box-shadow: 0 2.5rem 4.5rem -1.5rem rgba(0, 0, 0, 0.8), inset 0 0 0 0.375rem #0c1d15, inset 0 0 0 0.4375rem rgba(217, 178, 106, 0.2);
  color: var(--cream-text);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-50%, -1.25rem, 0);
  transition: transform 0.45s var(--ease), opacity 0.28s ease-out, visibility 0s 0.45s;
}

/* Opened by the script, or without it by following the link to the panel's
   own address. */
.site-header.is-more-open .more-panel,
.more-panel:target {
  opacity: 1;
  visibility: visible;
  transform: translate3d(-50%, 0, 0);
  transition-delay: 0s;
}

/* While the panel is open the header is solid, so nothing shows through it. */
.site-header.is-more-open .site-header__surface {
  background: rgba(10, 24, 18, 0.96);
}

/* The offer tag would hang across the open panel, so it steps aside. */
.offer-tag {
  transition: opacity 0.25s, visibility 0s;
}

.site-header.is-more-open .offer-tag {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0s 0.25s;
}

.more-scrim {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -3;
  width: 100%;
  height: 130vh;
  background: rgba(5, 10, 8, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}

.site-header.is-more-open .more-scrim {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.more-panel__list {
  display: flex;
  justify-content: center;
}

.more-panel__list > li {
  display: flex;
  flex: 1 1 0;
  justify-content: center;
  --hdr-ball: 5.25rem;
  --hdr-thread: 2.75rem;
  --hdr-label: 1.25rem;
  --hdr-foot: 0;
}

/* Longer threads towards the middle, so the row hangs in a gentle swag.
   Counted from both ends, so five or four ornaments hang as evenly as six. */
.more-panel__list > li:nth-child(2),
.more-panel__list > li:nth-last-child(2) {
  --hdr-thread: 3.75rem;
}

.more-panel__list > li:nth-child(3),
.more-panel__list > li:nth-last-child(3) {
  --hdr-thread: 4.5rem;
}

.more-panel__list .ornament {
  justify-content: flex-start;
}

.more-panel__list .ornament__swing::before {
  width: 0.75rem;
  height: calc(var(--hdr-thread) + 0.3125rem);
  background:
    linear-gradient(180deg, #f6e2b3, #b98d3f) 50% 100% / 100% 0.3125rem no-repeat,
    linear-gradient(180deg, rgba(217, 178, 106, 0.55), var(--gold)) 50% 0 / 0.0625rem 100% no-repeat;
}

.more-panel__list .ornament__ball {
  box-shadow: 0 0 0 0.125rem var(--gold), 0 0.875rem 1.75rem -0.625rem rgba(0, 0, 0, 0.8);
}

.more-panel__list .ornament__label {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  opacity: 1;
}

.ornament__price {
  margin-top: 0.3125rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Each ornament comes down whole as the panel opens, as in the bar. */
.site-header.is-more-open .more-panel__list .ornament {
  animation: ornament-arrive 1.5s cubic-bezier(0.3, 0.9, 0.3, 1) both;
  animation-delay: calc(0.05s + var(--n, 0) * 0.07s);
}

/* And sways as it lands at the pace of a pointer's sway, as in the bar. */
.site-header.is-more-open .more-panel__list .ornament__swing {
  animation: ornament-settle 1.9s cubic-bezier(0.36, 0, 0.3, 1) both;
  animation-delay: calc(0.6s + var(--n, 0) * 0.07s);
}

.site-header.is-more-open .more-panel__list .ornament.is-swaying .ornament__swing {
  animation: ornament-settle 1.9s cubic-bezier(0.36, 0, 0.3, 1) both, ornament-swing 1.9s cubic-bezier(0.36, 0, 0.3, 1);
  animation-delay: calc(0.6s + var(--n, 0) * 0.07s), 0s;
}

.more-panel__list > li:nth-child(2) { --n: 1; }
.more-panel__list > li:nth-child(3) { --n: 2; }
.more-panel__list > li:nth-child(4) { --n: 3; }
.more-panel__list > li:nth-child(5) { --n: 4; }
.more-panel__list > li:nth-child(6) { --n: 5; }

.more-panel__foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--line-light);
}

.more-panel__link {
  color: var(--cream-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.more-panel__link:hover {
  color: var(--gold-2);
}

/* Shown only where the bar itself has no room for them. */
.more-panel__link--tool {
  display: none;
}

/* ---------- Pages without menus ----------
   Where a page draws no menus ($page['nav'] is false: the front page before
   launch, the admin panel), the name stands alone in the middle. */

.site-header--plain .site-header__bar {
  grid-template-columns: minmax(0, 1fr);
}

.site-header--plain .site-header__name {
  justify-self: center;
}

/* ---------- Narrower desktops ---------- */

@media (min-width: 1024px) and (max-width: 1279.98px) {
  :root {
    --hdr-gutter: 40px;
    --hdr-logo-w: 11.5rem;
    --hdr-pitch: 7.375rem;
    --hdr-icon: 2.25rem;
    --hdr-action-w: 8.5rem;
    --hdr-action-gap: 0.375rem;
  }

  .site-header__action {
    font-size: 0.875rem;
  }

  .more-panel {
    padding: 0 1.25rem 1.5rem;
  }

  .more-panel__list > li {
    --hdr-ball: 4.75rem;
    --hdr-label: 1.125rem;
  }
}

/* Shorter desktop windows: the panel's ornaments are a size smaller. */
@media (min-width: 1024px) and (max-height: 760px) {
  .more-panel__list > li {
    --hdr-ball: 4.5rem;
    --hdr-thread: 2.25rem;
    --hdr-label: 1.125rem;
  }

  .more-panel__list > li:nth-child(2),
  .more-panel__list > li:nth-last-child(2) {
    --hdr-thread: 3rem;
  }

  .more-panel__list > li:nth-child(3),
  .more-panel__list > li:nth-last-child(3) {
    --hdr-thread: 3.5rem;
  }

  .more-panel__foot {
    margin-top: 1.125rem;
    padding-top: 0.875rem;
  }
}

/* ---------- Tablets: name row, then the ornaments on a gold string ---------- */

@media (max-width: 1023.98px) {
  :root {
    --header-h: 116px;
    --hdr-h: auto;
    --hdr-logo-w: 178px;
    --hdr-pitch: 150px;
    --hdr-ball: 30px;
    --hdr-thread: 4px;
    --hdr-label: clamp(14px, 2.35vw, 16px);
    --hdr-foot: 3px;
    --hdr-garland-h: 44px;
    --hdr-garland-top: -26px;
  }

  .site-header__bar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 54px 62px;
  }

  .site-header__name {
    margin-top: 4px;
  }

  .site-header__tools {
    grid-column: 2;
    min-width: 0;
    margin-top: 5px;
  }

  /* Without menus there is one row, at the old header's height. */
  .site-header--plain .site-header__bar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 60px;
  }

  .site-header--plain .site-header__name {
    width: 178px;
  }

  .site-header__icon {
    width: 40px;
    height: 40px;
  }

  .site-header__icon svg {
    width: 23px;
    height: 23px;
  }

  .site-header__action {
    min-width: 138px;
    min-height: 40px;
    margin-left: 8px;
    padding: 0 20px;
    font-size: 14px;
  }

  /* Up to 150px apart, closer where the screen is narrower. */
  .ornaments {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: center;
    /* The string the ornaments hang from. */
    background: linear-gradient(90deg, rgba(217, 178, 106, 0), rgba(217, 178, 106, 0.5) 14%, rgba(217, 178, 106, 0.5) 86%, rgba(217, 178, 106, 0)) 50% 0 / 100% 1px no-repeat;
  }

  .ornaments__list {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
  }

  .ornaments__list > li {
    flex: 0 1 var(--hdr-pitch);
  }

  .ornament__swing::before {
    width: 7px;
    height: calc(var(--hdr-thread) + 4px);
    background:
      linear-gradient(180deg, #f6e2b3, #b98d3f) 50% 100% / 100% 4px no-repeat,
      linear-gradient(180deg, rgba(217, 178, 106, 0.55), var(--gold)) 50% 0 / 1px 100% no-repeat;
  }

  .ornament__label {
    margin-top: 3px;
  }

  /* Three across, two rows. Each ornament takes two of six columns, so a
     last row of two (five ornaments) or of one (four) hangs in the middle. */
  .more-panel {
    width: min(620px, calc(100% - 2 * var(--hdr-gutter)));
    padding: 0 20px 20px;
    border-radius: 0 0 22px 22px;
  }

  .more-panel__list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 0;
  }

  .more-panel__list > li {
    grid-column: span 2;
  }

  .more-panel__list > li:nth-child(4):nth-last-child(2) {
    grid-column: 2 / span 2;
  }

  .more-panel__list > li:nth-child(4):last-child {
    grid-column: 3 / span 2;
  }

  .more-panel__list > li,
  .more-panel__list > li:nth-child(n) {
    --hdr-ball: 72px;
    --hdr-thread: 34px;
    --hdr-label: 18px;
  }

  /* Second row: short threads, as if hung from the row above. */
  .more-panel__list > li:nth-child(n + 4) {
    --hdr-thread: 12px;
  }

  .more-panel__list .ornament__swing::before {
    width: 10px;
    height: calc(var(--hdr-thread) + 4px);
    background:
      linear-gradient(180deg, #f6e2b3, #b98d3f) 50% 100% / 100% 4px no-repeat,
      linear-gradient(180deg, rgba(217, 178, 106, 0.55), var(--gold)) 50% 0 / 1px 100% no-repeat;
  }

  .more-panel__list .ornament__label {
    margin-top: 10px;
  }

  .ornament__price {
    font-size: 11px;
  }

  .more-panel__foot {
    gap: 24px;
    margin-top: 20px;
    padding-top: 15px;
  }

  .more-panel__link {
    font-size: 15px;
  }
}

/* Shorter screens (landscape tablets, sideways phones): one line again, with
   sign in and basket moved into the More panel. The names shrink with the
   screen so they never touch. */
@media (min-width: 600px) and (max-width: 1023.98px) and (max-height: 820px) {
  :root {
    --header-h: 56px;
    --hdr-logo-w: 120px;
    --hdr-pitch: 104px;
    --hdr-ball: 26px;
    --hdr-thread: 3px;
    --hdr-label: clamp(11px, 3.73vw - 12px, 14px);
    --hdr-foot: 3px;
    --hdr-garland-h: 40px;
    --hdr-garland-top: -26px;
  }

  .site-header__bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 56px;
    column-gap: 8px;
  }

  .site-header--plain .site-header__bar {
    grid-template-rows: 56px;
  }

  .site-header--plain .site-header__name {
    width: 140px;
  }

  .site-header__tools {
    grid-column: 3;
    min-width: 114px;
  }

  .site-header__icon {
    display: none;
  }

  .site-header__action {
    min-width: 114px;
    min-height: 36px;
    margin-left: 0;
    padding: 0 14px;
    font-size: 12.5px;
  }

  .ornaments {
    grid-column: 2;
    grid-row: 1;
    background: none;
  }

  .ornament__label {
    margin-top: 2px;
  }

  .more-panel__link--tool {
    display: inline;
  }

  /* Six across, so the panel stays low on a short screen. */
  .more-panel {
    width: calc(100% - 2 * var(--hdr-gutter));
    max-height: calc(100vh - 64px);
    max-height: calc(100svh - 64px);
    overflow-y: auto;
  }

  .more-panel__list {
    display: flex;
  }

  .more-panel__list > li,
  .more-panel__list > li:nth-child(n) {
    --hdr-ball: clamp(48px, 8vw, 60px);
    --hdr-thread: 26px;
    --hdr-label: clamp(12.5px, 2.1vw, 16px);
  }

  .more-panel__list > li:nth-child(2),
  .more-panel__list > li:nth-last-child(2) {
    --hdr-thread: 34px;
  }

  .more-panel__list > li:nth-child(3),
  .more-panel__list > li:nth-last-child(3) {
    --hdr-thread: 40px;
  }

  .ornament__price {
    font-size: clamp(8.5px, 1.4vw, 10.5px);
    letter-spacing: 0.1em;
  }

  .more-panel__foot {
    margin-top: 14px;
    padding-top: 12px;
  }
}

@media (min-width: 740px) and (max-width: 1023.98px) and (max-height: 820px) {
  :root {
    --hdr-logo-w: 136px;
  }
}

/* ---------- Phones ---------- */

@media (max-width: 599.98px) {
  :root {
    --hdr-logo-w: clamp(120px, 35vw, 140px);
    --hdr-ball: 27px;
    --hdr-thread: 3px;
    --hdr-label: clamp(11px, 3.47vw, 13.5px);
    --hdr-foot: 4px;
    --hdr-garland-h: 40px;
    --hdr-garland-top: -25px;
  }

  .site-header__bar {
    grid-template-rows: 46px 56px;
  }

  .site-header--plain .site-header__bar {
    grid-template-rows: 54px;
  }

  .site-header--plain .site-header__name {
    width: 150px;
  }

  .site-header__tools {
    gap: 0;
  }

  .site-header__icon {
    width: 34px;
    height: 34px;
  }

  .site-header__icon svg {
    width: 22px;
    height: 22px;
  }

  .site-header__action {
    min-width: 116px;
    min-height: 34px;
    margin-left: 4px;
    padding: 0 13px;
    font-size: 13px;
    line-height: 1;
  }

  /* Edge to edge, in four equal parts: the widest spacing the screen allows,
     which is what lets the names be this size. */
  .ornaments {
    margin: 0 calc(-1 * var(--hdr-gutter));
  }

  .ornaments__list > li {
    flex: 1 1 0;
  }

  .ornament__label {
    margin-top: 2px;
  }

  .more-panel {
    left: 0;
    width: 100%;
    max-height: calc(100vh - 114px);
    max-height: calc(100svh - 114px);
    padding: 0 14px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 0;
    border-left: 0;
    border-radius: 0 0 20px 20px;
    transform: translate3d(0, -20px, 0);
  }

  .site-header.is-more-open .more-panel,
  .more-panel:target {
    transform: none;
  }

  .more-panel__list {
    gap: 16px 0;
  }

  .more-panel__list > li,
  .more-panel__list > li:nth-child(n) {
    --hdr-ball: 64px;
    --hdr-thread: 30px;
    --hdr-label: 16px;
  }

  .more-panel__list > li:nth-child(n + 4) {
    --hdr-thread: 12px;
  }

  .more-panel__list .ornament__label {
    margin-top: 8px;
  }

  .ornament__price {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .more-panel__foot {
    margin-top: 18px;
    padding-top: 14px;
  }
}

/* 320px phones: no room for sign in beside the button, so it joins the
   More panel. */
@media (max-width: 359.98px) {
  :root {
    --hdr-gutter: 14px;
  }

  .site-header__tools:has(.site-header__action) .site-header__icon--account {
    display: none;
  }

  .more-panel__link--tool[data-tool="account"] {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header--festive .ornament,
  .site-header--festive .ornament__swing,
  .site-header--festive .brand-logo__star {
    animation: none !important;
    opacity: 1 !important;
  }

  .more-panel,
  .more-scrim {
    transition-duration: 0.01s;
  }
}
