/* ===== Design Tokens ===== */
:root {
  --color-bg: #fffcf8;
  --color-sidebar-bg: #faf7f2;
  --color-border: #e4ddd4;
  --color-text: #18181b;
  --color-text-muted: #71717a;
  --color-text-light: #a1a1aa;
  --font-serif: 'PT Serif', Georgia, ui-serif, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width: 320px;
  --sidebar-width-lg: 340px;
  --sidebar-current-width: var(--sidebar-width);
  --main-content-pad-x: 4rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== Layout ===== */
.layout {
  display: flex;
  min-height: 100vh;
  max-width: 1080px;
  margin: 0 auto;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: transparent;
  border-right: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-inner {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
}

/* Profile photo */
.profile-photo-wrap {
  width: 100%;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  object-position: top;
  display: block;
}

.profile-photo-placeholder {
  width: 110px;
  height: 145px;
  border-radius: 10px;
  background: linear-gradient(160deg, #fde68a 0%, #fca5a5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: #7c2d12;
}

/* Sidebar name */
.sidebar-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

/* Title + institution block */
.sidebar-meta {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.sidebar-meta a {
  display: inline-block;
  white-space: nowrap;
  word-break: normal;
}

/* Sidebar nav */
.sidebar-nav {
  margin-bottom: 1.75rem;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 0.2s ease;
}

.nav-link svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0;
  transform: translate(0, 0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
  text-decoration: none;
}

.nav-link:hover svg,
.nav-link.active svg {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* Sidebar social */
.sidebar-social {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.social-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.social-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 4rem var(--main-content-pad-x) 4rem var(--main-content-pad-x);
}

/* ===== Sections ===== */
section {
  margin-bottom: 6rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 3rem;
}

/* ===== Bio ===== */
.bio {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: #3f3f46;
  line-height: 1.9;
}

#about .bio {
  text-align: justify;
  text-justify: inter-word;
}

.bio a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.bio a:hover {
  color: var(--color-text-muted);
}

/* ===== Publications ===== */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-card {
  display: flex;
  gap: 1.5rem;
  padding: 2rem 0;
}

.pub-divider {
  height: 1px;
  background: var(--color-border);
}

/* Thumbnail */
.pub-thumb {
  flex-shrink: 0;
  width: 130px;
  height: 95px;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f4f5;
  cursor: zoom-in;
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.pub-card:hover .pub-thumb img {
  transform: scale(1.04);
}

/* Publication body */
.pub-body {
  flex: 1;
  min-width: 0;
}

/* Meta row: venue · year + award badge */
.pub-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.pub-venue-text {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-text-light);
}

/* Award badge with shimmer */
.badge-award {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  background: linear-gradient(to right, #fffbeb, #fff1f2);
  color: #92400e;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: default;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.badge-award:hover {
  transform: rotate(1deg);
}

.badge-award::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9), transparent);
  transform: translateX(-100%);
  transition: transform 1s ease;
}

.badge-award:hover::after {
  transform: translateX(100%);
}

/* Title */
.pub-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

/* Authors */
.pub-authors {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.pub-authors .author-name {
  white-space: nowrap;
}

/* Links — arrow style */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  transition: color 0.2s ease;
}

.pub-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.pub-link svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.pub-link:hover svg {
  transform: translate(1px, -1px);
}

/* Abstract */
.pub-abstract {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 0.87rem;
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: lightbox-in 0.2s ease;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Footer ===== */
footer {
  position: relative;
  padding-top: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--color-text-light);
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-1 * (var(--sidebar-current-width) + var(--main-content-pad-x)));
  right: calc(-1 * var(--main-content-pad-x));
  border-top: 1px solid var(--color-border);
}

footer a {
  color: var(--color-text-muted);
}

footer a:hover {
  color: var(--color-text);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  :root {
    --sidebar-current-width: 0px;
    --main-content-pad-x: 1.5rem;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .sidebar-inner {
    padding: 1.75rem 1.5rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
  }

  .profile-photo-wrap {
    margin-bottom: 0;
  }

  .profile-photo,
  .profile-photo-placeholder {
    width: 72px;
    height: 95px;
    font-size: 1.5rem;
  }

  .sidebar-name {
    font-size: 1.25rem;
  }

  .sidebar-nav {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .sidebar-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }

  .sidebar-social {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    width: 100%;
  }

  .main-content {
    padding: 2rem var(--main-content-pad-x);
  }

  section {
    margin-bottom: 3.5rem;
  }

  .pub-card {
    flex-direction: column;
  }

  .pub-thumb {
    width: 100%;
    height: 160px;
  }
}

@media (min-width: 1280px) {
  :root {
    --sidebar-current-width: var(--sidebar-width-lg);
  }

  .sidebar {
    width: var(--sidebar-width-lg);
  }
}