* {
  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: 120px 425px;
  display: flex;
  flex-direction: column;
  gap: 50px;
}

#main-content:has(#project-header) {
  margin: 120px 425px 0 425px;
}




/* 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: 85%;
  height: auto;
}

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

.header-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* 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,
#creative-work-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

/* Extra projects hidden until "See More" expands the grid to 2 rows */
.project-card.extra-project {
  display: none;
}
.projects-container.show-all .project-card.extra-project {
  display: flex;
}

#see-more-projects {
  align-self: flex-end;
  cursor: pointer;
  margin-top: 8px;
}
#see-more-projects .right-arrow-icon {
  transform: rotate(90deg);
  transition: transform 0.25s ease;
}
#see-more-projects[aria-expanded="true"] .right-arrow-icon {
  transform: rotate(270deg);
}

/* 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: cover;
  object-position: center;
}


/* Education & Skills Section */
#education-skills-section {
  display: flex;
  gap: 34px;
}

.info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.info-section-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.education-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-image-wrapper .project-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 200px;
  transition: opacity 0.25s ease;
}

.light-image {
  opacity: 1;
}

.dark-image {
  opacity: 0;
}

[data-theme="dark"] .light-image {
  opacity: 0;
}

[data-theme="dark"] .dark-image {
  opacity: 1;
}

/* Project header image — theme toggle with fade (synced to body 0.25s) */
.project-header-image-wrapper {
  display: grid;
  width: 100%;
}
.project-header-image-wrapper .project-header-image {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease;
}
.project-header-image-wrapper .light-image { opacity: 1; }
.project-header-image-wrapper .dark-image { opacity: 0; }
[data-theme="dark"] .project-header-image-wrapper .light-image { opacity: 0; }
[data-theme="dark"] .project-header-image-wrapper .dark-image { opacity: 1; }

/* Phone screenshots — cap at native width so they never upscale/blur */
.project-header-image-wrapper.phone,
.gallery-image-wrapper.phone {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Project Pages */

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

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

.project-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

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

.project-details-content.blog-content {
  gap: 24px;
}

/* 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;
}


.gallery-image-container.half-width .gallery-image-wrapper {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.gallery-image-container.half-width .gallery-image {
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-image-wrapper {
  display: grid;
  width: 100%;
}
.gallery-image-wrapper .gallery-image {
  grid-area: 1 / 1;
  width: 100%;
  height: auto;
  transition: opacity 0.25s ease;
}
.gallery-image-wrapper .light-image { opacity: 1; }
.gallery-image-wrapper .dark-image { opacity: 0; }
[data-theme="dark"] .gallery-image-wrapper .light-image { opacity: 0; }
[data-theme="dark"] .gallery-image-wrapper .dark-image { opacity: 1; }


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

  #main-content:has(#project-header) {
    margin: 140px 275px 0 275px;
  }
}

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

  #main-content:has(#project-header) {
    margin: 140px 175px 0 175px;
  }
}

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

  #main-content:has(#project-header) {
    margin: 140px 75px 0 75px;
  }
}

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

  #main-content:has(#project-header) {
    margin: 90px 50px 0 50px;
  }

  #portfolio-header {
    flex-direction: column;
  }

  .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: 95px 20px;
  }

  #main-content:has(#project-header) {
    margin: 70px 20px 0 20px;
  }

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

  #education-skills-section {
    flex-direction: column;
  }
}