@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&display=swap');

:root {
  --color-bg: #FAFAFA;
  --color-text: #111111;
  --color-text-secondary: #4A4A4A;
  --color-text-tertiary: #6D6E71; /* CMU Iron Gray */
  --color-hairline: #E0E0E0;
  --color-accent: #C41230; /* CMU Carnegie Red */
  --color-accent-hover: #9D0E26;
  --color-card-bg: #FFFFFF;
  --color-card-border: #E0E0E0;

  --font-serif: 'Fraunces', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Staggered Animations */
.animate-1 { animation: quickFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.0s both; }
.animate-2 { animation: quickFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s both; }
.animate-3 { animation: quickFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s both; }

@keyframes quickFadeUp {
  0% { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

/* Shared Components */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Navigation */
nav.site-nav {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-hairline);
  border-top: 4px solid var(--color-accent);
  z-index: 100;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--color-text);
  flex: 0 0 auto;
}

.nav-links {
  display: flex;
  gap: 20px;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--color-text-secondary);
  min-width: 0;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-links a.active {
  color: var(--color-accent);
  font-weight: 600;
}

/* Grain Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Footer */
footer {
  border-top: 1px solid var(--color-hairline);
  padding: 28px 0;
  margin-top: 64px;
  text-align: center;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Typography specifics */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-text);
}

.page-header {
  display: flex;
  flex-direction: column;
  margin-top: 56px;
  margin-bottom: 48px;
  padding-bottom: 0;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.page-header::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--color-accent);
  margin-top: 8px;
}

.page-title {
  font-size: 48px;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0;
  max-width: 540px;
  line-height: 1.65;
}

.section-heading, .theme-heading {
  font-family: var(--font-serif);
  font-size: 26px;
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: 12px;
  margin-bottom: 24px;
  margin-top: 48px;
  color: var(--color-text);
}

/* --- Profile Block (index.html) --- */
.profile-block {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  align-items: center;
  margin-top: 80px;
  margin-bottom: 80px;
}

.profile-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-photo {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--color-hairline);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  background-color: var(--color-card-bg);
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  line-height: 1.2;
  color: var(--color-text);
}

.profile-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.profile-bio p {
  margin-bottom: 16px;
  max-width: 60ch;
  line-height: 1.7;
  font-size: 16px;
}

.profile-contact {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
  justify-content: center;
}

.profile-contact a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-hairline);
  color: var(--color-text);
  background-color: var(--color-card-bg);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.profile-contact a i {
  font-size: 22px;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-contact a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(196, 18, 48, 0.1);
}

/* --- News Block --- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom Scrollbar for News List */
.news-list::-webkit-scrollbar {
  width: 6px;
}
.news-list::-webkit-scrollbar-track {
  background: var(--color-hairline);
  border-radius: 4px;
}
.news-list::-webkit-scrollbar-thumb {
  background: var(--color-text-tertiary);
  border-radius: 4px;
}
.news-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

.news-item {
  display: grid;
  grid-template-columns: 90px 36px 1fr;
  gap: 8px;
  padding: 16px 20px;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border-color: var(--color-accent);
}

.news-date {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
  padding-top: 4px;
}

.news-icon {
  font-size: 20px;
  color: var(--color-text-tertiary);
  display: flex;
  justify-content: center;
}

.news-body {
  font-size: 15px;
  color: var(--color-text);
}

.news-body a {
  text-decoration: underline;
  text-decoration-color: var(--color-hairline);
  text-underline-offset: 3px;
}

.news-body a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

/* --- Publications Block --- */
.pub-subline {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  margin-top: -16px;
}

.pub-subline a {
  text-decoration: underline;
  text-decoration-color: var(--color-hairline);
  text-underline-offset: 2px;
}

.pub-subline a:hover {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.pub-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 24px;
  margin-bottom: 24px;
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  scroll-margin-top: 96px;
  align-items: center;
  overflow: hidden; /* For image scaling containment */
}

.pub-footnote {
  font-size: 13px;
  color: var(--color-text-tertiary);
  font-style: italic;
  font-family: var(--font-mono);
  margin: 0;
}

