:root {
  --accent: #49566a;
  --accent-dark: #2d3746;
  --ink: #18202a;
  --muted: #5f6976;
  --rule: #d7dde4;
  --paper: #ffffff;
  --surface: #f5f7fa;
  --shadow: 0 18px 42px rgba(24, 32, 42, 0.08);
  --page-width: min(8.5in, calc(100vw - 2rem));
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f8fa 0%, #eef1f5 100%);
}

a {
  color: inherit;
  text-decoration-color: rgba(73, 86, 106, 0.38);
  text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
  color: var(--accent-dark);
}

p,
li,
dd {
  line-height: 1.42;
}

.page-shell {
  padding: 1.25rem 1rem 2rem;
}

.site-nav {
  width: var(--page-width);
  margin: 0 auto 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 0.9rem;
  border: 1px solid rgba(24, 32, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #465364;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(73, 86, 106, 0.22);
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent-dark);
}

.site-nav__link--active {
  border-color: rgba(73, 86, 106, 0.22);
  background: #f8fafc;
  color: var(--accent-dark);
}

.resume {
  width: var(--page-width);
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid rgba(24, 32, 42, 0.06);
  padding: 0.62in 0.72in 0.4in;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.12in;
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--rule);
}

.hero__photo-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  margin-top: 0.18rem;
}

.hero__photo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem;
  background: linear-gradient(180deg, #f1f4f8 0%, #e8edf3 100%);
  border-radius: 0.2rem;
}

.hero__photo {
  width: 1.02in;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 0;
  box-shadow: none;
}

.hero__content {
  min-width: 0;
  max-width: 100%;
}

.hero__name {
  margin: 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(2rem, 3.6vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.04;
}

.hero__identity {
  margin-top: 0.42rem;
}

.hero__title {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 600;
}

.hero__institution,
.hero__affiliation {
  margin: 0.18rem 0 0;
  color: var(--muted);
}

.hero__institution {
  font-weight: 500;
  color: #344150;
}

.hero__affiliation {
  max-width: 42rem;
  line-height: 1.36;
}

.hero__divider {
  width: 3.2rem;
  height: 1px;
  margin-top: 0.78rem;
  background: var(--rule);
}

.hero__contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.45rem;
  margin-top: 0.34rem;
  font-size: 0.92rem;
  color: #3f4c5b;
}

.hero__contact-line:first-of-type {
  margin-top: 0.56rem;
}

.hero__icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.82rem;
}

.hero__icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.85rem;
  padding: 0 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fafbfd;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.hero__icon-link img {
  width: 1.2rem;
  height: 1.2rem;
  object-fit: contain;
  display: block;
  opacity: 0.9;
}

.hero__icon-link--orcid img,
.hero__icon-link--wos img {
  filter: grayscale(1) contrast(0.92);
}

.hero__icon-link--ieee {
  width: 2.85rem;
  height: 1.78rem;
  padding: 0 0.35rem;
  background: #6f859a;
  border-color: #6f859a;
}

.hero__icon-link--ieee img {
  width: 100%;
  height: 0.78rem;
  opacity: 1;
}

.hero__icon-link:hover,
.hero__icon-link:focus-visible {
  transform: translateY(-1px);
  background: #f2f5f8;
  border-color: #c6d0da;
}

.hero__icon-link--ieee:hover,
.hero__icon-link--ieee:focus-visible {
  background: #62788d;
  border-color: #62788d;
}

.separator {
  color: #8b96a3;
}

.cv-section {
  margin-top: 1rem;
}

.cv-section__heading {
  margin-bottom: 0.48rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.18rem;
}

