/* =========================
   RESET & BASE
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: #111827;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* =========================
   TOP CONTINUOUS SCROLL BAR
   ========================= */
.top-scroll {
  width: 100%;
  height: 44px;
  background-color: #F9FAFB;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
}

/* SCROLL TRACK */
.scroll-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 500s linear infinite;
  width: fit-content;
}

/* SCROLL GROUP */
.scroll-group {
  display: flex;
  align-items: center;
  gap: 48px;
  /* 4x Gap (Large visual separation) between items */
  padding-right: 48px;
  /* Gap after the group to separate from next group */
}

/* SCROLL ITEM */
.scroll-group>span {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Gap between Title and Content Words */
  font-size: 14px;
  color: #6B7280;
}

.scroll-track strong {
  font-weight: 600;
  color: #111827;
}

.scroll-content {
  color: #6B7280;
}

/* CONTINUOUS ANIMATION */
@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* MOBILE – SLOWER */
@media (max-width: 768px) {
  .scroll-track {
    animation-duration: 35s;
  }
}

/* =========================
   HEADER
   ========================= */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    justify-content: center;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
  }

  .nav-item {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
  }
}

.logo {
  display: flex;
  align-items: center;
}

.logo a {
  display: block;
  /* Removes inline spacing */
  text-decoration: none;
  border: none;
}

.logo img {
  height: 36px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  gap: 8px;
  background-color: #F3F4F6;
  padding: 4px;
  border-radius: 999px;
  /* Pill shape container */
}

.nav-item {
  text-decoration: none;
  color: #4B5563;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 999px;
  /* Pill shape buttons */
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: #111827;
}

.nav-item.active {
  background-color: #111827;
  color: #ffffff;
}

/* =========================
   HERO SECTION
   ========================= */
.hero {
  /* Reduced top padding as requested to bring image closer to header. */
  padding: 40px 40px 43px 40px;
  /* Bottom padding removed */
  max-width: 1600px;
  /* Wider for 3-column layout */
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 40px;
  /* Space between columns */
}

/* SIDE CONTENT (Text) */
.hero-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.hero-side.left {
  text-align: right;
  /* Align left text towards the image */
  align-items: flex-end;
}

.hero-side.right {
  text-align: left;
  /* Align right text away from image */
  align-items: flex-start;
}

/* IMAGE WRAPPER (Center) */
.image-wrapper {
  flex: 0 0 auto;
  /* Don't grow/shrink */
  width: 500px;
  /* Fixed width base, can adjust */
  max-width: 35vw;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);

  /* Animation */
  opacity: 0;
  transform: scale(0.95);
  animation: heroImageEnter 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.profile-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-container:hover .profile-img {
  transform: scale(1.02);
}

/* TYPOGRAPHY */
.hero h1 {
  font-size: 64px;
  line-height: 1.0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  margin-bottom: 24px;

  /* Flex Layout for Stacking */
  display: flex;
  flex-direction: column;

  /* Animation */
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideUp 1s ease-out 0.4s forwards;
}

.hero-side.left h1 {
  align-items: center;
  font-size: 48px;
  /* Further reduced from 48px */
  /* Centers MECHANICAL, &, AEROSPACE */
}

.hero-side.right h1 {
  align-items: flex-start;
  /* Keeps DESIGN ENGINEER left-aligned */
}

.hero-side.right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* Ensures desc aligns with h1 */
}

.ampersand {
  font-size: 0.8em;
  /* Slightly smaller for elegance */
  margin: 4px 0;
  color: #111827;
}

.hero-desc {
  font-size: 18px;
  line-height: 1.5;
  color: #374151;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 400px;

  /* Animation */
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideUp 1s ease-out 0.6s forwards;
}

.highlight {
  display: block;
  margin-top: 8px;
  font-weight: 500;
  color: #111827;
}

/* Keyframes */
@keyframes heroImageEnter {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeSlideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero {
    padding: 40px 20px;
  }

  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 32px;
  }

  .hero-side.left,
  .hero-side.right {
    text-align: center;
    align-items: center;
    flex: none;
    width: 100%;
  }

  .hero-side.left h1 {
    font-size: 42px;
  }

  .hero-side.right h1 {
    font-size: 42px;
    align-items: center;
  }

  .image-wrapper {
    width: 100%;
    max-width: 320px;
    order: 2;
  }

  .hero-side.left {
    order: 1;
  }

  .hero-side.right {
    order: 3;
    align-items: center;
  }

  .hero-desc {
    max-width: 100%;
    font-size: 16px;
    padding: 16px;
  }
}

@media (max-width: 480px) {

  .hero-side.left h1,
  .hero-side.right h1 {
    font-size: 36px;
  }
}

/* =========================
   GALLERY SECTION
   ========================= */
/* =========================
   GALLERY SECTION
   ========================= */
/* =========================
   GALLERY SECTION
   ========================= */
/* Sub-styles for gallery elements below... */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0px 40px;
  width: 100%;
  max-width: 1400px;
  margin: 20px auto;
}

@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px;
  }
}

@media (max-width: 640px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .gallery-title {
    height: auto;
    padding: 40px 0;
  }

  .project-card {
    height: auto;
  }

  .project-media {
    margin-top: 0;
  }
}

.gallery-title {
  width: 100%;
  height: 500px;
  /* Match project card height */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
}

.gallery-title h2 {
  font-size: 48px;
  line-height: 1.1;
  font-weight: 700;
  color: #271311;
  text-align: center;
  /* Center text in the grid cell */
}

.project-card {
  width: 100%;
  height: 600px;
  /* Increased height to accommodate shifted image and bottom text */
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  background: none;
  box-shadow: none !important;
}

.project-card:hover {
  transform: translateY(-4px);
}

