

.legacy {
  position: relative;
  background-color: color-mix(in srgb, white 30%, #9c8256 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* height: 100vh; */
  /* padding: 20px; */
  box-sizing: border-box;
  /* gap: 20px; */
  overflow: hidden;
  background: url('../../Images/1842/legacy-bg.png') no-repeat center/cover;
   /* animation: zoomOutSlow 4s ease-in-out forwards; */
   margin:0;
   padding:0;


  /* zoom animation on inner content */
  /* animation: zoomInSlow 20s ease-in-out forwards; */
}
.legacy.active-scroll {
  animation: zoomOutSlow 4s ease-in-out forwards;
}

.legacy::before,
.legacy::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 150px;
  pointer-events: none;
  z-index: 5; /* behind fog */
}

/* Top white dark linear gradient */
.legacy::before {
  top: 0;
background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

.legacy::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

/* Fog overlays as child elements for layering and animation */
.fog-top,
.fog-bottom {
  position: absolute;
  left: 0;
  width: 250%;
  height: 50vh; /* Cover half viewport height */
  pointer-events: none;
  background-repeat: repeat-x;
  background-size: contain;
  opacity: 0.95;
  filter: brightness(1.8) blur(8px);
  z-index: 5;
  animation-timing-function: linear, ease-out;
  animation-iteration-count: infinite, 1;
  animation-duration: 40s, 4s;
   transition: transform 2s ease-in-out, opacity 2s ease-in-out;
}

/* Fog1 top: horizontal slide + slow vertical float */
/* .fog-top {
   /* top: 45%;
  transform: translateY(-50%);
  background-image: url('../../Images/1842/fog1.png'), url('../../Images/1842/fog1.png');
  animation: fogTopMoveUp 3s ease-out forwards, moveFogHorizontal 60s linear 3s infinite; */
/* } */ 

/* Fog2 bottom: reversed horizontal slide + slow vertical float */
/* .fog-bottom {
   bottom: 45%;
  transform: translateY(50%);
  background-image: url('../../Images/1842/fog2.png'), url('../../Images/1842/fog2.png');
  animation: fogBottomMoveDown 3s ease-out forwards, moveFogHorizontalReverse 60s linear 3s infinite;
} */


.fog-top {
top: 0;
  background-image: url('../../Images/1842/fog1.png');
  /* animation-name: fogDriftHorizontal, fogMoveUp; */
  animation-fill-mode: none, forwards;
  animation-delay: 0s, 0s;
  transform: translateY(0);
}

/* Fog bottom moves downward */
.fog-bottom {
bottom: 0;
  background-image: url('../../Images/1842/fog2.png');
  /* animation-name: fogDriftHorizontalReverse, fogMoveDown; */
  animation-fill-mode: none, forwards;
  animation-delay: 0s, 0s;
  transform: translateY(0);
}

.fog-top,
.fog-bottom {
  animation: none;
  opacity: 0;
}

.legacy.active-scroll .fog-top {
  animation: fogMoveUp 3s ease-out forwards, fogDrift 40s linear infinite;
  transform: translateY(-45%);
  opacity: 1;
}
.legacy.active-scroll .fog-bottom {
  animation: fogMoveDown 3s ease-out forwards, fogDrift 40s linear infinite;
  transform: translateY(45%);
  opacity: 1;
}

@keyframes fogMoveUp {
  0% { transform: translateY(50%); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 0.9; }
}

@keyframes fogMoveDown {
  0% { transform: translateY(-50%); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 0.9; }
}

@keyframes fogDriftHorizontal {
  0% { background-position: 0 0; }
  100% { background-position: -1000px 0; }
}

@keyframes fogDriftHorizontalReverse {
  0% { background-position: -1000px 0; }
  100% { background-position: 0 0; }
}


/* Optional subtle drifting motion after opening */
/* .legacy.active-scroll .fog-top,
.legacy.active-scroll .fog-bottom {
  animation: fogDrift 40s linear infinite;
} */

@keyframes fogDrift {
  0% { background-position: 0 0; }
  100% { background-position: -1000px 0; }
}
@keyframes fogTopMoveUp {
  0% { top: 45%; opacity: 0.6; }
  100% { top: 0; opacity: 0.5; }
}

/* Move fog to bottom */
@keyframes fogBottomMoveDown {
  0% { bottom: 45%; opacity: 0.6; }
  100% { bottom: 0; opacity: 0.5; }
}

/* Horizontal fog animations */
@keyframes moveFogHorizontal {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-50%) translateY(0); }
}

