/* =====================================================
   CSS Custom Properties
   ===================================================== */
:root {
  --color-bg:           #ffffff;
  --color-text:         #000000;
  --color-block-light:  rgb(205, 216, 227);   /* muted steel blue-grey */
  --color-block-dark:   rgb( 74, 101, 128);   /* deeper slate blue     */
  --color-emphasis:     rgb(158,  58,  43);   /* terracotta / rust red */
  --color-link:         rgb( 96, 130, 166);   /* muted blue-grey link  */

  --font-sans: "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont,
               Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --max-width:  900px;
  --nav-height: 60px;

  --sp-xs: 0.4rem;
  --sp-sm: 0.75rem;
  --sp-md: 1.25rem;
  --sp-lg: 2rem;
  --sp-xl: 3.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

/* =====================================================
   Typography
   ===================================================== */
h1 { font-size: 2rem;   font-weight: 700; line-height: 1.2; margin-bottom: var(--sp-xs); }
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; margin-bottom: var(--sp-sm); }
h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3;  margin-bottom: var(--sp-xs); }

p { margin-bottom: var(--sp-sm); }

a {
  color: var(--color-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* =====================================================
   Layout
   ===================================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.2rem;
}

main {
  padding: var(--sp-xl) 0;
}

/* =====================================================
   Navigation
   ===================================================== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-block-dark);
  height: var(--nav-height);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-brand:hover { text-decoration: none; opacity: 0.85; }

.nav-links {
  list-style: none;
  display: flex;
  gap: var(--sp-lg);
}

.nav-links a {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  border-bottom-color: var(--color-block-light);
  text-decoration: none;
}

/* =====================================================
   Section
   ===================================================== */
section {
  margin-bottom: var(--sp-xl);
  scroll-margin-top: calc(var(--nav-height) + 16px);
}

#about {
  margin-bottom: 1.2rem;
}

#news,
#publications,
#research,
#more-about-me {
  margin-left: 0.7rem;
}

#more-about-me {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  padding-bottom: var(--sp-xs);
  border-bottom: 2px solid var(--color-block-dark);
  margin-bottom: var(--sp-md);
}

.section-body {
  margin-left: 1rem;
}

/* =====================================================
   Profile / Hero  (index page)
   ===================================================== */
.profile {
  display: flex;
  gap: var(--sp-xl);
  align-items: flex-start;
  margin-bottom: 0;
}

.profile-photo {
  flex-shrink: 0;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-block-light);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-meta {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: var(--sp-sm);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  margin: var(--sp-sm) 0 var(--sp-md);
}

.more-about-section p {
  max-width: 760px;
}

.epigraph {
  max-width: 760px;
  margin: 1rem 0 0 auto;
  padding: 0.9rem 1rem 0.2rem 0;
  border-right: 3px solid var(--color-block-light);
  text-align: right;
}

.epigraph p {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  font-style: italic;
  color: #314150;
}

.epigraph cite {
  display: block;
  font-size: 0.88rem;
  font-style: normal;
  color: #667788;
}

/* =====================================================
   Button-style links
   ===================================================== */
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.85rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--color-block-light);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.btn-link:hover {
  background: var(--color-block-dark);
  color: #ffffff;
  text-decoration: none;
}

/* =====================================================
   News  (index page)
   ===================================================== */
.news-list {
  list-style: none;
}

.news-list li {
  display: flex;
  gap: var(--sp-md);
  padding: var(--sp-sm) 0;
  border-bottom: 1px solid var(--color-block-light);
  font-size: 0.95rem;
}

.news-date {
  flex-shrink: 0;
  width: 95px;
  color: #555;
  font-weight: 600;
  font-size: 0.88rem;
  padding-top: 2px;
}

.news-body {
  flex: 1;
  min-width: 0;
}

.news-link-card {
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 360px;
  padding: 0.65rem 0.8rem;
  margin: 0.15rem 0 0.1rem;
  border: 1px solid #ccd6e0;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f1f5f9 100%);
  color: #2b3d50;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.news-link-card:hover {
  text-decoration: none;
  border-color: var(--color-block-dark);
  background: linear-gradient(180deg, #f7fbff 0%, #e9f0f6 100%);
}

.news-link-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.76rem;
}

