/* Site extras — projects, publications, teaching, about */

.site-brand-silent {
  min-width: 1.25rem;
  min-height: 1.25rem;
  text-decoration: none;
}

body.is-black {
  background: #000 !important;
  margin: 0 !important;
  min-height: 100%;
}

html:has(body.is-black) {
  height: 100%;
}

/* Match masthead type: solid white, no exclusion wash */
body.is-black .navbar-div {
  mix-blend-mode: normal !important;
  background-color: transparent !important;
}

body.is-black .navlink,
body.is-black .navlink.w--current {
  color: #fff !important;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.35);
}

body.is-black .navlink.w--current {
  border-bottom-color: #fff !important;
}

body.is-black .container.is-nav {
  padding-left: clamp(1.25rem, 3.5vw, 2.75rem) !important;
  padding-right: clamp(1.25rem, 3.5vw, 2.75rem) !important;
  padding-top: max(0.75rem, env(safe-area-inset-top)) !important;
}

body.is-black .main {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100%;
}

.home-masthead.section,
.home-masthead {
  --home-masthead-height: 100vh;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: var(--home-masthead-height) !important;
  height: var(--home-masthead-height) !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-start;
  padding: 0 0 max(6.5vh, calc(env(safe-area-inset-bottom, 0px) + 1.5rem)) !important;
  margin: 0 !important;
  background: #000;
  box-sizing: border-box;
}

.home-masthead__media {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: #000;
  overflow: hidden;
}

.home-masthead__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center center;
  border: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.home-masthead__video--lq {
  z-index: 1;
  opacity: 1;
}

.home-masthead__video--hq {
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.home-masthead__video--hq.is-ready {
  opacity: 1;
}

/* Keeps type readable over bright / busy video frames */
.home-masthead__readable {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.42) 28%,
      rgba(0, 0, 0, 0.12) 55%,
      rgba(0, 0, 0, 0) 78%
    );
}

.home-masthead .container {
  position: relative;
  z-index: 4;
  width: 100%;
  margin-top: auto;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: clamp(1.25rem, 3.5vw, 2.75rem) !important;
  padding-right: clamp(1.25rem, 3.5vw, 2.75rem) !important;
}

.home-masthead__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(92vw, 58rem);
}

.home-masthead__title {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0.88;
  text-transform: uppercase;
  color: #fff !important;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

.home-masthead__tagline {
  display: block;
  margin: 0.9rem 0 0 !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff !important;
  text-shadow:
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 6px 18px rgba(0, 0, 0, 0.35);
}

@media (min-width: 1280px) {
  .home-masthead__title.display-h {
    font-size: clamp(6.5rem, 13vw, 14.5rem);
  }
}

/* Hide leftover Webflow footer CTAs */
.footer a[href*="learn"],
.footer-cta,
.learn-more,
.hero-still__cta,
a[href*="learn-more"],
.footer-trigger-wrap a {
  display: none !important;
}

.projects-grid-section,
.publications-list-section {
  padding-top: 1.5rem;
  padding-bottom: 5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.75rem 1.75rem;
  width: 100%;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.project-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.92;
  overflow: hidden;
  background: #e8e8e8;
  text-decoration: none;
  color: inherit;
}

.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.project-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #d8d8d8, #efefef 45%, #cfcfcf);
}

