/* GENERAL */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap");

:root {
  /* Main theme */
  --theme-color: rgb(53, 53, 53);
  --theme-color-hover: rgb(0, 0, 0);

  /* Text */
  --text-color: black;
  --text-muted-color: rgb(85, 85, 85);
  --text-description-color: rgb(65, 65, 65);
  --text-tag-color: rgb(70, 70, 70);
  --text-hover-color: grey;

  /* Backgrounds */
  --background-color: white;
  --surface-color: rgb(250, 250, 250);
  --image-background-color: #f7f7f7;

  /* Borders and decoration */
  --border-color: rgb(163, 163, 163);
  --underline-color: rgb(181, 181, 181);
  --card-border-color: rgb(225, 225, 225);
  --tag-border-color: rgb(210, 210, 210);
  --button-border-color: rgb(200, 200, 200);

  /* Shadows */
  --card-shadow: rgba(0, 0, 0, 0.05);
  --card-shadow-hover: rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
}

html {
  scroll-behavior: smooth;
}

p {
  color: var(--text-muted-color);
}

/* TRANSITION */

a,
.btn {
  transition: all 300ms ease;
}

/* DESKTOP NAV */

nav,
.nav-links {
  display: flex;
}

nav {
  justify-content: space-around;
  align-items: center;
  height: 17vh;
}

.nav-links {
  gap: 2rem;
  list-style: none;
  font-size: 1.5rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  text-decoration-color: var(--background-color);
}

a:hover {
  color: var(--text-hover-color);
  text-decoration: underline;
  text-underline-offset: 1rem;
  text-decoration-color: var(--underline-color);
}

.logo {
  font-size: 2rem;
}

.logo:hover {
  cursor: default;
}

/* HAMBURGER MENU */

#hamburger-nav {
  display: none;
}

.hamburger-menu {
  position: relative;
  display: inline-block;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3 ease-in-out;
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--background-color);
  width: fit-content;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3 ease-in-out;
}

.menu-links a {
  display: block;
  padding: 10px;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3 ease-in-out;
}

.menu-links li {
  list-style: none;
}

.menu-links.open {
  max-height: 300px;
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(10px, 5px);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(10px, -5px);
}

.hamburger-icon span:first-child {
  transform: none;
}

.hamburger-icon span:first-child {
  opacity: 1;
}

.hamburger-icon span:first-child {
  transform: none;
}

/* SECTIONS */

section {
  padding-top: 4vh;
  height: 96vh;
  margin: 0 10rem;
  box-sizing: border-box;
  min-height: fit-content;
}

.section-container {
  display: flex;
}

/* PROFILE SECTION */

#profile {
  display: flex;
  justify-content: center;
  gap: 5rem;
  height: 80vh;
}

.section__pic-container {
  display: flex;
  height: 400px;
  width: 400px;
  margin: auto 0;
}

.section__text {
  align-self: center;
  text-align: center;
}

.section__text p {
  font-weight: 600;
}

.section__text__p1 {
  text-align: center;
}

.section__text__p2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.title {
  font-size: 3rem;
  text-align: center;
}

#socials-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 1rem;
}

/* ICONS */

.icon {
  cursor: pointer;
  height: 2rem;
}

/* BUTTONS */

.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  font-weight: 600;
  transition: all 300ms ease;
  padding: 1rem;
  width: 8rem;
  border-radius: 2rem;
}

.btn-color-1,
.btn-color-2 {
  border: var(--theme-color) 0.1rem solid;
}

.btn-color-1:hover,
.btn-color-2:hover {
  cursor: pointer;
}

.btn-color-1,
.btn-color-2:hover {
  background: var(--theme-color);
  color: var(--background-color);
}

.btn-color-1:hover {
  background: var(--theme-color-hover);
}

.btn-color-2 {
  background: none;
}

.btn-color-2:hover {
  border: var(--background-color) 0.1rem solid;
}

.btn-container {
  gap: 1rem;
}

