@font-face {
  font-family: Rubik;
  src: url('./assets/rubik-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #090c0b;
  --brand-mint: #b6e3dc;
  font-family: Rubik, system-ui, sans-serif;
  background: var(--background);
  color: #f4faf8;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 240px; }
body { min-height: 100vh; min-height: 100svh; }
button { font: inherit; }
[hidden] { display: none !important; }

.brand-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  contain: layout paint;
}

.brand-backdrop img {
  position: absolute;
  top: 50%;
  left: 70%;
  display: block;
  width: 125vmax;
  max-width: none;
  height: auto;
  opacity: .045;
  transform: translate(-50%, -50%) rotate(-18deg);
}

.holding-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 40px 24px;
}

.message {
  position: relative;
  z-index: 2;
  margin: 0;
  text-align: center;
  font-weight: 700;
  letter-spacing: -.35px;
  line-height: 1.3;
}

.message-brand {
  display: block;
  font-size: clamp(22.4px, 3.52vw, 46.4px);
  font-weight: 700;
  white-space: nowrap;
}

.message-intro {
  font-weight: 400;
}

.message-rest {
  display: block;
  margin-top: 12px;
  font-size: clamp(14.4px, 2.16vw, 28.8px);
  font-weight: 400;
  white-space: nowrap;
}

.butterfly-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint;
}

.butterfly {
  position: absolute;
  left: 0;
  top: 0;
  aspect-ratio: 1;
  pointer-events: none;
  will-change: transform;
}

/* Original transparent artwork and wing masks from the Tussentijd tool. */
.guest-art { display: block; position: relative; width: 100%; height: 100%; }
.guest-sprite {
  position: absolute;
  inset: 0;
  display: block;
  background-image: url('./assets/butterfly-guests.png');
  background-size: 495.75% auto;
  background-position: var(--sprite-x) 47.58%;
  background-repeat: no-repeat;
}
.guest-art .wing {
  transform-origin: 50% 55%;
  will-change: transform;
  animation: flutter var(--flap-duration, .65s) ease-in-out infinite alternate;
}
.guest-wing-left { clip-path: polygon(0 0,39.5% 0,39.5% 34%,47.3% 37%,47.3% 100%,0 100%); }
.guest-wing-right { clip-path: polygon(60.5% 0,100% 0,100% 100%,52.7% 100%,52.7% 37%,60.5% 34%); }
.guest-body { clip-path: polygon(39.5% 0,60.5% 0,60.5% 34%,52.7% 37%,52.7% 100%,47.3% 100%,47.3% 37%,39.5% 34%); }

/* The first butterfly is the original green SVG mascot from the tool. */
.tool-art, .tool-butterfly { display: block; width: 100%; height: 100%; }
.tool-art .wing {
  transform-box: view-box;
  transform-origin: 128px 140px;
  will-change: transform;
  animation: flutter var(--flap-duration, .65s) ease-in-out infinite alternate;
}

@keyframes flutter {
  from { transform: scaleX(1); }
  to { transform: scaleX(.32); }
}

.motion-toggle {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 4;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #45554c;
  border-radius: 50%;
  background: var(--background);
  color: #a8b8b0;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.motion-toggle:hover { color: var(--brand-mint); border-color: var(--brand-mint); }
.motion-toggle:focus-visible { outline: 2px solid var(--brand-mint); outline-offset: 5px; }
.motion-toggle svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.play-icon { display: none; }
[data-motion='paused'] :is(.guest-art, .tool-art) .wing { animation-play-state: paused; }
[data-motion='paused'] .pause-icon { display: none; }
[data-motion='paused'] .play-icon { display: block; }

@media (max-width: 480px) {
  .holding-page { padding-inline: 16px; }
  .message { letter-spacing: -.15px; }
  .message-brand { font-size: clamp(16px, 5.6vw, 22.4px); }
  .message-rest { font-size: clamp(10.4px, 3.68vw, 14.4px); }
}

@media (prefers-reduced-motion: reduce) {
  .motion-toggle { transition: none; }
  /* The script respects this preference and lets the visitor opt into motion. */
  html:not([data-motion='running']) :is(.guest-art, .tool-art) .wing { animation: none; }
}
