/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --text-color: #1a1a1a;        
  --background-color: #fdfbf7;  
  --accent-color: #555;         
  --link-color: #333;
  --link-hover: #000;
  --border-color: #e0e0e0;
  --font-main: 'Cormorant Garamond', serif;
  
  /* FLUID TYPOGRAPHY VARIABLES */
  /* Adjusted: Starts smaller (1.0rem) for mobile screens */
  --h2-size: clamp(1.8rem, 4vw, 2.4rem); 
  --p-size: clamp(1.0rem, 2.5vw, 1.25rem);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  font-weight: 500;
  font-size: var(--p-size); 
  padding-top: 0; 
  overflow-x: hidden; 
}

/* =========================================
   2. FULL SCREEN SECTIONS (Vertical Layout)
   ========================================= */
.full-screen-section {
    min-height: 100vh;
    width: 100%;
    
    display: flex;
    flex-direction: column;
    
    /* Center content vertically */
    justify-content: center; 
    align-items: center; 
    
    position: relative;
    padding-bottom: 50px;
}

/* SPECIAL: About View */
#about-view {
    /* REDUCED to 220px to move photo/text higher up */
    padding-top: 220px; 
}

/* SPECIAL: Education View */
#education-view {
    padding-top: 80px; 
}

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
.header-container {
  padding: 1rem 3% 0; 
  background-color: transparent; 
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: auto;
}

.logo-nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; 
  width: 100%; 
  max-width: 1400px;
  margin: 0 auto;
  transition: all 0.5s ease;
}

/* DYNAMIC LOGO SIZING */
.logo {
  height: 250px; /* Desktop Size */
  width: auto;
  opacity: 1;
  margin-right: auto; 
  transition: all 0.5s ease;
  overflow: hidden;
  margin-top: -10px; 
  z-index: 1001; 
  position: relative;
}

.logo:hover { opacity: 0.8; }

/* Scrolled State */
.header-container.scrolled {
  padding: 0.8rem 3%; 
  background-color: rgba(253, 251, 247, 0.6); 
  backdrop-filter: blur(12px); 
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
}

.header-container.scrolled .logo-nav-wrapper {
  align-items: center; 
  justify-content: center; 
}

.header-container.scrolled .logo {
  height: 0;
  width: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

/* Navigation */
nav {
  padding-top: 15px; 
}

nav ul {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 5px;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active { color: var(--link-hover); }

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--link-hover);
  transition: width 0.3s ease;
}

nav a:hover::after,
nav a.active::after { width: 100%; }

/* --- HAMBURGER MENU --- */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001; 
    position: relative;
    padding: 10px;
    margin-top: 5px;
}

.bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 6px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}

.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* =========================================
   4. LAYOUT UTILITIES
   ========================================= */
.content-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

h2 {
  font-size: var(--h2-size);
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--text-color);
  margin-top: 10px;
  opacity: 0.8;
  margin-left: auto;
  margin-right: auto;
}

.about-content h2::after,
.research-intro h2::after,
.publications-section h2::after,
.conferences-section h2::after {
    margin-left: 0;
    margin-right: 0;
}

/* =========================================
   5. ABOUT SECTION
   ========================================= */
.about-section { padding: 0; }

.about-container {
  display: flex;
  gap: 5rem;             
  align-items: center; 
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.profile-column {
  display: flex;
  flex-direction: column;
  align-items: center; 
  justify-content: center;
  gap: 2rem;
  flex-shrink: 0;
  width: 250px;
}

.portrait {
  width: 200px;
  height: 200px;
  object-fit: cover;
  object-position: 50% 20%; 
  border-radius: 50%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08); 
  transition: transform 0.3s ease;
}

.portrait:hover { transform: scale(1.02); }

