/* ==========================================================================
   REACT BITS — INTRO ANIMATION (CRYSTAL BLACK & WHITE PORTFOLIO INTRO)
   ========================================================================== */

.portfolio-intro {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  isolation: isolate;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Subtle luxury polished crystal-glass reflection */
.portfolio-intro__reflection {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 50% at 50% 25%, rgba(255, 255, 255, 0.038), transparent 70%),
    radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.015), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.012) 0%, rgba(0, 0, 0, 0.96) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Centered content stage */
.portfolio-intro__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 28px);
  padding: 0 16px;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Responsive wrapper for SplitFlapText */
.portfolio-intro__splitflap-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: visible;
  /* Dynamic font scaling to guarantee 8 tiles fit perfectly on any screen */
  --split-flap-font-size: clamp(28px, 6.2vw, 56px);
  --split-flap-gap: clamp(3px, 0.9vw, 6px);
  --split-flap-radius: clamp(3px, 0.6vw, 5px);
}

/* Subtitle: DEVELOPER · CREATOR · ENGINEER */
.portfolio-intro__subtitle {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  font-size: clamp(10px, 1.8vw, 13px);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.portfolio-intro__subtitle--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Discreet indicator / skip on click during dev */
.portfolio-intro__hint {
  position: absolute;
  bottom: 24px;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 2;
}

.portfolio-intro:hover .portfolio-intro__hint {
  opacity: 0.6;
}

/* Fading out transition */
.portfolio-intro--fading {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Fully hidden / unmounted state */
.portfolio-intro--hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Media Query: Compact Mobile Screens */
@media (max-width: 480px) {
  .portfolio-intro__splitflap-wrap {
    --split-flap-font-size: clamp(24px, 8.5vw, 36px);
    --split-flap-gap: 3px;
    --split-flap-radius: 3px;
  }
  
  .portfolio-intro__subtitle {
    font-size: 9.5px;
    letter-spacing: 0.18em;
  }
}

/* Reduced Motion Handling */
@media (prefers-reduced-motion: reduce) {
  .portfolio-intro {
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .portfolio-intro__subtitle {
    transition: opacity 0.3s ease;
    transform: none !important;
  }
}
