/* ==========================================================================
   NYU-style academic homepage
   Palette: https://www.nyu.edu/employees/resources-and-services/media-and-communications/nyu-brand-guidelines/designing-in-our-style/nyu-colors.html
   ========================================================================== */

:root {
  --nyu-violet: #57068c;
  --ultra-violet: #8900e1;
  --light-violet: #eee6f3;

  --text: #333333;
  --heading: #151515;
  --muted: #6d6d6d;
  --border: #e6e6e6;
  --bg: #ffffff;

  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  /* All sizes are in rem/em so the whole layout scales with the root font size. */
  --container: 58.75rem;
  --nav-height: 3.75rem;
  --photo-width: 14rem;
  --bio-width: 36em; /* pins the bio line breaks */
  --pub-thumb: 12rem;
}

/* ---------- Base ---------- */

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 720px) {
  html {
    font-size: 17px;
  }
}

/* PC: scale the whole page with the viewport, like zooming. The root size is the
   smaller of two fits: the container takes ~86% of the viewport width, and
   About + the first three news items (~41.5rem tall) fit in one screen. */
@media (min-width: 992px) {
  html {
    font-size: clamp(15px, min(86vw / 58.75, 100vh / 41.5), 19px);
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--nyu-violet);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--ultra-violet);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  color: var(--heading);
  font-weight: 400;
  line-height: 1.25;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------- Navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);
}

.navbar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.nav-social {
  display: flex;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.55rem;
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: #404040;
  font-size: 1.0rem;
  line-height: 1.3;
}

.nav-links a:hover,
.nav-links a[aria-current] {
  color: var(--nyu-violet);
}

@media (max-width: 560px) {
  .nav-links {
    gap: 1.1rem;
  }
}

/* ---------- Sections ---------- */

main.container {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

@media (min-width: 720px) {
  main.container {
    padding-top: 2.5rem;
  }
}

.section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.85rem;
}

.subsection {
  margin-bottom: 2rem;
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}

.subsection:last-child {
  margin-bottom: 0;
}

.subsection-title {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.subsection p {
  margin: 0 0 1rem;
}

.subsection p:last-child {
  margin-bottom: 0;
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(0, var(--bio-width));
  gap: 3rem;
  align-items: center;
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--nav-height) + 3rem);
}

.profile {
  text-align: center;
}

.photo {
  display: block;
  width: var(--photo-width);
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
}

.profile-name {
  margin: 1.1rem 0 0.2rem;
  font-size: 1.6rem;
}

.profile p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.bio p {
  margin: 0 0 1rem;
}

.bio p:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .profile {
    --photo-width: 200px;
  }
}

/* ---------- News ---------- */

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

.news-list li {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.news-list.collapsed li:nth-child(n + 4) {
  display: none;
}

.news-date {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.news-toggle {
  margin-top: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--nyu-violet);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.news-toggle::after {
  content: "\25BE";
  display: inline-block;
  margin-left: 0.3em;
}

.news-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.news-toggle:hover {
  color: var(--ultra-violet);
}

/* ---------- Buttons ---------- */

.btn-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--nyu-violet);
  border-radius: 0.2rem;
  color: var(--nyu-violet);
  font-size: 0.8rem;
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: var(--nyu-violet);
  color: #ffffff;
}

/* ---------- Selected publications ---------- */

.pub-feature {
  display: flex;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.pub-feature:last-of-type {
  margin-bottom: 0;
}

.pub-thumb {
  flex: 0 0 var(--pub-thumb);
}

.pub-thumb img {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

.pub-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 700;
}

.pub-title a {
  color: var(--heading);
}

.pub-title a:hover {
  color: var(--nyu-violet);
}

.pub-authors {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.pub-authors .me {
  font-weight: 700;
}

.pub-venue {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pub-venue strong {
  color: var(--nyu-violet);
  font-weight: 700;
}

.pub-tldr {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .pub-feature {
    flex-direction: column;
    gap: 1rem;
  }

  .pub-thumb {
    flex-basis: auto;
    max-width: 360px;
  }
}

/* ---------- Footer ---------- */

.footer {
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
