/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --background:   oklch(0.98 0.006 85);
  --foreground:   oklch(0.18 0.01 60);
  --accent:       oklch(0.52 0.14 235);
  --accent-hover: oklch(0.42 0.16 235);
  --accent-light: oklch(0.94 0.025 235);
  --muted:        oklch(0.45 0.01 60);
  --border:       oklch(0.91 0.008 85);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: 'Inter', sans-serif;
  color: var(--foreground);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 { font-size: 3.75rem; font-weight: 300; }
h2 { font-size: 1.875rem; font-weight: 500; }
h3 { font-size: 1.1rem;   font-weight: 500; }
h4 { font-size: 1rem;     font-weight: 500; }

p { line-height: 1.7; }

::selection { background: var(--accent-light); color: var(--foreground); }

/* ============================================================
   LAYOUT
   ============================================================ */
.site-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ============================================================
   NAVIGATION
   ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: all 0.5s;
  padding: 1.25rem 0;
}

#navbar.scrolled {
  background-color: color-mix(in oklch, var(--background) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  background: none;
  border: none;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: color 0.3s;
  padding: 0;
}
.nav-brand:hover { color: var(--accent); }

.nav-desktop { display: none; align-items: center; gap: 2rem; }
@media (min-width: 768px) { .nav-desktop { display: flex; } }

.nav-item {
  position: relative;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.3s;
}
.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.nav-item:hover { color: var(--foreground); }
.nav-item.active { color: var(--accent); }
.nav-item.active::after { transform: scaleX(1); }

.nav-mobile-btn {
  display: flex;
  background: none;
  border: none;
  color: var(--foreground);
  padding: 0.5rem;
}
@media (min-width: 768px) { .nav-mobile-btn { display: none; } }

.nav-mobile {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 0px solid var(--border);
}
.nav-mobile.open {
  max-height: 300px;
  border-top-width: 1px;
}
.nav-mobile-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-mobile-item {
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  padding: 0.5rem 0;
  transition: color 0.2s;
}
.nav-mobile-item:hover,
.nav-mobile-item.active { color: var(--accent); }

/* ============================================================
   HERO / ABOUT SECTION
   ============================================================ */
.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 0 4rem;
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: start;
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 280px 1fr; gap: 4rem; }
}

/* Photo */
.photo-wrapper { position: relative; }
.photo-wrapper::before {
  content: '';
  position: absolute;
  inset: -0.5rem;
  background: linear-gradient(135deg, var(--accent-light), transparent);
  opacity: 0;
  transition: opacity 0.5s;
}
.photo-wrapper:hover::before { opacity: 1; }

.hero-photo {
  width: 100%;
  max-width: 260px;
  display: block;
  position: relative;
}

/* Social links */
.social-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.social-item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
}
.social-item:hover { color: var(--accent); text-decoration: none; }
.social-item .ext-icon { opacity: 0; transform: translateX(-8px); transition: all 0.3s; }
.social-item:hover .ext-icon { opacity: 0.5; transform: translateX(0); }

/* Hero right column */
.hero-right { display: flex; flex-direction: column; gap: 2rem; }

.hero-intro { display: flex; flex-direction: column; gap: 1rem; }

.hero-greeting { color: var(--accent); font-size: 1.125rem; font-weight: 500; }
.hero-name { /* uses h1 global */ }
.hero-title { font-size: 1.5rem; color: var(--muted); font-weight: 300; }

.hero-bio { display: flex; flex-direction: column; gap: 1rem; color: color-mix(in oklch, var(--foreground) 80%, transparent); }
.hero-bio strong { color: var(--foreground); font-weight: 600; }

/* Institutional logos */
.hero-logos {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-logos img { height: 34px; width: auto; opacity: 0.75; }

/* Email button */
.email-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background-color: var(--accent);
  color: white;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.email-btn:hover { box-shadow: 0 8px 25px color-mix(in oklch, var(--accent) 30%, transparent); }
.email-btn-bg {
  position: absolute;
  inset: 0;
  background-color: var(--accent-hover);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.email-btn:hover .email-btn-bg { transform: scaleX(1); }
.email-btn > * { position: relative; z-index: 1; }
.email-icon { transition: transform 0.3s; }
.email-btn:hover .email-icon { transform: rotate(-10deg); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); }

.email-note { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }

/* Outline action buttons */
.hero-links { display: flex; flex-wrap: wrap; gap: 1rem; }

.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
}
.outline-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ============================================================
   CONTENT SECTIONS (Research, Teaching, CV)
   ============================================================ */
.section-content {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

.content-grid { display: grid; gap: 2rem; }
@media (min-width: 1024px) {
  .content-grid { grid-template-columns: 200px 1fr; gap: 4rem; }
}

.sticky-heading { position: sticky; top: 5.5rem; }

.content-body { display: flex; flex-direction: column; gap: 4rem; }

.subsection { }

.subsection-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ============================================================
   PAPERS
   ============================================================ */
.papers-list { list-style: none; display: flex; flex-direction: column; gap: 2.5rem; }

.paper-item { display: flex; flex-direction: column; gap: 0.75rem; }

.paper-title-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s;
}
.paper-title-link:hover { color: var(--accent); text-decoration: none; }

