:root {
  --background: #fefffe;
  --foreground: #0f172a;
  --primary: #1e293b;
  --accent: #d4a562;
  --accent-dark: #b8914d;
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --surface: #ffffff;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  --font-serif: "Times New Roman", "Noto Serif SC", Georgia, serif;
}

.dark {
  --background: #0f172a;
  --foreground: #f8fafc;
  --primary: #f8fafc;
  --accent: #e4b976;
  --accent-dark: #f0c674;
  --neutral-50: #1e293b;
  --neutral-100: #243247;
  --neutral-200: #334155;
  --neutral-300: #475569;
  --neutral-500: #cbd5e1;
  --neutral-600: #e2e8f0;
  --neutral-700: #e2e8f0;
  --neutral-800: #f8fafc;
  --surface: #182235;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  transform: translateY(-180%);
  border-radius: 0.4rem;
  background: var(--primary);
  color: var(--background);
  padding: 0.65rem 0.9rem;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 3px;
}

.site-nav {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(18px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 80rem;
  height: 4.5rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
}

.desktop-links {
  display: flex;
  gap: 1.5rem;
  color: var(--neutral-600);
  font-size: 0.94rem;
  font-weight: 600;
}

.desktop-links a,
.mobile-links a {
  border-radius: 0.45rem;
  padding: 0.48rem 0.75rem;
  transition: color 160ms ease, background 160ms ease;
}

.desktop-links a:hover,
.mobile-links a:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.language-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  border-radius: 0.45rem;
  background: var(--neutral-50);
}

.language-switch button {
  min-height: 2.75rem;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--neutral-600);
  padding: 0.38rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.language-switch button.active {
  background: var(--accent);
  color: #fff;
}

.icon-button,
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  cursor: pointer;
  border: 1px solid var(--neutral-200);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--neutral-600);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.product-home {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  border-radius: 0.45rem;
  color: var(--accent-dark);
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.icon-button:hover,
.menu-button:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--neutral-200));
}

.icon-button svg,
.menu-button svg,
.social-row svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.menu-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.moon-icon,
.dark .sun-icon {
  display: none;
}

.dark .moon-icon {
  display: block;
}

.menu-button {
  display: none;
}

.mobile-links {
  display: none;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.page-shell {
  max-width: 76rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 7rem 1.5rem 3rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: 3.5rem;
}

.profile-panel {
  min-width: 0;
}

.sticky-profile {
  position: sticky;
  top: 7rem;
}

.avatar-wrap {
  width: 17rem;
  height: 12.75rem;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.avatar-wrap:hover {
  transform: scale(1.025);
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
}

.identity {
  margin-bottom: 1.25rem;
  text-align: center;
}

.identity h1 {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.2;
}

.role {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 700;
}

.institution {
  margin: 0;
  color: var(--neutral-600);
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 1.4rem;
}

.social-row a {
  display: inline-flex;
  width: 2.3rem;
  height: 2.3rem;
  align-items: center;
  justify-content: center;
  color: var(--neutral-600);
  border-radius: 0.45rem;
  transition: color 160ms ease, background 160ms ease;
}

.social-row a:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.interest-card,
.project-card,
.award-card {
  border: 1px solid color-mix(in srgb, var(--neutral-200) 80%, transparent);
  border-radius: 0.5rem;
  background: var(--neutral-50);
}

.interest-card {
  width: 16rem;
  margin: 0 auto 1.25rem;
  padding: 1rem;
}

.card-heading,
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-heading h2 {
  margin: 0;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 800;
}

.card-heading a,
.section-row span {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.interest-card ul {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 0;
  padding: 0;
  color: var(--neutral-700);
  font-size: 0.9rem;
  list-style: none;
}

.last-updated {
  margin: 0;
  color: var(--neutral-500);
  text-align: center;
  font-size: 0.8rem;
}

.content-column {
  display: grid;
  gap: 2rem;
  min-width: 0;
}

.section {
  scroll-margin-top: 6rem;
}

.section h2 {
  margin: 0 0 1rem;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.25;
}

.section-row {
  margin-bottom: 1rem;
}

.section-row h2 {
  margin: 0;
}

.prose {
  color: var(--neutral-700);
}

.prose p {
  margin: 0 0 1rem;
}

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

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1rem 0 1rem 1rem;
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--neutral-200));
}

.timeline-date {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.timeline-item h3,
.project-card h3,
.award-card h3 {
  margin: 0 0 0.45rem;
  color: var(--primary);
  font-size: 1.04rem;
  line-height: 1.35;
}

.timeline-item p,
.project-card p,
.award-card p {
  margin: 0;
  color: var(--neutral-700);
  font-size: 0.95rem;
}

.card-list {
  display: grid;
  gap: 1rem;
}

.project-card,
.award-card {
  padding: 1.1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.project-card:hover,
.award-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--neutral-200));
  box-shadow: var(--shadow);
}

.project-meta {
  margin-bottom: 0.45rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.tag-row,
.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-row {
  margin-top: 0.9rem;
}

.tag-row span,
.skill-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--neutral-200));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--neutral-700);
  padding: 0.18rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.award-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.skill-cloud {
  align-items: center;
}

.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 420ms ease, transform 420ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.archive-footer {
  border-top: 1px solid var(--neutral-200);
  color: var(--neutral-600);
  padding: 1.5rem;
  text-align: center;
}

.archive-footer p {
  margin: 0.3rem 0;
}

.archive-footer a {
  color: var(--accent-dark);
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .desktop-links {
    display: none;
  }

  .menu-button {
    display: inline-flex;
  }

  .mobile-links.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .layout-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .sticky-profile {
    position: static;
  }

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

@media (max-width: 640px) {
  .nav-inner {
    height: 4rem;
    padding: 0 1rem;
  }

  .brand {
    font-size: 1.2rem;
  }

  .language-switch button {
    padding: 0.34rem 0.48rem;
  }

  .page-shell {
    padding: 5.5rem 1rem 2.25rem;
  }

  .avatar-wrap,
  .interest-card {
    width: min(16rem, 100%);
  }

  .avatar-wrap {
    height: min(12rem, calc((100vw - 2rem) * 0.75));
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding-left: 0.85rem;
  }

  .section-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}
