/*
  The TentCraft preloader: a MONARCHTENT that stands in its transit bag, drops the bag, pops up, locks, and folds
  back into the bag, on a 2.4 s loop, while an app loads its data. Behaviour is in preloader.js.
  It covers only the app's content area (preloader.js sets its position), so the sidebar and header stay visible and on top.

  A file, not injected by the script, because the sites' content security policy (style-src 'self') blocks styles added by a
  script. The SVG (in preloader.js) has no style attributes: every colour and every movement is here. The movement is
  transforms and opacity only, so it runs on the compositor in every current browser, Safari included.

  Every colour comes from the site's theme tokens (--background, --primary, --brass, --muted-foreground), so the tent follows
  the site's theme and its light or dark mode. A site can override any of them for the preloader alone:
  --tc-pl-bg, --tc-pl-ink, --tc-pl-accent, --tc-pl-label, and --tc-pl-lock for the lock pins and the bag's pocket.
  Shades are mixed from those with color-mix(), so the tent needs no colour of its own.

  Drawn and animated by maintenance/preloader.mjs (npm run preloader): change the drawing or the timing there and run it again rather than editing numbers here.
*/
#tc-preloader {
  --pl-bg: var(--tc-pl-bg, var(--background, #ffffff));
  --pl-ink: var(--tc-pl-ink, var(--primary, #002e46));
  --pl-accent: var(--tc-pl-accent, var(--brass, #f15b43));
  --pl-label: var(--tc-pl-label, var(--muted-foreground, #4b5b64));
  --pl-lock: var(--tc-pl-lock, #f57e25);
  --pl-loop: 2.4s;

  /* Where it sits is set by preloader.js over the app's content area; this is only the starting point. Below menus and dialogs (z-50). */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--pl-bg);
  /* Never in the way: clicks and taps go to the page underneath, so a fast visitor or a browser test is not blocked while it fades. */
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms ease, visibility 0s;
}
#tc-preloader.tc-pl-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 0s 300ms;
}
#tc-preloader svg {
  width: min(170px, 42vw);
  height: auto;
  overflow: visible;
}
#tc-preloader .tc-pl-label {
  font: 500 14px/1 var(--font-sans, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  letter-spacing: 0.04em;
  color: var(--pl-label);
}

/* The drawing. Lines keep their width however a part is squeezed (vector-effect), so the frame never smears. */
#tc-preloader .tc-pl-tent g { transform-box: view-box; transform-origin: 0 0; }
#tc-preloader .tc-pl-line { fill: none; stroke: var(--pl-ink); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#tc-preloader .tc-pl-tube.tc-pl-front { stroke-width: 4.5; }
#tc-preloader .tc-pl-tube.tc-pl-side { stroke-width: 4; }
#tc-preloader .tc-pl-tube.tc-pl-back { stroke-width: 3; stroke: color-mix(in srgb, var(--pl-ink) 55%, var(--pl-bg)); }
#tc-preloader .tc-pl-tube-in { stroke-width: 2.6; stroke: color-mix(in srgb, var(--pl-ink) 70%, var(--pl-bg)); }
#tc-preloader .tc-pl-tube-in.tc-pl-back { stroke-width: 2; stroke: color-mix(in srgb, var(--pl-ink) 45%, var(--pl-bg)); }
#tc-preloader .tc-pl-truss { stroke-width: 2.2; }
#tc-preloader .tc-pl-ridge { stroke-width: 1.6; stroke: color-mix(in srgb, var(--pl-accent) 70%, var(--pl-ink)); }
#tc-preloader .tc-pl-pole { stroke-width: 2.2; }
#tc-preloader .tc-pl-foot,
#tc-preloader .tc-pl-slider,
#tc-preloader .tc-pl-cap { fill: var(--pl-ink); }
#tc-preloader .tc-pl-pin { fill: var(--pl-bg); stroke: var(--pl-ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
#tc-preloader .tc-pl-dot { fill: var(--pl-lock); }
#tc-preloader .tc-pl-roof-r,
#tc-preloader .tc-pl-val-r { fill: var(--pl-accent); }
#tc-preloader .tc-pl-roof-l,
#tc-preloader .tc-pl-val-l { fill: color-mix(in srgb, var(--pl-accent) 84%, #ffffff); }
#tc-preloader .tc-pl-roof-back { fill: color-mix(in srgb, var(--pl-accent) 68%, var(--pl-ink)); }
#tc-preloader .tc-pl-hem { fill: color-mix(in srgb, var(--pl-accent) 70%, var(--pl-ink)); }
#tc-preloader .tc-pl-pleats { fill: none; stroke: color-mix(in srgb, var(--pl-accent) 70%, var(--pl-ink)); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
#tc-preloader .tc-pl-flag-top { stop-color: var(--pl-lock); }
#tc-preloader .tc-pl-flag-bottom { stop-color: var(--pl-accent); }
#tc-preloader .tc-pl-bag-lit { fill: color-mix(in srgb, var(--pl-ink) 80%, #ffffff); }
#tc-preloader .tc-pl-bag-side { fill: var(--pl-ink); }
#tc-preloader .tc-pl-quilt-line { fill: none; stroke: color-mix(in srgb, var(--pl-ink) 55%, #ffffff); stroke-width: 2; }
#tc-preloader .tc-pl-bag-zip { fill: color-mix(in srgb, var(--pl-ink) 70%, #000000); }
#tc-preloader .tc-pl-bag-cap { fill: color-mix(in srgb, var(--pl-ink) 30%, #ffffff); }
#tc-preloader .tc-pl-bag-cap-side { fill: color-mix(in srgb, var(--pl-ink) 45%, #ffffff); }
#tc-preloader .tc-pl-bag-top { fill: color-mix(in srgb, var(--pl-ink) 18%, #ffffff); }
#tc-preloader .tc-pl-bag-strap { fill: color-mix(in srgb, var(--pl-ink) 40%, #ffffff); }
#tc-preloader .tc-pl-bag-pocket { fill: color-mix(in srgb, var(--pl-ink) 40%, #ffffff); stroke: var(--pl-lock); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
#tc-preloader .tc-pl-wheel { fill: color-mix(in srgb, var(--pl-ink) 70%, #000000); stroke: color-mix(in srgb, var(--pl-ink) 40%, #ffffff); stroke-width: 3; vector-effect: non-scaling-stroke; }
#tc-preloader .tc-pl-hub { fill: color-mix(in srgb, var(--pl-ink) 30%, #ffffff); }

/* The bag's resting state is gone, so with motion off the tent stands open (see the end of this file). */
#tc-preloader .tc-pl-bag { opacity: 0; }

/* The motion: one 2.4 s loop. Each group follows one control (open, peak, lock, legs or bag); nested groups combine them. */
#tc-preloader .tc-pl-move-leg0 { animation: tc-pl-leg0 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-slide-a-0 { animation: tc-pl-slide0 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-leg1 { animation: tc-pl-leg1 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-slide-a-1 { animation: tc-pl-slide1 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-leg2 { animation: tc-pl-leg2 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-slide-a-2 { animation: tc-pl-slide2 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-leg3 { animation: tc-pl-leg3 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-slide-a-3 { animation: tc-pl-slide3 var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-val-l { animation: tc-pl-move-val-l var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-truss-l { animation: tc-pl-move-truss-l var(--pl-loop) infinite; }
#tc-preloader .tc-pl-fold-val-l { animation: tc-pl-fold-val-l var(--pl-loop) infinite; }
#tc-preloader .tc-pl-fold-truss-l { animation: tc-pl-fold-truss-l var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-val-r { animation: tc-pl-move-val-r var(--pl-loop) infinite; }
#tc-preloader .tc-pl-move-truss-r { animation: tc-pl-move-truss-r var(--pl-loop) infinite; }
#tc-preloader .tc-pl-fold-val-r { animation: tc-pl-fold-val-r var(--pl-loop) infinite; }
#tc-preloader .tc-pl-fold-truss-r { animation: tc-pl-fold-truss-r var(--pl-loop) infinite; }
#tc-preloader .tc-pl-pleats { animation: tc-pl-pleats var(--pl-loop) infinite; }
#tc-preloader .tc-pl-roof-w { animation: tc-pl-roof-w var(--pl-loop) infinite; }
#tc-preloader .tc-pl-roof-h { animation: tc-pl-roof-h var(--pl-loop) infinite; }
#tc-preloader .tc-pl-peak { animation: tc-pl-peak var(--pl-loop) infinite; }
#tc-preloader .tc-pl-flag { animation: tc-pl-flag var(--pl-loop) infinite; }
#tc-preloader .tc-pl-lock { animation: tc-pl-lock var(--pl-loop) infinite; }
#tc-preloader .tc-pl-rise { animation: tc-pl-rise var(--pl-loop) infinite; }
#tc-preloader .tc-pl-extend { animation: tc-pl-extend var(--pl-loop) infinite; }
#tc-preloader .tc-pl-bag { animation: tc-pl-bag var(--pl-loop) infinite; }
#tc-preloader .tc-pl-all { animation: tc-pl-all var(--pl-loop) infinite; }
#tc-preloader .tc-pl-wave { animation: tc-pl-wave 0.5s ease-in-out infinite alternate; }

@keyframes tc-pl-leg0 {
  0% { transform: translate(43.19px, -48.36px); }
  17.5% { transform: translate(43.19px, -48.36px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(43.19px, -48.36px); }
  100% { transform: translate(43.19px, -48.36px); }
}
@keyframes tc-pl-slide0 {
  0% { transform: translate(0px, 101.09px); }
  17.5% { transform: translate(0px, 101.09px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(0px, 101.09px); }
  100% { transform: translate(0px, 101.09px); }
}
@keyframes tc-pl-leg1 {
  0% { transform: translate(-161.19px, -12.96px); }
  17.5% { transform: translate(-161.19px, -12.96px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(-161.19px, -12.96px); }
  100% { transform: translate(-161.19px, -12.96px); }
}
@keyframes tc-pl-slide1 {
  0% { transform: translate(0px, 101.09px); }
  17.5% { transform: translate(0px, 101.09px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(0px, 101.09px); }
  100% { transform: translate(0px, 101.09px); }
}
@keyframes tc-pl-leg2 {
  0% { transform: translate(-43.19px, 48.36px); }
  17.5% { transform: translate(-43.19px, 48.36px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(-43.19px, 48.36px); }
  100% { transform: translate(-43.19px, 48.36px); }
}
@keyframes tc-pl-slide2 {
  0% { transform: translate(0px, 101.09px); }
  17.5% { transform: translate(0px, 101.09px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(0px, 101.09px); }
  100% { transform: translate(0px, 101.09px); }
}
@keyframes tc-pl-leg3 {
  0% { transform: translate(161.19px, 12.96px); }
  17.5% { transform: translate(161.19px, 12.96px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(161.19px, 12.96px); }
  100% { transform: translate(161.19px, 12.96px); }
}
@keyframes tc-pl-slide3 {
  0% { transform: translate(0px, 101.09px); }
  17.5% { transform: translate(0px, 101.09px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(0px, 101.09px); }
  100% { transform: translate(0px, 101.09px); }
}
@keyframes tc-pl-move-val-l {
  0% { transform: translate(102.19px, -17.7px); }
  17.5% { transform: translate(102.19px, -17.7px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(102.19px, -17.7px); }
  100% { transform: translate(102.19px, -17.7px); }
}
@keyframes tc-pl-move-truss-l {
  0% { transform: translate(102.19px, -17.7px); }
  17.5% { transform: translate(102.19px, -17.7px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(102.19px, -17.7px); }
  100% { transform: translate(102.19px, -17.7px); }
}
@keyframes tc-pl-fold-val-l {
  0% { transform: scale(0.21, 4.38); }
  17.5% { transform: scale(0.21, 4.38); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: scale(1, 1); }
  73.75% { transform: scale(1, 1); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: scale(0.21, 4.38); }
  100% { transform: scale(0.21, 4.38); }
}
@keyframes tc-pl-fold-truss-l {
  0% { transform: scale(0.21, 2.82); }
  17.5% { transform: scale(0.21, 2.82); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: scale(1, 1); }
  73.75% { transform: scale(1, 1); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: scale(0.21, 2.82); }
  100% { transform: scale(0.21, 2.82); }
}
@keyframes tc-pl-move-val-r {
  0% { transform: translate(-59px, -30.66px); }
  17.5% { transform: translate(-59px, -30.66px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(-59px, -30.66px); }
  100% { transform: translate(-59px, -30.66px); }
}
@keyframes tc-pl-move-truss-r {
  0% { transform: translate(-59px, -30.66px); }
  17.5% { transform: translate(-59px, -30.66px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: translate(0px, 0px); }
  73.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: translate(-59px, -30.66px); }
  100% { transform: translate(-59px, -30.66px); }
}
@keyframes tc-pl-fold-val-r {
  0% { transform: scale(0.21, 4.38); }
  17.5% { transform: scale(0.21, 4.38); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: scale(1, 1); }
  73.75% { transform: scale(1, 1); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: scale(0.21, 4.38); }
  100% { transform: scale(0.21, 4.38); }
}
@keyframes tc-pl-fold-truss-r {
  0% { transform: scale(0.21, 2.82); }
  17.5% { transform: scale(0.21, 2.82); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: scale(1, 1); }
  73.75% { transform: scale(1, 1); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: scale(0.21, 2.82); }
  100% { transform: scale(0.21, 2.82); }
}
@keyframes tc-pl-pleats {
  0% { opacity: 0.85; }
  17.5% { opacity: 0.85; animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { opacity: 0; }
  73.75% { opacity: 0; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { opacity: 0.85; }
  100% { opacity: 0.85; }
}
@keyframes tc-pl-roof-w {
  0% { transform: scaleX(0.21); }
  17.5% { transform: scaleX(0.21); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  32.5% { transform: scaleX(1); }
  73.75% { transform: scaleX(1); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  85% { transform: scaleX(0.21); }
  100% { transform: scaleX(0.21); }
}
@keyframes tc-pl-roof-h {
  0% { transform: scaleY(0.28); }
  27.5% { transform: scaleY(0.28); animation-timing-function: cubic-bezier(0.34, 1.8, 0.64, 1); }
  36.25% { transform: scaleY(1); }
  68.75% { transform: scaleY(1); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  75% { transform: scaleY(0.28); }
  100% { transform: scaleY(0.28); }
}
@keyframes tc-pl-peak {
  0% { transform: translate(0px, 94px); }
  27.5% { transform: translate(0px, 94px); animation-timing-function: cubic-bezier(0.34, 1.8, 0.64, 1); }
  36.25% { transform: translate(0px, 0px); }
  68.75% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  75% { transform: translate(0px, 94px); }
  100% { transform: translate(0px, 94px); }
}
@keyframes tc-pl-flag {
  0% { transform: scaleY(0); opacity: 0; }
  27.5% { transform: scaleY(0); opacity: 0; animation-timing-function: cubic-bezier(0.34, 1.8, 0.64, 1); }
  36.25% { transform: scaleY(1); opacity: 1; }
  68.75% { transform: scaleY(1); opacity: 1; animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); }
  75% { transform: scaleY(0); opacity: 0; }
  100% { transform: scaleY(0); opacity: 0; }
}
@keyframes tc-pl-lock {
  0% { transform: scale(0); }
  32.5% { transform: scale(0); animation-timing-function: cubic-bezier(0.34, 1.8, 0.64, 1); }
  37.5% { transform: scale(1); }
  67.5% { transform: scale(1); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  70% { transform: scale(0); }
  100% { transform: scale(0); }
}
@keyframes tc-pl-rise {
  0% { transform: translate(0px, 60px); }
  37.5% { transform: translate(0px, 60px); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  48.75% { transform: translate(0px, 0px); }
  65% { transform: translate(0px, 0px); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  72.5% { transform: translate(0px, 60px); }
  100% { transform: translate(0px, 60px); }
}
@keyframes tc-pl-extend {
  0% { transform: scaleY(0.5); }
  37.5% { transform: scaleY(0.5); animation-timing-function: cubic-bezier(0.34, 1.45, 0.64, 1); }
  48.75% { transform: scaleY(1); }
  65% { transform: scaleY(1); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  72.5% { transform: scaleY(0.5); }
  100% { transform: scaleY(0.5); }
}
@keyframes tc-pl-bag {
  0%, 7.5% { transform: scaleY(1); opacity: 1; animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  14% { transform: scaleY(0.3); opacity: 1; animation-timing-function: linear; }
  17.5%, 83.75% { transform: scaleY(0.03); opacity: 0; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  87.5% { transform: scaleY(0.3); opacity: 1; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  94.5%, 100% { transform: scaleY(1); opacity: 1; }
}
@keyframes tc-pl-all {
  0% { transform: scale(1, 1); animation-timing-function: ease-out; }
  3% { transform: scale(1.024, 0.96); animation-timing-function: ease-in-out; }
  6.5%, 35% { transform: scale(1, 1); animation-timing-function: ease-out; }
  38% { transform: scale(1.018, 0.97); animation-timing-function: ease-in-out; }
  41.5%, 93.5% { transform: scale(1, 1); animation-timing-function: ease-out; }
  96.5% { transform: scale(1.02, 0.965); animation-timing-function: ease-in-out; }
  100% { transform: scale(1, 1); }
}
@keyframes tc-pl-wave {
  from { transform: skewY(-3deg) scaleX(0.97); }
  to { transform: skewY(3deg) scaleX(1); }
}

/* Reduced motion: the tent standing open, flag up, pins locked, and still. */
@media (prefers-reduced-motion: reduce) {
  #tc-preloader .tc-pl-tent *,
  #tc-preloader .tc-pl-tent { animation: none !important; }
  #tc-preloader .tc-pl-pleats { opacity: 0; }
}
