/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  /* Surfaces */
  --surface-overlay:  #252F38;
  --surface-content:  #FFFFFF;
  --surface-sidebar:  #EBF3F9;
  --surface-card:     #FFFFFF;

  /* Borders */
  --border-hard:      #1A1A1A;
  --border-subtle:    #CCE0EE;
  --border-accent:    #3672A0;

  /* Text */
  --text-heading:     #06080B;
  --text-body:        #14202A;
  --text-muted:       #2C3C4A;
  --text-faint:       #486070;

  /* Interactive */
  --text-link:        #1660A8;

  /* Dark surface (body bg, sidebar text) */
  --dark:             #242424;

  --white: #FFFFFF;

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono:  'Source Code Pro', 'Courier New', monospace;

  --ease-reveal: cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-collapsed-width: 72px;
}

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

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

body {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--text-body);
  background-color: var(--dark);
}


/* ============================================================
   Main Page Layout
   ============================================================ */
#main-page {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}


/* ============================================================
   Side Panel
   ============================================================ */
#side-panel {
  width: var(--sidebar-collapsed-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  background-color: var(--surface-sidebar);
  border-right: 1px solid var(--border-hard);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2.5rem 0;
  overflow: hidden;
  transition: width 0.2s ease-out;
}

#side-panel:hover {
  width: 256px;
  /*padding-right: 1.5rem;*/
}

.panel-initials {
  position: relative;
  width: 100%;
  height: 1em;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--dark);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.initials-short,
.initials-full {
  position: absolute;
  top: 0;
  white-space: nowrap;
  opacity: 0.75;
}

.initials-short {
  left: 0;
  width: var(--sidebar-collapsed-width);
  text-align: center;
}

.initials-full {
  left: 0;
  width: 100%;
  text-align: center;
  text-transform: none;
  opacity: 0;
}

#side-panel:hover .initials-short {
  opacity: 0;
}

#side-panel:hover .initials-full {
  opacity: 1;
}

.panel-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.panel-nav a {
  display: grid;
  grid-template-columns: var(--sidebar-collapsed-width) 1fr;
  align-items: center;
  padding: 0.8rem 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-faint);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.33s ease;
}

.panel-nav a i {
  justify-self: center;
  font-size: 1.4rem;
}

.panel-nav a:hover {
  color: var(--text-link);
}

.nav-label {
  opacity: 0;
}

#side-panel:hover .nav-label {
  opacity: 1;
}

/* ============================================================
   Content Area
   ============================================================ */
#content {
  margin-left: calc(var(--sidebar-collapsed-width) + 1px);
  flex: 1;
  background-color: var(--surface-content);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 0 6rem;
}

#content > section {
  width: 50vw;
}

/* ============================================================
   Profile Header
   ============================================================ */
.profile-header {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.profile-header-text {
  flex: 1;
  min-width: 0;
}

#profile-pic-wrap {
  width: 3.5rem;
  align-self: stretch;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

#profile-pic-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.5);
  transform-origin: 30% center;
  transition: opacity 0.15s;
}


#profile-pic-wrap:hover #profile-pic-thumb {
  opacity: 0.85;
}

