:root {
  --bg-page: #FAFAFB;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F3F5F8;

  --text-main: #111827;
  --text-body: #2B3442;
  --text-muted: #5A6577;

  --border: #E2E6EC;
  --border-strong: #CBD3DE;

  /* Single Scholarly Navy Accent (matches LaTeX CV linkblue) */
  --accent: #0A4B78;
  --accent-hover: #073657;
  --accent-soft: #EEF4F8;

  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --font-latex: 'Latin Modern Roman', 'CMU Serif', 'Computer Modern', 'Source Serif 4', Georgia, serif;
}

[data-theme="dark"] {
  --bg-page: #111418;
  --bg-surface: #181C22;
  --bg-subtle: #1E232B;

  --text-main: #F1F5F9;
  --text-body: #CBD5E1;
  --text-muted: #94A3B8;

  --border: #2A303B;
  --border-strong: #3B4352;

  --accent: #74B3E6;
  --accent-hover: #9BCBF2;
  --accent-soft: rgba(116, 179, 230, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* =========================================================
   TOP ACADEMIC HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-surface) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 60px;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  color: var(--text-main);
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand:hover {
  text-decoration: none;
  color: var(--text-main);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.site-nav a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text-main);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.text-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
}

.text-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.outline-btn {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  padding: 0.38rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

/* =========================================================
   TWO-COLUMN ACADEMIC PAGE LAYOUT
   ========================================================= */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 3rem;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  align-items: start;
}

.acad-section {
  padding-top: 2.1rem;
  margin-top: 2.1rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 76px;
}

.acad-section.first-section {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.sec-heading {
  font-family: var(--font-serif);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-bottom: 0.9rem;
}

.sec-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

/* =========================================================
   PROFILE / ABOUT BLOCK
   ========================================================= */
.profile-block {
  display: flex;
  gap: 1.65rem;
  align-items: flex-start;
}

.profile-photo-wrap {
  flex-shrink: 0;
}

.profile-photo {
  width: 156px;
  height: 192px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  display: block;
  background: var(--bg-subtle);
}

.page-name {
  font-family: var(--font-serif);
  font-size: 2.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin-bottom: 0.45rem;
}

.affiliation-line {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.95rem;
}

.bio-text {
  font-size: 0.97rem;
  color: var(--text-body);
  line-height: 1.68;
  margin-bottom: 0.95rem;
}

.simple-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.simple-links .sep {
  color: var(--text-muted);
  opacity: 0.6;
}

/* =========================================================
   RESEARCH INTERESTS CALLOUT
   ========================================================= */
.callout-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  padding: 1rem 1.35rem;
}

.clean-list {
  list-style: disc;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: var(--text-body);
}

/* =========================================================
   FILTER TABS & PUBLICATION-STYLE PROJECT LIST
   ========================================================= */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
}

.filter-tab {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.32rem 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.filter-tab.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  font-weight: 600;
}

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

.pub-item {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:first-child {
  padding-top: 0.2rem;
}

.pub-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
}

.pub-title a {
  color: var(--text-main);
}

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

.pub-domain {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.14rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

.pub-benchmark {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.pub-desc {
  font-size: 0.93rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 0.45rem;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-sep {
  opacity: 0.5;
}

/* =========================================================
   EDUCATION & EXPERIENCE LISTS
   ========================================================= */
.cv-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cv-item {
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.cv-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.cv-heading {
  font-size: 0.98rem;
  color: var(--text-main);
}

.cv-org {
  color: var(--text-body);
}

.cv-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cv-note {
  font-size: 0.91rem;
  color: var(--text-body);
  margin-bottom: 0.35rem;
}

.cv-bullets {
  list-style: disc;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.91rem;
  color: var(--text-body);
}

/* =========================================================
   SELECTED READING & MEDIA
   ========================================================= */
.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.reading-item {
  display: flex;
  flex-direction: column;
  padding: 0.95rem 1.05rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.reading-item:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.reading-type {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.reading-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.reading-item:hover .reading-title {
  color: var(--accent);
}

.reading-desc {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 0.45rem;
  flex-grow: 1;
}

.reading-handle {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}

/* =========================================================
   ACADEMIC SIDEBAR
   ========================================================= */
.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 78px;
}

.sidebar-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1rem 1.1rem;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  padding-bottom: 0.45rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-text {
  font-size: 0.86rem;
  color: var(--text-body);
  line-height: 1.55;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.86rem;
}

.stack-dl {
  display: grid;
  gap: 0.55rem;
  font-size: 0.84rem;
}

.stack-dl dt {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stack-dl dd {
  color: var(--text-body);
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.sidebar-metrics {
  display: flex;
  gap: 1.1rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-metrics strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */
@media (max-width: 920px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .sidebar-col {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 1.1rem;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 0.65rem 0;
    gap: 0.55rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
  }

  .profile-block {
    flex-direction: column;
    gap: 1.1rem;
  }

  .profile-photo {
    width: 132px;
    height: 162px;
  }

  .reading-grid,
  .sidebar-col {
    grid-template-columns: 1fr;
  }
}
