/* British Institute of Lasers preloader and cursor */
:root {
  --bil-preloader-progress: 0%;
  --bil-preloader-teal: #69e3eb;
}

html.bil-loader-pending,
html.bil-loader-pending body,
body.bil-is-loading {
  overflow: hidden !important;
}

.bil-preloader,
.bil-preloader *,
.bil-preloader *::before,
.bil-preloader *::after,
.bil-cursor,
.bil-cursor::before,
.bil-cursor::after,
.bil-cursor-dot {
  box-sizing: border-box;
}

.bil-preloader {
  position: fixed;
  z-index: 2147483645;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 50% 30%, rgba(109,80,237,.28), transparent 34%),
    radial-gradient(circle at 14% 82%, rgba(105,227,235,.1), transparent 28%),
    linear-gradient(148deg, #070b20 0%, #111735 48%, #25145f 100%);
  isolation: isolate;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 520ms ease 120ms;
}

.bil-preloader::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.08), transparent 27%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: auto, 54px 54px, 54px 54px;
  opacity: 1;
  transition: opacity 420ms ease 100ms;
}

.bil-preloader::after {
  position: absolute;
  z-index: -1;
  inset: -30%;
  content: "";
  background: conic-gradient(from 210deg at 50% 50%, transparent, rgba(108,80,237,.13), transparent 24%, rgba(105,227,235,.08), transparent 55%);
  opacity: 1;
  animation: bil-preloader-orbit 9s linear infinite;
  transition: opacity 420ms ease 100ms;
}

@keyframes bil-preloader-orbit {
  to { transform: rotate(1turn); }
}

.bil-preloader-panel {
  position: absolute;
  z-index: 4;
  left: 0;
  width: 100%;
  height: 51%;
  background:
    radial-gradient(circle at 50% 50%, rgba(109,80,237,.18), transparent 45%),
    linear-gradient(148deg, #070b20 0%, #111735 52%, #25145f 100%);
  transition: transform 980ms cubic-bezier(.76, 0, .24, 1);
}

.bil-preloader-panel--top { top: 0; }
.bil-preloader-panel--bottom { bottom: 0; }

.bil-preloader-inner {
  position: relative;
  z-index: 6;
  width: min(640px, calc(100% - 48px));
  text-align: center;
  transition: opacity 360ms ease, transform 700ms cubic-bezier(.2, .8, .2, 1), filter 500ms ease;
}

.bil-preloader-overline {
  margin: 0 0 28px;
  color: rgba(255,255,255,.65);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .21em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bil-preloader-logo-box {
  position: relative;
  width: min(500px, 100%);
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.24));
}

.bil-preloader-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.bil-preloader-logo--ghost {
  opacity: .16;
  filter: drop-shadow(0 0 18px rgba(108,80,237,.2));
}

.bil-preloader-logo-fill {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(calc(100% - var(--bil-preloader-progress)) 0 0 0);
  filter:
    drop-shadow(0 0 10px rgba(255,255,255,.12))
    drop-shadow(0 12px 28px rgba(83,51,210,.28));
  will-change: clip-path;
}

.bil-preloader-laser {
  position: absolute;
  z-index: 2;
  right: -5%;
  bottom: calc(var(--bil-preloader-progress) - 1px);
  left: -5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,31,42,.55), #fff 47%, var(--bil-preloader-teal) 55%, transparent);
  box-shadow: 0 0 12px rgba(201,31,42,.5), 0 0 24px rgba(105,227,235,.32);
  transform: translateY(50%);
  opacity: .82;
  will-change: bottom;
}

.bil-preloader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(500px, 100%);
  margin: 27px auto 0;
  padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,.2);
}

