/* ===== Base ===== */
:root {
  --bg: #f8f8f6;
  --panel: #ffffff;
  --text: #171717;
  --muted: #5f6368;
  --line: #e6e3dc;
  --link: #111827;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.055);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

[hidden] {
  display: none !important;
}

/* ===== Header ===== */
.site-header {
  min-height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-title {
  color: var(--text);
  text-decoration: none;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 720;
  letter-spacing: -0.04em;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 30px);
  font-size: clamp(14px, 1.5vw, 16px);
}

.nav a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 7px 0;
}

.nav a:hover,
.nav a.active {
  border-bottom-color: var(--text);
}

/* ===== Language switch ===== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.78em;
  line-height: 1.2;
  white-space: nowrap;
}

.lang-switch a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 0;
  padding: 0;
}

.lang-switch a:hover {
  border-bottom: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lang-current {
  color: var(--text);
  font-weight: 720;
}

.lang-sep {
  color: var(--muted);
}

/* ===== Layout ===== */
.page {
  width: min(1080px, calc(100% - 64px));
  margin: 0 auto;
  padding: 60px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: 210px minmax(0, 720px);
  gap: clamp(34px, 5vw, 64px);
  align-items: start;
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 20px);
}

h1 {
  margin: 0 0 18px;
  max-width: 760px;
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.bio {
  max-width: 760px;
  color: #374151;
  font-size: clamp(15px, 1.5vw, 17px);
  letter-spacing: 0.005em;
}

.bio p {
  margin: 0 0 18px;
}

.bio a,
.links a {
  color: var(--link);
}

/* ===== News ===== */
.news-section {
  margin-top: 28px;
  padding-top: 22px;
  max-width: 720px;
  border-top: 1px solid var(--line);
}

.news-section h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.news-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.news-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 0 0 4px;
}


.news-list time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.news-list span {
  color: #374151;
  font-size: 14px;
  line-height: 1.55;
}

.news-list em {
  color: #2f3743;
}

@media (max-width: 560px) {
  .news-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ===== Links ===== */
.links {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 12px;
  max-width: 680px;
}

.link-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px 16px;
  color: var(--text);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d6d1c8;
}

.link-title {
  display: block;
  font-size: 15px;
  font-weight: 720;
}

.link-desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* ===== Portrait ===== */
.portrait-card {
  width: 210px;
  margin-top: 105px;
}

.portrait-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.75), transparent 34%),
    linear-gradient(135deg, #ece9e2, #d8d2c8);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: #6b7280;
  font-size: 16px;
  font-weight: 650;
}

.portrait-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

.caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.footer {
  width: min(1080px, calc(100% - 64px));
  margin: 0 auto;
  padding: 24px 0 38px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

/* ===== Content pages ===== */
.content-page {
  max-width: 780px;
}

.content-page h1 {
  margin-bottom: 16px;
}

.content-page p,
.content-page li {
  color: #374151;
  font-size: 16px;
}

.placeholder-box {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .site-header {
    min-height: auto;
    padding: 22px 24px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .page {
    width: min(100% - 40px, 1120px);
    padding-top: 44px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .portrait-card {
    width: 150px;
    margin-top: 20px;
  }

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

  .footer {
    width: min(100% - 40px, 1120px);
  }
}

/* ===== Research page ===== */
.research-page {
  max-width: 880px;
}

.page-intro {
  margin-top: -4px;
  margin-bottom: 28px;
  color: var(--muted);
}

.research-group {
  padding: 24px 0 26px;
  border-top: 1px solid var(--line);
}

.research-group:first-of-type {
  margin-top: 20px;
}

.affiliation-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 15px !important;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.research-group h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

.research-subsection {
  margin-top: 18px;
}

.research-subsection h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
}

.publication-list {
  margin: 0;
  padding-left: 1.25rem;
}

.publication-list li {
  margin-bottom: 10px;
  padding-left: 2px;
  color: #374151;
  font-size: 15px;
  line-height: 1.58;
}

.publication-list a {
  color: var(--link);
  text-underline-offset: 3px;
}

.publication-list em {
  color: #4b5563;
}

/* ===== Education page ===== */
.education-page {
  max-width: 900px;
}

.education-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.education-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.education-card-header {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
}

.education-school {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 17px !important;
  font-weight: 720;
}

.education-card h2,
.coursework-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.education-detail {
  margin: 5px 0 0;
  color: #374151;
  font-size: 15px !important;
}

.education-meta {
  min-width: 130px;
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.education-notes {
  margin-top: 14px;
  display: grid;
  gap: 7px;
}

.education-notes p {
  margin: 0;
  color: #374151;
  font-size: 14.5px !important;
  line-height: 1.58;
}

.coursework-section {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px !important;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.course-hint {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 13px !important;
  line-height: 1.5;
}

.course-search-wrap {
  margin: 22px 0 14px;
}

.course-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
}

.course-search:focus {
  border-color: #c8c2b8;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.035);
}


.course-accordion {
  display: grid;
  gap: 12px;
}

.course-group {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  overflow: hidden;
}

.course-group summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 720;
  font-size: 15px;
}

.course-group summary::-webkit-details-marker {
  display: none;
}

.course-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.course-group-body {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.course-category + .course-category {
  margin-top: 16px;
}

.course-category h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.course-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(248, 248, 246, 0.84);
  color: #374151;
  font-size: 12.5px;
  line-height: 1.35;
  text-decoration: none;
}

.course-chip:hover {
  border-color: #c8c2b8;
  background: #ffffff;
}

@media (max-width: 700px) {
  .education-card-header,
  .section-heading-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .education-meta {
    min-width: 0;
    text-align: left;
    white-space: normal;
  }
}

/* ===== Project news ===== */
.project-updates {
  margin-top: 28px;
  padding-top: 22px;
  max-width: 820px;
  border-top: 1px solid var(--line);
}

.project-updates h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.project-update-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.project-update-list li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
}

.project-update-list time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

.project-update-list span {
  color: #374151;
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .project-update-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* ===== Projects page ===== */
.projects-page {
  max-width: 980px;
}

.project-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.project-focus-card {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.focus-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px !important;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-focus-card h2 {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.project-focus-card p {
  margin: 0;
  color: #4b5563;
  font-size: 13.5px !important;
  line-height: 1.55;
}

.project-section {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-heading-row.compact {
  align-items: start;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.project-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.54);
  color: #374151;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.project-filter:hover,
.project-filter.active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.project-portfolio {
  display: grid;
  gap: 34px;
  margin-top: 32px;
}

.project-category {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.project-category-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}

.project-category-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.project-category-heading > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  margin-top: 5px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
}

.project-item:last-child {
  border-bottom: 0;
}

.project-main h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.project-main h3 a,
.project-main p a {
  color: var(--link);
  text-underline-offset: 3px;
}

.project-main p {
  margin: 0;
  color: #374151;
  font-size: 14px !important;
  line-height: 1.58;
}

.project-side {
  display: grid;
  align-content: start;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: right;
}

.project-side span:first-child {
  color: #4b5563;
  font-weight: 650;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.project-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: #4b5563;
  font-size: 11.5px;
  background: rgba(248, 248, 246, 0.74);
}

@media (max-width: 820px) {
  .project-focus-grid {
    grid-template-columns: 1fr;
  }

  .project-category-heading {
    flex-direction: column;
    gap: 6px;
  }

  .project-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-side {
    text-align: left;
  }
}

/* ===== PhotoLab page ===== */
.photolab-page {
  max-width: 1040px;
}

.photo-note {
  margin-top: 22px;
  max-width: 760px;
}

.photo-note p {
  margin: 0;
  color: #374151;
  font-size: 15px !important;
  line-height: 1.6;
}

.photo-section {
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.photo-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.photo-section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.photo-section-heading > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  margin-top: 5px;
}

.photo-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 300px);
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 2px 0 16px;
}

.photo-rail::-webkit-scrollbar {
  height: 10px;
}

.photo-rail::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
}

.photo-rail::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

.photo-card {
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.photo-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.7), transparent 35%),
    linear-gradient(135deg, #ece9e2, #d8d2c8);
}

.photo-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-meta {
  padding: 13px 14px 15px;
}

.photo-meta h3 {
  margin: 0 0 3px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.photo-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px !important;
  line-height: 1.45;
}

.photo-description {
  margin-top: 8px !important;
  color: #374151 !important;
}

.photo-date {
  display: inline-flex;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11.5px;
}

.photo-empty {
  min-height: 180px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.36);
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
}

.photo-empty strong {
  color: var(--text);
  font-size: 15px;
}

.photo-empty code {
  color: #374151;
  font-size: 12px;
}

@media (max-width: 640px) {
  .photo-section-heading {
    flex-direction: column;
    gap: 6px;
  }

  .photo-rail {
    grid-auto-columns: minmax(220px, 82vw);
  }
}

.photo-missing-image .photo-image-wrap {
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.45;
}

.photo-empty span {
  line-height: 1.55;
}

/* ===== PhotoLab carousel override ===== */
.photolab-page {
  max-width: 1180px;
}

.photo-carousel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 14px;
}

.photo-stage {
  min-width: 0;
  display: grid;
  place-items: center;
}

.photo-nav-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.photo-nav-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #ffffff;
  border-color: #c8c2b8;
}

.photo-nav-button:disabled {
  cursor: default;
  opacity: 0.28;
}

.photo-stage .photo-card {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 192px;
  align-items: stretch;
  min-height: clamp(420px, 64vh, 660px);
}

.photo-stage .photo-image-wrap {
  height: clamp(420px, 64vh, 660px);
  aspect-ratio: auto;
  background: #f1f0ed;
}

.photo-stage .photo-image-wrap img {
  object-fit: contain;
}

.photo-stage .photo-meta {
  border-left: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.photo-stage .photo-meta h3 {
  font-size: 15px;
  margin-bottom: 7px;
}

.photo-stage .photo-meta p {
  font-size: 11.5px !important;
  line-height: 1.45;
}

.photo-stage .photo-description {
  margin-top: 12px !important;
}

.photo-stage .photo-date {
  margin-top: 14px;
  font-size: 10.5px;
}

.photo-position {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 900px) {
  .photo-carousel {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .photo-nav-button {
    width: 38px;
    height: 38px;
    font-size: 25px;
  }

  .photo-stage .photo-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .photo-stage .photo-image-wrap {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .photo-stage .photo-meta {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px;
    display: block;
  }
}

@media (max-width: 560px) {
  .photo-carousel {
    grid-template-columns: 1fr;
  }

  .photo-nav-button {
    display: none;
  }
}
