/* ==========================================================================
   Clean Borderless Academic Homepage — Inspired by MyResume / jiaxu-zhao.github.io
   Pure white canvas (#ffffff) + Cool Slate (#45505b) + Cobalt Blue (#0563bb)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-light: #f7f8f9;
  --text: #272829;
  --heading: #45505b;
  --muted: #6c7885;
  --accent: #0563bb;
  --accent-hover: #044f96;
  --accent-soft: rgba(5, 99, 187, 0.08);
  --border: #e6eaee;
  --pill-bg: #f2f3f5;

  --font-body: 'Roboto', 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-heading: 'Raleway', 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-nav: 'Poppins', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.72;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--heading);
  margin-top: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ==========================================================================
   Top-Right Floating Language Switch
   ========================================================================== */
.floating-tools {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 5px 4px 10px;
  border-radius: 50px;
  background: #ffffff;
  border: 1px solid #d0dae5;
  box-shadow: 0 4px 16px rgba(15, 23, 34, 0.10);
}

.lang-globe {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  margin-right: 4px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--heading);
  font-family: var(--font-nav);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  transition: all 0.2s ease;
}

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

.lang-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Left Floating Circular Pill Navigation (#header)
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 15px;
  pointer-events: none;
  transition: left 0.3s ease;
}

.navmenu {
  pointer-events: none;
}

.navmenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 156px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.navmenu li {
  position: relative;
  pointer-events: auto;
}

.navmenu a {
  display: inline-flex;
  align-items: center;
  height: 52px;
  width: 52px;
  padding: 0 15px;
  border-radius: 50px;
  background: var(--pill-bg);
  color: var(--heading);
  font-family: var(--font-nav);
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.25s ease, background-color 0.2s ease, color 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease;
}

.navmenu a svg {
  flex-shrink: 0;
  width: 21px;
  height: 21px;
}

.navmenu a span {
  display: none;
  margin-left: 10px;
}

.navmenu a:hover,
.navmenu a.active,
.navmenu li:hover > a {
  background: var(--accent);
  color: #ffffff;
}

.navmenu li:hover > a,
.navmenu a:hover,
.navmenu a:focus-visible {
  width: 152px;
  padding: 0 18px 0 15px;
  box-shadow: 0 6px 18px rgba(5, 99, 187, 0.22);
}

.navmenu li:hover > a span,
.navmenu a:hover span,
.navmenu a:focus-visible span {
  display: inline;
}

/* Mobile Sidebar Toggle */
.header-toggle {
  display: none;
  position: fixed;
  top: 15px;
  right: 16px;
  z-index: 980;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(5, 99, 187, 0.28);
}

#menu-icon-close {
  display: none;
}

.header-toggle.is-open #menu-icon-open {
  display: none;
}

.header-toggle.is-open #menu-icon-close {
  display: block;
}

/* Clear Left Floating Rail on Desktop */
@media (min-width: 1200px) {
  .main .section .container,
  .home-inner,
  .footer .container {
    padding-left: 96px;
    padding-right: 40px;
  }
}

@media (max-width: 1199px) {
  .header-toggle {
    display: inline-flex;
  }

  .floating-tools {
    right: 68px;
    top: 18px;
  }

  .header {
    width: 260px;
    left: -280px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    pointer-events: auto;
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.08);
  }

  .header.header-show {
    left: 0;
  }

  .navmenu ul {
    width: 100%;
  }

  .navmenu a {
    width: 100%;
    padding: 0 18px;
  }

  .navmenu a span {
    display: inline;
  }

  .navmenu li:hover > a,
  .navmenu a:hover {
    width: 100%;
  }
}

/* ==========================================================================
   1. Compact Full-Bleed Atmospheric Hero (#home)
   ========================================================================== */
.home {
  position: relative;
  width: 100%;
  min-height: 315px;
  padding: 74px 0 68px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: #f3f6f9;
}

.home-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  z-index: 1;
}

.home::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.56) 0%,
    rgba(255, 255, 255, 0.30) 54%,
    rgba(255, 255, 255, 0.14) 100%
  );
  z-index: 2;
}

.home-inner {
  position: relative;
  z-index: 3;
}

.home-content {
  max-width: 780px;
}

.home-name {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: clamp(36px, 4.8vw, 58px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--heading);
}

.home-name-sub {
  font-weight: 500;
  font-size: 0.56em;
  color: var(--muted);
  margin-left: 10px;
}

.home-typed-line {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(17px, 1.9vw, 22px);
  font-weight: 400;
  color: var(--heading);
}

.typed-text {
  letter-spacing: 0.3px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
}

