body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #333;
}

/* Header */
header {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  height: 560px;
  background: center center / cover no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  padding: 0 20px;
  position: relative;
  overflow: hidden;
}

header.loaded {
  opacity: 1;
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
}

header * {
  position: relative;
  z-index: 1;
}

header img {
  max-width: clamp(220px, 40vw, 480px);
  width: 100%;
}

header h6 {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  margin: 25px 0;
}

header p {
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  margin-top: 10px;
  opacity: 0;
  transition: opacity 1s ease-in-out 0.5s;
}
header.loaded h6 {
  opacity: 1;
}

/* Sections */
section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 20px;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.5;
}

p {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  margin-bottom: 20px;
}

#contact p {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  text-align: center;
  padding: 0 10%;
}

/* Flex container for About & Contact */
.flex-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.flex-container img {
  max-width: 360px;
  width: 100%;
  border-radius: 10px;
  height: 480px;
  object-fit: cover;
  box-shadow: 5px 5px 10px #ccc;
}

.flex-container .text {
  flex: 1;
  min-width: 250px;
}

/* Contact Form */
form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 500px;
  margin: 20px auto 0 auto; /* center form */
}

input,
textarea {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
  box-sizing: border-box;
}

button {
  padding: 12px;
  font-size: 1rem;
  background-color: #111;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%; /* ✅ full width */
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #333;
}

/* Footer */
footer {
  background: #f4f4f4;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .flex-container {
    flex-direction: column;
    text-align: left;
        gap: 0px;
  }

  header {
    height: 400px;
    background-attachment: scroll;
  }

  .flex-container img {
    margin: 0 auto;
    height: 320px;
  }

  #about .flex-container,
  #contact .flex-container {
    flex-direction: column;
    text-align: center;
    position: relative; /* needed for h2 absolute positioning */
  }

  #about .flex-container img,
  #contact .flex-container img {
    width: 100%;
    height: auto;
    position: relative;
    display: block;
  }

  #about .flex-container h2,
  #contact .flex-container h2 {
    position: absolute;
    top: -50%; /* vertically centered */
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    font-size: clamp(1.4rem, 5vw, 2rem);
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 2;

    /* Add bottom-to-top animation */
    opacity: 0;
    transform: translate(-50%, 50%); /* start slightly below */
    transition: all 0.8s ease-out;
  }

  #about .flex-container h2.aos-animate,
  #contact .flex-container h2.aos-animate {
    opacity: 1;
    transform: translate(-50%, -50%); /* final position centered */
  }

  #about .flex-container .text,
  #contact .flex-container .text {
    margin-top: 20px;
    text-align: left;
    position: relative;
    z-index: 1;
  }

  /* Ensure image comes first in Contact section */
  #contact .flex-container img {
    order: -1;
  }
}

@media (max-width: 480px) {
  header {
    height: 320px;
    padding: 0 10px;
  }

  .flex-container img {
    height: 260px;
  }

  section {
    padding: 10px 20px;
  }
  #about{
    padding-top: 30px !important;
  }

  #contact p {
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    text-align: left;
    padding: 0;
  }
}
