/* Site intro preloader — teal terminal vibe */
:root {
  --preloader-bg: #0a0b0f;
  --preloader-teal: #00d4aa;
  --preloader-teal-bright: #00f5c4;
  --preloader-fg: #e8eaef;
  --preloader-muted: rgba(232, 234, 239, 0.56);
}

html.preloader-skip #site-preloader {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.site-preloader-active,
html.site-preloader-active body {
  overflow: hidden;
}

.site-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--preloader-bg);
  color: var(--preloader-fg);
  transition: opacity 0.75s ease, visibility 0.75s ease;
}

.site-preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-preloader__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: site-preloader-grid-pulse 4s ease-in-out infinite;
}

.site-preloader__glow {
  position: absolute;
  width: min(600px, 90vw);
  height: min(600px, 90vw);
  background: radial-gradient(circle, rgba(0, 212, 170, 0.15) 0%, transparent 70%);
  animation: site-preloader-glow-pulse 3s ease-in-out infinite;
}

.site-preloader__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--preloader-teal), transparent);
  opacity: 0.3;
  animation: site-preloader-scan 3s linear infinite;
}

.site-preloader__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.site-preloader__particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--preloader-teal);
  border-radius: 50%;
  opacity: 0.4;
  animation: site-preloader-particle 8s ease-in-out infinite;
}

.site-preloader__particle:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
}
.site-preloader__particle:nth-child(2) {
  left: 20%;
  top: 80%;
  animation-delay: 1s;
}
.site-preloader__particle:nth-child(3) {
  left: 80%;
  top: 30%;
  animation-delay: 2s;
}
.site-preloader__particle:nth-child(4) {
  left: 70%;
  top: 70%;
  animation-delay: 3s;
}
.site-preloader__particle:nth-child(5) {
  left: 90%;
  top: 50%;
  animation-delay: 4s;
}
.site-preloader__particle:nth-child(6) {
  left: 30%;
  top: 40%;
  animation-delay: 5s;
}

.site-preloader__logo {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 40px;
  z-index: 1;
}

.site-preloader__hex {
  position: absolute;
  inset: 0;
  animation: site-preloader-hex-rotate 20s linear infinite, site-preloader-hex-in 1s ease forwards;
  opacity: 0;
}

.site-preloader__hex svg {
  width: 100%;
  height: 100%;
}

.site-preloader__bars {
  position: absolute;
  inset: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.site-preloader__bar {
  width: 8px;
  border-radius: 2px;
  background: linear-gradient(to top, var(--preloader-teal), var(--preloader-teal-bright));
  transform-origin: bottom;
  animation: site-preloader-bar 0.6s ease forwards;
  opacity: 0;
}

.site-preloader__bar:nth-child(1) {
  height: 20px;
  animation-delay: 0.3s;
}
.site-preloader__bar:nth-child(2) {
  height: 35px;
  animation-delay: 0.4s;
}
.site-preloader__bar:nth-child(3) {
  height: 28px;
  animation-delay: 0.5s;
}
.site-preloader__bar:nth-child(4) {
  height: 45px;
  animation-delay: 0.6s;
}
.site-preloader__bar:nth-child(5) {
  height: 32px;
  animation-delay: 0.7s;
}

.site-preloader__brand {
  display: flex;
  z-index: 1;
  font-size: clamp(32px, 10vw, 48px);
  font-weight: 600;
  letter-spacing: 4px;
  margin-bottom: 50px;
}

.site-preloader__brand span {
  opacity: 0;
  transform: translateY(20px);
  animation: site-preloader-letter 0.5s ease forwards;
}

.site-preloader__brand .site-preloader__ai {
  color: var(--preloader-teal);
  text-shadow: 0 0 30px rgba(0, 212, 170, 0.6);
}

.site-preloader__brand .site-preloader__rest {
  color: var(--preloader-fg);
}

.site-preloader__progress {
  width: min(280px, 85vw);
  text-align: center;
  z-index: 1;
}

.site-preloader__progress-bg {
  height: 3px;
  background: rgba(232, 234, 239, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}

.site-preloader__progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--preloader-teal), var(--preloader-teal-bright));
  border-radius: 3px;
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.5);
  transition: width 0.1s linear;
}

.site-preloader__progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.site-preloader__progress-label {
  color: var(--preloader-muted);
}

.site-preloader__progress-pct {
  color: var(--preloader-teal);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.site-preloader__hud {
  position: absolute;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--preloader-muted);
  opacity: 0;
  animation: site-preloader-hud 0.5s ease forwards;
  z-index: 1;
  line-height: 1.35;
}

.site-preloader__hud-val {
  color: var(--preloader-teal);
  font-weight: 500;
}

.site-preloader__hud--tl {
  top: 24px;
  left: 24px;
  animation-delay: 1s;
}
.site-preloader__hud--tr {
  top: 24px;
  right: 24px;
  text-align: right;
  animation-delay: 1.1s;
}
.site-preloader__hud--bl {
  bottom: 24px;
  left: 24px;
  animation-delay: 1.2s;
}
.site-preloader__hud--br {
  bottom: 24px;
  right: 24px;
  text-align: right;
  animation-delay: 1.3s;
}

@media (max-width: 480px) {
  .site-preloader__hud {
    display: none;
  }
}

@keyframes site-preloader-grid-pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes site-preloader-glow-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes site-preloader-scan {
  0% {
    top: 0;
  }
  100% {
    top: 100%;
  }
}

@keyframes site-preloader-particle {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-30px) scale(1.5);
    opacity: 0.8;
  }
}

@keyframes site-preloader-hex-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes site-preloader-hex-in {
  to {
    opacity: 1;
  }
}

@keyframes site-preloader-bar {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes site-preloader-letter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes site-preloader-hud {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-preloader__grid,
  .site-preloader__glow,
  .site-preloader__scan,
  .site-preloader__particle,
  .site-preloader__hex {
    animation: none !important;
  }
  .site-preloader__hex {
    opacity: 1;
  }
  .site-preloader__bar {
    opacity: 1;
    transform: scaleY(1);
    animation: none;
  }
  .site-preloader__brand span {
    opacity: 1;
    transform: none;
    animation: none;
  }
  .site-preloader__hud {
    opacity: 1;
    animation: none;
  }
}
