/* Norland – Arctic Vault Splash Screen */

@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #212121;
  --white: #FFFFFF;
  --gray-100: #F4F4F4;
  --gray-300: #CECECE;
  --gray-400: #A4A5A8;
  --purple-light: #D7D9EC;
  --purple-dark: #A3A7D2;
  --green-light: #D6EFEB;
  --green-dark: #9EC2BD;
  --pink-light: #ECD5DD;
  --pink-dark: #D6A0B2;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Splash Container ─── */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* ─── Aurora Background ─── */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  animation: auroraFadeIn 2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: auroraFloat 8s ease-in-out infinite;
}

.aurora::before {
  width: 60vmax;
  height: 60vmax;
  top: -30%;
  left: -20%;
  background: radial-gradient(ellipse, var(--purple-dark) 0%, transparent 70%);
  animation-delay: 0s;
}

.aurora::after {
  width: 50vmax;
  height: 50vmax;
  bottom: -25%;
  right: -15%;
  background: radial-gradient(ellipse, var(--green-dark) 0%, transparent 70%);
  animation-delay: -4s;
}

.aurora-accent {
  position: absolute;
  width: 45vmax;
  height: 45vmax;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
  background: radial-gradient(ellipse, var(--pink-dark) 0%, transparent 70%);
  animation: auroraFloat 10s ease-in-out infinite reverse;
}

@keyframes auroraFadeIn {
  to { opacity: 1; }
}

@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, -2%) scale(1.05); }
  66% { transform: translate(-2%, 3%) scale(0.95); }
}

/* ─── Grain Texture Overlay ─── */
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

/* ─── Content Wrapper ─── */
.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

/* ─── Logo Mark ─── */
.logo-container {
  position: relative;
  width: 80px;
  height: 80px;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  animation: logoReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.logo-ring {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: ringPulse 3s ease-in-out infinite;
}

.logo-ring:nth-child(2) {
  inset: -24px;
  border-color: rgba(255, 255, 255, 0.03);
  animation-delay: 1s;
}

@keyframes logoReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.5; }
}

/* ─── Typography ─── */
.splash-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.app-name {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
  opacity: 0;
  transform: translateY(16px);
  animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

.app-tagline {
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  opacity: 0;
  transform: translateY(12px);
  animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
}

@keyframes textReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Progress Indicator ─── */
.progress-wrapper {
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  animation: textReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.4s forwards;
}

.progress-track {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, var(--purple-dark), var(--green-dark), var(--pink-dark));
  border-radius: 2px;
  animation: progressSlide 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.progress-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 1.8s ease-in-out infinite;
  transform: translateX(-100%);
}

@keyframes progressSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.loading-text {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-400);
}

/* ─── Floating Particles ─── */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: particleDrift linear infinite;
}

.particle:nth-child(1) { left: 15%; top: 20%; animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 35%; top: 80%; animation-duration: 15s; animation-delay: -3s; }
.particle:nth-child(3) { left: 55%; top: 40%; animation-duration: 10s; animation-delay: -6s; width: 3px; height: 3px; }
.particle:nth-child(4) { left: 75%; top: 65%; animation-duration: 14s; animation-delay: -2s; }
.particle:nth-child(5) { left: 90%; top: 30%; animation-duration: 11s; animation-delay: -5s; }
.particle:nth-child(6) { left: 25%; top: 55%; animation-duration: 13s; animation-delay: -8s; width: 1.5px; height: 1.5px; }
.particle:nth-child(7) { left: 65%; top: 15%; animation-duration: 16s; animation-delay: -4s; }
.particle:nth-child(8) { left: 45%; top: 90%; animation-duration: 9s; animation-delay: -7s; width: 2.5px; height: 2.5px; }

@keyframes particleDrift {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translateY(-100vh) translateX(20px);
    opacity: 0;
  }
}

/* ─── Corner Accents ─── */
.corner-accent {
  position: absolute;
  width: 80px;
  height: 80px;
  opacity: 0;
  animation: textReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 1.2s forwards;
}

.corner-accent::before,
.corner-accent::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
}

.corner-accent--tl {
  top: 32px;
  left: 32px;
}
.corner-accent--tl::before {
  top: 0; left: 0;
  width: 24px; height: 1px;
}
.corner-accent--tl::after {
  top: 0; left: 0;
  width: 1px; height: 24px;
}

.corner-accent--br {
  bottom: 32px;
  right: 32px;
}
.corner-accent--br::before {
  bottom: 0; right: 0;
  width: 24px; height: 1px;
}
.corner-accent--br::after {
  bottom: 0; right: 0;
  width: 1px; height: 24px;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .logo-container {
    width: 64px;
    height: 64px;
  }
  .splash-content {
    gap: 36px;
  }
  .corner-accent {
    display: none;
  }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
