/* -----------------------------------
   General Page Styles
----------------------------------- */
html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: #ffffff;
}

/* -----------------------------------
   Navigation
----------------------------------- */
nav {
  background: #1a1a1a;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav a {
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  transition: background 0.3s;
}

nav a:hover,
nav a.active {
  background: #444;
  border-radius: 5px;
}

nav .logo {
  margin-left: auto;   /* pushes links to the right */
}

nav .logo img {
  height: 40px;         /* control logo size */
  width: auto;
}

/* -----------------------------------
   Main Content
----------------------------------- */
main {
  flex: 1;
  width: 100%;
  padding: 30px 20px; /* vertical and horizontal spacing */
  box-sizing: border-box;
}

/* -----------------------------------
   Headings
----------------------------------- */
h1 {
  font-size: 2.2rem;
  margin-bottom: 15px;
}

h2 {
  font-size: 1.8rem;
  margin-top: 15px;
  margin-bottom: 15px;
}

h3 {
  font-size: 1.4rem;
  margin-top: 15px;
  margin-bottom: 10px;
}

/* -----------------------------------
   Home
----------------------------------- */
.home-content {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.home-content .content-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
  max-width: none;
  padding: 0 40px;
  padding-left: 5px;
  box-sizing: border-box;
}
.home-content .text {
  flex: 2;
  text-align: justify;
}

.home-content .photo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.home-content .photo img {
  max-width: 250px;
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: 0px 4px 12px rgba(0,0,0,0.2);
}

/* -----------------------------------
   Project Sections
----------------------------------- */
.project-section {
  padding: 20px;
  background: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 25px;
}

.subproject {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 40px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 25px;
}

.subproject h3 {
  flex: 0 0 12%;   /* fixed width column for title */
  margin: 0;
}

.subproject-content {
  flex: 1;                     /* takes remaining space */
  display: flex;
  flex-direction: column;      /* stack p above images */
  gap: 15px;
}

.subproject-content p {
  text-align: justify;
  margin-bottom: 15px;
}

.examples {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;             /* wrap if too narrow */
}


.subproject img {
  display: inline-block;   /* align images horizontally */
  vertical-align: top;
  width: calc(40% - 5%);   /* two images per row with 10% total gap */
  margin-right: 10%;       /* horizontal space between images */
  margin-top: 15px;        /* vertical spacing from text */
  border-radius: 8px;
  height: auto;
}

.publication {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 25px;
}

.publication h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.publication-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.publication-text {
  flex: 2;
  text-align: justify;   /* justify text */
  text-align-last: left; /* align last line to left */
}

.publication-figure {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.publication-figure img {
  max-width: 500px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.software {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 25px;
}

.software h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.software-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.software-text {
  flex: 2;
  text-align: justify;   /* justify text */
  text-align-last: left; /* align last line to left */
}

.software-figure {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.software-figure img {
  max-width: 500px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* -----------------------------------
   Footer
----------------------------------- */
footer {
  background: #1a1a1a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

footer .left {
  font-size: 0.9rem;
}

footer .left a {
  color: #fff;
  text-decoration: none;
  margin-left: 10px;
  font-size: 1rem;
}

footer .left a:hover {
  color: #0ea5e9;
}

footer .socials {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 2.5rem;
}

footer .socials a {
  color: #fff;
  transition: color 0.3s, transform 0.3s;
}

footer .socials a:hover {
  color: #0ea5e9;
  transform: scale(1.1);
}



/* -----------------------------------
   Responsive Adjustments for phones
----------------------------------- */
@media (max-width: 768px) {
  /* Home content stacking */
  .home-content .content-inner {
    flex-direction: column;
    text-align: center;
  }

  .home-content .photo {
    display: flex;
    justify-content: center;  /* center horizontally */
    margin-top: 20px;         /* add spacing from text */
    width: 100%;
  }

  .home-content .photo img {
    max-width: 200px;  /* optional: keep a good size on small screens */
    height: auto;
  }

  /* Footer stacking */
  footer {
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      gap: 0;
      text-align: left;
    }

    footer .socials {
      justify-content: flex-start;
    }

    footer .left a:hover {
      color: #fff;
    }
    footer .socials a:hover {
      color: #fff;
      transform: scale(1.1);
    }



  /* Subproject stacking */
  .subproject {
    flex-direction: column;  /* stack h3, p, images */
    padding: 15px;           /* reduce padding */
    gap: 10px;               /* reduce gap */
    margin-bottom: 15px; /* smaller spacing on mobile */
  }

  .subproject h3 {
    flex: none;              /* remove fixed width */
    text-align: left;
    margin-bottom: 5px;
  }

  .subproject-content {
    flex: none;
  }

  .examples {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .examples img {
    width: 45%;              /* two per row on mobile */
    max-width: none;         /* let flexbox control size */
    height: auto;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .subproject p {
    text-align: justify;
  }

  .publication-content {
   flex-direction: column;
   align-items: center;
 }
 .publication-text {
   flex: 2;
   text-align: justify;   /* justify text */
   text-align-last: left; /* align last line to left */
 }
 .publication-figure img {
   max-width: 80%;
 }

 .software-content {
  flex-direction: column;
  align-items: center;
}
.software-text {
  flex: 2;
  text-align: justify;   /* justify text */
  text-align-last: left; /* align last line to left */
}
.software-figure img {
  max-width: 80%;
}
  nav {
      flex-wrap: wrap;              /* allow wrapping */
      justify-content: center;      /* center items across rows */
      gap: 5px 15px;                /* vertical/horizontal gaps */
    }

    nav a {
      flex: 1 1 40%;                /* each link takes ~40% of row */
      text-align: center;
      padding: 8px;
      font-size: 14px;
    }

    nav .logo {
  display: none;                /* hide logo on mobile */
}
}