.social-links {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.social-links a,
.social-links button.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(39, 40, 41, 0.76);
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover,
.social-links button.social-icon-btn:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.social-divider {
  width: 1px;
  height: 18px;
  background: rgba(69, 80, 91, 0.24);
}

.hero-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 50px;
  border: 1px solid rgba(5, 99, 187, 0.32);
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-family: var(--font-nav);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.hero-lang-switch:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Global Sections & Centered Dual-Tone Underlined Titles
   ========================================================================== */
.section {
  padding: 56px 0;
  background: var(--bg);
}

.section-profile {
  padding-top: 44px;
}

.section-title {
  text-align: center;
  margin-bottom: 42px;
}

.section-title h2 {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 16px;
  position: relative;
  color: var(--heading);
  letter-spacing: 0.01em;
}

.section-title h2::before {
  content: '';
  position: absolute;
  display: block;
  width: 140px;
  height: 1px;
  background: #d2d8df;
  left: 0;
  right: 0;
  bottom: 1px;
  margin: auto;
}

.section-title h2::after {
  content: '';
  position: absolute;
  display: block;
  width: 52px;
  height: 3px;
  background: var(--accent);
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}

.section-title p {
  margin: 0 auto;
  max-width: 680px;
  font-size: 14.5px;
  color: var(--muted);
}

/* ==========================================================================
   2. About Section + Borderless Facts Row
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.about-photo {
  align-self: start;
}

.about-photo img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid #e9edf2;
}

.about-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 18px;
}

.about-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 28px;
  margin-bottom: 22px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  line-height: 1.5;
  min-width: 0;
}

.meta-chevron {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.meta-label {
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
}

.meta-val {
  color: var(--text);
  overflow-wrap: anywhere;
}

.inline-copy {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  font-weight: 500;
}

.inline-copy:hover {
  text-decoration: underline;
}

.about-bio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  color: var(--text);
}

.about-bio p {
  margin: 0;
}

.about-bio strong {
  color: var(--heading);
  font-weight: 600;
}

/* Facts Row (Borderless Counters with Solid Cobalt Circle Icons) */
.facts-row {
  margin-top: 54px;
  padding-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.fact-item {
  text-align: center;
  padding: 8px 10px;
}

.fact-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fact-value {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  color: #011426;
  margin-bottom: 4px;
}

.fact-label {
  font-family: var(--font-heading);
  font-size: 13.5px;
  color: var(--muted);
}

/* ==========================================================================
   3. News Section (Clean Single-Column Rows + Show More)
   ========================================================================== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: grid;
  grid-template-columns: 92px 22px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  font-size: 15px;
  line-height: 1.65;
}

.news-date {
  font-weight: 700;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}

.news-icon {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(2px);
}

.news-text {
  color: var(--text);
}

.news-text strong {
  color: var(--heading);
  font-weight: 600;
}

.news-more-wrap {
  text-align: center;
  margin-top: 22px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 20px;
  border-radius: 50px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: var(--accent);
  color: #ffffff;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 20px;
  border-radius: 50px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

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

/* ==========================================================================
   4. Publications (Borderless Typographic Academic List)
   ========================================================================== */
.pub-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-btn {
  border: none;
  background: transparent;
  color: var(--heading);
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  transition: all 0.2s ease;
}

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

.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.pub-search {
  position: relative;
  width: 300px;
}

.pub-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.pub-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid #d9dfe6;
  border-radius: 50px;
  background: #ffffff;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.pub-search input:focus {
  border-color: var(--accent);
}

.pub-meta-line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

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

.pub-item {
  padding: 0;
}

.pub-title {
  margin: 0 0 5px;
  font-family: var(--font-heading);
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.42;
}

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

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

.pub-award {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 8px;
  border-radius: 4px;
  vertical-align: 1px;
}

.pub-authors {
  margin: 0 0 3px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
}

.pub-authors strong {
  color: #111315;
  font-weight: 700;
}

.pub-venue-row {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.pub-venue-row em {
  color: #4f5b67;
}

.pub-inline-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-style: normal;
  font-size: 13px;
}

.pub-inline-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.pub-inline-btn:hover {
  text-decoration: underline;
}

.pub-note {
  color: var(--muted);
  font-size: 13px;
}

.pub-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14.5px;
}

/* ==========================================================================
   5. Projects & Open-Source Tools (Grouped Editorial 2+1 Layout)
   ========================================================================== */
.projects-layout {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.project-group-title {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.01em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 42px;
}

.projects-grid-single {
  grid-template-columns: 1fr;
}

.project-item {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  position: relative;
}

.project-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent);
}

.project-item-wide {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.9fr);
  gap: 16px 42px;
  align-items: start;
}

