/* ============================================================
   MYFOLIO STUDIO — CINEMATIC 3D UNIVERSE SCROLL ENGINE STYLES
   ============================================================ */

/* 1. Universal Top Scroll Progress Indicator */
#scroll-progress-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3.5px;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6, #f5a623);
  z-index: 100000;
  box-shadow: 0 0 14px #38bdf8, 0 0 4px #ffffff;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* 2. Master Fixed 3D WebGL Canvas */
.master-viewport-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background-color: #040714;
}

#masterUniverseCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.master-atmosphere-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 40%, rgba(4, 7, 20, 0.45) 80%, rgba(3, 5, 15, 0.85) 100%);
  pointer-events: none;
}

/* 3. Master Journey Scroll Track */
.journey-scroll-track {
  position: relative;
  width: 100%;
  height: 950vh; /* Generous depth for 10 cinematic stages */
  z-index: 5;
}

/* 4. Pinned Viewport Container for HTML Narrative */
.cinematic-stage-pin {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
}

/* 5. Narrative Chapter Overlay States */
.cinematic-narrative-chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vw, 48px);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(28px) scale(0.97);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.55s;
  will-change: opacity, transform;
}

.cinematic-narrative-chapter.chapter-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* 6. Typography & Spatial Badges */
.chapter-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(11, 22, 56, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(56, 189, 248, 0.15);
}

.chapter-headline {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: #ffffff;
  max-width: 900px;
  margin-bottom: 16px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2);
}

.chapter-headline span {
  background: linear-gradient(135deg, #ffffff 0%, #bae6fd 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chapter-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: #bae6fd;
  max-width: 680px;
  margin-bottom: 28px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* 7. Action Cluster Buttons */
.chapter-action-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  pointer-events: auto;
}

/* 8. Spatial Monolith Feature Clusters */
.spatial-feature-row {
  display: flex;
  gap: 16px;
  max-width: 880px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.spatial-feature-card {
  flex: 1 1 240px;
  max-width: 280px;
  background: linear-gradient(135deg, rgba(11, 22, 56, 0.65) 0%, rgba(6, 11, 30, 0.8) 100%);
  border: 1px solid rgba(186, 230, 253, 0.16);
  border-radius: 18px;
  padding: 20px;
  backdrop-filter: blur(16px);
  text-align: left;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.spatial-feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.45);
}

.feature-card-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.feature-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.feature-card-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
  color: #94a3b8;
}

/* 9. Universe Mini Preview Grid */
.universe-quick-strip {
  display: flex;
  gap: 12px;
  max-width: 900px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.universe-mini-token {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(9, 18, 48, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #bae6fd;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.universe-mini-token:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-2px);
}

/* 10. Mobile and Tablet Breakpoints */
@media (max-width: 768px) {
  .journey-scroll-track {
    height: 650vh; /* Shorter touch scroll track */
  }

  .chapter-headline {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
  }

  .chapter-subtitle {
    font-size: 0.92rem;
    margin-bottom: 20px;
  }

  .spatial-feature-card {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 16px;
  }

  .chapter-action-cluster {
    flex-direction: column;
    width: 100%;
  }

  .chapter-action-cluster button,
  .chapter-action-cluster a {
    width: 100%;
    justify-content: center;
  }
}

/* 11. Reduced-Motion Calming Fallback */
@media (prefers-reduced-motion: reduce) {
  .journey-scroll-track {
    height: auto;
  }
  .cinematic-stage-pin {
    position: relative;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 60px 20px;
  }
  .cinematic-narrative-chapter {
    position: relative;
    inset: auto;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
  }
}
