/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --ink:          #1a1a1a;
  --paper:        #f8f6f1;
  --paper-alt:    #f2ede6;
  --accent:       #b44a2f;
  --accent-light: #e8d5ce;
  --muted:        #7a7168;
  --border:       #d8d2c8;
  --card-bg:      #ffffff;
  --tag-bg:       #eee8df;
  --serif:        'Nunito', system-ui, sans-serif;
  --sans:         'Nunito', system-ui, sans-serif;
  --mono:         'JetBrains Mono', monospace;
  --nav-h:        64px;
  --transition:   0.3s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--ink); }

img { max-width: 100%; display: block; }

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(248,246,241,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}
#navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.06); }

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

.nav-logo {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--accent); }
.nav-logo-accent { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   SECTIONS
   ============================================================ */
section { padding: 3rem 2rem; }
#publications { padding-top: 1.5rem; }
#teaching { padding-top: 1.5rem; }

.news-block {
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
}

.news-block-header {
  background: var(--accent);
  color: #fff;
  padding: 0.45rem 1.1rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.news-block-body {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
}

.news-block-body p {
  margin-bottom: 0.5rem;
}
.news-block-body p:last-child {
  margin-bottom: 0;
}

.section-alt { background: var(--card-bg); }

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* ============================================================
   HOME / HERO
   ============================================================ */
#home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--nav-h) + 3rem);
  padding-bottom: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-news-wrap {
  max-width: 1200px;
  width: 100%;
  padding: 0 2rem;
  margin-top: 3rem;
}

#home::before {
  content: '';
  position: absolute; top: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1.6fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 0 2rem;
}

.hero-photo-wrap { position: relative; }

.hero-photo {
  width: 100%;
  max-width: 210px;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.hero-photo-accent {
  position: absolute;
  top: -16px; left: -16px;
  width: 100%; max-width: 210px;
  aspect-ratio: 3/4;
  border: 2px solid var(--accent);
  border-radius: 12px;
  z-index: -1;
}

.hero-greeting {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.hero-name em { font-style: italic; color: var(--accent); }

.hero-role {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.hero-role a {
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.hero-role a:hover { color: var(--accent); border-color: var(--accent); }

.hero-welcome {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero-career {
  padding-top: 0.5rem;
}

.hero-career-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.hero-bio {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  text-align: justify;
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ============================================================
   TAGS
   ============================================================ */
.tag {
  padding: 0.35rem 0.85rem;
  background: var(--tag-bg);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.tag-current {
  background: #D1FAE5;
  color: #065F46;
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  margin-left: 6px;
  vertical-align: middle;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--paper);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   RESEARCH INTEREST CARDS
   ============================================================ */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}

.interest-card {
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.interest-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}
.interest-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.06); }
.interest-card:hover::before { transform: scaleX(1); }

.interest-name {
  font-family: var(--serif);
  font-size: 0.85rem;
  white-space: nowrap;
  margin-bottom: 0.4rem;
}
.interest-desc { font-size: 0.82rem; color: var(--muted); }

/* ============================================================
   PUBLICATION FILTER
   ============================================================ */
.pub-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ============================================================
   PUBLICATIONS — accordion list
   ============================================================ */
.pub-group { margin-bottom: 3rem; }

.pub-group-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.pub-item {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
}
.pub-item.hidden { display: none; }

.pub-section-title {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 2.5rem 0 1.5rem;
}

.pub-header {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
}

.pub-info { flex: 1; }

.pub-title-text {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  transition: color 0.25s;
}
.pub-header:hover .pub-title-text { color: var(--accent); }

.pub-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.pub-journal { font-weight: 600; color: var(--accent); }
.pub-status  { font-weight: 600; color: var(--accent); }

.pub-toggle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tag-bg);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.pub-toggle:hover { background: var(--accent-light); }
.pub-toggle svg {
  transition: transform 0.3s;
  width: 16px; height: 16px;
  stroke: var(--ink);
}
.pub-item.open .pub-toggle svg { transform: rotate(180deg); }

.pub-abstract-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1);
}
.pub-item.open .pub-abstract-wrap { max-height: 500px; }

.pub-abstract-text {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  padding: 1.2rem 0 0.5rem 1rem;
  border-left: 2px solid var(--accent-light);
  margin-top: 1rem;
  text-align: justify;
}

.pub-abstract-links {
  padding: 0.8rem 0 0 1rem;
  display: flex;
  gap: 0.6rem;
}

.pub-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--accent-light);
  border-radius: 6px;
  transition: all 0.25s;
}
.pub-link:hover { background: var(--accent); color: var(--paper); }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 2rem;
  max-width: 720px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 0.7rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -1.65rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--paper-alt);
}
.timeline-item.current .timeline-dot {
  background: var(--accent);
}

.timeline-period {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.timeline-role {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.1rem;
  line-height: 1.3;
}

.timeline-place {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ============================================================
   TEACHING
   ============================================================ */
.teaching-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.teaching-block {
  padding: 1.75rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.teaching-uni {
  color: var(--accent);
  font-weight: 700;
}

.teaching-block h3 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.teaching-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.teaching-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.teaching-table td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink);
}
.teaching-table td:last-child {
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
  padding-left: 12px;
}
.teaching-table tr:last-child td { border-bottom: none; }
.teaching-table em { color: var(--muted); }

/* ============================================================
   CV
   ============================================================ */
.cv-actions { margin-bottom: 1.75rem; }

.cv-embed {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper-alt);
}
.cv-embed iframe { display: block; border: none; }
.cv-fallback {
  padding: 12px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--paper-alt);
  border-top: 1px solid var(--border);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-info {
  display: grid;
  grid-template-columns: 2fr 1.8fr 2fr;
  gap: 2rem;
}

.contact-info-wide {
  grid-column: span 1;
}

.contact-info-center {
  text-align: center;
}
.contact-info-center .contact-info-value a {
  display: inline-block;
  white-space: nowrap;
}

.contact-info-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.contact-info-value {
  font-size: 0.92rem;
  white-space: nowrap;
  color: var(--ink);
  line-height: 1.65;
}
.contact-info-value a {
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.contact-info-value a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  text-align: center;
  padding: 2.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-ids {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 0.75rem;
}

.footer-ids a { color: var(--muted); }
.footer-ids a:hover { color: var(--accent); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .hero-photo-wrap {
    display: flex;
    justify-content: center;
    order: -1;
  }
  .hero-photo-accent { display: none; }
  .hero-links { justify-content: center; }
  .hero-bio { text-align: left; }
  .contact-info { grid-template-columns: 1fr; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(248,246,241,0.97);
    backdrop-filter: blur(16px);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
  }

  .teaching-grid { grid-template-columns: 1fr; }
  .contact-info  { grid-template-columns: 1fr; }
  section { padding: 4rem 1.5rem; }
}

@media (max-width: 480px) {
  .hero-photo { max-width: 240px; }
}
