/* Tokens ---------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --fg: #262626;
  --head: #141414;
  --mut: #555555;
  --fnt: #8a8a8a;
  --rule: #ebebeb;
  --link: #1772d0;
  --hover: #f09228;
  --sans: Lato, Verdana, Helvetica, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616; --fg: #e4e4e4; --head: #f4f4f4; --mut: #aaaaaa; --fnt: #7c7c7c;
    --rule: #2c2c2c; --link: #6aa9f0; --hover: #f5a74d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161616; --fg: #e4e4e4; --head: #f4f4f4; --mut: #aaaaaa; --fnt: #7c7c7c;
  --rule: #2c2c2c; --link: #6aa9f0; --hover: #f5a74d;
  color-scheme: dark;
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--hover); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
strong { font-weight: 700; color: var(--head); }

.page { position: relative; max-width: 880px; margin: 0 auto; padding: 56px 24px 32px; }

/* Profile --------------------------------------------------------------- */
.profile { display: flex; align-items: center; gap: 40px; }
.profile-text { flex: 1 1 auto; min-width: 0; }
.profile h1 { margin: 0 0 18px; text-align: center; font-size: 36px; line-height: 1.2; font-weight: 700; letter-spacing: -.5px; color: var(--head); }
.profile p { margin: 0 0 14px; }
.profile-links { text-align: center; margin-top: 20px; }
.profile-links a { font-weight: 700; }
.profile-photo { flex: 0 0 auto; }
.profile-photo img { display: block; width: 224px; height: 280px; object-fit: cover; object-position: 50% 22%; border-radius: 14px; }

/* Sections -------------------------------------------------------------- */
.section { margin-top: 44px; }
.section h2 {
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -.2px; color: var(--head);
}
.section > p { margin: 0 0 10px; }
.note { color: var(--fnt); font-size: 14.5px; }

/* Publication / project entries ------------------------------------------ */
.entry { display: flex; flex-direction: column; gap: 14px; padding: 16px 0; }
.entry + .entry { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 28px; }
.entry.row { flex-direction: row; align-items: flex-start; gap: 24px; }
.entry-info { min-width: 0; }
.entry-info .title { font-size: 16.5px; font-weight: 700; color: var(--head); }
a.title:hover { color: var(--hover); }
.entry-info .authors { margin-top: 4px; color: var(--mut); }
.entry-info .authors strong { color: var(--fg); }
.entry-info .venue { margin-top: 2px; font-size: 15px; font-style: italic; }
.entry-info .links { margin-top: 4px; font-size: 15px; }
.entry-info p { margin: 6px 0 0; }
.entry-info .note { font-size: 14px; }
.entry-info .sub { margin-top: 12px; font-weight: 700; color: var(--head); }
.list.patents li { padding: 2px 0; }

/* Figures --------------------------------------------------------------- */
.figure { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.figure img, .figure video { width: 100%; height: auto; display: block; border-radius: 10px; }
.figure figcaption { font-size: 14.5px; line-height: 1.5; color: var(--fnt); }
.figure.thumb { flex: 0 0 240px; }
.fig-mosaic { aspect-ratio: 2 / 1; object-fit: cover; background: #fff; }
.fig-orbit { aspect-ratio: 2 / 1; object-fit: contain; background: #fff; }
.fig-map { aspect-ratio: 4 / 3; object-fit: cover; background: #0c0c0c; }
.fig-panorama { object-fit: contain; background: #0c0c0c; }

/* Patents / experience / education --------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 4px 0; }
.list .meta { flex: 0 0 auto; color: var(--fnt); font-size: 15px; text-align: right; }

/* Footer ---------------------------------------------------------------- */
.footer {
  margin-top: 56px; display: flex; justify-content: center; align-items: center; gap: 16px;
  color: var(--fnt); font-size: 14.5px;
}

/* Theme toggle: small icon in the page's top-right corner --------------- */
.theme-toggle {
  position: absolute; top: 18px; right: 24px;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  color: var(--fnt); background: transparent; border: 0; border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); background: var(--rule); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle[data-next="light"] .moon, .theme-toggle[data-next="dark"] .sun { display: none; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 680px) {
  .page { padding: 36px 16px 28px; }
  .theme-toggle { top: 8px; right: 8px; }
  .profile { flex-direction: column-reverse; gap: 24px; }
  .profile-photo img { width: 160px; height: 200px; }
  .entry.row { flex-direction: column; gap: 14px; }
  .figure.thumb { flex-basis: auto; width: 100%; }
  .list li { flex-direction: column; gap: 0; }
  .list .meta { text-align: left; }
}
