/* ============================================================
   HFG CAPITAL — Preloader: Particle Constellation
   Ultra-premium animated loading with orbital particle system
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #0B0B0D;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: 'Open Sans', sans-serif;
  color: #EAE7E1;
  cursor: pointer;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Particle canvas (full viewport) ---- */
#particleCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* ---- Background image (fades in at end) ---- */
.preloader-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 1;
  filter: saturate(0.5) brightness(0.85);
}

/* ---- Film grain overlay ---- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grainShift 0.5s steps(4) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, -3%); }
  50%  { transform: translate(3%, 1%); }
  75%  { transform: translate(-1%, 3%); }
  100% { transform: translate(2%, -2%); }
}

/* ---- Logo: HFG CAPITAL ---- */
#monogram {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  font-family: 'Marcellus', serif;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: #C6A96B;
  opacity: 0;
  filter: blur(8px);
  white-space: nowrap;
  will-change: opacity, filter;
}

/* ---- Gold separator line ---- */
#goldLine {
  position: fixed;
  top: calc(50% + clamp(2rem, 4vw, 3.5rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: clamp(30px, 4vw, 50px);
  height: 1px;
  background: linear-gradient(90deg, transparent, #C6A96B, transparent);
  opacity: 0;
  will-change: opacity;
}

/* ---- Universe containers ---- */
#universes {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.universe {
  position: absolute;
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
}

.universe-family {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: #C6A96B;
  margin-bottom: 8px;
  white-space: nowrap;
}

.universe-subs {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.45rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(234, 231, 225, 0.35);
  white-space: nowrap;
}

.universe-subs .sep {
  margin: 0 0.6em;
  opacity: 0.4;
}

/* ---- Motto — same visual width as HFG CAPITAL ---- */
#motto {
  position: fixed;
  top: calc(50% + clamp(3rem, 5.5vw, 5rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: 'Marcellus', serif;
  font-size: clamp(0.55rem, 1.1vw, 0.85rem);
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-transform: uppercase;
  color: rgba(198, 169, 107, 0.5);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  will-change: opacity;
}

/* ---- Click hint ---- */
#clickHint {
  position: fixed;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(198, 169, 107, 0.5);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  transition: color 0.3s;
}

#clickHint:hover { color: #C6A96B; }

.hint-arrow {
  display: inline-flex;
  animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(4px); opacity: 1; }
}

/* ---- Skip button ---- */
.skip-preloader {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  background: none;
  border: 1px solid rgba(198, 169, 107, 0.3);
  color: rgba(198, 169, 107, 0.5);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}

.skip-preloader:hover {
  color: #C6A96B;
  border-color: rgba(198, 169, 107, 0.6);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  #monogram {
    font-size: 1.8rem;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
  }

  #goldLine {
    top: calc(50% + 2rem);
    width: 25px;
  }

  #motto {
    font-size: 0.4rem;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
    top: calc(50% + 2.8rem);
  }

  .universe-family {
    font-size: 0.45rem;
    letter-spacing: 0.25em;
  }

  .universe-subs {
    font-size: 0.38rem;
    letter-spacing: 0.2em;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .hint-arrow { animation: none; }
  #monogram { opacity: 1 !important; filter: blur(0) !important; }
  .preloader-bg { opacity: 0.25 !important; }
  #goldLine { opacity: 1 !important; }
  #motto { opacity: 1 !important; }
  #clickHint { opacity: 1 !important; }
  #universes { display: none; }
  #particleCanvas { display: none; }
}
