/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333;
}

/* Shared horizontal padding (320px on desktop) */
.container {
  padding-left: 320px;
  padding-right: 320px;
}

/* Light, readable, sticky navbar */
nav {
  background-color: #ffffffee;
  /* light shaded */
  color: #000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  /* vertical + small base horizontal */
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links li a {
  text-decoration: none;
  color: #000;
  font-size: 1rem;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: #00bfff;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Sections */
section {
  padding: 20px 0;
  scroll-margin-top: 80px;
}

/* Home Section */
#home {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: center;
}

#home img {
  width: 100%;
  max-width: 50%;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  /* centers image */
}

.left-column {
  text-align: center;
}

.left-column p {
  margin: 8px 0;
  font-size: 1rem;
}

.left-column .email {
  color: black;
  font-weight: normal;
}

.left-column a {
  color: #0051ffa5;
  text-decoration: none;
}

.left-column a:hover {
  text-decoration: underline;
}

.right-column {
  text-align: justify;
  font-size: 1.1rem;
}

/* Research Statement */
#research-statement {
  display: flex;
  justify-content: center;
  text-align: justify;
}

#research-statement h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

/* Education */
#education {
  text-align: justify;
}

#education h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: left;
}

.edu-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  /* details : time = 3:1 */
  gap: 20px;
  margin-bottom: 15px;
}

.edu-left {
  text-align: left;
}

.edu-right {
  text-align: right;
  color: #555;
}

/* Experience */
#experience {
  text-align: justify;
}

#experience h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: left;
}

.experience-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  /* details : time = 3:1 */
  gap: 20px;
  margin-bottom: 15px;
}

.exp-left {
  text-align: left;
}

.exp-right {
  text-align: right;
  color: #555;
}

/* Publications */
#publications {
  text-align: justify;
}

#publications h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: left;
}

.pub-row {
  display: grid;
  grid-template-columns: 1fr 3fr;
  /* details : time = 3:1 */
  gap: 20px;
  margin-bottom: 15px;
}

.pub-left img {
  width: 100%;
  height: auto;
  max-width: 90%;
  display: block;
  margin: 0 auto;
  /* centers image */
}

.pub-left {
  text-align: left;
}

.pub-right {
  text-align: justify;
  color: #555;
}

/* Contact */
#contact {
  text-align: justify;
}

#contact h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  text-align: left;
}

.contact-left {
  font-size: 1rem;
}

/* Link styles (global) */
#publications a,
#experience a,
.contact-left a {
  color: #0051ffa5;
  text-decoration: none;
}

#publications a:hover,
#experience a:hover,
.contact-left a:hover {
  text-decoration: underline;
}

/* Back to Top (unchanged design) */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 10px 15px;
  font-size: 16px;
  background-color: #e8e9e9;
  color: #000;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
}

#backToTop:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* --- Responsiveness --- */

/* Tablet screens */
@media (max-width: 1024px) {
  #home img {
    max-width: 65%;
  }
}

/* Small tablets & large phones */
@media (max-width: 768px) {
  #home img {
    max-width: 80%;
  }
}

/* Phones */
@media (max-width: 480px) {
  #home img {
    max-width: 95%;
  }
}

/* Step down side padding for smaller screens */
@media (max-width: 1200px) {
  .container {
    padding-left: 200px;
    padding-right: 200px;
  }
}

@media (max-width: 992px) {
  .container {
    padding-left: 100px;
    padding-right: 100px;
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    background-color: rgba(255, 255, 255, 0.97);
    /* light, readable */
    width: 220px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

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

  .menu-toggle {
    display: block;
  }
}
@media (max-width: 1280px) {
  #home,
  #education,
  #experience {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .edu-right,
  .exp-right {
    width: 215px;
    text-align: right;
    margin-top: 5px;
  }

  #home img {
    max-width: 200px;
  }
}

@media (max-width: 1024px) {
  #home,
  #education,
  #experience {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .edu-right,
  .exp-right {
    width: 215px;
    text-align: right;
    margin-top: 5px;
  }

  #home img {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  #home img {
    max-width: 120px;
  }

  h2 {
    font-size: 1.4rem;
  }

  .right-column,
  .edu-left,
  .edu-right,
  .exp-left,
  .exp-right,
  #contact p {
    font-size: 0.9rem;
  }

  /* Education section */
  .edu-row {
    grid-template-columns: 1fr;
    text-align: center;
    row-gap: 2px;
  }

  .edu-right {
    text-align: left;
    margin-top: 2px;
  }

  /* Experience section */
  .experience-row {
    grid-template-columns: 1fr;
    text-align: center;
    row-gap: 2px;
  }

  .exp-right {
    text-align: left;
    margin-top: 2px;
  }
}
/* Publication Section Media Query */
@media (max-width: 1024px) {
  .pub-row {
    grid-template-columns: 1fr 2fr;
    /* give text more room */
  }
}

/* Mobile */
@media (max-width: 768px) {
  .pub-row {
    grid-template-columns: 1fr;
    /* stack image above text */
    text-align: center;
  }

  .pub-left img {
    max-width: 90%; /* make it almost as wide as the screen */
    display: block;
    margin: 0 auto; /* center it */
  }

  .pub-right {
    text-align: left;
    /* text aligned left under image */
    font-size: 0.95rem;
  }
}

/* Extra small */
@media (max-width: 480px) {
  .pub-left img {
    max-width: 90%; /* make it almost as wide as the screen */
    display: block;
    margin: 0 auto; /* center it */
  }

  #publications h2 {
    font-size: 1.4rem;
  }

  .pub-right {
    font-size: 0.85rem;
  }
}