.cv-section__heading h2 {
  margin: 0;
  color: var(--accent);
  font-size: 0.96rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.entry + .entry,
.publication-group + .publication-group {
  margin-top: 0.85rem;
}

.entry__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.entry__header h3,
.publication-group__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.entry__date {
  margin: 0;
  white-space: nowrap;
  font-style: italic;
  color: var(--muted);
}

.entry__subtitle,
.entry__meta,
.entry__detail,
.cv-section p {
  margin: 0.14rem 0 0;
}

.entry__meta {
  color: var(--muted);
}

.entry__list,
.publication-list {
  margin: 0.32rem 0 0 1.15rem;
  padding: 0;
}

.entry__list li,
.publication-list li {
  margin-bottom: 0.28rem;
}

.publication-group__title {
  font-size: 0.98rem;
}

.compact-list p,
.award-list p {
  margin: 0.2rem 0 0.45rem;
}

.award-list p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.skills-grid {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.34rem 1.5rem;
}

.skills-grid dt {
  font-weight: 700;
}

.skills-grid dd {
  margin: 0;
}

.gallery-page {
  width: var(--page-width);
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid rgba(24, 32, 42, 0.06);
  padding: 0.62in 0.72in 0.5in;
}

.gallery-hero {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.gallery-hero__eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-hero__title {
  margin: 0.32rem 0 0;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.gallery-hero__description {
  max-width: 28rem;
  margin: 0.46rem 0 0;
  color: var(--muted);
}

.gallery-layout {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(14rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.gallery-column {
  display: grid;
  gap: 1rem;
}

.gallery-column--side {
  align-content: start;
}

.gallery-card {
  margin: 0;
  overflow: hidden;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
  box-shadow: 0 14px 28px rgba(24, 32, 42, 0.08);
}

.gallery-card--landscape .gallery-card__image {
  aspect-ratio: 2.26 / 1;
}

.gallery-card--portrait .gallery-card__image {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.gallery-column--side .gallery-card:first-child .gallery-card__image {
  aspect-ratio: 4 / 5.8;
}

.gallery-column--side .gallery-card:first-child .gallery-card__image {
  object-position: center 8%;
}

.gallery-column--side .gallery-card:last-child .gallery-card__image {
  object-position: center 28%;
}

.gallery-card__image {
  width: 100%;
  display: block;
  height: auto;
  object-fit: contain;
  transition: transform 260ms ease, filter 260ms ease;
}

.gallery-card__caption {
  margin: 0;
  padding: 0.62rem 0.82rem 0.72rem;
  color: #485565;
  font-size: 0.88rem;
  line-height: 1.35;
  background: #f7f9fc;
}

.gallery-card:hover .gallery-card__image,
.gallery-card:focus-within .gallery-card__image {
  transform: scale(1.02);
  filter: saturate(1.02) contrast(1.02);
}

@media (max-width: 980px) {
  .gallery-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(12rem, 1fr);
  }
}

@media (max-width: 780px) {
  .resume {
    padding: 1.4rem 1rem 1.2rem;
  }

  .site-nav {
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .hero__photo-wrap {
    order: -1;
    justify-content: center;
    margin-top: 0;
  }

  .hero__photo {
    width: min(9rem, 38vw);
  }

  .hero__photo-frame {
    padding: 0.16rem;
  }

  .hero__content {
    text-align: center;
  }

  .entry__header,
  .award-list p,
  .skills-grid {
    display: block;
  }

  .hero__contact-line,
  .hero__icons {
    justify-content: center;
  }

  .hero__divider {
    margin-left: auto;
    margin-right: auto;
  }

  .entry__date {
    margin-top: 0.15rem;
  }

  .skills-grid dd {
    margin: 0.08rem 0 0.38rem;
  }

  .gallery-page {
    padding: 1.4rem 1rem 1.2rem;
  }

  .gallery-layout {
    grid-template-columns: 1fr;
  }

  .gallery-card__caption {
    font-size: 0.9rem;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm 12mm 9mm;
  }

  body {
    background: #fff;
  }

  .page-shell {
    padding: 0;
  }

  .resume {
    width: auto;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  a {
    text-decoration: none;
  }
}
