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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.7;
  color: #333;
  background-color: #ffffff;
  min-height: 100vh;
  position: relative;
}


/* Smooth scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 66px;
}

/* ===== Hero (nav + intro with cloud) ===== */
.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 100%;
  background-image: url('cloud.png');
  background-size: cover;
  background-position: center 100%;
  background-repeat: no-repeat;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  animation: floatCloud 60s ease-in-out infinite;
  transition: opacity 1.2s ease-in-out;
}

.hero.school-active::before {
  opacity: 0;
}

@keyframes floatCloud {
  0% {
    transform: translateX(0) scale(1);
  }
  25% {
    transform: translateX(3%) scale(1.02);
  }
  50% {
    transform: translateX(-2%) scale(1);
  }
  75% {
    transform: translateX(1%) scale(1.01);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

/* School background layers (hidden by default, used for season cycling) */
.school-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 1.2s ease-in-out;
  animation: subtleZoom 99s ease-in-out infinite;
}

.school-bg.active {
  opacity: 0.55;
}

@keyframes subtleZoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Toggle button */
.bg-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.bg-toggle-btn:hover {
  transform: scale(1.3);
}

/* Fade cloud to white at the bottom of hero */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 15%;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ===== Navigation ===== */
nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #eee;
  z-index: 100;
  padding: 14px 0;
}

nav .nav-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 60px;
  display: flex;
  justify-content: center;
  gap: 0;
}

nav a {
  color: #555;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  flex: 1;
  text-align: center;
  padding: 4px 0;
}

nav a:hover {
  color: #000;
}

/* ===== Container ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 40px 60px;
}

/* ===== Typography ===== */
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #222;
  margin: 50px 0 20px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
}

p {
  margin-bottom: 14px;
  color: #444;
  font-size: 1rem;
}

a {
  color: #00ff00;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #00ff00;
}

/* ===== Introduction section ===== */
.intro {
  padding: 40px 0 20px;
  text-align: center;
  position: relative;
}

.intro-content {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  text-align: left;
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 40px;
}

