/* ==========================================================================
   mate. — preloader
   The wordmark assembles itself: "use" lands, then "mate" beside it so the
   word reads "usemate", the full stop drops, and only then does the feather
   slide in from the left to sit beside it. Monochrome — no accent colour.
   It is decorative — the page underneath is fully rendered the whole time,
   and the curtain removes itself on a timer whether or not any animation ran.
   ========================================================================== */

#preload {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: #070c15;
  transition: opacity .62s cubic-bezier(.6, .02, .28, 1), visibility .62s;
}
#preload[hidden] { display: grid; }          /* keep it painted while fading */
#preload.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.pl {
  display: flex;
  align-items: baseline;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(46px, 9vw, 104px);
  letter-spacing: -0.045em;
  color: #fff;
  line-height: 1;
}

.pl__feather,
.pl__use,
.pl__mate,
.pl__dot { display: inline-block; will-change: transform, opacity; }

/* The feather is a signature, not a co-brand — monochrome, centred on the
   line, and it arrives last, sliding in from the left once "usemate." is set.
   Its slot is reserved from the start so nothing reflows when it lands. */
.pl__feather {
  align-self: center;
  width: 0.64em;
  height: 0.78em;
  margin-right: 0.18em;
  color: #fff;
  opacity: 0;
  transform-origin: 50% 50%;
  animation: pl-feather 640ms cubic-bezier(.22, .9, .28, 1) 1180ms forwards;
}
@keyframes pl-feather {
  from { opacity: 0; transform: translateX(-1.3em); }
  to   { opacity: 1; transform: none; }
}

.pl__use  { opacity: 0; animation: pl-use 520ms cubic-bezier(.22,.9,.28,1) 140ms forwards; }
.pl__mate { opacity: 0; animation: pl-mate 520ms cubic-bezier(.22,.9,.28,1) 560ms forwards; }
.pl__dot  { opacity: 0; color: #fff; animation: pl-dot 440ms cubic-bezier(.2,1.5,.4,1) 960ms forwards; }

@keyframes pl-use {
  from { opacity: 0; transform: translateY(0.24em); filter: blur(9px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes pl-mate {
  from { opacity: 0; transform: translateX(-0.42em) scaleX(.86); filter: blur(7px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes pl-dot {
  0%   { opacity: 0; transform: translateY(-0.7em) scale(.5); }
  70%  { opacity: 1; transform: translateY(0) scale(1.18); }
  100% { opacity: 1; transform: none; }
}

/* A hairline that fills as the sequence runs, so the wait reads as progress. */
.pl__bar {
  position: absolute;
  left: 50%;
  bottom: clamp(48px, 12vh, 120px);
  transform: translateX(-50%);
  width: min(200px, 42vw);
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.pl__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: rgba(255, 255, 255, 0.88);
  animation: pl-bar 1880ms cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes pl-bar { to { width: 100%; } }

/* Hold the page still underneath while the curtain is up. */
html.is-loading, html.is-loading body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pl__feather, .pl__use, .pl__mate, .pl__dot { animation: none; opacity: 1; transform: none; }
  .pl__bar { display: none; }
  #preload { transition: none; }
}
