:root {
  --font: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #ffffff;
  --text: #101828;
  --body: #364153;
  --muted: #737373;
  --line: #eaeaea;
  --link-line: #c5c5c5;
  --bullet: #d1d5dc;
  --page-width: 36rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.has-modal {
  overflow: hidden;
}

h1,
h2,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
}

h1,
h2 {
  margin-bottom: 0.9em;
  color: var(--text);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin-top: 2em;
}

p {
  line-height: 1.7;
}

p + p {
  margin-top: 1.25em;
}

a {
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 2.5px;
  transition: text-decoration-color 150ms ease;
}

a:hover {
  text-decoration-color: var(--text);
}

.page {
  display: flex;
  flex-direction: column;
  width: min(100% - 2rem, var(--page-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: 3rem 0;
}

.tab-input,
.preview-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tabs {
  position: sticky;
  top: 3rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
  background: var(--bg);
  font-size: 0.875rem;
  line-height: 1.4;
}

.tabs::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 3rem;
  background: var(--bg);
  pointer-events: none;
}

.tabs::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 100vw;
  height: 3rem;
  background: linear-gradient(
    to bottom,
    var(--bg) 0,
    var(--bg) 0.8rem,
    rgb(255 255 255 / 0.75) 1.5rem,
    rgb(255 255 255 / 0.35) 2.35rem,
    rgb(255 255 255 / 0) 100%
  );
  transform: translateX(-50%);
  pointer-events: none;
}

.tabs label {
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease;
}

.tabs label:hover,
#tab-about:checked ~ .tabs label[for="tab-about"],
#tab-publications:checked ~ .tabs label[for="tab-publications"],
#tab-education:checked ~ .tabs label[for="tab-education"],
#tab-service:checked ~ .tabs label[for="tab-service"] {
  color: var(--text);
}

.panel {
  display: none;
  padding-bottom: 2rem;
}

#tab-about:checked ~ .panel-about,
#tab-publications:checked ~ .panel-publications,
#tab-education:checked ~ .panel-education,
#tab-service:checked ~ .panel-service {
  display: block;
}

.intro {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.intro + p {
  margin-top: 1.25em;
}

.intro-text p {
  margin: 0;
}

.intro-text p + p {
  margin-top: 1rem;
}

.portrait {
  display: block;
  width: 7.2rem;
  height: auto;
  align-self: start;
  border-radius: 0 0 30px 0;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.contact span,
.paper-links span {
  color: var(--muted);
}

.contact span {
  margin: 0 0.35em;
}

.entries {
  padding-left: 1.25em;
  list-style: disc;
}

.entries li::marker {
  color: var(--bullet);
}

.entries li + li {
  margin-top: 0.5em;
}

.entries strong,
.papers strong {
  color: var(--text);
  font-weight: 500;
}

.entries p {
  margin-top: 0.15em;
  color: var(--muted);
}

.years,
.papers {
  list-style: none;
}

.years {
  margin-top: 2em;
}

.publication-controls {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.25em;
  margin-top: -0.35em;
  font-size: 0.875rem;
  line-height: 1.4;
}

.publication-controls + .years {
  margin-top: 1.25em;
}

.all-details-button,
.preview-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-underline-offset: 2.5px;
  cursor: pointer;
  transition: text-decoration-color 150ms ease;
}

.all-details-button:hover,
.preview-button:hover {
  text-decoration-color: var(--text);
}

.all-details-separator {
  margin: 0 0.25em;
  color: var(--muted);
}

.year-group {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  padding: 1em 0;
  border-top: 1px solid var(--line);
}

.year-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.year {
  padding-top: 0.18em;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: nowrap;
}

.papers > li {
  padding-bottom: 0.75rem;
}

.papers li + li {
  margin-top: 0.75rem;
}

.papers p {
  margin-top: 0.25em;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

.paper-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.paper-meta em {
  color: var(--text);
  background-color: var(--line);
  font-style: normal;
  font-weight: 500;
}

.paper-links {
  margin-left: auto;
  white-space: nowrap;
}

.paper-links span {
  margin: 0 0.25em;
}

.preview-button span {
  margin: 0;
  color: inherit;
}

.preview-hide,
.preview-toggle:checked ~ .paper-meta .preview-show {
  display: none;
}

.preview-toggle:checked ~ .paper-meta .preview-hide {
  display: inline;
}

.paper-preview {
  display: none;
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.preview-toggle:checked ~ .paper-preview {
  display: block;
}

.paper-preview p {
  margin-top: 0;
}

.preview-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.teaser {
  margin: 0;
}

.image-thumb,
.video-thumb {
  position: relative;
  display: block;
  width: 100%;
  min-height: 6.75rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fafafa;
  appearance: none;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.image-thumb:hover,
.video-thumb:hover {
  border-color: var(--link-line);
}

.image-thumb img,
.video-thumb img {
  display: block;
  width: 100%;
  height: 6.75rem;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: rgb(16 24 40 / 0.2);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
}

.video-play {
  font-size: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(16 24 40 / 0.55);
  cursor: pointer;
}

.modal-frame {
  position: relative;
  z-index: 1;
  width: min(94vw, 64rem);
  overflow: hidden;
  border-radius: 0.75rem;
}

.image-frame {
  height: min(80vh, 42rem);
  background: var(--bg);
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

@media (min-width: 48rem) {
  .page {
    padding-top: 4rem;
  }

  .tabs {
    top: 4rem;
  }

  .tabs::before {
    height: 4rem;
  }
}

@media (max-width: 48rem) {
  .tabs {
    gap: 0.75rem 1rem;
  }

  .paper-meta {
    flex-wrap: wrap;
  }

  .modal {
    padding: 0.75rem;
  }

  .modal-frame {
    width: 100%;
  }
}

@media (max-width: 34rem) {
  body {
    font-size: 0.975rem;
  }

  h1,
  h2 {
    font-size: 2rem;
  }

  .page {
    width: min(100% - 1.5rem, var(--page-width));
    padding: 2rem 0;
  }

  .tabs {
    top: 2rem;
    gap: 0.65rem 0.9rem;
    margin-bottom: 2.5rem;
  }

  .tabs::before {
    height: 2rem;
  }

  .intro {
    gap: 1rem;
  }

  .portrait {
    width: 5.25rem;
  }

  .year-group {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .year {
    padding-top: 0;
  }

  .paper-preview {
    padding: 0.75rem;
  }

  .preview-media {
    grid-template-columns: 1fr;
  }

  .image-thumb,
  .video-thumb,
  .image-thumb img,
  .video-thumb img {
    height: 9rem;
  }

  .image-frame {
    height: min(78vh, 36rem);
  }
}

@media (max-width: 26rem) {
  .intro {
    flex-direction: column;
  }

  .portrait {
    width: 5rem;
  }
}