/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --paper: #EDEEE6;
  --paper-raised: #F7F7F1;
  --ink: #1B2A3D;
  --ink-soft: #3D4B5C;
  --muted: #6B6F63;
  --accent: #0F5257;      /* deep teal-ink, links / primary accent */
  --accent-soft: #E4EEEC;
  --highlight: #C68B1F;   /* amber, like a highlighter / index tab */
  --highlight-soft: #F3E6C8;
  --rule: #C9C4B4;
  --rule-strong: #A9A48F;
  --shadow: 0 2px 10px rgba(27, 42, 61, 0.08);
  --shadow-lift: 0 10px 30px rgba(27, 42, 61, 0.14);

  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  --tab-width: 64px;
  --content-max: 1400px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  padding-left: var(--tab-width);
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; }

/* ============================================================
   SIDE INDEX TABS (signature element)
   ============================================================ */

/* ============================================================
   SIDE INDEX TABS (signature element)
   ============================================================ */
.index-tabs {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--tab-width);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  z-index: 100;
}

.index-tabs .mark {
  margin-top: auto;   /* pushes it to the bottom */
  margin-bottom: 20px;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 20px;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(-90deg);
  opacity: 0.5;
}

.tab {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 16px 8px;
  margin-bottom: 6px;
  width: 48px;
  cursor: pointer;
  border-radius: 3px 0 0 3px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, width 0.18s ease;
  text-decoration: none;
  display: block;
}

.tab:hover { background: var(--accent-soft); color: var(--accent); width: 54px; }

.tab.active {
  background: var(--highlight);
  color: var(--ink);
  width: 58px;
  font-weight: 600;
}

/* ============================================================
   LAYOUT
   ============================================================ */
main { max-width: var(--content-max); margin: 0 auto; padding: 64px 32px 120px; }

section { padding-top: 72px; margin-top: -72px; }
section + section { margin-top: 96px; padding-top: 72px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--highlight);
  display: block;
  margin-bottom: 10px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: 20px;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 1.8rem;
}

.profile-photo {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--rule);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  flex-shrink: 0;
}

.hero-text {
  flex: 1;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.1;
  margin: 8px 0 14px;
}

.hero .role {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.hero .affiliation {
  color: var(--ink-soft);
  margin-top: 14px;
  line-height: 1.6;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 20px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: all .15s ease;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.pill.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.pill.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.hero-abstract {
  margin-top: 0;
  padding: 22px 24px;
  background: var(--paper-raised);
  border-left: 3px solid var(--highlight);
  border-radius: 0 4px 4px 0;
  color: var(--ink-soft);
  font-size: 15px;
  text-align: justify;

}

.hero-abstract .label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

/* ===========================
   MOBILE
=========================== */

@media (max-width: 768px) {

  .hero-header {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .profile-photo {
    width: 150px;
    height: 150px;
  }

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

}
/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 32px; }
.section-head h2 { font-size: 1.7rem; }
.section-head .count { font-family: var(--font-mono); color: var(--muted); font-size: 13px; }
.section-head::after { content: ""; flex: 1; border-bottom: 1px dashed var(--rule); }

/* ============================================================
   PUBLICATIONS (bibliography with hover-reveal abstract)
   ============================================================ */
.pub-list { list-style: none; margin: 0; padding: 0; }

.pub {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 18px 12px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.pub:first-child { border-top: 1px solid var(--rule); }
.pub:hover { background: var(--paper-raised); }

.pub .num {
  font-family: var(--font-mono);
  color: var(--highlight);
  font-weight: 600;
  font-size: 14px;
  padding-top: 2px;
}

.pub .title { font-weight: 600; font-size: 15.5px; color: var(--ink); }
.pub .meta { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.pub .venue { font-style: italic; }
.pub .tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.pub .tag {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 10px;
}

.pub .abstract {
  grid-column: 2;
  text-align: justify;
  text-justify: inter-word; /* improves justification where supported */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.2s ease, margin-top 0.28s ease;
  opacity: 0;
  font-size: 14px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--rule);
  margin-top: 0;
}
.pub.open .abstract { max-height: 240px; opacity: 1; margin-top: 12px; padding-top: 12px; }

.pub .links { margin-top: 10px; display: flex; gap: 14px; }
.pub .links a { font-family: var(--font-mono); font-size: 12.5px; text-decoration: none; border-bottom: 1px solid var(--accent); }

/* ============================================================
   CV / TIMELINE
   ============================================================ */
.cv-download { margin-bottom: 36px; }

.timeline { position: relative; padding-left: 24px; border-left: 2px solid var(--rule); }
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -30px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--highlight);
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--highlight);
}
.tl-item .when { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.tl-item h3 { font-size: 16px; margin-top: 4px; }
.tl-item .where { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.tl-item p { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.cv-group { margin-bottom: 40px; }
.cv-group h3.group-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

/* ============================================================
   ABOUT / RESEARCH INTERESTS
   ============================================================ */
.interests { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.interest-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 14px;
  flex: 1 1 200px;
}
.interest-card .n { font-family: var(--font-mono); color: var(--highlight); font-size: 12px; }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 24px; }
.contact-item { padding: 16px; background: var(--paper-raised); border-radius: 4px; border: 1px solid var(--rule); }
.contact-item .label { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.contact-item a, .contact-item span.value { display: block; margin-top: 6px; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.contact-item a:hover { color: var(--accent); }

footer {
  margin-top: 100px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  :root { --tab-width: 44px; }
  .tab { font-size: 10.5px; padding: 12px 6px; width: 34px; }
  .tab:hover, .tab.active { width: 40px; }
  main { padding: 40px 18px 100px; }
  .pub { grid-template-columns: 28px 1fr; gap: 10px; }
}