/* Profile image: circle crop */
#profile .section__pic-container {
  width: 400px;
  height: 400px;
  margin: auto 0;
  overflow: hidden;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#profile .section__pic-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ABOUT SECTION */

#about {
  position: relative;
}

.about-containers {
  gap: 2rem;
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.about-details-container {
  justify-content: center;
  flex-direction: column;
}

.about-containers,
.about-details-container {
  display: flex;
}

.about-pic {
  border-radius: 2rem;
}

.arrow {
  position: absolute;
  right: -5rem;
  bottom: 2.5rem;
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  background: var(--background-color);
  border-radius: 2rem;
  border: var(--theme-color) 0.1rem solid;
  border-color: var(--border-color);
  text-align: center;
}

.section-container {
  gap: 4rem;
  height: 80%;
}

.section__pic-container {
  height: 400px;
  width: 400px;
  margin: auto 0;
}

#socials-container .icon {
  transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
}

#socials-container .icon:hover {
  transform: translateY(-3px) scale(1.08);
  opacity: 0.85;
  filter: drop-shadow(0 4px 6px var(--card-shadow-hover));
}

/* About Me Image: Square Crop */
#about .section__pic-container {
  width: 400px !important;
  height: 400px !important;
  aspect-ratio: 1 / 1;
  flex: 0 0 400px;

  margin: auto 0;
  overflow: hidden;

  border-radius: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

#about .section__pic-container img.about-pic {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 2rem;
  display: block;
}

/* EXPERIENCE SECTION */

#experience {
  position: relative;
}

.experience-sub-title {
  color: var(--text-muted-color);
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.experience-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.article-container {
  display: flex;
  text-align: initial;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 2.5rem;
  justify-content: space-around;
}

article {
  display: flex;
  width: 10rem;
  justify-content: space-around;
  gap: 0.5rem;
}

article .icon {
  cursor: default;
}

/* PROJECTS SECTION */

#projects {
  position: relative;
}

.color-container {
  border-color: var(--border-color);
  background: var(--surface-color);
}

.project-img {
  border-radius: 2rem;
  width: 90%;
  height: 90%;
}

.project-title {
  margin: 1rem;
  color: var(--text-color);
}

.project-btn {
  color: var(--text-color);
  border-color: var(--border-color);
}

/* CONTACT */

#contact {
  display: flex;
  justify-content: center;
  flex-direction: column;
  height: 70vh;
}

.contact-info-upper-container {
  display: flex;
  justify-content: center;
  border-radius: 2rem;
  border: var(--theme-color) 0.1rem solid;
  border-color: var(--border-color);
  background: var(--surface-color);
  margin: 2rem auto;
  padding: 0.5rem;
}

.contact-info-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem;
}

.contact-info-container p {
  font-size: larger;
}

.contact-icon {
  cursor: default;
}

.email-icon {
  height: 2.5rem;
}

/* FOOTER SECTION */

footer {
  height: 26vh;
  margin: 0 1rem;
}

footer p {
  text-align: center;
}

.back-to-top {
  transform: rotate(180deg);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.back-to-top:hover {
  transform: rotate(180deg) translateY(3px);
  opacity: 0.65;
}

/* ============================= */
/* Compact 2-Column Project Cards */
/* ============================= */

#projects {
  width: 100%;
  margin: 0 auto !important;
  padding: 0.9rem 1rem 1.1rem;
  box-sizing: border-box;
}

#projects .title {
  margin-bottom: 2.5rem;
}

/* 2 cards per row, but narrower and centered */
.projects-list-custom {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 500px));
  justify-content: center;
  gap: 1.5rem;
}

/* Card */
.project-row-card {
  width: 100%;
  max-width: 500px;
  min-height: 455px;

  padding: 1.1rem 1.2rem;
  border-radius: 0.75rem;
  background: var(--background-color);
  border: 1px solid var(--card-border-color);
  box-shadow: 0 6px 18px var(--card-shadow);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

  text-align: center;
  box-sizing: border-box;
  overflow: hidden;

  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-row-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px var(--card-shadow-hover);
}

