/* ============================================
   DIGITALIST — Portal Intro Styles
   Immersive dimensional entry experience
   ============================================ */

/* --- Body Lock during Portal --- */
body.portal-active {
  overflow: hidden !important;
  height: 100vh !important;
}

/* --- Intro Container --- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #050510;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Background Artwork --- */
.intro__artwork {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #050510;
  overflow: hidden;
}

.intro__artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: 50% 62%;
  transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

/* Subtle zoom on hover */
.intro:hover .intro__artwork img {
  transform: scale(1.02);
}

/* Kinetic Forward Push (Thrust into portal) */
.intro__artwork img.portal-thrust {
  transform: scale(1.045) !important;
  filter: brightness(1.08) contrast(1.03) !important;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease !important;
}

/* Vignette overlay */
.intro__artwork::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(5, 5, 16, 0.5) 100%),
    linear-gradient(to bottom, rgba(5, 5, 16, 0.2) 0%, transparent 30%, transparent 60%, rgba(5, 5, 16, 0.6) 100%);
  pointer-events: none;
}

/* --- Particle Layer --- */
.intro__particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(100, 180, 255, 0.6);
  box-shadow: 0 0 6px rgba(100, 180, 255, 0.4);
  animation: float-particle var(--duration, 15s) var(--delay, 0s) infinite ease-in-out;
}

@keyframes float-particle {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% { opacity: 1; }
  50% {
    transform: translate(var(--dx, 30px), var(--dy, -50px)) scale(1.5);
    opacity: 0.8;
  }
  90% { opacity: 1; }
}

/* --- Portal Glow Effect --- */
.intro__portal-glow {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 180, 50, 0.25) 0%,
    rgba(180, 100, 255, 0.1) 40%,
    transparent 70%
  );
  filter: blur(40px);
  z-index: 1;
  pointer-events: none;
  animation: portal-pulse 4s ease-in-out infinite;
}

@keyframes portal-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
}

/* --- Interactive Portal Hotspot --- */
.intro__portal-hotspot {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 220px;
  z-index: 3;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro__portal-hotspot::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 180, 50, 0);
  transition: all 0.6s ease;
}

.intro__portal-hotspot:hover::before {
  border-color: rgba(255, 180, 50, 0.4);
  box-shadow: 0 0 40px rgba(255, 180, 50, 0.15), inset 0 0 40px rgba(255, 180, 50, 0.1);
}

.intro__portal-hotspot:hover ~ .intro__portal-glow {
  animation-play-state: paused;
  opacity: 1;
  filter: blur(30px);
}

/* --- Awakening Energy Pulse (Activation Flash) --- */
.intro__awaken-pulse {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 245, 190, 0.95) 0%,
    rgba(255, 180, 50, 0.75) 25%,
    rgba(0, 212, 255, 0.55) 55%,
    rgba(139, 107, 184, 0.25) 75%,
    transparent 85%
  );
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
  filter: blur(18px);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease-out, filter 0.7s ease-out;
}

.intro__awaken-pulse.ignited {
  opacity: 1;
  transform: translate(-50%, -50%) scale(3.2);
  filter: blur(28px);
}

.intro__awaken-pulse.fade {
  opacity: 0;
  transform: translate(-50%, -50%) scale(4.4);
  transition: opacity 0.85s ease-out, transform 0.85s ease-out;
}

/* --- UI Content --- */
.intro__content {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8vh;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.intro__content.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

/* --- Entry Options --- */
.intro__options {
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
  perspective: 800px;
}

.intro__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 2.5rem;
  background: rgba(10, 10, 30, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(100, 140, 255, 0.16);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  min-width: 220px;
  text-align: center;
  color: inherit;
}

.intro__option:hover {
  background: rgba(20, 20, 50, 0.75);
  border-color: rgba(100, 180, 255, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(77, 168, 255, 0.15);
}

.intro__option--portal:hover {
  border-color: rgba(255, 180, 50, 0.45);
  box-shadow: 0 12px 40px rgba(255, 180, 50, 0.15);
}

.intro__option-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #e8e4f0;
}

.intro__option--portal .intro__option-title {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro__option-sub {
  font-size: 0.75rem;
  color: rgba(154, 149, 176, 0.8);
  letter-spacing: 1px;
}

/* --- Divider between options --- */
.intro__divider {
  display: flex;
  align-items: center;
  color: rgba(154, 149, 176, 0.45);
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

/* --- Video Transition Layer --- */
.intro__video-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.85s cubic-bezier(0.25, 1, 0.5, 1);
}

.intro__video-layer.active {
  opacity: 1;
  pointer-events: auto;
}

.intro__video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(1.08) contrast(1.04);
  transform-origin: 50% 62%;
}

/* --- Skip Button (Top Right during Video) --- */
.portal__skip-btn {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10005;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(232, 228, 240, 0.85);
  background: rgba(10, 10, 30, 0.65);
  border: 1px solid rgba(100, 140, 255, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.65rem 1.35rem;
  border-radius: 30px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.portal__skip-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.portal__skip-btn:hover {
  background: rgba(20, 20, 50, 0.9);
  border-color: rgba(0, 212, 255, 0.6);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.35);
}

.portal__skip-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.portal__skip-btn:hover svg {
  transform: translateX(3px);
}

/* --- Multidimensional Portal Energy Bloom (Outro Transition) --- */
.portal__energy-bloom {
  position: fixed;
  inset: 0;
  z-index: 10006;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(0, 212, 255, 0.85) 30%,
    rgba(139, 107, 184, 0.65) 60%,
    rgba(5, 5, 20, 0.9) 85%,
    rgba(5, 5, 16, 1) 100%
  );
  mix-blend-mode: screen;
  transform: scale(0.8);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal__energy-bloom.bloom-active {
  opacity: 1;
  transform: scale(1.3);
}

.portal__energy-bloom.bloom-fadeout {
  opacity: 0;
  transform: scale(1.6);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

/* Arrival settle on hero artwork */
.portal-arrival {
  animation: arrivalSettle 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes arrivalSettle {
  0% {
    transform: scale(1.08) !important;
    filter: brightness(1.2) contrast(1.06);
  }
  100% {
    transform: scale(1.05) !important;
    filter: brightness(1) contrast(1);
  }
}

/* --- Loading indicator --- */
.intro__loading {
  position: absolute;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.intro__loading.show {
  display: flex;
}

.intro__loading-bar {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  overflow: hidden;
}

.intro__loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d4ff, #8b6bb8);
  border-radius: 1px;
  transition: width 0.3s ease;
}

.intro__loading-text {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(154, 149, 176, 0.6);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .intro__options {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1.5rem;
  }

  .intro__option {
    min-width: auto;
    padding: 1.2rem 2rem;
  }

  .intro__divider {
    display: none;
  }

  .intro__portal-glow {
    width: 200px;
    height: 200px;
  }

  .intro__portal-hotspot {
    width: 120px;
    height: 150px;
  }

  .intro__content {
    padding-bottom: 5vh;
  }

  .portal__skip-btn {
    top: 16px;
    right: 16px;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .intro__artwork img {
    transition: none;
  }

  .particle {
    animation: none;
    opacity: 0.3;
  }

  .intro__portal-glow {
    animation: none;
    opacity: 0.5;
  }
}
