/* An editorial academic layout; the original Luka theme is kept separately. */
:root {
  color-scheme: light;
  --paper: #fdfefd;
  --ink: #242b29;
  --muted: #626e69;
  --accent: #286956;
  --warm: #a45239;
  --line: #dce3df;
  --soft: #f0f5f2;
  --logo-bg: #ffffff;
  --serif: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191e1c;
  --ink: #e5eae6;
  --muted: #adb9b2;
  --accent: #94cdb6;
  --warm: #e3a08a;
  --line: #35443c;
  --soft: #232e28;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.75 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
img, svg { display: block; }
button { font: inherit; }
::selection { background: var(--accent); color: var(--paper); }
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 8px 16px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

/* Compact navigation stays available without covering the reading column. */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav-container {
  width: min(1040px, calc(100% - 64px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-left { display: flex; flex-wrap: wrap; gap: 4px 26px; min-width: 0; }
.nav-left a {
  padding: 7px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.nav-left a:hover, .nav-left a:focus-visible { color: var(--accent); }
.nav-right { flex-shrink: 0; }
.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 10px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--soft); }
.theme-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }

.wrapper { width: min(1040px, calc(100% - 64px)); margin: 0 auto; }
.sidebar { padding: 42px 0 38px; text-align: center; }
.profile-card { display: flex; flex-direction: column; align-items: center; }
.image.avatar { margin: 0 0 20px; }
.image.avatar img {
  width: 136px;
  height: 136px;
  object-fit: cover;
  border-radius: 50%;
}
.site-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 12px;
  font: 400 48px/1.2 var(--serif);
}
.site-name span { color: var(--muted); font-size: 25px; }
.site-email { margin: 0; font: 14px/1.6 "Ubuntu Mono", Consolas, monospace; }
.site-email a { color: var(--muted); overflow-wrap: anywhere; }
.site-email a:hover { color: var(--accent); }
.content { min-width: 0; padding-bottom: 48px; }

/* Shared section grid keeps headings and entries on consistent baselines. */
.section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 40px;
  padding: 38px 0;
  border-top: 1px solid var(--line);
}
.section-title {
  margin: 0;
  font: 400 25px/1.3 var(--serif);
  text-wrap: balance;
}
.section-body { min-width: 0; overflow-wrap: break-word; }
.section-body p { margin: 0 0 16px; }
.section-body p:last-child { margin-bottom: 0; }
.section-body .opportunity {
  margin-top: 22px;
  padding: 3px 0 3px 15px;
  border-left: 2px solid var(--warm);
  color: var(--warm);
  font-weight: 500;
  font-size: 14px;
}

.timeline-item { padding: 0 0 24px; }
.timeline-item + .timeline-item { padding-top: 24px; border-top: 1px solid var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.experience-item { display: flex; align-items: flex-start; gap: 20px; }
.institution-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  padding: 3px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--logo-bg);
}
.experience-content { flex: 1; min-width: 0; }
.experience-content p { margin: 0 0 3px; }
.exp-title { font-size: 15px; line-height: 1.6; }
.exp-title strong { font-weight: 600; }
.exp-detail { color: var(--muted); font-size: 14px; }
.exp-detail em { font-style: normal; }
.exp-period { color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }

.publication-item + .publication-item { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.publication-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.publication-meta span { color: var(--warm); font-size: 12px; font-weight: 600; text-transform: none; }
.publication-meta span + span {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-weight: 400;
}
.publication-title { margin: 0 0 10px; font: 400 23px/1.4 var(--serif); text-wrap: pretty; }
.section-body .publication-authors { margin: 0; font-size: 14px; color: var(--muted); }
.publication-authors strong { font-weight: 600; color: var(--ink); }
.section-body .publication-links { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 0; font-size: 13px; font-weight: 600; }

.project-card-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.project-labels { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; min-width: 0; }
.project-type { color: var(--accent); font-size: 12px; font-weight: 600; }
.project-location { padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; text-transform: none; }
.project-date { flex-shrink: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.project-experience-card h3 { margin: 0 0 10px; font: 400 22px/1.4 var(--serif); }
.project-summary { color: var(--muted); font-size: 14px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; }
.project-tags span { font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); }
.section-body .project-highlight { margin: 0; color: var(--warm); font-size: 12px; line-height: 1.6; }
.project-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.project-links a { font-size: 13px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); }
.project-links a:hover { text-decoration-color: currentColor; }

.fun-facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.fun-fact-card { padding-top: 12px; border-top: 2px solid var(--accent); }
.fun-fact-card:nth-child(2) { border-color: var(--warm); }
.fun-fact-card:nth-child(3) { border-color: var(--muted); }
.fact-kicker { display: block; margin-bottom: 10px; font: 400 20px/1.4 var(--serif); }
.fun-fact-card p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.friend-links-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.friend-link-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.friend-link-title { font-size: 14px; font-weight: 500; }
.friend-link-url { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .nav-container, .wrapper { width: calc(100% - 48px); }
  .nav-left { gap: 2px 18px; }
  .section { grid-template-columns: 160px minmax(0, 1fr); gap: 28px; }
  .section-title { font-size: 23px; }
  .fun-facts-grid { grid-template-columns: 1fr; gap: 22px; }
  .friend-links-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 600px) {
  html { scroll-padding-top: 120px; }
  .nav-container, .wrapper { width: calc(100% - 40px); }
  .nav-container { min-height: 80px; gap: 12px; padding: 8px 0; }
  .nav-left { column-gap: 16px; }
  .nav-left a { font-size: 12px; padding: 3px 0; }
  .sidebar { padding: 28px 0; }
  .image.avatar { margin-bottom: 16px; }
  .image.avatar img { width: 104px; height: 104px; }
  .site-name { flex-direction: column; align-items: center; gap: 8px; font-size: 36px; }
  .site-name span { font-size: 20px; }
  .site-email { font-size: 13px; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 28px 0; }
  .section-title { font-size: 25px; }
  .section-body { font-size: 14px; }
  .experience-item { gap: 14px; }
  .institution-logo { width: 40px; height: 40px; }
  .exp-title { font-size: 14px; }
  .exp-detail { font-size: 13px; }
  .publication-title, .project-experience-card h3 { font-size: 21px; }
  .publication-authors, .project-summary { font-size: 13px; }
  .project-labels { gap: 4px 8px; }
  .project-location { padding-left: 8px; }
  .project-type, .project-location { font-size: 11px; }
  .fact-kicker { margin-bottom: 6px; }
}

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

@media print {
  .top-nav, .skip-link { display: none; }
  .wrapper { width: 100%; }
  .sidebar { padding-top: 0; }
  .section { break-inside: avoid; }
}