.project-card__media:hover .project-card__img {
  transform: scale(1.03);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.project-card__year {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

.project-card__title {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.project-card__title a {
  color: inherit;
  text-decoration: none;
}

.project-card__title a:hover {
  text-decoration: underline;
}

.project-card__summary {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* Project detail — copy left, gallery right */
.detail-split {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.detail-split__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3rem 4rem;
  align-items: start;
}

.detail-split__gallery {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  min-width: 0;
}

.detail-split__gallery .section,
.detail-split__gallery .page-media-section,
.detail-split__gallery .image-gallery-section {
  padding: 0;
  margin: 0;
}

.detail-split__gallery .container {
  max-width: none;
  width: 100%;
  padding: 0;
}

.detail-split__gallery .image-gallery {
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

.detail-split__gallery .page-media {
  align-items: stretch;
}

.detail-split__gallery .page-media img,
.detail-split__gallery .page-media video,
.detail-split__gallery .image-gallery__img {
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: auto !important;
  object-fit: contain !important;
}

.detail-split__copy {
  text-align: left;
  min-width: 0;
}

.detail-split__copy .detail-header {
  padding: 0 0 1.5rem;
}

.detail-split__copy .detail-header__title,
.detail-split__copy .detail-header__meta,
.detail-split__copy .detail-header__authors,
.detail-split__copy .detail-prose .txt-large,
.detail-split__copy .detail-prose .w-richtext,
.detail-split__copy .detail-related {
  margin-right: auto;
  margin-left: 0;
  max-width: 34rem;
  text-align: left;
}

.detail-split__copy .section {
  padding-top: 0;
  padding-bottom: 1.25rem;
}

.detail-split__copy .container {
  max-width: none;
  width: 100%;
  padding: 0;
}

/* Detail pages — title + year/category, then proportional media */
.detail-header {
  padding-bottom: 0.5rem;
}

.detail-header__meta {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.85rem;
}

.detail-header__title {
  margin: 0;
}

.detail-header__authors {
  margin: 1rem 0 0;
  max-width: 46rem;
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.72;
}

.detail-prose .txt-large,
.detail-prose .w-richtext {
  max-width: 46rem;
}

.detail-prose .w-richtext p + p,
.detail-prose .w-richtext h3 + p {
  margin-top: 1.15rem;
}

.detail-prose .w-richtext h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.page-media-section {
  padding-top: 0.35rem;
  padding-bottom: 1.75rem;
}

.page-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.page-media img,
.page-media video {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: min(72vh, 820px) !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent;
}

.page-media__caption {
  margin-top: 0.85rem;
  opacity: 0.7;
  text-align: center;
}

.detail-related {
  margin: 0 0 2rem;
}

.detail-related h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}

.detail-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-related li {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.image-gallery__img {
  width: 100%;
  height: auto;
  max-height: 64vh;
  object-fit: contain;
  display: block;
}

.image-gallery__caption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* Publications — venue, then PDF / BibTeX underneath */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
  width: 100%;
}

.pub-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
  gap: 1.75rem 2.25rem;
  align-items: start;
  padding-bottom: 3.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pub-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pub-row__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f2f2;
}

.pub-row__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-row__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #d8d8d8, #efefef 45%, #cfcfcf);
}

.pub-row__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 0.15rem;
}

.pub-row__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.pub-row__authors {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.72;
}

.pub-row__venue {
  margin: 1.1rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.pub-row__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.pub-row__links a {
  color: inherit;
  text-decoration: none;
}

.pub-row__bib {
  display: inline;
}

.pub-row__bib summary {
  cursor: pointer;
  list-style: none;
}

.pub-row__bib summary::-webkit-details-marker {
  display: none;
}

.pub-row__bibtex {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.04);
  max-width: 100%;
}

/* About */
.image-text {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, 0.7fr);
  gap: 3rem 4rem;
  align-items: start;
  padding-bottom: 3rem;
}

.image-text.is-image-left {
  grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.4fr);
}

.image-text.is-image-left .image-text__media {
  order: -1;
}

.image-text__img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: #f0f0f0;
}

.image-text__body {
  max-width: 40rem;
}

.image-text__body p + p {
  margin-top: 1.15rem;
}

.about-kicker {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.35rem !important;
}

.about-role {
  opacity: 0.7;
  letter-spacing: 0.04em;
  margin: 0 0 1.5rem !important;
}

.hero-still {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-still__subtitle {
  margin-top: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 991px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }

  .detail-split__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .detail-split__copy,
  .detail-split__copy .detail-header__title,
  .detail-split__copy .detail-header__meta,
  .detail-split__copy .detail-header__authors,
  .detail-split__copy .detail-prose .txt-large,
  .detail-split__copy .detail-prose .w-richtext,
  .detail-split__copy .detail-related {
    text-align: left;
    margin-left: 0;
  }

  .pub-row {
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 640px) {
  .projects-grid,
  .image-gallery,
  .image-text,
  .image-text.is-image-left {
    grid-template-columns: 1fr;
  }

  .image-text.is-image-left .image-text__media {
    order: 0;
  }

  .image-text__img {
    max-width: 280px;
  }

  .pub-row {
    grid-template-columns: 1fr;
  }

  .pub-row__media {
    max-width: 280px;
  }

  .page-media img,
  .page-media video {
    max-height: min(60vh, 640px) !important;
  }
}