.ext-icon-sm {
  flex-shrink: 0;
  margin-top: 0.3rem;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.paper-title-link:hover .ext-icon-sm { opacity: 1; }

.paper-authors { color: var(--muted); font-size: 0.95rem; }
.paper-authors a { color: var(--muted); }
.paper-authors a:hover { color: var(--accent); }

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.875rem;
  font-weight: 500;
  width: fit-content;
}

/* Paper title (plain text) + separate links */
.paper-title-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--foreground);
  line-height: 1.4;
}

.paper-links-row { display: flex; gap: 1rem; flex-wrap: wrap; }

.paper-link-item {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
.paper-link-item:hover { color: var(--accent-hover); text-decoration: underline; }

/* Abstract collapsible */
details summary {
  font-size: 0.875rem;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: inline;
}
details summary::-webkit-details-marker { display: none; }
details summary:hover { text-decoration: underline; text-underline-offset: 3px; }

.abstract-text {
  font-size: 0.875rem;
  line-height: 1.75;
  color: color-mix(in oklch, var(--foreground) 70%, transparent);
  margin-top: 0.75rem;
  max-width: 700px;
}

/* WIP */
.wip-title { font-size: 1rem; font-weight: 500; color: var(--foreground); }

/* ============================================================
   PRESENTATIONS
   ============================================================ */
.presentations-section { padding-top: 0; }

.presentations-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s;
}
.presentations-toggle:hover { color: var(--foreground); }

#presentations-chevron { transition: transform 0.3s; }

.presentations-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.4s ease;
}
.presentations-content.open { max-height: 4000px; opacity: 1; }

.presentations-inner {
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pres-year { font-size: 1.1rem; font-weight: 500; color: var(--accent); margin-bottom: 1rem; }

.pres-list {
  list-style: none;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pres-list li { padding-left: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem; }

.pres-name { color: var(--foreground); font-size: 0.95rem; transition: color 0.2s; }
.pres-list li:hover .pres-name { color: var(--accent); }
.pres-loc { color: var(--muted); font-size: 0.875rem; }
.pres-coauthor { color: var(--accent); margin-left: 0.125rem; }

.pres-footnote {
  font-size: 0.875rem;
  color: var(--muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   TEACHING
   ============================================================ */
.teaching-header { margin-bottom: 1.5rem; }
.teaching-institution { font-size: 1.05rem; font-weight: 500; color: var(--foreground); margin-bottom: 0.2rem; }
.teaching-role { color: var(--muted); font-size: 0.95rem; }

.courses-list { display: flex; flex-direction: column; gap: 0.75rem; }

.course-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.course-card:hover {
  border-color: color-mix(in oklch, var(--accent) 30%, transparent);
  background-color: color-mix(in oklch, var(--accent) 3%, transparent);
}

.course-left { display: flex; flex-direction: column; gap: 0.5rem; }
.course-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

.course-name { font-size: 1rem; font-weight: 500; color: var(--foreground); transition: color 0.2s; }
.course-card:hover .course-name { color: var(--accent); }
.course-years { font-size: 0.875rem; color: var(--muted); }

.level-badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid;
  letter-spacing: 0.01em;
}
.badge-phd {
  background-color: color-mix(in oklch, var(--accent) 10%, white);
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 20%, transparent);
}
.badge-master { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-bachelor { background: #f5f5f4; color: #57534e; border-color: #d6d3d1; }

.syllabus-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s;
}
.syllabus-link:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   CV
   ============================================================ */
.cv-text { color: color-mix(in oklch, var(--foreground) 80%, transparent); line-height: 1.75; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}
.footer-inner {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { opacity: 0; animation: fadeInUp 0.6s ease-out forwards; }
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.5rem; }

  .section-hero { padding: 5.5rem 0 3rem; min-height: auto; }
  .section-content { padding: 3.5rem 0; }

  /* Center hero left column (photo + socials) on mobile */
  .hero-left { display: flex; flex-direction: column; align-items: center; }
  .hero-photo { max-width: 200px; }

  /* Social: icons only on narrow screens */
  .social-list { flex-direction: row; flex-wrap: wrap; gap: 1rem; margin-top: 1.5rem; justify-content: center; }
  .social-item span { display: none; }
  .social-item .ext-icon { display: none; }

  .hero-logos { justify-content: center; }

  .site-container { padding: 0 1.25rem; }
  .nav-inner { padding: 0 1.25rem; }
  .nav-mobile-inner { padding: 1rem 1.25rem; }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  .hero-title { font-size: 1.2rem; }
}
