@import url("../vendor/fonts/google-fonts.css");

:root {
  --bg: #fff;
  --text: #000;
  --muted: #636363;
  --line: #e6e6e6;
  --link: #636363;
  --link-hover: #000;
  --selection: #c05b4d;
  --sans: "Roboto", Arial, sans-serif;
  --heading: "Raleway", "Roboto", Arial, sans-serif;
  --mono: "Source Code Pro", monospace;
  --max-width: clamp(720px, 62vw, 880px);
  --page-inset: clamp(1rem, 4vw, 2rem);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
}

::selection {
  background: var(--selection);
  color: #fff;
}

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

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  width: min(calc(100% - var(--page-inset) - var(--page-inset)), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem 3rem;
  padding: 1.1rem max(var(--page-inset), calc((100vw - var(--max-width)) / 2)) 1rem;
  background: var(--bg);
}

.site-title {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--heading);
  font-size: 1.25rem; 
  /* font-size: 0.95rem;  */
  /* font-weight: 700; */
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0.35rem;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
}

.nav-toggle span + span {
  margin-top: 0.3rem;
}

.site-nav {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
  font-size: 0.95rem;
  font-weight: 300;
  min-width: max-content;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a::after {
  display: block;
  height: 0;
  overflow: hidden;
  content: attr(data-label);
  font-weight: 400;
  visibility: hidden;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  font-weight: 400;
}

.page {
  padding: 1.8rem 0 3rem;
}

.content {
  display: flow-root;
  overflow-wrap: anywhere;
}

.title-image {
  width: 100%;
  height: clamp(9.26rem, 24.85vw, 13.67rem);
  margin: 0;
  overflow: hidden;
}

.title-image img,
.title-image-slide {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 53%;
}

.about-title-image img {
  object-position: center 51%;
}

.research-title-image img {
  object-position: center 45%;
}

.teaching-title-image img {
  object-position: center 44%;
}

.talks-title-image img {
  object-position: center 34%;
}

.working-title-image img {
  object-position: center 65%;
}

.contact-title-image img {
  object-position: center 65%;
}

.title-image.is-transitioning {
  position: relative;
}

.title-image.is-transitioning > img {
  opacity: 0;
}

.title-image-track {
  position: absolute;
  inset: 0;
  display: flex;
  width: 200%;
  height: 100%;
  transform: translate3d(0, 0, 0);
  animation: title-image-scroll-next 520ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.title-image.is-transitioning-back .title-image-track {
  transform: translate3d(-50%, 0, 0);
  animation-name: title-image-scroll-prev;
}

.title-image-slide {
  flex: 0 0 50%;
}

@keyframes title-image-scroll-next {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes title-image-scroll-prev {
  from {
    transform: translate3d(-50%, 0, 0);
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-image-track {
    animation-duration: 1ms;
  }
}

h1,
h2 {
  font-family: var(--heading);
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 2.1rem;
}

h2 {
  margin: 2.15rem 0 0.75rem;
  padding-bottom: 0.25rem;
  font-size: 1.45rem;
}

.profile-card {
  --profile-section-gap: 1.1rem;
  float: left;
  width: min(10rem, 34vw);
  margin: 0.25rem clamp(1.5rem, 5vw, 3rem) 0.8rem 0;
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  display: grid;
  gap: 0.45rem;
  margin-top: var(--profile-section-gap);
  font-size: 0.86rem;
  line-height: 1.25;
}

.profile-name strong,
.profile-name span {
  display: block;
}

.profile-name strong {
  font-weight: 700;
}

.profile-name span {
  color: var(--muted);
  white-space: nowrap;
}

.profile-links {
  display: grid;
  gap: var(--profile-section-gap);
  margin-top: var(--profile-section-gap);
  font-size: 0.86rem;
  line-height: 1.25;
}

.profile-section {
  display: grid;
  gap: 0.45rem;
}

.profile-section a {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: center;
  gap: 0.42rem;
  color: var(--muted);
  text-decoration: none;
}

.profile-section a:hover,
.profile-section a:focus-visible {
  color: var(--text);
}

.profile-links img {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

p {
  margin: 0 0 1.1rem;
}

.lead {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 300;
}

.plain-list {
  list-style-type: square;
  margin: 0.5rem 0 1.4rem;
  padding-left: 1.2rem;
}

.plain-list li::marker {
  color: var(--muted);
}

.plain-list li + li {
  margin-top: 0.45rem;
}

.publication-list {
  display: grid;
  gap: 0.9rem;
  list-style: none;
  margin: 0.5rem 0 1.4rem;
  padding: 0;
}

.publication p {
  margin-bottom: 0.35rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.publication-links a,
.course-links a,
.talk-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  justify-content: center;
  min-height: 1.35rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid #d9d9d9;
  border-radius: 0.45rem;
  background: #f4f4f4;
  color: #555;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: top;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.publication-links a:hover,
.publication-links a:focus-visible,
.course-links a:hover,
.course-links a:focus-visible,
.talk-icon-link:hover,
.talk-icon-link:focus-visible {
  background: #111;
  border-color: #111;
  color: #fff;
}

.teaching-section {
  margin-top: 2rem;
}

.teaching-section h2 {
  margin-bottom: 1.25rem;
}

.teaching-block {
  margin-bottom: 2rem;
}

.teaching-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.teaching-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.teaching-location {
  margin: 0.2rem 0 0;
  color: #666;
}

.teaching-dates {
  color: #444;
  font-weight: 500;
  white-space: nowrap;
}

.course-list {
  display: grid;
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-item {
  margin-bottom: 0;
  padding: 1rem 1.1rem;
  border: 1px solid #e6e6e6;
  border-radius: 1rem;
  background: #fafafa;
}

.course-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.course-title-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.course-code {
  font-weight: 700;
}

.course-title {
  font-weight: 500;
}

.course-term-pills {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}

.course-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border: 1px solid #dddddd;
  border-radius: 999px;
  background: #f2f2f2;
  color: #555;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
}

.course-meta {
  color: #444;
  font-size: 0.95rem;
}

.course-role {
  color: #555;
}

.course-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
  font-size: 0.9rem;
}

.talks-section {
  margin-top: 2rem;
}

.talks-intro {
  max-width: 900px;
  margin-bottom: 1.5rem;
}

.talk-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.talk-table {
  min-width: 760px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.talk-table th,
.talk-table td {
  padding: 0.75rem 0.8rem 0.75rem 0;
  border-bottom: 1px solid #e6e6e6;
  text-align: left;
  vertical-align: top;
}

.talk-table th {
  color: #444;
  font-weight: 600;
}

.talk-table th:first-child,
.talk-table td:first-child {
  white-space: nowrap;
}

.talk-location {
  color: #666;
  font-size: 0.9rem;
}

.talk-materials-heading,
.talk-materials {
  text-align: right;
}

.talk-materials {
  white-space: nowrap;
}

.talk-material-list {
  display: inline-grid;
  justify-items: start;
  gap: 0.25rem;
}

.talk-icon-link {
  margin-left: 0.25rem;
}

.talk-icon-link svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.talk-icon-link.is-disabled {
  background: transparent;
  border-color: transparent;
  color: #c5c5c5;
}

code,
pre,
kbd {
  font-family: var(--mono);
}

.contact-form {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 2rem;
}

.contact-form label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--link);
  outline: 2px solid rgba(24, 95, 122, 0.16);
  outline-offset: 1px;
}

.contact-form input[name="_honey"] {
  display: none;
}

.contact-form button {
  justify-self: start;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--link);
  border-radius: 0;
  background: #fff;
  color: var(--link);
  cursor: pointer;
  font: inherit;
}

.contact-form button:hover,
.contact-form button:focus-visible {
  background: var(--muted);
  border-color: var(--link-hover);
  color: #fff;
}

.contact-list {
  margin: 0;
}

.contact-list div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.contact-list dt {
  color: var(--muted);
  font-weight: 400;
}

.contact-list dd {
  margin: 0;
}

.katex {
  color: #222;
  font-size: 0.96em;
  font-synthesis: none;
  font-weight: 400;
}

.site-footer {
  width: min(calc(100% - var(--page-inset) - var(--page-inset)), var(--max-width));
  margin: 0 auto;
  padding: 1.3rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    gap: 0.6rem 1.5rem;
  }

  .site-title,
  .site-nav {
    flex-basis: 100%;
  }

  .site-nav {
    justify-content: flex-start;
    min-width: 0;
  }

  .profile-card {
    width: min(9rem, 32vw);
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: center;
  }

  .site-title {
    flex-basis: auto;
  }

  .nav-toggle {
    display: inline-grid;
    align-content: center;
    justify-self: end;
  }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding-bottom: 0;
  }

  .site-header.is-nav-open .site-nav {
    display: flex;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

  .profile-card {
    float: none;
    width: min(10rem, 52vw);
    margin: 0 auto 1.5rem;
  }

  .talk-table-wrap {
    overflow-x: visible;
  }

  .talk-table,
  .talk-table tbody,
  .talk-table tr,
  .talk-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .talk-table thead {
    display: none;
  }

  .talk-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid #e6e6e6;
  }

  .talk-table td {
    padding: 0.15rem 0;
    border-bottom: 0;
  }

  .talk-table td::before {
    display: block;
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
  }

  .talk-materials {
    margin-top: 0.25rem;
    text-align: left;
  }

  .talk-material-list {
    justify-items: start;
  }

  .talk-icon-link {
    margin-left: 0;
    margin-right: 0.25rem;
  }
}

@media (max-width: 560px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding-top: 1.5rem;
  }

  .site-nav {
    gap: 0.25rem 0.8rem;
  }

  .contact-list div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}
