* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background-color);
  position: relative;
  min-height: 100vh;
}



/* Background image overlay - sits on top of solid background */
html::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: var(--current-background-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--current-background-opacity);
  pointer-events: none;
  z-index: -1;
  /* Ensure smooth rendering */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

/* Alternative: If still flickering, uncomment this noise overlay approach */
/*
html::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>');
  pointer-events: none;
  z-index: -1;
  opacity: 0.3;
}
*/




/* Main Page Layout */

#main-content {
  margin: 225px 425px;
  display: flex;
  flex-direction: column;
  gap: 96px;
}




/* Portfolio Header */

#portfolio-header {
  display: flex;
  gap: 100px;
  align-items: center;
}

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

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

.portfolio-header-image {
  width: 100%;
  height: 400px; /* Fixed height for square aspect ratio */
  object-fit: cover; /* Crops image to fit square */
  object-position: center; /* Centers the crop */
  border: 3px solid var(--text-color);
  border-radius: 50px;
  padding: 8px;
}

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

/*:This is the gap between the text-header and the text*/
.header-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}




/* About Section */

#about-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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




/* Project Section */

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

.projects-container {
  display: flex;
  gap: 34px 16px;
  flex-wrap: wrap;
}

    /* Project Cards */

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

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

    .project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  border: 3px solid var(--text-color);
  border-radius: 20px;
  padding: 8px;
}




/* Project Pages */

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

.project-header-image {
  width: 100%;
  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-gallery-content {
      display: flex;
      flex-wrap: wrap;
      gap: 34px 16px;
    }

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

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

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


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

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

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

/* Small devices (portrait tablets and large phones, 800px and below) */
@media only screen and (max-width: 800px) {
  #main-content {
    margin: 150px 50px;
  }

  #portfolio-header {
    flex-direction: column;
    gap: 50px;
    align-items: center;
  }

  .portfolio-header-image {
    height: 300px; /* Smaller square for mobile */
  }

  .project-card {
    max-width: calc((100% - 16px) / 2);
  }
}

/* Small devices (portrait tablets and large phones, 600px and below) */
@media only screen and (max-width: 600px) {
  #main-content {
    margin: 125px 20px;
  }

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



