@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&family=Nunito:wght@400;700&display=swap");

/* Cafe theme variables */
:root {
  --bg: #fff7ef;
  --paper: #fffaf5;
  --ink: #2b2b2b;
  --c1: #f9d3b4;
  --c2: #ffd9e0;
  --c3: #e8f2dd;
  --c4: #ffe9bf;
  --line: #7c584c;
  --shadow: 0 10px 30px rgba(124, 88, 76, .12);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px; /* Account for sticky nav */
}

body {
  font-family: "Nunito", 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Subtle cafe background blobs */
  background:
    radial-gradient(circle at 12% 10%, #fff2e6 0 20%, transparent 21%),
    radial-gradient(circle at 85% 20%, #ffeef5 0 22%, transparent 23%),
    radial-gradient(circle at 20% 85%, #f0fae9 0 18%, transparent 19%),
    var(--bg);
}

main {
  display: block;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: "Quicksand", 'Inter', sans-serif;
  color: #111;
  margin-top: 2em;
  margin-bottom: 0.8em;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: .2px;
}

h1 { font-size: 2.2em; }
h2 { 
  font-size: 1.8em; 
  margin-top: 0; /* Remove top margin for section headings */
  padding-top: 20px; /* Add padding instead for better spacing */
}
h3 { font-size: 1.4em; }

p {
  margin-bottom: 1.2em;
}

/* Links */
a {
  color: var(--line);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:visited {
  color: var(--line);
}

a:hover {
  opacity: .85;
}

a:active {
  color: var(--line);
}

/* Intro Section */
.intro-section {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 20px 0 40px 0;
  border-bottom: 2px solid #f3e2d7;
  flex-wrap: wrap;
}

.profile-pic-container {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--c1);
  box-shadow: var(--shadow);
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex-grow: 1;
  text-align: left;
  max-width: 560px;
}

.profile-info h1 {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: 2em;
  color: var(--ink);
}

.profile-info p {
  margin: 2px 0;
  line-height: 1.5;
  color: #555;
  font-size: 1em;
}

.social-links {
  margin-top: 15px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.social-links a {
  padding: 8px 16px;
  background: linear-gradient(90deg, var(--c3), var(--c4));
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-links a:hover {
  background: linear-gradient(90deg, var(--c1), var(--c2));
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow);
  opacity: 1;
}

.social-links:hover::before {
  opacity: 1;
}

.social-links {
  position: relative;     
  display: inline-flex;   
  gap: 15px;
}

.miffy-floater {
  position: absolute;
  top: -20%;
  left: calc(100% + 15px); 
  transform: translateY(-50%);
}

.miffy-floater img {
  width: 150px;  
  height: auto;
}

@media (max-width: 900px){
  .miffy-floater{
    position: static;
    transform: none;
    margin-left: 0;
  }
  .miffy-floater img{ width: 80px; }
}


/* Navigation */
nav.main-navigation {
  position: sticky;
  top: 0;
  z-index: 900;
  background-color: var(--paper);
  padding: 15px 0;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 40px;
  border: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(124, 88, 76, 0.1);
}

nav.main-navigation a {
  font-size: 1em;
  color: var(--line);
  text-decoration: none;
  margin: 0 15px;
  transition: all 0.2s ease;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
}

nav.main-navigation a:hover {
  background: var(--c1);
  opacity: 0.9;
}

/* Content Sections */
#about, #projects, #posters, #education, #interests {
  max-width: 760px;
  margin: 0 auto 60px auto;
  padding: 0;
  box-sizing: border-box;
}

#about h2, #projects h2, #posters h2, #education h2, #interests h2 {
  margin-bottom: 20px;
  font-size: 2rem;
  text-align: left;
  margin-top: 0;
  padding-top: 0;
}

/* Education Section */
.education-card {
  background: linear-gradient(180deg, #fff, #fffaf6);
  border: 2px solid #f3e2d7;
  border-left: 5px solid var(--c2);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.education-card:hover {
  box-shadow: 0 20px 40px rgba(124, 88, 76, .25);
  transform: translateY(-5px) scale(1.02);
  text-decoration: none;
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.education-header h3 {
  margin: 0;
  font-size: 1.25em;
  color: var(--line);
}

.education-dates {
  font-size: 0.9em;
  color: #666;
  font-style: italic;
}

.education-degree {
  font-size: 0.95em;
  color: #333;
  margin: 0 0 10px 0;
  line-height: 1.6;
}

.education-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.95em;
  color: #333;
  line-height: 1.6;
}

.education-list li {
  margin-bottom: 6px;
}

.education-list li:last-child {
  margin-bottom: 0;
}

.education-card[role="link"] {
  cursor: pointer;
}

.inline-link {
  font-weight: 600;
  color: var(--line);
  text-decoration: underline;
  text-decoration-color: rgba(124, 88, 76, 0.3);
  text-underline-offset: 2px;
}

.inline-link:hover {
  text-decoration-color: var(--line);
}

/* Posters Section */
.posters-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-top: 10px;
}

.poster-card {
  background: linear-gradient(180deg, #fff, #fffaf6);
  border: 2px solid #f3e2d7;
  border-left: 5px solid var(--c1);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.poster-card:hover {
  box-shadow: 0 20px 40px rgba(124, 88, 76, .25);
  transform: translateY(-5px) scale(1.02);
  text-decoration: none;
}

.poster-card .poster-citation {
  font-size: 0.95em;
  color: #333;
  margin: 0;
  line-height: 1.6;
}

.poster-card .poster-doi {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: var(--line);
}

.poster-card:hover .poster-doi {
  text-decoration: underline;
}

/* About Section */
#about p {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 16px;
  text-align: left;
}

/* Projects Section */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding-top: 10px;
  margin: 0;
}

.project-card {
  background: linear-gradient(180deg, #fff, #fffaf6);
  border: 2px solid #f3e2d7;
  border-left: 5px solid #b5d49a;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  box-shadow: 0 20px 40px rgba(124, 88, 76, .25);
  transform: translateY(-5px) scale(1.02);
  text-decoration: none;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.25em;
  color: var(--line);
}

.project-card .project-tags {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 15px;
}

.project-card .project-description {
  font-size: 0.95em;
  color: #444;
  flex-grow: 1;
  margin-bottom: 0;
}

.interests-intro p {
  margin-bottom: 8px;  
  text-align: center;   
}


.interests-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  padding-top: 10px;
  margin: 0;
}

.interest-card {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  border: 2px solid #f3e2d7;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.interest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--c3), var(--c4));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.interest-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(124, 88, 76, .25);
}

.interest-card:hover::before {
  opacity: 1;
}

.interest-card .interest-name {
  font-weight: 600;
  font-size: 1.1em;
  color: var(--ink);
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Cafe Audio Control Styles */
.cafe-audio {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffffcc;
  backdrop-filter: blur(6px);
  border: 1px solid #ead8cb;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.cafe-audio .miffy-button {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.cafe-audio .miffy-button:hover {
  transform: scale(1.05);
}

.cafe-audio .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aaa;
}

.cafe-audio.playing .dot {
  background: #64c27b;
}

.cafe-icon {
  width: 25px;   
  height: 25px;
  object-fit: contain;
}



/* Responsive Design */
@media (max-width: 768px) {
  .intro-section {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

  .profile-info {
    text-align: center;
  }

  .profile-pic-container {
    width: 140px;
    height: 140px;
  }

  nav.main-navigation a {
    margin: 0 8px;
    font-size: 0.9em;
  }
  
  .social-links {
    justify-content: center;
  }

  main {
    padding: 20px 15px;
  }

  .interests-container {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .interest-card {
    padding: 15px;
    min-height: 50px;
  }
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none;
    transition: none;
  }
}