.bil-preloader-status {
  margin: 0;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.bil-preloader-percent {
  min-width: 47px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  text-align: right;
}

.bil-preloader.is-complete {
  background: transparent;
}

.bil-preloader.is-complete::before,
.bil-preloader.is-complete::after {
  opacity: 0;
}

.bil-preloader.is-complete .bil-preloader-inner {
  opacity: 0;
  filter: blur(10px);
  transform: scale(.96);
}

.bil-preloader.is-complete .bil-preloader-panel--top { transform: translateY(-100%); }
.bil-preloader.is-complete .bil-preloader-panel--bottom { transform: translateY(100%); }

.bil-preloader.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.bil-cursor,
.bil-cursor-dot {
  position: fixed;
  z-index: 2147483646;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}

.bil-cursor {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin: -19px 0 0 -19px;
  overflow: visible;
  border: 1px solid rgba(105,227,235,.78);
  border-radius: 50%;
  background: rgba(105,227,235,.055);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 0 22px rgba(105,227,235,.15);
  backdrop-filter: blur(3px);
  transition: width 220ms cubic-bezier(.2,.8,.2,1), height 220ms cubic-bezier(.2,.8,.2,1), margin 220ms cubic-bezier(.2,.8,.2,1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.bil-cursor::before,
.bil-cursor::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  transition: opacity 160ms ease, transform 200ms ease, background 180ms ease, border-color 180ms ease;
}

.bil-cursor::before {
  width: 7px;
  height: 7px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 12px rgba(105,227,235,.85);
}

.bil-cursor::after {
  inset: -7px;
  opacity: 0;
  border: 1px solid transparent;
  transform: scale(.82);
}

.bil-cursor-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 11px rgba(105,227,235,.8);
  transition: opacity 180ms ease, background 160ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.cursor-visible .bil-cursor,
body.cursor-visible .bil-cursor-dot { opacity: 1; }

body.cursor-active .bil-cursor {
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-color: rgba(130,123,255,.96);
  background: radial-gradient(circle at 35% 30%, rgba(108,80,237,.28), rgba(26,36,82,.58) 72%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.08) inset,
    0 0 20px rgba(83,51,210,.24),
    0 0 42px rgba(26,36,82,.22);
  animation: bil-cursor-breathe 1.55s ease-in-out infinite;
}

body.cursor-active .bil-cursor::before {
  opacity: 0;
  transform: scale(0);
}

body.cursor-active .bil-cursor::after {
  opacity: .92;
  border-color: rgba(108,80,237,.42);
  box-shadow: 0 0 22px rgba(83,51,210,.2);
  animation: bil-cursor-pulse 1.55s ease-out infinite;
}

body.cursor-active .bil-cursor-dot {
  background: #a99cff;
  box-shadow: 0 0 14px rgba(108,80,237,.95), 0 0 20px rgba(26,36,82,.42);
  animation: bil-cursor-core-pulse 1.55s ease-in-out infinite;
}

body.cursor-pressed .bil-cursor {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
}

@keyframes bil-cursor-breathe {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255,255,255,.08) inset,
      0 0 20px rgba(83,51,210,.24),
      0 0 42px rgba(26,36,82,.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255,255,255,.1) inset,
      0 0 28px rgba(108,80,237,.34),
      0 0 54px rgba(26,36,82,.3);
  }
}

@keyframes bil-cursor-pulse {
  0% { opacity: .9; transform: scale(.82); }
  70% { opacity: .18; transform: scale(1.28); }
  100% { opacity: 0; transform: scale(1.38); }
}

@keyframes bil-cursor-core-pulse {
  0%, 100% {
    opacity: .88;
    box-shadow: 0 0 14px rgba(108,80,237,.85), 0 0 18px rgba(26,36,82,.34);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 18px rgba(108,80,237,.98), 0 0 28px rgba(26,36,82,.5);
  }
}

@media (hover: hover) and (pointer: fine) {
  body,
  body a,
  body button,
  body input,
  body textarea,
  body select,
  body label,
  body summary,
  body [role="button"] {
    cursor: none !important;
  }
}

@media (max-width: 680px) {
  .bil-preloader-inner { width: min(640px, calc(100% - 32px)); }
  .bil-preloader-overline { margin-bottom: 21px; }
  .bil-preloader-meta { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .bil-preloader { display: none !important; }
  .bil-cursor,
  .bil-cursor-dot { display: none !important; }
  html.bil-loader-pending,
  html.bil-loader-pending body,
  body.bil-is-loading { overflow: auto !important; }
  body,
  body a,
  body button,
  body input,
  body textarea,
  body select,
  body label,
  body summary,
  body [role="button"] { cursor: auto !important; }
}
