@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Inter:wght@300;400;600&display=swap&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900');

:root {
    --font-serif: 'Libre Baskerville', serif;
    --font-head: 'Source Serif 4', serif;
    --font-sans: 'Inter', sans-serif;
    --color-theme-toggle: #50a887;
    
    --max-width: 800px;
}

/* Reset & layout basics */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  margin: 0;
  line-height: 1.6;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

/* ----- NAVIGATION BAR ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
}

/* .navbar.scrolled {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
} */

#theme-toggle {
  /* position: absolute; */
  left: 1rem;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.5s ease;
}

#theme-toggle:hover {
  transform: rotate(-25deg);
  color: var(--color-theme-toggle)
}


.nav-container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  position: relative;
}

.nav-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.nav-center {
  flex: 1;
  display: flex;
  flex-direction: row;
  position: relative;
  align-self: center;
  align-items: center;
  gap: 3rem;
}

.nav-name {
  font-family: var(--font-head);
  font-weight: 300;
  font-size: 1.8rem;
  text-decoration: none;
}

/* ----- HEADER ----- */

h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.4rem;
  margin: 0;
}

.tagline {
  font-style: italic;
  margin-top: 0.5rem;
}

/* ----- SECTIONS ----- */
section {
  margin-bottom: 3rem;
}

/* About section layout */
.about-section {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}

.about-content {
  flex: 3; /* main text column */
}

.about-image {
  flex: 2; /* image column */
  display: flex;
  position: relative;
  justify-content: center;
  align-items: start;
}

.about-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 40px 20px var(--background);
  pointer-events: none;
}

/* .about-image img {
  max-width: 100%;
  height: auto;
} */

.about-image img {
  /* max-width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.6s ease, box-shadow 0.6s ease; */
  max-width: 80%;
  height: auto;
  filter: grayscale(100%);
  
  transition: transform 0.5s ease, filter 0.5s ease;
}

.about-image:hover img {
  filter: grayscale(0%) contrast(1.05);
}

.pubs-section {
  margin: 2rem auto;
  max-width: 950px;
  text-align: left;
}

.publications {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0; /* no gap, we’ll control overlap manually */
  margin-top: 5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow: visible;
  scroll-behavior: smooth;
  padding-bottom: 2rem;
}

.publications.mobile .pub-details {
  display: block !important;
}

/* Each paper card */
.pub {
  position: relative;
  max-width: 330px;
  max-height: 465px;
  margin-left: -60px; /* creates the overlap */
  transition:
    transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.3s ease,
    z-index 0.2s;
  cursor: pointer;
  z-index: 1;
  transform: rotate(calc(var(--r, 0deg))) translateY(calc(var(--y, 0px)));
}

/* Slightly randomized positions for natural layout */
.pub:nth-child(1) { --r: -3deg; --y: 10px; z-index: 4; }
.pub:nth-child(2) { --r: 2deg;  --y: -5px; z-index: 3; }
.pub:nth-child(3) { --r: -1.5deg; --y: 6px; z-index: 2; }
.pub:nth-child(4) { --r: 1deg; --y: -8px; z-index: 1; }

.pub img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.12);
  transition: box-shadow 0.3s ease;
}

/* Hover: lift, straighten, and bring to front */
.pub:hover {
  transform: scale(1.1) rotate(0deg) translateY(-15px);
  z-index: 998;
}

.pub:hover img {
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

/* Tooltip styling — unchanged */
.pub-tooltip {
  position: fixed;
  display: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  max-width: 380px;
  font-size: 0.9rem;
  text-align: left;
  pointer-events: none;
  backdrop-filter: blur(10px);
  z-index: 999;
  transition: opacity 0.2s ease, transform 0.15s ease;
  transform: translateY(2px);
  opacity: 0;
}

.pub-tooltip.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

h2 {
  font-family: var(--font-head);
  font-weight: 250;
  font-size: 1.1 rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  position: relative;
  margin: 2rem 0 1rem;
}
h2::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10%;
  width: 60px;
  height: 1px;
  background: #ddd;
}

h3 {
  font-family: var(--font-serif);
  margin-bottom: 0.4rem;
}

a:hover {
  text-decoration: underline;
  color: var(--color-theme-toggle)
}

/* ----- FOOTER ----- */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
}

/* Transition for theme */
body,
.navbar,
a,
button,
h1, h2, h3, h4, h5, h6, p {
  transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 700px) {
  .nav-container {
    flex-direction: column;
    align-items: center;
  }

  .nav-left {
    align-items: center;
  }

  .nav-center {
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .about-section {
    flex-direction: column; /* image below text */
    gap: 1.5rem;
  }

  .about-image {
    justify-content: center;
  }

.about-image img {
  max-width: 50%;
}

  .publications {
      display: block;          /* force vertical flow */
      padding: 1rem;
      max-width: 720px;
      margin: 0 auto;
    }

  .pub {
    display: flex !important;   /* ensure horizontal card */
    align-items: flex-start;
    gap: 1rem;
    width: 100% !important;
    margin-left: 0 !important;
    transform: none !important;
    box-shadow: none;
    padding: .5rem 0;
  }

  .pub img {
    width: 96px;            /* thumbnail on left */
    height: 128px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  }

  /* generated details become visible on mobile */
  .pub .pub-details {
    display: block;
    flex: 1;
  }

  .pub .pub-details h4 {
    margin: 0 0 .25rem 0;
    font-size: 1rem;
    line-height: 1.15;
  }

  .pub .pub-details p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.3;
  }

  /* hide floating tooltip on mobile to avoid duplicate UI */
  .pub-tooltip {
    display: none !important;
    opacity: 0 !important;
  }

  /* optional divider between items */
  .pub + .pub {
    border-top: 1px solid var(--border-color, #eee);
    padding-top: 1rem;
  }

  main {
  padding-top: 8rem; /* offset for navbar */
  }
}
