/*
 * Styles for the static holding page at /coming-soon.html.
 *
 * The holding page is deliberately self-contained: these styles and the assets
 * beside them are independent of the theme build, so the page renders on a host
 * where the application has never been built or installed.
 */

@font-face {
  font-display: swap;
  font-family: Tiempos;
  font-style: normal;
  font-weight: 400;
  src:
    url('fonts/TiemposTextWeb-Regular.woff2') format('woff2'),
    url('fonts/TiemposTextWeb-Regular.woff') format('woff');
}

:root {
  --holding-colour-text: #181515;
  --holding-colour-background: #fff;
  --holding-font-body: Tiempos, georgia, 'Times New Roman', times, serif;
  --holding-logo-width: 17.5rem;
  --holding-stack-gap: 1.875rem;
  --holding-gutter: 1.5rem;
}

html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
}

.holding {
  align-items: center;
  background-color: var(--holding-colour-background);
  color: var(--holding-colour-text);
  display: flex;
  flex-direction: column;
  font-family: var(--holding-font-body);
  font-size: 1rem;
  justify-content: center;
  line-height: 1.5;
  min-height: 100vh;
  padding: var(--holding-gutter);
  text-align: center;
}

.holding__logo {
  display: block;
  height: auto;
  max-width: 100%;
  width: var(--holding-logo-width);
}

.holding__message {
  margin: var(--holding-stack-gap) 0 0;
}

/*
 * Confetti easter egg.
 *
 * The palette is numbered rather than named so the script can pick one at
 * random; keep --confetti-palette-* contiguous from 1, and tell the script
 * how many there are via PALETTE_SIZE.
 *
 * Each piece is positioned, coloured and timed by custom properties the script
 * sets per element. The rules themselves stay here.
 */
.confetti {
  --confetti-palette-1: #181515;
  --confetti-palette-2: #e5484d;
  --confetti-palette-3: #ffb224;
  --confetti-palette-4: #30a46c;
  --confetti-palette-5: #0091ff;
  --confetti-palette-6: #8e4ec6;

  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 1;
}

.confetti__piece {
  animation-delay: var(--confetti-delay);
  animation-duration: var(--confetti-duration);
  animation-fill-mode: forwards;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  background-color: var(--confetti-colour);
  height: var(--confetti-height);
  left: var(--confetti-left);
  opacity: 0;
  position: absolute;
  top: -10vh;
  width: var(--confetti-width);
}

.confetti__piece--round {
  border-radius: 50%;
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) rotateY(0deg);
  }

  5% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate3d(var(--confetti-drift), 120vh, 0)
      rotate(var(--confetti-spin))
      rotateY(var(--confetti-flip));
  }
}

/*
 * The script also checks this preference before spawning anything; the rule is
 * the backstop for pieces already in flight when the setting changes.
 */
@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }
}
