/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:          #F5F2ED;
  --bg-alt:      #EDEAE3;
  --surface:     #FFFFFF;
  --ink:         #1A1714;
  --ink-muted:   #6B6560;
  --ink-faint:   #A8A29C;
  --accent:      #1C3F5E;
  --accent-warm: #C9552A;
  --line:        rgba(26,23,20,0.12);
  --sidebar-w:   240px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --transition:  0.35s var(--ease-out);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   NOISE OVERLAY
   ============================================================ */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.5rem 2rem;
}

.sidebar-brand {
  margin-bottom: 3rem;
}

.brand-initials {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  padding: 0.55rem 0.8rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 60%;
  background: var(--accent-warm);
  border-radius: 2px;
  transition: transform 0.2s var(--ease-out);
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.nav-link.active::before {
  transform: translateY(-50%) scaleY(1);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.02em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5BCA8A;
  flex-shrink: 0;
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--accent);
  height: 56px;
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.brand-initials-mobile {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: 0.05em;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: rgba(255,255,255,0.8);
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

.menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 5vw 4rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,85,42,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4rem;
  width: 100%;
}

.hero-text {
  flex: 1;
  min-width: 0;
  padding-right: 2rem;
}

.hero-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-warm);
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.hero-name em {
  font-style: italic;
  color: var(--accent);
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--ink-muted);
  line-height: 1.8;
  margin-bottom: 1.1rem;
}

kw {
  color: var(--ink);
  font-weight: 500;
  background: rgba(28,63,94,0.07);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  font-style: normal;
}

.hero-sub {
  font-size: 0.85rem;
  color: var(--ink-faint);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--line);
}

.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.4rem 0.85rem;
  border-radius: 99px;
  transition: all 0.18s;
  cursor: pointer;
}

.contact-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(28,63,94,0.04);
}

.chip-icon {
  font-size: 0.78rem;
  font-style: normal;
  color: var(--accent-warm);
  line-height: 1;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: all 0.2s;
  cursor: pointer;
  border: 1.5px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #15304a;
  border-color: #15304a;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink-muted);
  background: rgba(26,23,20,0.04);
}

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

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
}

.tag-accent {
  background: rgba(28,63,94,0.08);
  border-color: rgba(28,63,94,0.22);
  color: var(--accent);
  font-weight: 500;
}

/* Photo */
.hero-photo { position: relative; }

.photo-frame {
  position: relative;
  width: 300px;
  flex-shrink: 0;
}

.profile-img {
  width: 300px;
  height: 370px;
  object-fit: cover;
  border-radius: 6px;
  position: relative;
  z-index: 1;
  filter: grayscale(15%);
}

.photo-accent {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent-warm);
  border-radius: 6px;
  z-index: 0;
  opacity: 0.5;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content-section {
  padding: 5rem 5vw;
  border-bottom: 1px solid var(--line);
}

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

.section-inner {
  max-width: 860px;
}

.section-label {
  font-size: 1.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-warm);
  font-weight: 500;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
}

.section-label + .timeline + .section-label,
.timeline + .section-label {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* About */
.lead {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.section-body p {
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 620px;
}

/* ============================================================
   RESEARCH GRID
   ============================================================ */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.research-card {
  background: var(--surface);
  padding: 1.75rem 1.5rem;
  transition: background 0.2s;
}

.research-card:hover {
  background: #FAFAF8;
}

.research-icon {
  font-size: 1.2rem;
  color: var(--accent-warm);
  margin-bottom: 0.85rem;
  line-height: 1;
}

.research-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: normal;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.research-card p {
  font-size: 0.87rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.primary-card {
  border-left: 3px solid var(--accent);
}

/* Timeline extras */
.timeline-spec {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.timeline-thesis {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.55;
  margin-top: 0.25rem;
}

.timeline-bullets {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.timeline-bullets li {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* Recognition */
.recog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
}

.recog-heading {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

.recog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.recog-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.5;
  align-items: baseline;
}

.recog-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-warm);
  padding-top: 2px;
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.pub-filter-btn {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-mono);
}

.pub-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pub-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pub-count {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.pub-loading {
  padding: 3rem 0;
  color: var(--ink-faint);
  font-size: 0.9rem;
  font-family: var(--font-mono);
}

.pub-empty {
  padding: 2rem 0;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.pub-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.pub-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}

.pub-box-count {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--ink-faint);
}

.pub-box-hint {
  font-size: 0.72rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pub-scroll {
  height: 500px;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.pub-scroll::-webkit-scrollbar {
  width: 5px;
}

.pub-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.pub-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.pub-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
}

.pub-hint {
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  margin-top: 0.6rem;
  padding-left: 0.25rem;
}

.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 1.1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
  align-items: baseline;
}

.pub-item:last-child { border-bottom: none; }
.pub-item:hover { background: var(--bg-alt); }

.pub-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-warm);
  padding-top: 3px;
  line-height: 1.4;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: normal;
  color: var(--ink);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.pub-venue {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.pub-desc {
  font-size: 0.9rem;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
  max-width: 580px;
  line-height: 1.65;
}

.pub-links {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pub-link {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(28,63,94,0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  transition: all 0.2s;
}

.pub-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Publications — dynamic */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  padding: 0.35rem 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn:hover {
  border-color: var(--ink-muted);
  color: var(--ink);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-count {
  font-size: 0.72rem;
  opacity: 0.7;
}

.pub-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(28,63,94,0.07);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.pub-authors {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
  line-height: 1.45;
}

.et-al {
  color: var(--ink-faint);
  font-style: italic;
}

.pub-loading, .pub-empty {
  font-size: 0.9rem;
  color: var(--ink-faint);
  padding: 2rem 0;
}

.pub-fallback {
  font-size: 0.9rem;
  color: var(--ink-muted);
  line-height: 1.8;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.pub-fallback a { color: var(--accent); text-decoration: underline; }
.pub-fallback code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-alt); padding: 1px 5px; border-radius: 3px; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  padding: 0 0 2.5rem 2rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-warm);
  border: 2px solid var(--bg-alt);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.timeline-item h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: normal;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.timeline-org {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}

.timeline-item p {
  font-size: 0.9rem;
  color: var(--ink-muted);
  max-width: 520px;
  line-height: 1.65;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-section {
  background: var(--accent);
}

.contact-section .section-label {
  color: rgba(255,255,255,0.4);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-meta {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.6rem;
}

.contact-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  transition: color 0.2s;
}

.contact-value:hover { color: rgba(255,255,255,0.7); }

.profile-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-link {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.profile-link::before {
  content: '→';
  font-size: 0.8rem;
  color: var(--accent-warm);
}

.profile-link:hover { color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-left: var(--sidebar-w);
  background: var(--accent);
  padding: 1.5rem 5vw;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.reveal-delay { transition-delay: 0.15s; }
.reveal.in-view { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-header {
    display: flex;
  }
  .main {
    margin-left: 0;
    padding-top: 56px;
  }
  .site-footer {
    margin-left: 0;
  }
  .hero {
    padding: 3rem 1.5rem 3rem;
    min-height: auto;
  }
  .hero-grid {
    flex-direction: column;
    gap: 2.5rem;
  }
  .hero-text {
    max-width: 100%;
  }
  .hero-photo {
    order: -1;
  }
  .photo-frame {
    width: 180px;
  }
  .profile-img {
    width: 180px;
    height: 220px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .hero-name { font-size: 2.8rem; }
  .research-grid { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .content-section { padding: 3rem 1.25rem; }
}