/* Cover the page from the first paint until preloader.js takes over. */
html.pl-wait, html.pl-wait body { overflow: hidden; }
html.pl-wait body::after { content: ""; position: fixed; inset: 0; z-index: 9999; background: var(--hero-bg, var(--bg, #0B1030)); }
html.pl-ready body::after { display: none; }

.preloader {
  position: fixed; inset: 0; z-index: 10000; overflow: hidden;
  background-color: var(--hero-bg, var(--bg, #0B1030));
  background-image: radial-gradient(circle at 12px 12px, var(--hero-dot, var(--dot, #1F2756)) 1.1px, transparent 1.7px);
  background-size: 24px 24px;
  color: var(--pl-fg); will-change: transform;
  --pl-fg: #FFFFFF; --pl-muted: rgba(255, 255, 255, 0.65); --pl-line: rgba(255, 255, 255, 0.15);
  --pl-letter: #C9F24D; --pl-accent: #C9F24D;
  --rope: #ECE6D6; --rope-ridge: #A29A85; --rope-shine: rgba(255, 255, 255, 0.55); --rope-shadow: rgba(0, 0, 0, 0.45);
}
html[data-theme="light"] .preloader {
  --pl-fg: #0D0D0F; --pl-muted: rgba(13, 13, 15, 0.6); --pl-line: rgba(13, 13, 15, 0.12);
  --pl-letter: #2547E8; --pl-accent: #2547E8;
  --rope: #3A3833; --rope-ridge: #141310; --rope-shine: rgba(255, 255, 255, 0.28); --rope-shadow: rgba(40, 30, 10, 0.28);
}

.pl-rope { position: absolute; left: 50%; top: -60px; width: 12px; margin-left: -6px; height: 300px; transform-origin: 50% 0; will-change: transform; }
.pl-rope svg { display: block; overflow: visible; }

.pl-center {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-38%);
  display: flex; flex-direction: column; align-items: center; gap: 22px; will-change: transform;
}
.pl-counter { display: flex; align-items: flex-end; gap: 10px; }
.pl-num { position: relative; font: 400 clamp(120px, 15vw, 220px)/1 "Climate Crisis", "Geist", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.pl-num .face { position: relative; color: var(--pl-letter); }
.pl-num .extrude { position: absolute; left: 0.07em; top: 0.08em; color: #0D0D0F; }
.pl-pct { font: 400 clamp(36px, 4.4vw, 64px)/1 "Climate Crisis", system-ui, sans-serif; color: var(--pl-muted); padding-bottom: 0.25em; }
.pl-status { display: flex; align-items: center; gap: 10px; font: 500 12px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: 0.13em; color: var(--pl-muted); }
.pl-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--pl-accent); animation: pl-blink 1.1s ease-in-out infinite; }
.pl-status span { display: inline-block; transition: opacity 0.25s ease, transform 0.25s ease; }
.pl-status span.out { opacity: 0; transform: translateY(-4px); }

.pl-foot { position: absolute; left: 40px; right: 40px; bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
.pl-meta { display: flex; justify-content: space-between; font: 500 11px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: 0.11em; color: var(--pl-muted); }
.pl-track { height: 3px; border-radius: 3px; background: var(--pl-line); overflow: hidden; }
.pl-fill { height: 100%; width: 100%; border-radius: 3px; background: var(--pl-accent); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }

@keyframes pl-blink { 50% { opacity: 0.25; } }

@media (max-width: 600px) {
  .pl-rope { top: -92px; height: 260px; }
  .pl-rope svg { height: 260px; }
  .pl-center { transform: translateY(-32%); gap: 16px; }
  .pl-num { font-size: clamp(88px, 30vw, 126px); }
  .pl-pct { font-size: 18px; padding-bottom: 13px; }
  .pl-status { max-width: calc(100vw - 48px); font-size: 10px; letter-spacing: 0.1em; text-align: center; }
  .pl-foot { left: 20px; right: 20px; bottom: max(24px, env(safe-area-inset-bottom)); gap: 12px; }
  .pl-meta { font-size: 9px; letter-spacing: 0.08em; }
}