/* Image: smaller and centered */
.project-row-img {
  width: 100%;
  max-width: 100%;
  height: 210px;

  object-fit: cover;
  object-position: center;

  border-radius: 0.55rem;
  border: 1px solid var(--card-border-color);
  background: var(--image-background-color);
  display: block;
  margin: 0 auto 1rem;
}

/* Main content */
.project-row-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Number + title centered */
.project-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.project-number {
  width: 36px;
  height: 36px;
  border-radius: 0.45rem;
  background: var(--theme-color);
  color: var(--background-color);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}

.project-title-row h2 {
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--text-color);
  text-align: left;
}

/* Description centered */
.project-row-main p {
  max-width: 420px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-description-color);
  text-align: center;
  margin: 0 auto;
}

/* Right side becomes centered bottom content */
.project-row-side {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.9rem;
}

/* Tech stack centered */
.project-tech-stack-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-tech-stack-row span {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--tag-border-color);
  color: var(--text-tag-color);
  background: var(--background-color);
  white-space: nowrap;
}

/* Buttons centered and not too wide */
.project-row-buttons {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.project-row-buttons button {
  min-width: 135px;
  max-width: 160px;
  padding: 0.6rem 0.8rem;

  border-radius: 0.45rem;
  border: 1.4px solid var(--button-border-color);
  background: var(--background-color);
  color: var(--text-color);

  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;

  transition: all 0.25s ease;
}

.project-row-buttons button:hover {
  border-color: var(--theme-color);
  color: var(--theme-color);
  transform: translateY(-2px);
}

/* GitHub button styling */
.project-row-buttons button:first-child {
  background: var(--theme-color);
  color: var(--background-color);
  border-color: var(--theme-color);
}

.project-row-buttons button:first-child:hover {
  background: var(--theme-color-hover);
  border-color: var(--theme-color-hover);
  color: var(--background-color);
}

/* ============================= */
/* Tablet */
/* ============================= */

@media screen and (max-width: 1550px) {
  #profile .section__pic-container,
  #about .section__pic-container {
    width: 280px !important;
    height: 280px !important;
    flex: 0 0 280px;
    margin: 0 auto;
  }
  
  .projects-list-custom {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .project-row-card {
    max-width: 520px;
  }


}

/* ============================= */
/* Phone */
/* ============================= */

@media screen and (max-width: 600px) {
  #profile .section__pic-container,
  #about .section__pic-container {
    width: 240px !important;
    height: 240px !important;
    flex: 0 0 240px;
  }
  
  #projects {
    padding: 5rem 1rem 4rem;
  }

  .projects-list-custom {
    max-width: 430px;
  }

  .project-row-card {
    min-height: auto;
    padding: 1rem;
  }

  .project-row-img {
    width: 100%;
    max-width: 100%;
    height: 210px;
    object-fit: cover;
    object-position: center;
  }

  .project-title-row {
    align-items: center;
  }

  .project-title-row h2 {
    font-size: 1.05rem;
  }

  .project-row-main p {
    font-size: 0.84rem;
  }

  .project-row-buttons {
    flex-direction: column;
  }

  .project-row-buttons button {
    width: 100%;
    max-width: none;
  }
}

/* ============================= */
/* Desktop Center Alignment */
/* For screens wider than 1200px */
/* ============================= */

@media screen and (min-width: 1201px) {
  /* Center the whole profile section content */
  #profile {
    max-width: 1200px;
    margin: 0 auto !important;
    justify-content: center;
    align-items: center;
    gap: 5rem;
  }

  #profile .section__pic-container {
    margin: auto 0;
  }

  #profile .section__text {
    max-width: 650px;
  }

  /* Center the whole About section content */
  #about {
    max-width: 1200px;
    margin: 0 auto !important;
  }

  #about .section-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
  }

  #about .section__pic-container {
    margin: auto 0;
  }

  #about .about-details-container {
    flex: 1;
    max-width: 780px;
  }
}
