/* =========================================================
   Preloader — particle lotus (canvas), minimal serif type, iris exit
   ========================================================= */
@property --hole { syntax: "<length>"; inherits: false; initial-value: 0px; }

html.is-preloading, html.is-preloading body { overflow: hidden; }

.pl {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(90% 70% at 50% 46%, #150724 0%, #08030f 55%, #040206 100%);
  color: #f5f3f8;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
          user-select: none;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent var(--hole), #000 calc(var(--hole) + 2px));
          mask-image: radial-gradient(circle at 50% 50%, transparent var(--hole), #000 calc(var(--hole) + 2px));
}
.pl.is-holding { cursor: grabbing; }
.pl__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* faint vignette + film grain feel */
.pl::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .55));
}

/* ---------- type ---------- */
.pl__brand {
  position: absolute;
  top: clamp(28px, 7vh, 64px); left: 0; right: 0;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  font-family: "Crimson Text", Georgia, serif;
  font-weight: 400;
  font-size: clamp(13px, 1.35vw, 16px);
  letter-spacing: .5em;
  text-transform: uppercase;
  color: rgba(247, 230, 200, .85);
  z-index: 1;
}
.pl__brand span { display: inline-block; opacity: 0; filter: blur(6px); transform: translateY(8px); animation: plLetter 1s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(.25s + var(--i) * .045s); }
@keyframes plLetter { to { opacity: 1; filter: blur(0); transform: none; } }

.pl__line {
  position: absolute;
  left: 0; right: 0; bottom: clamp(40px, 11vh, 110px);
  margin: 0;
  padding: 0 16px;
  text-align: center;
  font-family: "Crimson Text", Georgia, serif;
  font-style: italic;
  font-size: clamp(18px, 2.1vw, 26px);
  color: rgba(236, 228, 246, .82);
  opacity: 0;
  animation: plFadeUp 1.4s ease .9s forwards;
  z-index: 1;
}
@keyframes plFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.pl__foot {
  position: absolute;
  left: clamp(16px, 4vw, 56px); right: clamp(16px, 4vw, 56px); bottom: clamp(18px, 4vh, 40px);
  display: flex; align-items: center; gap: 18px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 10px; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(226, 220, 234, .5);
  z-index: 1;
}
.pl__track { flex: 1; height: 1px; background: rgba(255, 255, 255, .1); position: relative; overflow: hidden; }
.pl__track i { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(247, 196, 124, 0), #f7c47c); transform-origin: left; transform: scaleX(var(--p, 0)); }
.pl__count {
  min-width: 3.2em; text-align: right;
  font-family: "Crimson Text", Georgia, serif;
  font-size: 15px; letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  color: #f7c47c;
}

/* ---------- exit ---------- */
.pl.is-leaving { pointer-events: none; }
.pl.is-leaving .pl__brand,
.pl.is-leaving .pl__line,
.pl.is-leaving .pl__foot { transition: opacity .6s ease, transform .8s ease; opacity: 0; transform: translateY(-6px); }
.pl.is-opening { animation: plIris 1.25s cubic-bezier(.76, 0, .24, 1) forwards; }
@keyframes plIris { to { --hole: 150vmax; } }

@media (max-width: 600px) { .pl__foot span:first-child { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .pl__brand span, .pl__line { animation-duration: .01s; animation-delay: 0s; }
  .pl.is-opening { animation: plFade .5s ease forwards; }
  @keyframes plFade { to { opacity: 0; } }
}