@keyframes moveFogHorizontalReverse {
  0% { transform: translateX(-50%) translateY(0); }
  100% { transform: translateX(0) translateY(0); }
}

/* Vertical floating fog effect */
@keyframes moveFogVertical {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

.legacy-images {
  top:-20px;
  position: relative;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
}

.legacy-main {
  transform: rotate(-8.29deg); /* tilt left */
  position: relative;
  /*top: -8px;*/  /* slight upward nudge */
  left: -8px; /* slight left nudge */
  /* width: 423px; */
  width: 580px;
  height: auto;
  z-index: 6; /* below fog layers */
  animation: flowZoomIn 4s ease forwards;
}

.legacy2 {
  position: absolute;
  /* width: 400px; */
  top: 90px;  /* adjusted vertical alignment */
  left: 180px; /* aligned slightly right */
  transform: rotate(-8.29deg);
  opacity: 1;
  z-index: 7; /* above first image but below fog */
  pointer-events: none; /* clicks pass through */
  animation: flowZoomIn 2s ease forwards;
   animation-delay: 3.5s
}




/* Zoom-in animation for text and images inside .legacy */
.legacy > img,
.legacy h2,
.legacy-content img ,
.legacy-content  p{
 opacity: 0;
transform: translateX(-50px);
 z-index: 20; 
 transition: none; 
}
@keyframes flowZoomIn {
  0% {
    transform: translateX(-50px) scale(0.85);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes zoomInSlow {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}




.legacy h2 {
  font-family: 'Cerost', sans-serif;  /* your font */
  font-weight: 400;
  text-transform: uppercase;
  margin: 0;
font-weight: 400;
font-style:normal;
font-size: 48px;
line-height: 100%;
letter-spacing: 0%;
text-align: center;
vertical-align: middle;
text-transform: capitalize;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1.5s ease forwards;
animation-delay: 4.5s;

}

.legacy-content {
  margin-top: 20px;
  padding: 20px;
  width: 100%;
  /* width:1200px; */
  /* height:400px; */
  /* padding-top: 40px; */
  display: flex;
  /* flex-direction: column; */
  align-items: center; 
  /* justify-content: center; center content vertically */
  /* gap: 15px; */
  max-width:1400px; 
  margin-left:auto; margin-right: auto;
}


.legacy-content p {
  /* margin-left: 180px; */
  margin-left: 25px;
  color: #333;
  font-family: 'DM Sans' sans-serif;
font-weight: 400;
font-style:normal;
font-size: 18px;
line-height: 31px;
letter-spacing: 0%;
text-align: center;
vertical-align: middle;
/* padding-left: 20px; */
width: 670px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 2s ease forwards;
  animation-delay: 5s;

}


@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------------- Optional Background Zoom ---------------- */
@keyframes zoomOutSlow {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.legacy.active-scroll .legacy-main,
.legacy.active-scroll .legacy2,
.legacy.active-scroll h2,
.legacy.active-scroll p {
  animation: flowZoomIn 1s ease forwards; /* reduced from 1.5s to 1s */
}

.legacy.active-scroll .legacy-main {
  animation-delay: 1.8s; /* reduced from 2.8s */
}

.legacy.active-scroll .legacy2 {
  animation-delay: 2s;   /* reduced from 3s */
}

.legacy.active-scroll h2 {
  animation-delay: 2.2s; /* reduced from 3.2s */
}

.legacy.active-scroll p {
  animation-delay: 2.4s; /* reduced from 3.6s */
}


@media (max-width: 1024px) {
  .legacy {
    height: auto;
    /* padding: 60px 20px; */
    padding: 30px 20px;
  }

  .legacy-content {
    /* width: 90%;
    height: auto; */
    flex-direction: row;
    align-items: center;
    text-align: center;
    margin-top: 40px;
  }

  .legacy-images {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 0;
    gap: 20px;
  }

  .legacy-main {
  transform: rotate(-8.29deg); /* tilt left */
  position: relative;
  
  left: -5px; /* slight left nudge */
  /* width: 250px; */
  max-width:400px;
  height: auto;
  z-index: 6; /* below fog layers */
  animation: flowZoomIn 4s ease forwards;
}

.legacy2 {
  position: absolute;
  width: 300px;
  top: -1px; 
  left: 100px; /* aligned slightly right */
  transform: rotate(-8.29deg);
  opacity: 1;
  z-index: 7; /* above first image but below fog */
  pointer-events: none; /* clicks pass through */
  animation: flowZoomIn 2s ease forwards;
   animation-delay: 3.5s
}


  .legacy h2 {
    font-size: 36px;
    line-height: 44px;
    margin-top: 20px;
  }

  .legacy-content p {
    width: 100%;
    margin: 20px 0px 0px 0;
    font-size: 16px;
    line-height: 26px;
    /* padding-left: 120px; */
    padding-left:20px;
    width: auto;
  }
}

/* --- For Mobile (Phones) --- */
@media (max-width: 768px) {
  .legacy {
    height: auto;
    padding: 40px 15px;
    background-position: center;
  }

  .legacy-content {
    width: 100%;
    padding: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .legacy-images {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    top: 0;
    gap: 10px;
  }

.legacy-main {
  transform: rotate(-8.29deg); /* tilt left */
  position: relative;
  /* top: -30px;   */
  left: -5px; /* slight left nudge */
  /* width: 300px; */
  max-width:100%;
  /* height: auto; */
  z-index: 6; /* below fog layers */
  animation: flowZoomIn 4s ease forwards;
}

.legacy2 {
  position: absolute;
  width: 300px;
  top: -1px;  /* adjusted vertical alignment */
  left: 100px; /* aligned slightly right */
  transform: rotate(-8.29deg);
  opacity: 1;
  z-index: 7; /* above first image but below fog */
  pointer-events: none; /* clicks pass through */
  animation: flowZoomIn 2s ease forwards;
   animation-delay: 3.5s
}


  .legacy h2 {
    font-size: 28px;
    line-height: 34px;
    margin-top: 15px;
  }

  .legacy-content p {
    width: 100%;
    font-size: 14px;
    line-height: 22px;
    margin-top: 10px;
    padding: 0 10px;
  }

  /* Fog opacity reduced for better readability on small screens */
  .fog-top,
  .fog-bottom {
    opacity: 0.7;
    filter: blur(5px);
  }
}

/* --- For Extra Small Devices (below 480px) --- */
@media (max-width: 480px) {
  .legacy {
    padding: 30px 10px;
  }

  .legacy-main {
    width: 180px;
  }

  .legacy2 {
    width: 160px;
    margin-top: -20px;
  }

  .legacy h2 {
    font-size: 22px;
    line-height: 28px;
  }

  .legacy-content p {
    font-size: 13px;
    line-height: 20px;
  }

  
  .legacy-images {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    top: 0;
    gap: 10px;
    left:0;
  }

.legacy-main {
  transform: rotate(-8.29deg); /* tilt left */
  position: relative;
  top: -30px;  
  left: -5px; /* slight left nudge */
  width: 200px;
  height: auto;
  z-index: 6; /* below fog layers */
  animation: flowZoomIn 4s ease forwards;
}

.legacy2 {
  position: absolute;
  width: 200px;
  top: -1px;  /* adjusted vertical alignment */
  left: 100px; /* aligned slightly right */
  transform: rotate(-8.29deg);
  opacity: 1;
  z-index: 7; /* above first image but below fog */
  pointer-events: none; /* clicks pass through */
  animation: flowZoomIn 2s ease forwards;
   animation-delay: 3.5s
}

}





