* {
  box-sizing: border-box;
}

html {
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  -ms-text-size-adjust: none;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Main Page Layout */
#main-content {
  margin: 225px 425px;
  display: flex;
  flex-direction: column;
  gap: 96px;
  align-items: flex-start; /* default for desktop */
}

/* Portfolio Header */
#portfolio-header {
  display: flex;
  gap: 20px;
  align-items: center;
}

#portfolio-header-image-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-basis: 50%;
}

.portfolio-header-image {
  width: 100%;
  height: auto;
}

#portfolio-header-text-container {
  display: flex;
  flex-direction: column;
  gap: 34px;
  flex-basis: 50%;
}

/* About Section */
#about-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.about-section-content {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

/* Project Section */
#my-work-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.projects-container {
  display: flex;
  gap: 34px 16px;
  flex-wrap: wrap;
  justify-content: flex-start; /* default for desktop */
}

/* Project Cards */
.project-card {
  max-width: calc((100% - 32px) / 3);
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.project-card-text-container {
  flex-direction: column;
  display: flex;
  gap: 16px;
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  background-color: #ffffff;
}

/* Project Pages */
#project-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-header-image {
  width: 100%;
  height: auto;
}

.small-project-header-image {
  display: block;
  margin: 0 auto;
  width: 50%;
  height: auto;
}

#project-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-details-content {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

/* Project Gallery */
#project-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-video {
  display: block;
  margin: 0 auto;
  width: calc((75% - 16px) /1.5);
  flex-direction: column;
  gap: 10px;
}

.project-gallery-content {
  display: flex;
  flex-wrap: wrap;
  gap: 34px 50px;
}

.gallery-image-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-image-container.half-width {
  width: calc((75% - 16px) / 2.5);
}

.gallery-image-container.less-width {
  width: calc((75% - 16px) / 1.5);
  display: block;
  margin: 0 auto;
}

.gallery-image {
  width: 100%;
  height: auto;
}

/* ============================= */
/* NAVBAR + DROPDOWN ANIMATION  */
/* ============================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.nav-left {
  display: flex;
  align-items: center;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 220px;
  border: 1px solid #ddd;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) {
  .dropdown:hover .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Submenus */
.submenu {
  position: relative;
}

.submenu-title {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  text-decoration: none;
  color: black;
  white-space: nowrap;
}

.submenu-title:hover {
  background-color: #f2f2f2;
}

.submenu-menu {
  position: absolute;
  top: 0;
  left: 100%;
  background: white;
  min-width: 220px;
  border: 1px solid #ddd;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (hover: hover) {
  .submenu:hover .submenu-menu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }
}

.submenu.open .submenu-menu {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.submenu-menu a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: black;
  font-size: 14px;
}

.submenu-menu a:hover {
  background-color: #f2f2f2;
}

/* ============================= */
/* RESPONSIVE / MOBILE CENTERING */
/* ============================= */

/* Extra Extra large devices */
@media only screen and (max-width: 1600px) {
  #main-content {
    margin: 225px 275px;
  }
}

/* Extra large devices */
@media only screen and (max-width: 1200px) {
  #main-content {
    margin: 225px 175px;
  }
}

/* Large devices */
@media only screen and (max-width: 1000px) {
  #main-content {
    margin: 225px 75px;
  }
}

/* Small devices (800px and below) */
@media only screen and (max-width: 800px) {
  #main-content {
    margin: 150px auto; /* centers horizontally */
    padding: 0 20px;
    align-items: center; /* center children flex items */
  }

  #portfolio-header {
    flex-direction: column;
    align-items: center; /* center text & images */
  }

  #portfolio-header-text-container,
  #portfolio-header-image-container {
    flex-basis: auto;
    text-align: center;
  }

  .projects-container {
    justify-content: center; /* center project cards */
  }

  .project-card {
    max-width: 80%;
  }

  h1, h2, h3, p {
    text-align: center; /* center headings/text */
  }
}

/* Extra small devices (600px and below) */
@media only screen and (max-width: 600px) {
  #main-content {
    margin: 125px auto;
    max-width: 500px;
    padding: 0 20px;
    align-items: center;
  }

  .project-card {
    max-width: 90%;
  }

  .gallery-image-container,
  .gallery-image-container.less-width,
  .gallery-image-container.half-width {
    width: 80%;
    display: block;
    margin: 0 auto 20px auto;
  }
}

/* Responsive videos */
@media only screen and (max-width: 800px) {
  .project-video {
    width: 100%;       /* full width */
    max-width: 600px;  /* optional, prevents it from being too big on tablets */
    height: auto;      /* maintain aspect ratio */
  }
}

@media only screen and (max-width: 600px) {
  .project-video {
    width: 100%;       /* full width for small phones */
    max-width: 100%;   /* let it fill container */
    height: auto;
  }
}


.requirements-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.requirements-table th,
.requirements-table td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: left;
}

.requirements-table th {
  font-weight: 600;
}