/* ── Profile picture modal ── */
#profile-pic-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#profile-pic-modal img {
  max-width: min(80vw, 560px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.profile-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.profile-name {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.profile-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.profile-social a {
  color: var(--text-faint);
  font-size: 1.1rem;
  text-decoration: none;
  transition: color 0.33s ease;
}

.profile-social a:hover {
  color: var(--text-link);
}

.profile-title {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-link);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.profile-affiliation {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.profile-bio {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text-body);
  margin-top: 1.75rem;
}

.profile-bio a {

  color: #1660A8;
  text-decoration: none;
}


.profile-bio a:hover {

  color: #1660A8;
  text-decoration: underline;
}

/* ============================================================
   Collapsible Sections
   ============================================================ */
.collapsible-section {
  border-bottom: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

.collapsible-section:first-of-type {
  margin-top: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem 0;
  cursor: pointer;
  user-select: none;
}

.section-header h2 {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toggle-icon {
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.section-body {
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ── Publication entries ── */
.pub-year-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.pub-year-group:first-of-type {
  margin-top: 0;
}

.pub-year {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.pub-show-all {
  display: block;
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.55rem 0;
  background: none;
  border: none;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

.pub-show-all:hover {
  color: var(--text-link);
}


.publication {
  padding-left: 1rem;
  border-left: 2px solid var(--border-subtle);
}

.publication.pub-starred,
.thesis-entry.pub-starred {
  border-left: 4px solid #b8962e;
  padding-left: calc(1rem - 2px);
}

.pub-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pub-title {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.5;
}

.pub-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

.pub-title a:hover {
  border-color: var(--text-link);
}

.pub-badges {
  display: block;
  margin-top: 0.3em;
}

.pub-badge {
  height: 1.1em;
  width: auto;
  vertical-align: middle;
  margin-right: 0.35em;
}

.pub-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}

.pub-bib-link,
.pub-artifact-link {
  font-size: 0.65rem;
  color: var(--text-faint);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
  cursor: pointer;
  white-space: nowrap;
}

.pub-bib-link:hover,
.pub-artifact-link:hover {
  color: var(--text-link);
}

.pub-meta-block {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.2rem;
}

.pub-authors strong {
  font-weight: 500;
  color: var(--text-muted);
}

.pub-coauthor {
  color: #607080;
}

/* ── Project entries ── */
.project-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-link);
  margin-bottom: 0.2rem;
}

.project-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Experience / Education / Service entries (shared layout) ── */
.experience-entry,
.education-entry,
.service-entry,
.teaching-entry {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.5;
}

.service-entry,
.teaching-entry {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.service-category,
.teaching-category {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 0.1em;
}

/* ── Experience / Education shared layout ── */
.experience-entry,
.education-entry {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.entry-primary {
  font-size: 0.875rem;
  color: var(--text-body);
}

.entry-secondary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.entry-period {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.entry-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.entry-link,
.experience-entry a,
.education-entry a {
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

.entry-link:hover,
.experience-entry a:hover,
.education-entry a:hover {
  border-color: var(--text-link);
}

/* ── Talk entries ── */
.talk-title {
  font-size: 0.875rem;
  color: var(--text-body);
  margin-bottom: 0.2rem;
}

.talk-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Thesis entries ── */
.thesis-entry {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-subtle);
}

.thesis-title {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.5;
}

.thesis-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

.thesis-title a:hover {
  border-color: var(--text-link);
}

.thesis-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.thesis-type {
  color: var(--text-faint);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
}

.thesis-awards {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.3rem;
}

.thesis-award {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.thesis-award i {
  color: #b8962e;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.thesis-award a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.thesis-award a:hover {
  color: var(--text-link);
  border-bottom-color: var(--border-subtle);
}

/* ── Contact ── */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-info a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.contact-info a:hover {
  color: #1660A8;
}

/* ============================================================
   Mobile  (≤ 640 px)
   ============================================================ */
@media (max-width: 640px) {

  html {
    font-size: 18px;
  }

  /* Sidebar becomes a fixed bottom nav bar */
  #side-panel {
    width: 100%;
    height: 52px;
    top: auto;
    bottom: 0;
    left: 0;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--border-hard);
    overflow: visible;
    transition: none;
  }

  #side-panel:hover {
    width: 100%;
    padding-right: 0;
  }

  .panel-initials {
    display: none;
  }

  .panel-nav {
    width: 100%;
  }

  .panel-nav ul {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
  }

  .panel-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-template-columns: none;
    padding: 0.6rem 0;
    width: 100%;
  }

  .panel-nav a i {
    font-size: 1.2rem;
  }

  .nav-label {
    display: none;
  }

  #side-panel:hover .nav-label {
    display: none;
  }

  /* Content: full width, bottom padding for nav bar */
  #content {
    margin-left: 0;
    padding: 2.5rem 0 4.5rem;
  }

  #content > section {
    width: 88vw;
  }

  /* Profile pic: slightly smaller on mobile */
  #profile-pic-wrap {
    width: 3rem;
  }

  /* Highlighted author more visible on small screens */
  .pub-authors strong {
    color: var(--text-body);
    font-weight: 600;
  }
}