.project-wide-highlights {
  margin: 4px 0 0;
  padding: 14px 18px;
  list-style: none;
  background: var(--bg-light);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.project-wide-highlights li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}

.project-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.project-icon-sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.project-name {
  margin: 0;
  font-family: var(--font-nav);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

.project-meta {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--heading);
  background: var(--bg-light);
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.project-desc {
  margin: 0 0 8px;
  font-size: 14.5px;
  line-height: 1.66;
  color: var(--text);
}

.project-stack {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
}

.project-copy-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.project-copy-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-item {
  scroll-margin-top: 28px;
}

.projects-more-bar {
  margin-top: 2px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.projects-more-info {
  flex: 1 1 420px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.projects-more-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--heading);
  margin-right: 10px;
}

.projects-more-desc code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 13.5px;
}

.projects-more-btn {
  flex-shrink: 0;
}

/* ==========================================================================
   6. Resume (Classic 2-Column Left-Blue-Timeline)
   ========================================================================== */
.resume-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 44px;
}

.resume-col-full {
  grid-column: 1 / -1;
}

.resume-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 44px;
}

.resume-service-grid .resume-item {
  padding-bottom: 0;
}

.resume-title {
  font-size: 23px;
  font-weight: 700;
  color: var(--heading);
  margin: 22px 0 18px;
}

.resume-col .resume-title:first-child,
.resume-col-full .resume-title:first-child {
  margin-top: 0;
}

.resume-item {
  padding: 0 0 22px 22px;
  margin-top: -2px;
  border-left: 2px solid var(--accent);
  position: relative;
}

.resume-item:last-child {
  padding-bottom: 0;
}

.resume-item::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: -8px;
  top: 2px;
  background: #ffffff;
  border: 2px solid var(--accent);
}

.resume-item h4 {
  font-family: var(--font-nav);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
  margin: 0 0 7px;
}

.resume-item h5 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  background: var(--bg-light);
  padding: 3px 12px;
  border-radius: 3px;
  display: inline-block;
  margin: 0 0 8px;
}

.resume-item p {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: var(--text);
}

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

.resume-item em {
  color: var(--muted);
}

.resume-item ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 14.5px;
}

.resume-item ul li {
  margin-bottom: 6px;
}

/* ==========================================================================
   7. Service & Prospective Students
   ========================================================================== */
.service-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.service-item {
  padding: 0 0 4px 22px;
  border-left: 2px solid var(--accent);
  position: relative;
}

.service-item::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: -8px;
  top: 3px;
  background: #ffffff;
  border: 2px solid var(--accent);
}

.service-item h4 {
  font-family: var(--font-nav);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
}

.service-item p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text);
}

/* ==========================================================================
   8. Contact & Footer
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.contact-item:hover .contact-icon {
  background: var(--accent);
  color: #ffffff;
}

.contact-item h4 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
}

.contact-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

/* Footer */
.footer {
  background: var(--bg-light);
  color: var(--text);
  text-align: center;
  padding: 40px 0 34px;
  margin-top: 20px;
}

.footer-name {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 700;
  color: var(--heading);
}

.footer-motto {
  margin: 0 auto 22px;
  max-width: 640px;
  font-size: 14.5px;
  font-style: italic;
  color: var(--muted);
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.footer-socials a:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-2px);
}

.footer-copyright {
  padding-top: 18px;
  border-top: 1px solid #e2e6ea;
  font-size: 13px;
  color: var(--muted);
}

/* Scroll Top FAB */
.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 850;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(5, 99, 187, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.scroll-top.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

/* ==========================================================================
   BibTeX Modal & Toast
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 34, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 640px;
  background: #ffffff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.4;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--heading);
}

.modal-pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 6px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 1050;
  transform: translate(-50%, 14px);
  padding: 9px 18px;
  border-radius: 50px;
  background: #272829;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 26px;
  }

  .about-meta-grid,
  .projects-grid,
  .project-item-wide,
  .resume-grid,
  .resume-service-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .facts-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 18px;
  }

  .home {
    min-height: 260px;
    padding: 68px 0 54px;
  }

  .section {
    padding: 44px 0;
  }

  .section-title {
    margin-bottom: 30px;
  }

  .section-title h2 {
    font-size: 26px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .about-photo {
    max-width: 220px;
  }

  .news-item {
    grid-template-columns: 78px 20px minmax(0, 1fr);
    gap: 8px;
    font-size: 14px;
  }

  .pub-search {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .header,
  .header-toggle,
  .floating-tools,
  .scroll-top,
  .pub-controls,
  .pub-inline-links,
  .modal-backdrop,
  .toast {
    display: none !important;
  }

  .main .section .container,
  .home-inner,
  .footer .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