.affiliation-logos {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.lab-logo,
.university-logo {
  height: 60px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.4s ease;
}

.lab-logo:hover,
.university-logo:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

.about-content { flex: 1; }
.about-content h2 { margin-top: 0; }

.about-content p {
  /* ENSURES TEXT IS ALWAYS JUSTIFIED */
  text-align: justify;
  text-justify: inter-word;
  margin-bottom: 1.5rem;
  font-size: var(--p-size);
}

/* =========================================
   6. EDUCATION
   ========================================= */
.education-section { padding: 2rem 0 0.5rem; }

.timeline {
  margin-top: 2rem;
  border-left: 1px solid var(--border-color);
  padding-left: 2rem;
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.4rem; 
  top: 8px;
  width: 11px;
  height: 11px;
  background-color: var(--background-color);
  border: 2px solid var(--text-color);
  border-radius: 50%;
}

.timeline-item h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.institution {
  font-style: italic;
  font-weight: 500;
  color: var(--accent-color);
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
}

.duration {
  font-size: 0.9rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================
   7. CV DOWNLOAD
   ========================================= */
.cv-section {
  padding: 1rem 0 2rem; 
  text-align: center;
  background-color: transparent; 
  margin-top: 0;
}

.cv-download p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.cv-button {
  display: inline-block;
  padding: 1rem 3rem;
  background-color: transparent;
  color: var(--text-color);
  text-decoration: none;
  border: 1px solid var(--text-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.cv-button:hover {
  background-color: var(--text-color);
  color: var(--background-color);
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--accent-color);
  font-size: 0.9rem;
  opacity: 0.7;
}

/* =========================================
   9. SCROLL PROMPT
   ========================================= */
.scroll-prompt {
    position: absolute; 
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s;
    z-index: 500;
    pointer-events: none;
}

.scroll-prompt span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    font-weight: 700; 
}

.scroll-line {
    width: 1px;
    height: 40px;
    background-color: var(--accent-color);
    animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* =========================================
   10. ACADEMIC PUBLICATIONS LIST
   ========================================= */
.academic-list { list-style: none; margin-top: 2rem; }

.academic-list li {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: baseline;
}

.academic-list .year {
    font-weight: 700;
    color: var(--accent-color);
    width: 60px;       
    flex-shrink: 0;   
    text-align: right;
}

.academic-list .citation { font-size: 1.15rem; color: var(--text-color); }

/* =========================================
   11. CONTACT PAGE STYLES
   ========================================= */
.contact-section { text-align: center; width: 100%; }

.contact-details {
    margin: 1.5rem 0 2.5rem; 
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.detail-item { margin-bottom: 0.8rem; font-size: 1.15rem; }

.detail-item .label {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    margin-bottom: 0.1rem;
    font-weight: 600;
}

.detail-item .value { color: var(--text-color); }

.detail-item .value.link {
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.detail-item .value.link:hover { border-bottom-color: var(--text-color); }

.social-links-container h3 { margin-bottom: 1rem; font-size: 1.6rem; }

.social-links {
    display: flex;
    gap: 1rem; 
    flex-wrap: wrap;
    justify-content: center; 
}

.social-button {
    display: inline-block;
    padding: 0.6rem 1.8rem;
    background-color: transparent;
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.social-button:hover {
    background-color: var(--text-color);
    color: var(--background-color);
}

/* =========================================
   12. PRELOADER & ANIMATIONS
   ========================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s;
    opacity: 1;
    visibility: visible;
}

#preloader.fade-out { opacity: 0; visibility: hidden; }

.quote-wrapper { max-width: 800px; padding: 0 2rem; text-align: center; }

#quote-text {
    font-size: var(--h2-size); 
    font-style: italic;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    text-align: center; 
}

.word { display: inline-block; white-space: nowrap; }

.letter {
    opacity: 0;
    display: inline-block; 
    animation: letter-appear 0.8s forwards;
    transform-origin: center;
}

#quote-author {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
    font-weight: 600;
    display: block;
    opacity: 0;
    animation: author-appear 1s ease-out forwards 1s; 
}

@keyframes letter-appear {
    from { opacity: 0; filter: blur(4px); transform: scale(1.1); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes author-appear {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   13. RESPONSIVE UTILITIES
   ========================================= */

/* --- TABLETS (769px to 1024px) --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .logo { height: 150px; }
  
  /* Reset special paddings for tablet sizes */
  #about-view { padding-top: 180px; }
  #education-view { padding-top: 80px; }
  
  .about-container { gap: 3rem; padding: 0 1rem; }
  .profile-column { width: 220px; }
  .portrait { width: 180px; height: 180px; }
  nav ul { gap: 1.5rem; }
}

/* --- MOBILE (Up to 768px) --- */
@media (max-width: 768px) {
  .logo { height: 80px; margin-right: 0; margin-top: 0; }
  
  #about-view { padding-top: 120px; }
  #education-view { padding-top: 80px; }
  
  .full-screen-section { 
      min-height: auto; 
      padding-bottom: 50px; 
      justify-content: flex-start;
  }

  .hamburger { display: block; margin-top: 0; }
  
  .logo-nav-wrapper { 
      align-items: center; 
      justify-content: space-between; 
  }
  
  nav {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100vh;
      background-color: var(--background-color);
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      opacity: 0;
      visibility: hidden;
      pointer-events: none; 
      transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
      z-index: 1000; 
      padding-top: 0;
  }

  nav.active { opacity: 1; visibility: visible; pointer-events: auto; }
  
  nav ul { 
      flex-direction: column; 
      gap: 3rem; 
      font-size: 1.5rem; 
      text-align: center;
  }

  .about-container { flex-direction: column; gap: 2rem; text-align: center; }
  .profile-column { width: 100%; margin-bottom: 1rem; }
  .affiliation-logos { flex-direction: row; justify-content: center; gap: 2rem;}
  
  /* MAINTAIN JUSTIFICATION ON MOBILE */
  /* Previously this was overridden to 'left', now it inherits 'justify' from above */
  
  h2::after { margin-left: auto; margin-right: auto; }
  .about-content h2::after { margin-left: auto; margin-right: auto; }
  .content-container { padding: 0 1.5rem; }
  .scroll-prompt { bottom: 20px; }
}