.profile-container {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-image {
  width: 366px;
  height: 366px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.intro-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding-top: 10px;
}

.intro-text h1 {
  text-align: center;
}

.intro-text .subtitle {
  color: #111;
  font-size: 1rem;
  margin-bottom: 16px;
  line-height: 1.6;
  text-align: center;
}

.intro-text .subtitle a {
  color: inherit;
  text-decoration: none;
}

.intro-text .subtitle a:hover {
  color: inherit;
  text-decoration: none;
}

.intro-text .subtitle .minor {
  color: #666;
  font-size: 0.9rem;
}

.edu-group {
  text-align: center;
  margin-bottom: 6px;
}

.edu-school {
  font-weight: 600;
  color: #222;
  font-size: 0.95rem;
}

.edu-degree {
  color: #444;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Links row: plain text separated by slashes */
.links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.links a {
  color: #2d9f5e;
  text-decoration: none;
  font-size: 0.95rem;
}

.links a:hover {
  text-decoration: underline;
}

.links .sep {
  color: #bbb;
  font-size: 0.9rem;
  user-select: none;
}

/* ===== Research / Bio section ===== */
.research {
  padding: 10px 0 0;
  margin-top: 1px;
  position: relative;
  z-index: 1;
}

/* Bio inside hero needs its own width constraints */
.hero .research {
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.research p {
  line-height: 1.75;
  text-align: justify;
  color: #111;
}

.research a {
  color: #2d9f5e;
}

/* ===== News section ===== */
.news ul {
  list-style: none;
  padding: 0;
}

.news li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
  color: #444;
}

.news li:last-child {
  border-bottom: none;
}

.news strong {
  color: #222;
  font-weight: 600;
  margin-right: 4px;
}

/* ===== Publications section ===== */
.pub {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: flex-start;
}

.pub:last-child {
  border-bottom: none;
}

.pub-media {
  flex-shrink: 0;
  width: 200px;
}

.pub-media img,
.pub-media video {
  width: 100%;
  height: 160px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

.pub-media a:hover img {
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.pub-info {
  flex: 1;
  min-width: 0;
}

.pub .pub-title {
  font-weight: 600;
  color: #222;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.pub .pub-authors {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.pub .pub-authors a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.pub .pub-authors a:hover {
  color: inherit;
  text-decoration: none;
}

.pub .pub-venue {
  color: #888;
  font-style: italic;
  font-size: 0.93rem;
  margin-bottom: 5px;
}

.pub-award {
  color: #ff5c1a;
  font-style: normal;
  font-weight: 700;
}

.pub .pub-links a {
  color: #0066cc;
  font-size: 0.9rem;
  margin-right: 4px;
}

.pub .pub-links a:hover {
  color: #004499;
  text-decoration: underline;
}

.pub .pub-links .sep {
  color: #ccc;
  margin-right: 4px;
}

/* ===== Expandable section ===== */
.expandable-section {
  margin: 16px 0;
}

.expand-button {
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: #2d9f5e;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.expand-button:hover {
  color: #1e7a42;
}

.expand-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.expandable-content {
  display: none;
  padding: 12px 0;
  margin-top: 4px;
}

.expandable-content p {
  margin-bottom: 14px;
  line-height: 1.75;
  text-align: justify;
  color: #111;
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 30px 0;
  color: #aaa;
  font-size: 0.85rem;
  border-top: 1px solid #f0f0f0;
  margin-top: 40px;
}

/* ===== Celebration emoji effect ===== */
.celebrate {
  display: inline-block;
  cursor: default;
  position: relative;
}

.celebrate:hover {
  animation: celebrateBounce 0.5s ease;
}

@keyframes celebrateBounce {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.6) rotate(-10deg);
  }
  50% {
    transform: scale(0.9) rotate(8deg);
  }
  75% {
    transform: scale(1.3) rotate(-5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Sparkle particles on hover */
.celebrate::before,
.celebrate::after {
  content: '✨';
  position: absolute;
  font-size: 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.celebrate::before {
  top: -8px;
  left: -6px;
}

.celebrate::after {
  bottom: -8px;
  right: -6px;
}

.celebrate:hover::before {
  animation: sparkleUp 0.6s ease-out forwards;
}

.celebrate:hover::after {
  animation: sparkleDown 0.6s ease-out 0.1s forwards;
}

@keyframes sparkleUp {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-10px, -12px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-14px, -18px) scale(0.3);
  }
}

@keyframes sparkleDown {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(10px, 10px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(16px, 16px) scale(0.3);
  }
}

/* ===== Focus styles for accessibility ===== */
a:focus {
  outline: 2px solid #2d9f5e;
  outline-offset: 2px;
}

/* ===== Responsive design ===== */
@media (max-width: 768px) {
  .container {
    padding: 24px 20px 40px;
  }

  nav .nav-inner {
    padding: 0 20px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .intro-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 0 20px;
  }

  .intro-text {
    text-align: center;
    width: 100%;
  }

  .intro-text h1 {
    text-align: center;
  }

  .intro-text .subtitle {
    font-size: 0.9rem;
  }

  .intro-text .subtitle span[style*="nowrap"] {
    white-space: normal !important;
  }

  .profile-image {
    width: 160px;
    height: 160px;
  }

  .links {
    justify-content: center;
  }

  .pub {
    flex-direction: column;
    align-items: center;
  }

  .pub-media {
    width: 100%;
    max-width: 280px;
  }

  .pub-info {
    width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }

  .intro-text .subtitle {
    font-size: 0.85rem;
  }

  .profile-image {
    width: 140px;
    height: 140px;
  }
}

/* ===== Print styles ===== */
@media print {
  nav {
    display: none;
  }

  .container {
    max-width: 100%;
  }
}
