@font-face {
  font-family: "Raleway Local";
  src: url("./Raleway-8e794822.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f5f5ef;
  --card: #fbfbf7;
  --ink: #1b1b18;
  --ink-strong: #080907;
  --muted: #655f53;
  --soft: #716c61;
  --rule: #deddd2;
  --accent: #1d7350;
  --accent-soft: rgba(29, 115, 80, 0.1);
  --accent-line: rgba(29, 115, 80, 0.28);
  --topbar: rgba(245, 245, 239, 0.86);
  --shadow: 0 18px 48px rgba(35, 35, 25, 0.08);
}

:root[data-theme="dark"] {
  --paper: #13140f;
  --card: #1b1d16;
  --ink: #e4e3da;
  --ink-strong: #f8f7f0;
  --muted: #aaa596;
  --soft: #9b978b;
  --rule: #303128;
  --accent: #6abd95;
  --accent-soft: rgba(106, 189, 149, 0.13);
  --accent-line: rgba(106, 189, 149, 0.35);
  --topbar: rgba(19, 20, 15, 0.88);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Raleway Local", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: clip;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
button { font: inherit; }
::selection { background: var(--ink); color: var(--paper); }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-150%);
  border-radius: 4px;
  background: var(--ink-strong);
  color: var(--paper);
  padding: 8px 12px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--rule);
  background: var(--topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-inner,
.wrap,
.footer-inner {
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  flex: 0 0 auto;
  color: var(--ink-strong);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover { color: var(--accent); text-decoration: none; }

.navlinks {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.navlinks > a {
  border-radius: 999px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  padding: 6px 9px;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.navlinks > a:hover,
.navlinks > a.active {
  color: var(--ink-strong);
  background: var(--accent-soft);
  text-decoration: none;
}

.navlinks .nav-external { color: var(--accent); }

.theme-button {
  width: 32px;
  height: 32px;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-button:hover { color: var(--accent); border-color: var(--accent); }

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

.wrap { padding: 74px 0 96px; }
section { margin-top: 88px; }
section:first-child { margin-top: 0; }

.hero {
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 64px;
}

.eyebrow,
.section-index,
.role,
.interests,
.publication-meta,
.paper-links,
.heading-note,
.fact-year,
.experience-date,
.timeline span,
.service-number,
figcaption {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: clamp(3.35rem, 8vw, 5.3rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.role { margin: 0 0 3px; color: var(--muted); font-size: 13px; }
.interests { margin: 0 0 22px; color: var(--accent); font-size: 12.5px; }
.bio { max-width: 650px; margin: 0 0 24px; font-size: 1.02rem; }
.hero-copy,
.bio,
.interests { min-width: 0; overflow-wrap: anywhere; }
.bio a { font-weight: 600; }

.availability-note {
  display: block;
  margin-top: 12px;
  padding: 8px 11px;
  border-left: 2px solid var(--accent);
  border-radius: 0 5px 5px 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.profile-links { display: flex; flex-wrap: wrap; gap: 8px; }

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  min-height: 44px;
  max-width: 100%;
  padding: 9px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.profile-links a:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.portrait-wrap { margin: 0; justify-self: end; }

.portrait {
  width: 210px;
  height: auto;
  aspect-ratio: 1;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 7px;
  object-fit: cover;
  filter: saturate(0.88);
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 9px;
  color: var(--soft);
  font-size: 10.5px;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-heading {
  margin-bottom: 26px;
  padding-bottom: 13px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--rule);
}

.section-index { margin: 0 0 2px; color: var(--accent); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }

h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.heading-note { margin: 0 0 3px; color: var(--soft); font-size: 10.5px; }

.news-panel {
  max-height: 252px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-color: var(--accent-line) transparent;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.news-panel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.news-list { margin: 0; padding: 0 22px; list-style: none; }

.news-list li {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
}

.news-list li:last-child { border-bottom: 0; }
.news-list time { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11.5px; }
.news-list time a { color: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.news-list time a:hover { text-decoration-color: var(--accent); }
.news-list p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.news-list a { color: var(--ink-strong); font-weight: 600; }
.news-list a:hover { color: var(--accent); }

.publication-list { display: grid; gap: 0; }

.publication {
  padding: 28px 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 28px;
  border-bottom: 1px solid var(--rule);
}

.publication:first-child { padding-top: 0; }
.publication-media { align-self: start; display: block; overflow: hidden; border-radius: 5px; background: var(--card); }

.publication-media img {
  width: 100%;
  aspect-ratio: 1.62;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 5px;
  object-fit: contain;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.publication-media:hover img { transform: scale(1.025); filter: saturate(1.08); }
.publication-body { min-width: 0; }

.publication-meta {
  min-height: 22px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.status {
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 7px;
  font-size: 9px;
}

h3 { margin: 0; color: var(--ink-strong); font-size: 1.02rem; line-height: 1.35; }
h3 a { color: inherit; }
h3 a:hover { color: var(--accent); }

.authors { margin: 7px 0 9px; color: var(--muted); font-size: 0.83rem; line-height: 1.55; }
.authors strong { color: var(--ink-strong); }

.paper-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--soft);
  font-size: 11.5px;
}

.paper-links a { color: var(--accent); }

.github-code-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.github-stars {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.github-stars[hidden] { display: none; }

.fact-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.honors-list { border-top: 0; }

.fact-list li {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--rule);
}

.fact-year { color: var(--accent); font-size: 11px; }
.fact-list strong { display: block; color: var(--ink-strong); font-size: 0.98rem; }
.fact-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.83rem; }

.experience-stack {
  display: grid;
  gap: 20px;
}

.experience-card {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr;
  gap: 54px;
  padding: 30px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.experience-card:hover,
.experience-card:focus-within { transform: translateY(-3px); border-color: var(--accent-line); }

.experience-date { margin: 0 0 8px; color: var(--accent); font-size: 10.5px; text-transform: uppercase; }
.experience-intro h3 { font-size: 1.25rem; }
.experience-intro > p:not(.experience-date) { margin: 9px 0 0; color: var(--muted); font-size: 0.88rem; }
.experience-intro .experience-topic { margin-top: 22px; color: var(--ink); font-size: 0.94rem; }

.timeline { margin: 0; padding: 0; list-style: none; }

.timeline li {
  position: relative;
  padding: 0 0 20px 22px;
  border-left: 1px solid var(--rule);
}

.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; top: 5px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline span { color: var(--soft); font-size: 10.5px; text-transform: uppercase; }
.timeline p { margin: 3px 0 0; color: var(--muted); font-size: 0.84rem; }

.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.service-grid article {
  min-height: 0;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.service-grid article:hover { transform: translateY(-3px); border-color: var(--accent-line); }
.service-number { color: var(--accent); font-size: 10.5px; }
.service-grid h3 { margin-top: 16px; font-size: 1.05rem; }
.service-grid p { margin: 8px 0 0; color: var(--muted); font-size: 0.87rem; }

footer { border-top: 1px solid var(--rule); }

.footer-inner {
  min-height: 110px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  color: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
}

.footer-inner p { margin: 0; }
.footer-inner p:nth-child(2) { text-align: center; }
.footer-inner > a { justify-self: end; }
.footer-credit a { color: inherit; }
.footer-credit a:hover { color: var(--accent); }

@media (max-width: 840px) {
  .topbar-inner,
  .wrap,
  .footer-inner { width: min(100% - 36px, 960px); }

  .brand { display: none; }
  .topbar-inner { justify-content: center; }
  .navlinks { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .navlinks::-webkit-scrollbar { display: none; }
  .navlinks > a { padding: 6px 8px; }
  .nav-external { margin-left: auto; }

  .hero { grid-template-columns: minmax(0, 1fr) 170px; gap: 36px; }
  .portrait { width: 170px; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 64px; }
  .wrap { padding: 46px 0 70px; }
  section { margin-top: 68px; }
  .navlinks .nav-external { display: none; }
  .navlinks { justify-content: space-between; }
  .theme-button { width: 44px; height: 44px; margin-left: 1px; }

  .hero { min-height: 0; grid-template-columns: 1fr; gap: 26px; }
  .hero-copy { max-width: 100%; }
  .portrait-wrap { grid-row: 1; justify-self: start; }
  .portrait { width: 132px; }
  figcaption { text-align: left; }
  h1 { font-size: clamp(3.1rem, 18vw, 4.5rem); }

  .section-heading { align-items: start; }
  .heading-note { display: none; }
  .heading-note.news-scroll-hint { display: block; max-width: 120px; text-align: right; }
  .publication { grid-template-columns: 1fr; gap: 16px; }
  .publication-media { max-width: 340px; }
  .publication-media img { aspect-ratio: 1.72; }

  .news-panel { max-height: 280px; }
  .news-list { padding-inline: 17px; }
  .news-list li { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }

  .experience-card { grid-template-columns: 1fr; gap: 30px; padding: 24px; }
  .service-grid { grid-template-columns: 1fr; }

  .footer-inner { min-height: 145px; grid-template-columns: 1fr auto; }
  .footer-inner p:nth-child(2) { grid-row: 2; grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 420px) {
  .topbar-inner,
  .wrap,
  .footer-inner { width: calc(100% - 28px); }
  .navlinks > a { font-size: 11.5px; padding-inline: 7px; }
  .fact-list li { grid-template-columns: 64px 1fr; gap: 14px; }
}

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