/* CINEMATIC PROCESS SECTION STYLES */

:root {
  --transition-speed: 0.8s;
  --transition-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- CONTAINER (SCROLL TRACK) --- */
.process-container {
  height: 600vh;
  /* 100vh per step + extra */
  position: relative;
  background: var(--bg-dark);
}

/* --- STICKY VIEWPORT --- */

/* --- STICKY VIEWPORT --- */
.process-sticky-view {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  /* changed to hidden to prevent double scrollbars, we handle internal scroll on steps */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

/* --- BACKGROUND FX --- */
.process-bg-fx {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.fx-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.fx-glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: pulseGlow 8s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

/* --- INTRO SECTION --- */
.process-intro {
  position: absolute;
  top: calc(50% + 3rem);
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
  width: 90%;
  max-width: 800px;
}

.process-intro.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-50px);
  pointer-events: none;
}

.process-intro h1 {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(to right, #fff, #888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.process-intro p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.scroll-indicator {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.7;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-indicator .line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}

/* --- STEPS WRAPPER --- */
.process-steps-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 5;
  /* Removed display:flex since we use absolute centering */
}

/* --- INDIVIDUAL STEP --- */
.process-step {
  position: absolute;
  top: calc(50% + 3rem);
  left: 50%;
  width: 80%;
  max-width: 1200px;
  /* Use flex to center internal content if needed, but grid is fine */
  justify-content: center;
  gap: 40px;
  /* Reset grid for internal layout */
  display: flex;
  flex-direction: column;

  /* Initial State */
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
  transition: opacity var(--transition-speed) var(--transition-ease), transform var(--transition-speed) var(--transition-ease);
  pointer-events: none;

  /* Handle tall content */
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  /* Firefox */
  padding: 20px;
  /* Add padding to prevent edge touches */
  box-sizing: border-box;
}

.process-step::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

/* ACTIVE STATE */
.process-step.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* PREVIOUS STATE */
.process-step.prev {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(-50px) scale(0.9);
}

/* NEXT STATE */
.process-step.next {
  opacity: 0;
  transform: translate(-50%, -50%) translateY(50px) scale(1.1);
}

/* --- STEP COMPONENTS --- */
.step-bg-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 35vw;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.02);
  z-index: -1;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  /* Ensure it doesn't block scroll */
}



/* --- STEP GRID LAYOUT --- */
.step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  text-align: left;
}

.step-visual {
  width: 100%;
  height: 400px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateX(-50px);
  opacity: 0;
  transition: 0.8s ease 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s ease;
}

.process-step.active .step-visual {
  transform: translateX(0);
  opacity: 1;
}

.process-step.active .step-visual img {
  transform: scale(1.1);
}

.step-text-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateX(50px);
  opacity: 0;
  transition: 0.8s ease 0.2s;
}

.process-step.active .step-text-content {
  transform: translateX(0);
  opacity: 1;
}

.step-content {
  position: relative;
  z-index: 2;
  display: block;
  /* changed from flex column to block to let grid handle it */
  width: 100%;
}

.step-title {
  font-size: 4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.6s ease 0.1s;
}

.step-intent {
  font-size: 1.5rem;
  color: var(--text-muted);
  max-width: 800px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.6s ease 0.2s;
}

/* VISIBILITY ON ACTIVE */
.process-step.active .step-title,
.process-step.active .step-intent {
  opacity: 1;
  transform: translateY(0);
}

/* --- DETAILS SECTION (Actions & Outputs) --- */
.step-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  width: 100%;
  width: 100%;
  /* max-width: 900px; Remove max-width restriction inside the grid */
  margin-top: 40px;
  text-align: left;
  opacity: 1;
  /* Handled by parent container now */
  transform: none;
  transition: none;
  /* Delayed appearance */
}

/* Remove old transition overrides since we moved them */
/* .process-step.active .step-details {
  opacity: 1;
  transform: translateY(0);
} */

.step-actions,
.step-outputs {
  background: rgba(255, 255, 255, 0.02);
  padding: 30px;
  border-radius: 1px;
  /* Sharp technical feel */
  border-left: 1px solid var(--accent);
}

.step-actions h4,
.step-outputs h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 20px;
}

.step-actions ul {
  list-style: none;
}

.step-actions ul li {
  margin-bottom: 12px;
  color: #ccc;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-actions ul li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  display: block;
}

/* PILLS */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pills span {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  font-size: 0.9rem;
  color: #fff;
  border-radius: 20px;
  white-space: nowrap;
}

/* --- PROGRESS BAR --- */
.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 20;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transition: width 0.1s linear;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .process-container {
    height: auto;
    overflow: hidden;
  }

  .process-sticky-view {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    display: block;
    padding-bottom: 80px;
  }

  .process-intro {
    position: relative;
    top: auto;
    left: auto;
    transform: none !important;
    opacity: 1 !important;
    margin: 80px auto 40px;
    width: 90%;
  }

  .process-intro h1 {
    font-size: 2.5rem;
  }

  .process-steps-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 100px;
    /* Space between steps */
    padding-bottom: 100px;
  }

  .process-step {
    position: relative;
    top: auto;
    left: auto;
    transform: none !important;
    /* Override JS transforms */
    opacity: 1 !important;
    /* Force visible */
    pointer-events: auto;
    width: 90%;
    margin: 0 auto;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .step-title {
    font-size: 2.2rem;
    opacity: 1;
    transform: none;
  }

  .step-intent {
    font-size: 1.1rem;
    opacity: 1;
    transform: none;
  }

  .step-details {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 20px;
    opacity: 1;
  }

  .step-bg-number {
    font-size: 15rem;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
  }

  .step-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: left;
    /* Keep left alignment */
  }

  .step-visual {
    height: 250px;
    transform: none !important;
    opacity: 1 !important;
    width: 100%;
    border: none;
  }

  .step-visual img {
    transform: none !important;
  }

  .step-text-content {
    transform: none !important;
    opacity: 1 !important;
    align-items: flex-start;
    /* Align text left */
  }

  .progress-bar-container {
    display: none;
  }
}