/* Specific overrides can be removed as we generalized the styles */

.project-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 20px;
  background: #f9fafb;
  margin-top: 40px;
  /* Move image slightly down */
}

.project-media img {
  width: 100%;
  height: 110%;
  /* Slightly larger to allow for crop shift */
  object-fit: cover;
  object-position: center bottom;
  display: block;
}

.project-info {
  margin-top: auto;
  /* Push text to the bottom most */
  padding: 24px 0;
  text-align: left;
}

.project-info h3 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.project-info p {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
}

/* =========================
   INDIVIDUAL PROJECT CODES
   ========================= */

/* Project 1 - Aircraft Wing Rib */
.project-1 {
  background: transparent;
}

/* Project 2 - Aerospace Component Drafting */
.project-2 {
  background: transparent;
}

/* Project 3 - Aerospace Component 3D */
.project-3 {
  background: transparent;
}

/* Project 4 - Mechanical Assembly */
.project-4 {
  background: transparent;
}

/* Project 5 - Simulation Study */
.project-5 {
  background: transparent;
}

.card-content {
  width: 100%;
  height: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Align content to bottom if we add text */
}

/* Mockup containers inside */
.card-image {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* =========================
   FOOTER
   ========================= */
/* =========================
   FOOTER
   ========================= */
footer {
  padding: 40px;
  border-top: 1px solid #F3F4F6;
  margin-top: 40px;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-container p {
  color: #9CA3AF;
  font-size: 14px;
  margin: 0;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-link {
  color: #9CA3AF;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #111827;
}

.linkedin-icon {
  color: #9CA3AF;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
}

.linkedin-icon:hover {
  color: #0077B5;
  /* LinkedIn Blue */
  transform: translateY(-2px);
}

.upwork-icon {
  color: #9CA3AF;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
}

.upwork-icon:hover {
  color: #14a800;
  /* Upwork Green */
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .footer-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* =========================
   SERVICES SECTION
   ========================= */
#services {
  padding-top: 40px;
  max-width: 1200px;
}

.section-intro {
  max-width: 2000px;
  margin: 0 auto 48px auto;
  font-size: 18px;
  line-height: 1.6;
  color: #4B5563;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 40px;
  text-align: left;
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: #ffffff;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 24px 32px;
  /* Reduced vertical padding, adjusted horizontal */
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.service-card:hover {
  border-color: #9CA3AF;
}

.service-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}

.service-desc {
  font-size: 15px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 24px;
}

.service-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  flex-grow: 1;
}

.service-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #6B7280;
  line-height: 1.5;
}

.service-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #9CA3AF;
}

.deliverables {
  font-size: 13px;
  color: #4B5563;
  padding-top: 20px;
  border-top: 1px solid #F3F4F6;
  margin: 0 !important;
  text-align: left !important;
}

.deliverables strong {
  color: #111827;
  font-weight: 600;
}

.engagement-note {
  margin-top: 60px;
  font-size: 16px;
  font-style: italic;
  color: #6B7280;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   CONTENT SECTIONS (About / Contact)
   ========================= */
html {
  scroll-behavior: smooth;
}

#about {
  padding-top: 10px;
}

#about .section-container {
  text-align: justify;
  /* Better for long-form text */
  max-width: 800px;
  margin: 0 auto;
}

#about h2 {
  text-align: center;
  margin-bottom: 48px;
}

#about p {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 24px;
  /* More standard paragraph spacing */
}

.content-section,
.gallery {
  scroll-margin-top: 100px;
  /* Offset for fixed header */
}

.content-section {
  padding: 80px 20px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .content-section {
    padding: 60px 20px;
  }

  .section-container h2 {
    font-size: 32px;
  }
}

.section-container {
  text-align: center;
}

.section-container h2 {
  font-size: 40px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #111827;
}

.section-container p {
  font-size: 18px;
  line-height: 1.6;
  color: #4B5563;
  margin-bottom: 48px;
}

/* =========================
   CONTACT SECTION
   ========================= */
#contact {
  padding-top: 10px;
}

.contact-container {
  display: flex;
  gap: 80px;
  text-align: left;
  max-width: 1200px;
  /* Increased from 1000px */
  margin: 0 auto;
}

.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-method {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-method strong {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
}

.contact-method a {
  font-size: 20px;
  color: #111827;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.contact-method a:hover {
  color: #4B5563;
}

.response-note {
  margin-top: auto;
  font-size: 14px;
  color: #6B7280;
  font-style: italic;
}

.contact-form {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Reduced from 16px */
  background: #F9FAFB;
  padding: 20px 32px;
  /* Reduced vertical padding from 24px */
  border-radius: 24px;
  border: 1.5px solid #E5E7EB;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #D1D5DB;
  font-family: inherit;
  font-size: 15px;
  color: #111827;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.05);
}

.file-input {
  padding: 8px 0 !important;
  border: none !important;
  background: transparent !important;
  font-size: 14px;
  cursor: pointer;
}

.contact-form .cta-button {
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

@media (max-width: 850px) {
  .contact-container {
    flex-direction: column;
    gap: 48px;
  }
}

.cta-button {
  display: inline-block;
  background-color: #111827;
  color: #ffffff;
  padding: 16px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  background-color: #374151;
}

/* =========================
   VIDEO & ANIMATIONS
   ========================= */
.project-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.fade-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* FINAL SPACING OVERRIDES */
#work.work-section {
  padding-top: 0 !important;
  padding-bottom: 60px;
  max-width: 100% !important;
  margin-top: -20px;
  /* Slight pull-up */
}

/* Ensure the gallery title box is aligned tight to the top */
.gallery-title {
  height: 500px;
  align-items: flex-start;
  /* Move text to top of its grid cell if gap persists */
  padding-top: 20px;
}