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

:root {
  --radius-pill: 999px;
  --radius-card: 18px;
  --radius-hero: 24px;
  --radius-control: 10px;
  --radius-round: 50%;
  --radius-accent: 4px;
  --section-accent: var(--md-sys-color-secondary);
  --on-section-accent: var(--md-sys-color-on-secondary);
  --item-accent: var(--md-sys-color-tertiary);
  --on-item-accent: var(--md-sys-color-on-tertiary);
  --link-accent: var(--md-sys-color-secondary);
  --on-link-accent: var(--md-sys-color-on-secondary);
  --link-accent-container: var(--md-sys-color-secondary-container);
  --on-link-accent-container: var(--md-sys-color-on-secondary-container);
}

/* ===== Base ===== */
html {
  font-size: 15px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a,
.hero,
.avatar,
.social-links a,
.pub-card,
.pub-links a {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

/* ===== Container ===== */
.container {
  max-width: 880px;
  margin   : 0 auto;
  padding  : 4rem 2rem 5rem;
  position : relative;
}

/* ===== Section Rhythm ===== */
section {
  margin-bottom: 4rem;
}

h2 {
  font-size     : 1.6rem;
  font-weight   : 700;
  color         : var(--md-sys-color-on-background);
  margin-bottom : 1.5rem;
  letter-spacing: -0.02em;
  display       : inline-flex;
  align-items   : center;
  gap           : 0.7rem;
}

h2::before {
  content      : "";
  width        : 0.5rem;
  height       : 1.35rem;
  border-radius: var(--radius-accent);
  background   : var(--section-accent);
}

section p,
section li {
  color: var(--md-sys-color-on-surface-variant);
}

#research-text {
  max-width: 760px;
}

/* ===== Hero ===== */
.hero {
  display        : flex;
  gap            : 3rem;
  align-items    : center;
  margin-bottom  : 4rem;
  padding        : 2.5rem;
  background     : color-mix(in srgb, var(--md-sys-color-surface-container-lowest) 88%, transparent);
  border-radius  : var(--radius-hero);
  border         : 1px solid var(--md-sys-color-outline-variant);
  box-shadow     : 0 24px 70px color-mix(in srgb, var(--md-sys-color-shadow) 10%, transparent);
  backdrop-filter: blur(18px);
}

.avatar {
  width: 28%;
  max-width: 180px;
  flex-shrink: 0;
  border-radius: var(--radius-round);
}

.hero-info h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--md-sys-color-on-background);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.hero-info .affiliation {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--link-accent);
  margin-bottom: 0.3rem;
}

.hero-info .tagline {
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== Personal Meta ===== */
.personal-meta {
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.8;
}

.meta-line {
  display: block;
}

.email-line {
  display: block;
  margin-top: 0.1rem;
}

.email-line a {
  color: var(--link-accent);
  text-decoration: none;
  font-weight: 500;
}

.email-line a:hover {
  text-decoration: underline;
}

/* ===== Social Links ===== */
.social-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.social-links a {
  display        : flex;
  align-items    : center;
  justify-content: center;
  width          : 38px;
  height         : 38px;
  border-radius  : var(--radius-control);
  color          : var(--md-sys-color-on-surface-variant);
  background     : var(--md-sys-color-surface-container-low);
  border         : 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 72%, transparent);
}

.social-links a:hover {
  color       : var(--link-accent);
  background  : var(--md-sys-color-surface-container-high);
  border-color: color-mix(in srgb, var(--link-accent) 34%, var(--md-sys-color-outline-variant));
}

.social-links svg,
.social-links img,
.social-links .mask-icon {
  width: 18px;
  height: 18px;
}

/* ===== Publications ===== */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 200px;
}

/* Card */
.pub-card {
  background    : var(--md-sys-color-surface-variant);
  border        : 1px solid var(--md-sys-color-outline-variant);
  border-radius : var(--radius-card);
  overflow      : hidden;
  display       : flex;
  flex-direction: row;
  box-shadow    : 0 10px 34px color-mix(in srgb, var(--md-sys-color-shadow) 5%, transparent);
}

.pub-card:hover {
  border-color: color-mix(in srgb, var(--link-accent) 42%, var(--md-sys-color-outline-variant));
  box-shadow: 0 18px 52px color-mix(in srgb, var(--md-sys-color-shadow) 11%, transparent);
  transform: translateY(-3px);
}

.pub-card.highlight {
  border-color: color-mix(in srgb, var(--link-accent) 38%, var(--md-sys-color-outline-variant));
  box-shadow  : 0 12px 40px color-mix(in srgb, var(--link-accent) 10%, transparent);
}

/* Teaser image */
.pub-teaser {
  width: 220px;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  background: var(--md-sys-color-surface-container-low);
}

.pub-teaser img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Card body */
.pub-body {
  padding: 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 180px;
}

.pub-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--md-sys-color-on-background);
  margin-bottom: 0.4rem;
  line-height: 1.45;
}

.pub-authors {
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.pub-authors strong {
  font-weight: 700;
  color: var(--md-sys-color-on-background);
}

.pub-card.highlight .pub-authors strong {
  color: var(--md-sys-color-on-background);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pub-venue {
  font-style: italic;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

.pub-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.pub-links a {
  display        : inline-flex;
  align-items    : center;
  justify-content: center;
  width          : 36px;
  height         : 36px;
  color          : var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  border-radius  : var(--radius-control);
  border         : 1px solid var(--md-sys-color-outline-variant);
  background     : var(--md-sys-color-surface-container-low);
}

.pub-links svg {
  width: 18px;
  height: 18px;
}

.pub-links a:hover {
  color: var(--link-accent);
  background: var(--md-sys-color-surface-container-high);
  border-color: color-mix(in srgb, var(--link-accent) 34%, var(--md-sys-color-outline-variant));
}

.pub-description {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* ===== Experience ===== */
.exp-item {
  margin-bottom: 1.2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--item-accent);
}

.exp-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--md-sys-color-on-background);
  margin-bottom: 0.2rem;
}

.exp-item .exp-meta {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
}

/* ===== Miscellanea ===== */
.miscellanea ul {
  list-style: none;
}

.miscellanea li {
  margin-bottom: 0.5rem;
  padding-left: 1.2rem;
  position: relative;
}

.miscellanea li::before {
  content      : "";
  position     : absolute;
  left         : 0;
  top          : 0.72em;
  width        : 0.42rem;
  height       : 0.42rem;
  border-radius: var(--radius-round);
  background   : var(--item-accent);
}

/* ===== Footer ===== */
footer {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
  padding-top: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  text-align: center;
}

/* ===== Global Link Styles ===== */
a {
  color: var(--link-accent);
  text-decoration: none;
}

a:hover {
  color: var(--md-sys-color-on-secondary-container);
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .container {
    padding: 2rem 1rem 3rem;
  }

  .hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }

  .avatar {
    width: 40%;
    max-width: 140px;
  }

  .social-links {
    justify-content: center;
  }

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

  .pub-teaser {
    width: 100%;
    height: 180px;
    align-self: auto;
  }

  .pub-body {
    padding: 1.25rem;
  }
}

/* ===== Print ===== */
@media print {
  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000;
  }
}