.pub-row:hover {
  transform: translateY(-4px);
  border-color: var(--color-accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.pub-row:hover .pub-thumb {
  transform: scale(1.05);
}

.pub-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background-color: transparent;
  object-fit: contain;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.pub-title a:hover {
  color: var(--color-accent);
}

.pub-info {
  min-width: 0;
}

.pub-authors {
  font-size: 14.5px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

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

.pub-venue {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-tertiary);
}

.pub-tldr {
  font-size: 14.5px;
  color: var(--color-text-secondary);
  max-width: 64ch;
  margin-top: 8px;
  margin-bottom: 8px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.pub-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: rgba(0,0,0,0.03);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

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

/* --- About Page New Layout --- */
.about-row {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

@media (min-width: 900px) {
  .about-row {
    flex-direction: row;
    gap: 64px;
  }
}

.about-column {
  flex: 1;
}

.about-section-title {
  font-family: var(--font-serif);
  font-size: 26px;
  border-bottom: 1px solid var(--color-hairline);
  padding-bottom: 12px;
  margin-bottom: 32px;
  color: var(--color-text);
}

.experience-item {
  margin-bottom: 32px;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-header h5 {
  font-family: var(--font-serif);
  font-size: 19px;
  margin-bottom: 4px;
  color: var(--color-text);
  font-weight: 600;
}

.theme-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--color-hairline);
  margin-bottom: 40px;
  padding-bottom: 12px;
  margin-top: 48px;
}

.theme-heading-row .theme-heading {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
  margin-top: 0;
}

.experience-role {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--color-hairline);
  padding-bottom: 8px;
  gap: 16px;
}

.experience-role strong {
  font-size: 15px;
  color: var(--color-text);
}

.experience-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.experience-desc {
  font-size: 14.5px;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

.experience-details p {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.experience-details p strong {
  color: var(--color-text);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  .container {
    padding: 0 12px;
  }
  
  .nav-inner {
    gap: 16px;
    padding: 14px 16px;
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-logo {
    font-size: 19px;
  }
  
  .nav-links {
    flex: 1 1 auto;
    justify-content: flex-end;
    font-size: 13px;
    gap: 14px;
  }

  .page-title {
    font-size: 36px;
  }

  .page-header {
    margin-top: 40px;
    margin-bottom: 32px;
  }
  
  /* Single column transformations */
  .profile-block {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-photo {
    width: 180px;
    height: 180px;
  }
  
  .profile-contact {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
  
  .about-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .news-item {
    grid-template-columns: 86px 1fr;
    column-gap: 12px;
    row-gap: 0;
    padding: 16px 20px;
  }

  .news-date {
    grid-column: 1;
    grid-row: 1;
    padding-top: 2px;
  }

  .news-icon {
    display: none;
  }

  .news-body {
    grid-column: 2;
    grid-row: 1;
    line-height: 1.55;
  }

  .theme-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
  }

  .pub-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    max-width: 100%;
  }

  .pub-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    margin-bottom: 0;
    border-radius: 8px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }

  .pub-row:hover {
    transform: none;
  }

  .pub-row:hover .pub-thumb {
    transform: none;
  }
  
  .pub-thumb {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 4 / 5;
    height: auto;
    border-radius: 0;
    border-bottom: 1px solid var(--color-card-border);
    object-fit: cover;
    object-position: center;
  }

  .pub-info {
    padding: 18px 18px 20px;
  }

  .pub-title {
    font-size: 19px;
    line-height: 1.32;
    margin-bottom: 10px;
  }

  .pub-authors,
  .pub-tldr {
    font-size: 14px;
    line-height: 1.55;
  }

  .pub-links {
    gap: 8px;
    margin-top: 14px;
  }

  .pub-links a {
    padding: 7px 12px;
    font-size: 12.5px;
  }
  

}

@media (max-width: 380px) {
  .nav-inner {
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-logo {
    font-size: 18px;
  }

  .nav-links {
    gap: 10px;
    font-size: 12.5px;
  }
}