.news-link-branding {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.news-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.news-brand-eureka-logo {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 0.35rem;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 1px solid #c7d2de;
  background: #ffffff;
}

.news-brand-x {
  background: #111111;
  color: #ffffff;
}

.news-brand-x svg {
  width: 0.78rem;
  height: 0.78rem;
  fill: currentColor;
}

.news-link-source {
  font-weight: 700;
  color: #485d72;
}

.news-link-date {
  color: #76889a;
  white-space: nowrap;
}

.news-link-copy {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #24384c;
}

.news-link-copy-secondary {
  color: #52667a;
}

.news-link-more {
  color: var(--color-link);
  font-weight: 600;
}

.news-submeta {
  color: #555;
  font-size: 0.88rem;
}

/* =====================================================
   Publications  (publication page)
   ===================================================== */
.pub-year-group {
  margin-bottom: var(--sp-lg);
}

.pub-year-label {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--color-block-dark);
  padding: 0.15rem 0.8rem;
  border-radius: 4px;
  margin-bottom: var(--sp-md);
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.pub-item {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: var(--sp-md);
  border-left: 4px solid var(--color-block-light);
  background: #fafafa;
  transition: border-left-color 0.15s, background 0.15s;
}
.pub-item:hover {
  border-left-color: var(--color-block-dark);
  background: #f2fdf8;
}

.pub-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.pub-content {
  flex: 1;
  min-width: 0;
}

.pub-thumb {
  width: 168px;
  min-width: 168px;
  display: block;
  color: #314150;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}

.pub-thumb:hover {
  text-decoration: none;
  color: var(--color-block-dark);
}

.pub-thumb-image {
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.pub-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.pub-thumb-static {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  cursor: default;
  color: #617487;
  font-size: 0.68rem;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: none;
}
.pub-title a { color: var(--color-text); }
.pub-title a:hover { color: var(--color-link); text-decoration: none; }

.pub-authors {
  font-size: 0.91rem;
  color: #333;
  margin-bottom: 0.2rem;
}
.pub-authors strong {
  font-weight: 700;
  color: var(--color-text);
}

.pub-venue {
  font-size: 0.9rem;
  font-style: italic;
  color: #555;
  margin-bottom: 0.35rem;
}

.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.08rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 3px;
  text-decoration: none;
  transition: opacity 0.15s;
}
.badge:hover { opacity: 0.8; text-decoration: none; }

.badge-conf     { background: var(--color-block-dark);  color: #ffffff; }
.badge-preprint { background: #e0e0e0;                  color: #333333; }
.badge-arxiv {
  background: #e8b5ab;
  color: #4b3732;
}
.badge-paper    { background: var(--color-block-light); color: var(--color-text); }

/* =====================================================
   Research  (research page)
   ===================================================== */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.research-card {
  padding: 1rem 0.9rem;
  border-top: 4px solid var(--color-block-dark);
  background: var(--color-block-light);
}

.research-card h3 {
  font-size: 0.98rem;
  margin-bottom: 0.6rem;
}

.research-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #222;
}

.research-card .pub-badges {
  margin-top: var(--sp-sm);
}

/* =====================================================
   Footer
   ===================================================== */
footer {
  background: var(--color-block-light);
  padding: var(--sp-md) 0;
  text-align: center;
  font-size: 0.85rem;
  color: #555;
  border-top: 1px solid #b8c8d8;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 720px) {
  :root { --sp-xl: 2.5rem; --sp-lg: 1.5rem; }

  #news,
  #publications,
  #research,
  #more-about-me {
    margin-left: 0;
  }

  .section-body {
    margin-left: 0.5rem;
  }

  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-links { justify-content: center; }

  .nav-links {
    gap: var(--sp-md);
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .news-list li {
    flex-direction: column;
    gap: 0.15rem;
  }
  .news-date { width: auto; }

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

  .pub-thumb {
    width: 140px;
    min-width: 140px;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }
}
