/* ===== Variables ===== */
:root {
  --color-bg: #FDFBF7;
  --color-bg-alt: #F5F1EA;
  --color-text: #1A1A1A;
  --color-text-muted: #5C5C5C;
  --color-accent: #2563EB;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #DBEAFE;
  --color-border: #E5E1D8;
  --color-card: #FFFFFF;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 17px;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1000;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

/* ===== Layout ===== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Scroll-triggered animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Header / Profile ===== */
.profile-section {
  display: flex;
  align-items: flex-start;
  gap: 44px;
  padding: 60px 0 40px;
}

.profile-photo {
  flex-shrink: 0;
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
  animation-delay: 0.1s;
}

.profile-photo img {
  width: 210px;
  height: auto;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo img:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.profile-info h1 {
  font-family: var(--font-serif);
  font-size: 2.8em;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.profile-info .affiliation {
  font-size: 1em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  line-height: 1.7;
}

.profile-info .bio {
  font-size: 0.95em;
  color: var(--color-text-muted);
  margin-bottom: 18px;
  line-height: 1.8;
}

.profile-info .bio strong {
  color: var(--color-text);
  font-weight: 600;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.88em;
  font-weight: 500;
  transition: all 0.3s ease;
}

.profile-links a:hover {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.profile-links a i {
  font-size: 1.05em;
}

/* ===== Section Styles ===== */
.section {
  padding: 40px 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
  display: block;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2em;
  font-weight: 400;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 24px;
}

.section-divider {
  width: 50px;
  height: 2px;
  background: var(--color-accent);
  margin-bottom: 30px;
  border-radius: 1px;
}

/* ===== News ===== */
.news-card {
  background: var(--color-bg-alt);
  border-radius: 16px;
  padding: 28px 32px;
  border: 1px solid var(--color-border);
}

.news-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
}

.news-list li {
  padding: 8px 0;
  font-size: 0.92em;
  display: flex;
  gap: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.2s ease;
}

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

.news-list li:hover {
  background: rgba(0, 0, 0, 0.015);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 6px;
}

.news-date {
  font-family: var(--font-mono);
  color: var(--color-accent);
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
  font-size: 0.85em;
  padding-top: 1px;
}

.news-content {
  color: var(--color-text-muted);
}

.news-content strong {
  color: var(--color-text);
  font-weight: 600;
}

.news-content a {
  color: var(--color-accent);
}

.news-content a:hover {
  color: var(--color-accent-hover);
}

.news-content a strong {
  color: inherit;
}

/* ===== Publications ===== */
.pub-entry {
  display: flex;
  gap: 24px;
  padding: 22px;
  margin-bottom: 14px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.pub-entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.06);
  border-color: rgba(37, 99, 235, 0.2);
}

.pub-teaser {
  flex-shrink: 0;
  width: 350px;
  overflow: hidden;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-teaser img,
.pub-teaser video {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.pub-entry:hover .pub-teaser img,
.pub-entry:hover .pub-teaser video {
  transform: scale(1.05);
}

.pub-teaser .placeholder {
  color: var(--color-text-muted);
  font-size: 0.75em;
  text-align: center;
  padding: 10px;
  opacity: 0.5;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.pub-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pub-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.15em;
  color: var(--color-text);
  margin-bottom: 6px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.pub-title a {
  color: var(--color-text);
  transition: color 0.2s ease;
}

.pub-title a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.pub-authors {
  font-size: 0.88em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  line-height: 1.5;
}

.pub-authors .me {
  font-weight: 600;
  color: var(--color-text);
}

.pub-venue {
  font-size: 0.85em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.78em;
  letter-spacing: 0.02em;
}

.pub-venue .award {
  color: #dc2626;
  font-weight: 600;
}

.pub-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  font-size: 0.82em;
  font-weight: 500;
  transition: all 0.25s ease;
}

.pub-links a:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ===== Year Divider ===== */
.year-divider {
  font-family: var(--font-serif);
  font-size: 1.6em;
  font-weight: 400;
  color: var(--color-text);
  padding: 20px 0 10px;
  margin-top: 10px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===== Blog ===== */
.blog-entry {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.blog-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  border-color: rgba(37, 99, 235, 0.2);
}

.blog-entry a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
  font-size: 1em;
  font-weight: 500;
  text-decoration: none;
}

.blog-entry a:hover {
  color: var(--color-accent);
}

.blog-entry a i {
  color: var(--color-accent);
  font-size: 0.9em;
}

.year-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ===== Education & Experience ===== */
.edu-grid {
  display: grid;
  gap: 16px;
}

.edu-entry {
  display: flex;
  gap: 20px;
  padding: 20px 24px;
  align-items: flex-start;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.edu-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.edu-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.edu-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.edu-info h3 {
  font-family: var(--font-serif);
  font-size: 1.15em;
  font-weight: 400;
  color: var(--color-text);
}

.edu-info p {
  font-size: 0.9em;
  color: var(--color-text-muted);
}

/* ===== Experience Grid ===== */
.experience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.exp-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.exp-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.exp-entry {
  display: flex;
  gap: 16px;
  padding: 18px 22px;
  align-items: center;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.exp-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.exp-info h3 {
  font-family: var(--font-serif);
  font-size: 1.1em;
  font-weight: 400;
  color: var(--color-text);
}

.exp-info p {
  font-size: 0.88em;
  color: var(--color-text-muted);
}

.exp-info .role {
  color: var(--color-text-muted);
  font-size: 0.85em;
}

/* ===== Service ===== */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.service-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 22px 26px;
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.service-card h3 {
  font-family: var(--font-mono);
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.service-card p {
  font-size: 0.92em;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 0;
  color: var(--color-text-muted);
  font-size: 0.85em;
  border-top: 1px solid var(--color-border);
  margin-top: 40px;
}

.footer a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-decoration-color: var(--color-border);
  text-underline-offset: 3px;
}

.footer a:hover {
  color: var(--color-text);
}

/* ===== Scrollbar ===== */
.news-list::-webkit-scrollbar {
  width: 4px;
}

.news-list::-webkit-scrollbar-track {
  background: transparent;
}

.news-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.news-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container {
    padding: 0 1.2rem;
  }

  .profile-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    padding: 40px 0 30px;
  }

  .profile-info h1 {
    font-size: 2.2em;
  }

  .profile-links {
    justify-content: center;
  }

  .pub-entry {
    flex-direction: column;
    padding: 18px;
  }

  .pub-teaser {
    width: 100%;
  }

  .experience-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.8em;
  }

  .year-divider {
    font-size: 1.3em;
  }
}
