/* Institutional / academic styling */
:root {
  --site-header-h: 5.25rem;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, monospace;
}

@media (min-width: 640px) {
  :root {
    --site-header-h: 6.75rem;
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-header-h) + 0.75rem);
}

.site-main {
  padding-top: var(--site-header-h);
}

/* —— Institutional header: red cut block · centred menu · Contact + Sapienza right —— */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 200;
}

.site-header-bar {
  position: relative;
  background: #fff;
  color: #241c1d;
  border-bottom: 3px solid #822433;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.site-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 1rem;
  min-height: calc(var(--site-header-h) - 3px);
  padding-right: 0.75rem;
}

@media (min-width: 1024px) {
  .site-header-inner {
    padding-right: 2rem;
  }
}

.site-brand {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #822433;
  color: #fff;
  text-decoration: none;
  padding: 0.8rem 2.4rem 0.8rem 1rem;
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.25rem) 100%, 0 100%);
  z-index: 2;
}

.site-brand:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.site-brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-brand-sub {
  margin-top: 0.3rem;
  max-width: 11rem;
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.86;
}

@media (min-width: 640px) {
  .site-brand {
    padding: 1.1rem 3.5rem 1.1rem 1.5rem;
    clip-path: polygon(0 0, 100% 0, calc(100% - 1.6rem) 100%, 0 100%);
  }

  .site-brand-name {
    font-size: 2.15rem;
  }

  .site-brand-sub {
    max-width: 18.5rem;
    font-size: 0.64rem;
  }
}

@media (min-width: 1024px) {
  .site-brand {
    padding-left: 2rem;
  }
}

.site-header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
  z-index: 2;
}

.site-header-contact {
  display: none;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #822433;
  text-decoration: none;
  white-space: nowrap;
}

.site-header-contact:hover,
.site-header-contact:focus-visible {
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}

.site-header-sep {
  display: none;
  width: 1px;
  height: 2.4rem;
  background: #e0dad9;
}

/* White logo file recoloured in Sapienza red via mask */
.site-brand-logo {
  display: block;
  height: 1.9rem;
  aspect-ratio: 204 / 60;
  background: #822433;
  -webkit-mask: url("/images/_opt/logo_sapienza.webp") center / contain no-repeat;
  mask: url("/images/_opt/logo_sapienza.webp") center / contain no-repeat;
}

@media (min-width: 640px) {
  .site-brand-logo {
    height: 2.9rem;
  }
}

.site-nav {
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.site-nav a {
  padding: 0.4rem 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #241c1d;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #822433;
  outline: none;
}

.site-nav a:focus-visible {
  box-shadow: inset 0 0 0 2px #822433;
}

/* Current section page */
.site-nav a[aria-current="page"] {
  color: #822433;
  box-shadow: inset 0 -3px 0 #822433;
}

/* Contact lives in the mobile drawer only; on desktop it sits next to the logo */
.site-nav-cta {
  display: none;
}

.site-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(130, 36, 51, 0.35);
  background: transparent;
  color: #822433;
  cursor: pointer;
  border-radius: 2px;
}

.site-nav-toggle-bars,
.site-nav-toggle-bars::before,
.site-nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  content: "";
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav-toggle-bars {
  position: relative;
}

.site-nav-toggle-bars::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.site-nav-toggle-bars::after {
  position: absolute;
  top: 6px;
  left: 0;
}

.site-header.is-nav-open .site-nav-toggle-bars {
  background: transparent;
}

.site-header.is-nav-open .site-nav-toggle-bars::before {
  top: 0;
  background: currentColor;
  transform: rotate(45deg);
}

.site-header.is-nav-open .site-nav-toggle-bars::after {
  top: 0;
  background: currentColor;
  transform: rotate(-45deg);
}

/* Mobile / tablet drawer */
.site-header.is-nav-open .site-nav {
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0.75rem 1rem 1rem;
  background: #fff;
  border-bottom: 3px solid #822433;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.site-header.is-nav-open .site-nav a {
  padding: 0.7rem 0.85rem;
  font-size: 0.86rem;
}

.site-header.is-nav-open .site-nav a[aria-current="page"] {
  box-shadow: inset 3px 0 0 #822433;
}

.site-header.is-nav-open .site-nav-cta {
  display: block;
  margin-top: 0.35rem;
  text-align: center;
  background: #822433;
  color: #fff;
}

@media (min-width: 1100px) {
  .site-nav,
  .site-header.is-nav-open .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.1rem;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .site-nav-toggle {
    display: none;
  }

  .site-nav a,
  .site-header.is-nav-open .site-nav a {
    padding: 0.5rem 0.55rem;
    font-size: 0.8rem;
  }

  .site-header.is-nav-open .site-nav a[aria-current="page"] {
    box-shadow: inset 0 -3px 0 #822433;
  }

  .site-nav-cta,
  .site-header.is-nav-open .site-nav-cta {
    display: none;
  }

  .site-header-contact,
  .site-header-sep {
    display: block;
  }

  .site-header-end {
    gap: 1rem;
  }
}

@media (min-width: 1280px) {
  .site-nav a {
    padding: 0.55rem 0.75rem;
    font-size: 0.86rem;
    letter-spacing: 0.07em;
  }
}

.hero-institutional-figure {
  aspect-ratio: 4 / 3;
}

.hero-typewriter--light:not(.is-empty) {
  border-right-color: #822433;
}

.nav-blur {
  backdrop-filter: blur(12px);
  background: rgba(130, 36, 51, 0.97);
}

.hero-pan {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-pan-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 118%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  animation: hero-pan 36s ease-in-out infinite alternate;
  will-change: transform;
}

.hero--fullscreen {
  /* Compact hero: no longer full-viewport */
  min-height: min(78vh, 860px);
  min-height: min(78dvh, 860px);
  position: relative;
  z-index: 0;
  align-items: flex-end;
}

/* Light scrim only for text contrast — no heavy bordeaux wash */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(22, 12, 15, 0.55) 0%,
      rgba(22, 12, 15, 0.3) 45%,
      rgba(22, 12, 15, 0) 75%
    ),
    linear-gradient(
      180deg,
      rgba(22, 12, 15, 0.3) 0%,
      rgba(22, 12, 15, 0.25) 35%,
      rgba(22, 12, 15, 0.8) 100%
    );
  pointer-events: none;
  transition: opacity 0.35s ease;
}

/* Copy block — fixed bottom padding for the compact hero */
.hero-copy {
  padding-top: 6rem;
  padding-bottom: 3.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 2px 14px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1023px) {
  .hero-copy {
    padding-bottom: 2.5rem;
  }
}

/* —— About lab spotlight (post-hero) —— */
.about-lab {
  position: relative;
  overflow: hidden;
}

.about-lab::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: min(42vw, 28rem);
  height: min(42vw, 28rem);
  background:
    radial-gradient(circle at 70% 30%, rgba(130, 36, 51, 0.07), transparent 62%),
    repeating-linear-gradient(
      -28deg,
      transparent,
      transparent 18px,
      rgba(130, 36, 51, 0.035) 18px,
      rgba(130, 36, 51, 0.035) 19px
    );
  pointer-events: none;
}

.about-lab-grid {
  display: grid;
  gap: 2rem;
  padding: 3rem 1rem 2.5rem;
}

@media (min-width: 1024px) {
  .about-lab-grid {
    grid-template-columns: minmax(16rem, 0.92fr) minmax(0, 1.35fr);
    gap: 2.5rem 2rem;
    align-items: start;
    padding: 4rem 1.5rem 3rem;
  }
}

.about-lab-copy {
  position: relative;
  z-index: 1;
}

/* Side-by-side layout: centre the intro text vertically next to the carousel */
@media (min-width: 1024px) {
  .about-lab-copy {
    align-self: center;
  }
}

.about-lab-title {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #1f1f1f;
}

.about-lab-lead {
  margin: 1.1rem 0 0;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #4b4b4b;
}

.about-lab-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: 1.35rem;
  font-size: 0.85rem;
}

.about-lab-links-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #822433;
  margin-right: 0.25rem;
}

.about-lab-links a {
  color: #3b3b3b;
  text-decoration: none;
  font-weight: 600;
}

.about-lab-links a:hover {
  color: #822433;
  text-decoration: underline;
}

.about-lab-sep {
  color: #c4c4c4;
}

.about-lab-stats {
  margin-top: 1.75rem;
}

.about-lab-carousel {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.about-lab-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.about-lab-track::-webkit-scrollbar {
  display: none;
}

.about-card {
  flex: 0 0 min(78%, 19.5rem);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e7e5e4;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

@media (min-width: 768px) {
  .about-card {
    flex-basis: min(52%, 20.5rem);
  }
}

@media (min-width: 1024px) {
  .about-card {
    flex-basis: min(46%, 21rem);
  }
}

.about-card:hover,
.about-card:focus-visible {
  border-color: #822433;
  transform: translateY(-2px);
  outline: none;
}

.about-card-media {
  aspect-ratio: 16 / 10;
  background: #1a1a1a;
  overflow: hidden;
}

.about-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem 1.15rem;
  border-top: 1px solid #e7e5e4;
  background: #fafaf8;
}

.about-card-tag {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #822433;
}

.about-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1f1f1f;
}

.about-card-blurb {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #5c5c5c;
}

.about-lab-progress {
  position: relative;
  height: 2px;
  margin-top: 1.1rem;
  background: #e7e5e4;
  overflow: hidden;
}

.about-lab-progress-bar {
  display: block;
  height: 100%;
  width: 25%;
  background: #822433;
  transform-origin: left center;
  transition: width 0.25s ease;
}

/* Projects carousel — text cards, no images */
.projects-band-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.projects-track {
  padding-bottom: 0.15rem;
}

.project-card {
  flex: 0 0 min(82%, 18.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 13.5rem;
  padding: 1.15rem 1.2rem 1.25rem;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-top: 3px solid #b7b0af;
}

@media (min-width: 768px) {
  .project-card {
    flex-basis: min(48%, 19.5rem);
  }
}

@media (min-width: 1024px) {
  .project-card {
    flex-basis: min(32%, 20rem);
  }
}

.project-card.is-active {
  border-top-color: #822433;
}

.project-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.project-card-status {
  display: inline-block;
  padding: 0.18rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  background: #eceae6;
}

.project-card-status.is-on {
  color: #fff;
  background: #822433;
}

.project-card-meta {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #822433;
}

.project-card-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #1f1f1f;
}

.project-card-blurb {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5c5c5c;
}

.project-card-link {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0070b3;
  text-decoration: none;
}

.project-card-link:hover {
  text-decoration: underline;
}


.hero-slideshow {
  background: #1a1a1a;
  overflow: hidden;
}

.hero-slideshow.hero-slideshow--backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 2.2s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-slide img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.hero-slide-title {
  min-height: 1.35em;
  transition: opacity 0.35s ease;
}

.hero-nav {
  position: absolute;
  inset: 0;
  z-index: 12;
}

/* Narrow strips along each edge are buttons: left = back, right = forward */
.hero-nav-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(4.5rem, 16%, 13rem);
  display: flex;
  align-items: center;
  padding: 0 0.85rem;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hero-nav-btn--prev {
  left: 0;
  justify-content: flex-start;
}

.hero-nav-btn--next {
  right: 0;
  justify-content: flex-end;
}

.hero-nav-btn:focus {
  outline: none;
}

/* The round arrow is only a hint of which half you are on */
.hero-nav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.55;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    opacity 0.28s ease;
}

.hero-nav-chip svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.hero-nav-btn:hover .hero-nav-chip,
.hero-nav-btn:focus-visible .hero-nav-chip {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.85);
}

.hero-nav-btn--prev:hover .hero-nav-chip {
  transform: translateX(-3px);
}

.hero-nav-btn--next:hover .hero-nav-chip {
  transform: translateX(3px);
}

.hero-nav-btn:active .hero-nav-chip {
  transform: scale(0.94);
}

.hero-nav-btn:focus-visible .hero-nav-chip {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

@media (min-width: 768px) {
  .hero-nav-btn {
    padding: 0 1.35rem;
  }

  .hero-nav-chip {
    width: 3.15rem;
    height: 3.15rem;
  }

  .hero-nav-chip svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (min-width: 1100px) {
  .hero-nav-btn {
    padding: 0 1.75rem;
  }
}

/* Text sits above the edge strips and keeps its own clicks (so links in the
   title or description work); the empty space around it lets clicks through */
.hero .hero-copy {
  z-index: 13;
  pointer-events: none;
}

.hero .hero-copy h1,
.hero .hero-copy .hero-below {
  pointer-events: auto;
}

/* Description fades in after the title has finished typing */
.hero-desc {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.hero-desc.is-hidden {
  opacity: 0;
  transform: translateY(8px);
}

/* Slide segments: one per slide; the active one fills while the slide is held */
.hero-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.4rem;
  pointer-events: auto;
}

.hero-dots[hidden] {
  display: none;
}

.hero-dot {
  position: relative;
  width: 2.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.hero-dot::before,
.hero-dot-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 999px;
}

.hero-dot::before {
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.2s ease;
}

.hero-dot:hover::before {
  background: rgba(255, 255, 255, 0.65);
}

.hero-dot-fill {
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.hero-dot.is-active .hero-dot-fill {
  transform: scaleX(0.12);
}

.hero-dot.is-active.is-running .hero-dot-fill {
  animation: hero-dot-fill var(--hero-hold, 8000ms) linear forwards;
}

.hero-dot:focus {
  outline: none;
}

.hero-dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 3px;
}

@keyframes hero-dot-fill {
  from {
    transform: scaleX(0.12);
  }
  to {
    transform: scaleX(1);
  }
}

@media (min-width: 768px) {
  .hero-dot {
    width: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: none;
  }

  .hero-nav-chip,
  .hero-desc {
    transition: none;
  }

  .hero-dot.is-active .hero-dot-fill {
    transform: scaleX(1);
  }
}

@keyframes hero-pan {
  from {
    transform: translateX(0) scale(1.04);
  }
  to {
    transform: translateX(-12%) scale(1.04);
  }
}

.image-marquee-track {
  display: flex;
  width: max-content;
  animation: image-marquee 55s linear infinite;
}

.image-marquee-item {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  width: clamp(16rem, 32vw, 26rem);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.image-marquee-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.image-marquee-item:hover img {
  opacity: 1;
}

.image-marquee-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  pointer-events: none;
}

@keyframes image-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.hero-stat {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.hero-title-wrap,
.nav-lab-name {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.03em;
  word-spacing: -0.22em;
}

.hero-title-stack {
  display: inline-grid;
  vertical-align: top;
}

.hero-title-ghost,
.hero-typewriter {
  grid-area: 1 / 1;
}

.hero-title-ghost {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* Reserve the caret's width so the ghost wraps exactly like the typed text */
.hero-title-ghost::after {
  content: "";
  display: inline-block;
  width: 0.2em;
}

.font-mono-tech {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-below {
  text-wrap: pretty;
}

/* Long captions (e.g. "AI and Robotics for Precision Agriculture") wrap onto two lines;
   the caret is drawn after the last character so it follows the wrapped text */
.hero-typewriter {
  display: block;
  min-width: 0;
  white-space: normal;
}

.hero-typewriter:not(.is-empty)::after {
  content: "";
  display: inline-block;
  width: 0.12em;
  height: 0.92em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  background: rgba(255, 255, 255, 0.92);
  animation: typewriter-caret 0.75s step-end infinite;
}

@keyframes typewriter-caret {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-typewriter::after {
    display: none;
  }

  .hero-pan-img,
  .image-marquee-track {
    animation: none;
  }

  .hero-pan-img {
    width: 100%;
    transform: none;
  }
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #822433;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #3b3b3b;
  line-height: 1.25;
}

.section-rule {
  width: 3rem;
  height: 3px;
  background: #822433;
  margin-top: 0.75rem;
  margin-bottom: 1.75rem;
}

.prose-lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #5c5c5c;
  max-width: 42rem;
}

.card-pro {
  border: 1px solid #e5e5e5;
  background: #fff;
  border-radius: 2px;
  transition: border-color 0.15s ease;
}

.card-pro:hover {
  border-color: #c9c9c9;
}

/* Research band — Sapienza fascia */
.research-band {
  background: #822433;
  color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.research-band-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 1.85rem;
}

@media (min-width: 768px) {
  .research-band-wrap {
    padding: 2rem 1.5rem 2.1rem;
  }
}

.research-band-head {
  margin-bottom: 1.35rem;
  max-width: 46rem;
}

.research-band-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.research-band-heading {
  margin: 0.35rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #fff;
}

.research-band-intro {
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.research-band-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .research-band-inner {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.research-band-item {
  min-width: 0;
}

/* Static white bar above each research area (no hover effect) */
.research-band-meter {
  display: block;
  height: 2px;
  margin-bottom: 0.85rem;
  background: #fff;
}

.research-band-cat {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.research-band-copy {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .research-band-copy {
    -webkit-line-clamp: 4;
    font-size: 0.88rem;
  }
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-bar dt {
  font-size: 1.375rem;
  font-weight: 700;
  color: #822433;
}

.stat-bar dd {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6b6b;
}

.news-row {
  border-left: 3px solid #822433;
}

.btn-primary {
  display: inline-block;
  background: #822433;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.625rem 1.25rem;
  border-radius: 2px;
}

.btn-primary:hover {
  background: #6b1d2a;
}

.btn-secondary {
  display: inline-block;
  border: 1px solid #822433;
  color: #822433;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 2px;
}

.btn-secondary:hover {
  background: #f6f6f2;
}

/* —— Contact footer + map —— */
.site-footer {
  background: #292929;
  color: rgba(255, 255, 255, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 1.5rem;
}

@media (min-width: 1024px) {
  .site-footer-inner {
    padding: 3rem 1.5rem 1.75rem;
  }
}

.site-footer-grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 900px) {
  .site-footer-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: 2rem;
    align-items: stretch;
  }
}

.site-footer-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.site-footer-title {
  margin: 0.4rem 0 1.1rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.site-footer-address {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.site-footer-address strong {
  color: #fff;
  font-size: 1rem;
}

.site-footer-person {
  margin-top: 0.55rem;
}

.site-footer-person span {
  color: rgba(255, 255, 255, 0.55);
}

.site-footer-address a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.site-footer-address a:hover {
  text-decoration: underline;
}

.site-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.site-footer-btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #822433;
  background: #fff;
  text-decoration: none;
  border: 1px solid #fff;
}

.site-footer-btn:hover {
  background: #f3f0ee;
}

.site-footer-btn--ghost {
  color: #fff;
  background: transparent;
}

.site-footer-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.site-footer-map {
  display: flex;
  flex-direction: column;
  min-height: 16rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1f1f1f;
  overflow: hidden;
}

.site-footer-map iframe {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 16rem;
  height: 100%;
  border: 0;
  filter: grayscale(0.15) contrast(1.02);
}

@media (min-width: 900px) {
  .site-footer-map,
  .site-footer-map iframe {
    min-height: 20rem;
  }
}

.site-footer-map-caption {
  display: block;
  padding: 0.55rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer-map-caption:hover {
  color: #fff;
}

.site-footer-legal {
  margin: 1.35rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.site-footer-legal a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.site-footer-legal a:hover {
  color: #fff;
}

/* —— Faculty slideshow —— */
.faculty-slideshow {
  margin-bottom: 0.35rem;
}

.faculty-card {
  flex: 0 0 min(88%, 22rem);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e7e5e4;
  overflow: hidden;
  min-height: 100%;
}

@media (min-width: 768px) {
  .faculty-card {
    flex-basis: min(56%, 26rem);
    flex-direction: row;
    min-height: 15.5rem;
  }
}

@media (min-width: 1100px) {
  .faculty-card {
    flex-basis: min(48%, 30rem);
  }
}

.faculty-card-photo {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 4 / 5;
  background: #eceae6;
  overflow: hidden;
}

@media (min-width: 768px) {
  .faculty-card-photo {
    width: 11.5rem;
    aspect-ratio: auto;
    align-self: stretch;
  }
}

.faculty-card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.faculty-card-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #a8a29e;
}

.faculty-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.15rem 1.2rem;
  flex: 1;
}

.faculty-card-role {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #822433;
}

.faculty-card-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #1f1f1f;
}

.faculty-card-blurb {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5c5c5c;
}

/* —— Publications carousel + filters —— */
.pub-filters {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.15rem;
}

.pub-filter-row {
  display: grid;
  gap: 0.45rem;
}

@media (min-width: 768px) {
  .pub-filter-row {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.6rem;
  }
}

.pub-filter-label {
  padding-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.pub-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-chip {
  appearance: none;
  border: 1px solid #d6d3d1;
  background: #fff;
  color: #3b3b3b;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.pub-chip:hover,
.pub-chip:focus-visible {
  border-color: #822433;
  color: #822433;
  outline: none;
}

.pub-chip.is-active {
  background: #822433;
  border-color: #822433;
  color: #fff;
}

.pub-count {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #822433;
}

.pub-card {
  min-height: 14.5rem;
}

/* Venue always on its own line under the year, so every card lines up */
.pub-card .project-card-top {
  flex-direction: column;
  align-items: flex-start;
}

.pub-card .project-card-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pub-card-title {
  font-size: 1.02rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-card .project-card-blurb {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Year on the left, labels pushed to the card's right edge */
.pub-card-year-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.pub-card-year-row .pub-card-tags {
  margin-left: auto;
  justify-content: flex-end;
}

.pub-card-title-link {
  color: inherit;
  text-decoration: none;
}

.pub-card-title-link:hover,
.pub-card-title-link:focus-visible {
  color: #822433;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.pub-card-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
}

.pub-card-tag {
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(130, 36, 51, 0.35);
  border-radius: 999px;
  background: rgba(130, 36, 51, 0.06);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: #822433;
  white-space: nowrap;
}

.pub-card[hidden] {
  display: none !important;
}

.pub-empty {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #6b6b6b;
}

.pub-scholar-inline {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 1.15rem 0 0;
  padding: 0;
}

.pub-scholar-inline a {
  font-size: 0.8rem;
  font-weight: 600;
  color: #822433;
  text-decoration: none;
}

.pub-scholar-inline a:hover {
  text-decoration: underline;
}

/* Hero kicker ("DIAG · Sapienza …") — sits higher where the scrim is lighter */
.hero-copy .hero-kicker {
  display: block;
  width: fit-content;
  padding: 0.2em 0.6em;
  border-radius: 0.25rem;
  background: rgba(22, 12, 15, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* —— Blend slide (World Modeling): video left, photo right, soft fade between —— */
.hero-slide--blend .hero-blend-video,
.hero-slide--blend .hero-blend-bg {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Photo panel on the right of the World Modeling slide */
.hero-blend-photo {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 7%, rgba(0, 0, 0, 0.6) 15%, rgba(0, 0, 0, 0.85) 23%, rgba(0, 0, 0, 0.97) 30%, #000 34%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.25) 7%, rgba(0, 0, 0, 0.6) 15%, rgba(0, 0, 0, 0.85) 23%, rgba(0, 0, 0, 0.97) 30%, #000 34%);
}

/* Keep the whole robot in view, centred in the part of the slide you can see.
   The hero starts under the fixed header, so its top --site-header-h is hidden.
   In tiago.jpg (1100×776, ratio 1.4175) the robot spans x 36–57%, y 10–76%.
   The photo always covers the full height; it is capped so the robot takes at most
   ~84% of the visible height, then moved so the robot is centred vertically below
   the header and sits as far left as the box allows (any gap on the left falls in
   the faded edge). The photo may extend up behind the header but never leaves a
   gap at the bottom. */
.hero-blend-photo {
  container-type: size;
}

.hero-slide .hero-blend-photo img {
  --hdr: var(--site-header-h);
  --vis-h: calc(100cqh - var(--hdr));
  --img-w: max(141.75cqh, min(100cqw, 1.8 * var(--vis-h)));
  --img-h: calc(var(--img-w) / 1.4175);
  --img-x: calc(66cqw - 0.465 * var(--img-w));
  --img-y: calc(var(--hdr) + 0.5 * var(--vis-h) - 0.43 * var(--img-h));
  inset: auto;
  width: var(--img-w);
  height: var(--img-h);
  left: clamp(min(0px, 100cqw - var(--img-w)), var(--img-x), max(0px, 100cqw - var(--img-w)));
  top: clamp(calc(100cqh - var(--img-h)), var(--img-y), var(--hdr));
  object-fit: fill;
  /* soft left edge of the photo itself (the robot starts at 36%, clear of it) */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 25%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 25%);
}

/* Portrait screens: the text spans the bottom of the slide, so the robot is
   shrunk into the band between the header and the text (top ~55%), and the
   photo fades out at its top and bottom edges */
@media (max-aspect-ratio: 1/1) {
  .hero-slide .hero-blend-photo img {
    --band: calc(55cqh - var(--hdr));
    --img-w: min(max(100cqw, 141.75cqh), 285cqw, 1.93 * var(--band));
    --img-y: calc(var(--hdr) + 0.5 * var(--band) - 0.43 * var(--img-h));
    top: min(var(--hdr), var(--img-y));
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 80%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 8%, #000 80%, transparent 100%);
  }
}

/* —— Social Robotics slide: panorama. The three photos sit side by side at
   full height (pair | group | solo), each seam cross-fading into the next so
   there are no gaps. The row is anchored right: any extra width runs off the
   left edge, under the text, where a slide-specific scrim keeps it readable. —— */
.hero-slide--social {
  --social-blend: 5.5rem;
  background: #140b0e;
}

.social-strip {
  position: absolute;
  top: var(--site-header-h);
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-end;
  overflow: hidden;
}

.hero-slide .social-strip img {
  position: static;
  flex: none;
  width: auto;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.hero-slide .social-strip img + img {
  margin-left: calc(var(--social-blend) * -1);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--social-blend));
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--social-blend));
}

.hero-slide--social.is-active .social-strip img { opacity: 1; }
.hero-slide--social.is-active .social-strip img:nth-child(2) { transition-delay: 0.15s; }
.hero-slide--social.is-active .social-strip img:nth-child(3) { transition-delay: 0.3s; }

/* Text sits over the left photo: darken that side more than the shared scrim does */
.hero-slide--social::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 11, 14, 0.85) 0%, rgba(20, 11, 14, 0.55) 34%, rgba(20, 11, 14, 0) 60%),
    linear-gradient(180deg, transparent 55%, rgba(20, 11, 14, 0.5) 100%);
}

@media (max-width: 767px) {
  .hero-slide--social {
    --social-blend: 3rem;
  }

  .social-strip {
    bottom: 38%;
    -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  }

  .hero-slide--social::after {
    background: linear-gradient(180deg, transparent 45%, rgba(20, 11, 14, 0.9) 66%, #140b0e 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide .social-strip img {
    transition: none;
  }
}

/* Left-only scrim: darkens the text side, leaves the photo bright */
.hero-overlay--left {
  opacity: 0;
  transition: opacity 2.2s ease;
  background:
    linear-gradient(90deg, rgba(22, 12, 15, 0.6) 0%, rgba(22, 12, 15, 0.35) 35%, rgba(22, 12, 15, 0) 55%),
    linear-gradient(180deg, rgba(22, 12, 15, 0.25) 0%, rgba(22, 12, 15, 0) 30%);
}

.hero-overlay--left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(22, 12, 15, 0.75) 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 40%, transparent 60%);
  mask-image: linear-gradient(90deg, #000 0%, #000 40%, transparent 60%);
}

.hero > .hero-overlay:not(.hero-overlay--left) {
  transition: opacity 2.2s ease;
}

.hero--scrim-left > .hero-overlay:not(.hero-overlay--left) {
  opacity: 0;
}

.hero--scrim-left > .hero-overlay--left {
  opacity: 1;
}

/* Narrow screens: text spans the width, so keep the bottom dark all the way across */
@media (max-width: 767px) {
  .hero-blend-photo {
    width: 65%;
  }

  .hero-overlay--left::after {
    -webkit-mask-image: none;
    mask-image: none;
    background: linear-gradient(180deg, transparent 35%, rgba(22, 12, 15, 0.8) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-overlay--left,
  .hero > .hero-overlay:not(.hero-overlay--left) {
    transition: none;
  }
}

/* —— AI Safety slide: canvas particle backdrop on the shared dark ink ground —— */
.hero-slide--flock {
  background: #160c0f;
}

.hero-flock {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* —— Shared colour grade: every slide (photos, video, canvas) gets the same
   slight desaturation and a soft bordeaux wash, so the set reads as one —— */
.hero-slide img,
.hero-slide video {
  filter: saturate(0.82) contrast(1.04);
}

.hero-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(130, 36, 51, 0.38) 0%, rgba(60, 22, 30, 0.22) 55%, rgba(130, 36, 51, 0.3) 100%);
  mix-blend-mode: soft-light;
}

/* Highlights: featured event */
.highlight-feature {
  border: 1px solid #d6d3d1;
  border-top: 4px solid #822433;
  background: #fff;
}

.highlight-media {
  margin: 0;
}

.highlight-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 9rem;
  gap: 4px;
  background: #fff;
}

.highlight-collage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.highlight-collage img:hover {
  filter: brightness(1.06);
}

.highlight-collage .hc-main {
  grid-column: span 2;
  grid-row: span 2;
  object-position: center 75%;
}

.highlight-collage .hc-tall {
  grid-row: span 2;
}

@media (min-width: 768px) {
  .highlight-collage {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 12rem;
  }

  .highlight-collage .hc-main {
    grid-column: span 3;
  }
}

.highlight-media figcaption {
  padding: 0.6rem 1.25rem;
  font-size: 0.75rem;
  color: #78716c;
  border-bottom: 1px solid #e7e5e4;
}

.highlight-body {
  display: grid;
  gap: 2rem;
  padding: 1.25rem;
}

@media (min-width: 900px) {
  .highlight-body {
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 3rem;
    padding: 1.5rem;
  }
}

.highlight-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #822433;
}

.highlight-title {
  margin-top: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.375;
  color: #3b3b3b;
  text-wrap: balance;
}

.highlight-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #78716c;
}

.highlight-copy p:not(.highlight-kicker):not(.highlight-meta) {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #57534e;
  max-width: 42rem;
}

.highlight-copy strong {
  color: #3b3b3b;
}

.highlight-facts dl {
  display: grid;
  gap: 1rem;
}

.highlight-facts dl > div {
  padding-bottom: 1rem;
  border-bottom: 1px solid #e7e5e4;
}

.highlight-facts dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #822433;
}

.highlight-facts dd {
  margin-top: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #3b3b3b;
}

.highlight-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.highlight-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0070b3;
}

.highlight-links a:hover {
  text-decoration: underline;
}

/* Highlights: text panel for items without a photo/video */
.hl-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  height: 100%;
  padding: 1.5rem;
  background: linear-gradient(135deg, #822433 0%, #4a1520 100%);
  color: #fff;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.hl-placeholder small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.about-card-media .hl-placeholder {
  min-height: 0;
  font-size: 1.5rem;
}

.hl-list {
  display: grid;
  gap: 2rem;
}

/* Highlights: every card has a photo and the same size */
.about-card-media img.is-contain {
  object-fit: contain;
  background: #fff;
}

.hl-list > article > :first-child {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.hl-list > article > :last-child {
  min-height: 15rem;
}

@media (min-width: 1024px) {
  .hl-list > article {
    height: 24rem;
  }

  .hl-list > article > :first-child {
    aspect-ratio: auto;
    height: 100%;
  }

  .hl-list > article > :last-child {
    min-height: 0;
    overflow: hidden;
  }
}

/* Archive — same cards as the projects carousel, laid out as a grid */
.archive-group-title {
  margin: 2rem 0 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #78716c;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.archive-grid .project-card {
  min-height: 0;
}

@media (min-width: 768px) {
  .archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* —— Carousel scrollbars: draggable, clickable, keyboard-operable —— */
.carousel-scrollbar {
  position: relative;
  height: 18px;
  margin-top: 0.75rem;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  outline: none;
}

.carousel-scrollbar[hidden] {
  display: none;
}

.carousel-scrollbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #e7e5e4;
}

.carousel-scrollbar-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  height: 6px;
  margin-top: -3px;
  width: 25%;
  border-radius: 999px;
  background: #822433;
  cursor: grab;
  transition: height 0.15s ease, margin-top 0.15s ease;
}

.carousel-scrollbar:hover .carousel-scrollbar-thumb,
.carousel-scrollbar:focus-visible .carousel-scrollbar-thumb,
.carousel-scrollbar.is-dragging .carousel-scrollbar-thumb {
  height: 10px;
  margin-top: -5px;
}

.carousel-scrollbar.is-dragging .carousel-scrollbar-thumb {
  cursor: grabbing;
  background: #6a1d29;
}

.carousel-scrollbar:focus-visible {
  outline: 2px solid #822433;
  outline-offset: 3px;
  border-radius: 4px;
}

.about-lab-track:focus-visible {
  outline: 2px solid #822433;
  outline-offset: 4px;
}

/* Publications: years before the last five sit behind an "Older years" toggle */
.pub-older-years {
  display: contents;
}

.pub-older-years[hidden] {
  display: none;
}

.pub-chip--more {
  border-style: dashed;
  color: #822433;
}

.pub-chip--more[aria-expanded="true"] {
  border-style: solid;
}

/* —— Carousels: on first view, a whole number of cards fills the track exactly,
   so no card is cut off at the right edge. The count depends on the track's own
   width (container queries), and each card shrinks/grows to share it. —— */
.about-lab-track {
  container-type: inline-size;
}

.about-lab-track > .about-card,
.about-lab-track > .project-card,
.about-lab-track > .faculty-card {
  --per-view: 1;
  flex: 0 0 calc((100cqw - (var(--per-view) - 1) * 1rem) / var(--per-view));
  min-width: 0;
}

/* Photo cards (homepage) and text cards (projects, publications): ≥ ~16.5rem each */
@container (min-width: 34rem) {
  .about-lab-track:not(.faculty-track) > * { --per-view: 2; }
}
@container (min-width: 51.5rem) {
  .about-lab-track:not(.faculty-track) > * { --per-view: 3; }
}
@container (min-width: 69rem) {
  .about-lab-track:not(.faculty-track) > * { --per-view: 4; }
}
@container (min-width: 86.5rem) {
  .about-lab-track:not(.faculty-track) > * { --per-view: 5; }
}

/* Faculty cards are wider (photo beside text): ≥ ~26rem each */
@container (min-width: 53rem) {
  .about-lab-track.faculty-track > * { --per-view: 2; }
}
@container (min-width: 80rem) {
  .about-lab-track.faculty-track > * { --per-view: 3; }
}

/* —— Project videos: the box is exactly 16:9 at the full width of its column, and
   the video fills it (a video that isn't 16:9 is stretched, never cropped or
   letterboxed). The frame — not the video — sets the size, so the card is as
   tall as the video unless the text beside it is longer; then the video is
   centred vertically next to the text. —— */
.work-video-frame {
  position: relative;
  align-self: center;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.work-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* Slideshow title: a link only on slides with data-href (SPQR Team, AI Safety) */
.hero-title-link {
  display: inline-grid;
  vertical-align: top;
  color: inherit;
  text-decoration: none;
}

.hero-title-link > .hero-title-ghost,
.hero-title-link > .hero-typewriter {
  grid-area: 1 / 1;
}

.hero-title-link[href] {
  cursor: pointer;
}

.hero-title-link[href]:hover .hero-typewriter,
.hero-title-link[href]:focus-visible .hero-typewriter {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

.hero-title-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* —— Home: header trasparente sopra la foto iniziale —— */
.is-home .site-header-bar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-bar {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}

/* —— Home: leggibilità di scritte e logo sull'header trasparente —— */
.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-bar {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.32) 65%, rgba(0, 0, 0, 0) 100%);
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .nav-lab-name,
.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav a {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.45);
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav a {
  font-weight: 700;
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav-cta {
  text-shadow: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-brand-logo {
  filter: brightness(0) invert(1) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav-toggle {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.2);
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-contact {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.45);
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-sep {
  background: rgba(255, 255, 255, 0.55);
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav-toggle-bars,
.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav-toggle-bars::before,
.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav-toggle-bars::after {
  background: #fff;
}

/* —— Header: un solo font (quello di "LabRoCoCo"), niente sottotitolo —— */
.site-brand-sub {
  display: none;
}

.site-nav a,
.site-header-contact,
.site-nav-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-transform: none;
}

/* Home trasparente: niente linea sotto l'header */
.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-bar {
  border-bottom: 0;
  background-repeat: no-repeat;
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-sep {
  display: none;
}

/* —— Niente blocco rosso: solo la scritta LabRoCoCo —— */
.site-brand,
.site-brand:focus-visible {
  background: transparent;
  clip-path: none;
  color: #822433;
  padding: 0.8rem 1rem;
}

@media (min-width: 640px) {
  .site-brand {
    padding: 1.1rem 1.5rem;
    clip-path: none;
  }
}

@media (min-width: 1024px) {
  .site-brand {
    padding-left: 2rem;
  }
}

.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-brand {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75), 0 0 10px rgba(0, 0, 0, 0.45);
}

/* —— Contact nel menu, subito dopo Archive —— */
@media (min-width: 1100px) {
  .site-nav .site-nav-cta,
  .site-header.is-nav-open .site-nav .site-nav-cta {
    display: inline-block;
    margin: 0;
    background: transparent;
    color: inherit;
    text-align: left;
  }

  .site-header-contact,
  .site-header-sep {
    display: none;
  }

  .site-nav .site-nav-cta:not(:hover):not(:focus-visible) {
    color: #241c1d;
  }

  .is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-nav .site-nav-cta {
    color: #fff;
  }
}

/* —— Testi della slide con il font dell'header —— */
.hero-copy .hero-title-ghost,
.hero-copy .hero-typewriter,
.hero-copy .hero-desc {
  font-family: var(--font-display);
}

.hero-copy .hero-title-ghost,
.hero-copy .hero-typewriter {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-copy .hero-desc {
  font-weight: 600;
}

/* —— Header bordeaux con scritte e logo bianchi —— */
.site-header-bar {
  background: #822433;
  color: #fff;
  border-bottom: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.site-brand,
.site-brand:focus-visible {
  color: #fff;
}

.site-nav a,
.site-nav .site-nav-cta,
.site-nav .site-nav-cta:not(:hover):not(:focus-visible) {
  color: #fff;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.site-nav a:focus-visible {
  box-shadow: inset 0 0 0 2px #fff;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -3px 0 #fff;
}

.site-brand-logo {
  background: #fff;
}

.site-nav-toggle {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.site-nav-toggle-bars,
.site-nav-toggle-bars::before,
.site-nav-toggle-bars::after {
  background: #fff;
}

.site-header.is-nav-open .site-nav-toggle-bars {
  background: transparent;
}

/* Menu a tendina (telefono): fondo bordeaux */
.site-header.is-nav-open .site-nav {
  background: #822433;
  border-bottom: 0;
}

.site-header.is-nav-open .site-nav a[aria-current="page"] {
  box-shadow: inset 3px 0 0 #fff;
}

.site-header.is-nav-open .site-nav-cta {
  background: #fff;
  color: #822433 !important;
}

@media (min-width: 1100px) {
  .site-header.is-nav-open .site-nav {
    background: transparent;
  }
}

/* Home in cima: resta trasparente */
.is-home .site-header:not(.is-scrolled):not(.is-nav-open) .site-header-bar {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.32) 65%, rgba(0, 0, 0, 0) 100%);
  background-repeat: no-repeat;
  box-shadow: none;
}

/* —— Slider: più spazio attorno al titolo della slide —— */
.hero-copy .hero-title-wrap {
  line-height: 1.12;
}

.hero-copy .hero-below {
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .hero-copy .hero-below {
    margin-top: 1.9rem;
  }
}

.hero-copy .hero-dots {
  margin-top: 2.25rem;
}

.hero-copy .hero-title-ghost,
.hero-copy .hero-typewriter {
  letter-spacing: 0.01em;
}

/* —— Titoli: lettere meno attaccate —— */
h1, h2, h3,
.site-brand-name,
.about-lab-title,
.research-band-heading,
.site-footer-title,
.hero-copy .hero-title-ghost,
.hero-copy .hero-typewriter {
  letter-spacing: 0.02em !important;
}

/* —— Slider a tutto schermo —— */
.hero--fullscreen {
  min-height: 100vh;
  min-height: 100dvh;
}

/* —— Titoli dello slider: spazio normale tra le parole —— */
.hero-copy .hero-title-wrap,
.hero-copy .hero-title-ghost,
.hero-copy .hero-typewriter {
  word-spacing: normal;
}

/* —— Slider: scritte proporzionate allo schermo (larghezza e altezza) —— */
.hero-copy .hero-title-wrap {
  font-size: clamp(2rem, min(4.6vw, 7.2vh) + 0.6rem, 5rem);
}

.hero-copy .hero-desc {
  font-size: clamp(1rem, 0.85rem + 0.45vw, 1.35rem);
}

.hero-copy .hero-below {
  max-width: min(100%, 44rem);
}

/* —— Slider con header trasparente: le foto partono dal bordo alto —— */
.is-home .social-strip {
  top: 0;
}

.is-home .hero-slide .hero-blend-photo img {
  top: clamp(calc(100cqh - var(--img-h)), var(--img-y), 0px);
}

@media (max-aspect-ratio: 1/1) {
  .is-home .hero-blend-photo {
    width: 100%;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .is-home .hero-slide .hero-blend-photo img {
    --img-h: 64cqh;
    --img-w: calc(1.4175 * 64cqh);
    width: var(--img-w);
    max-width: none;
    height: var(--img-h);
    left: calc(50cqw - 0.465 * var(--img-w));
    top: 0;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
  }
}

/* —— Menu: una sola sottolineatura, larga quanto la parola ——
   Pagina corrente e voce sotto il mouse usano la stessa linea sotto il testo.
   Quando il mouse è su un'altra voce, la linea della pagina corrente sparisce. */
.site-nav a,
.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  box-shadow: none !important;
  text-decoration: none !important;
}

.site-nav a[aria-current="page"],
.site-nav a:hover,
.site-nav a:focus-visible {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 7px !important;
}

.site-nav:hover a[aria-current="page"]:not(:hover) {
  text-decoration: none !important;
}

/* —— Slider: scritte un po più in alto —— */
.hero--fullscreen .hero-copy {
  padding-bottom: clamp(4.5rem, 11vh, 9rem);
}

/* —— Home: titoli di sezione cliccabili e anteprime delle altre pagine —— */
.home-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f1f1f;
  text-decoration: none;
}

.home-sec-title span {
  display: inline-block;
  color: #822433;
  transition: transform 0.2s ease;
}

.home-sec-title:hover,
.home-sec-title:focus-visible {
  color: #822433;
}

.home-sec-title:hover span,
.home-sec-title:focus-visible span {
  transform: translateX(4px);
}

.home-sec-more,
.home-teaser-link {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #822433;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  white-space: nowrap;
}

.home-explore {
  background: #f6f4f1;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.home-explore-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 1rem;
}

@media (min-width: 640px) {
  .home-explore-wrap { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  .home-explore-wrap { padding-left: 2rem; padding-right: 2rem; }
}

.home-explore-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #822433;
}

.home-explore-heading {
  margin: 0 0 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: #1f1f1f;
}

.home-explore-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .home-explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.home-teaser {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 3px solid #822433;
}

.home-teaser-text {
  margin: 0;
  color: #4a4245;
  line-height: 1.55;
}

.home-teaser-link {
  margin-top: auto;
  align-self: flex-start;
}

.home-faces {
  display: flex;
  padding-left: 0.6rem;
}

.home-faces img {
  width: 3.4rem;
  height: 3.4rem;
  margin-left: -0.6rem;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  object-position: 50% 20%;
  background: #eee;
}

.home-pubs,
.home-chips {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-pubs li + li {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.home-pubs a {
  display: block;
  padding: 0.6rem 0;
  color: #1f1f1f;
  text-decoration: none;
}

.home-pub-venue {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #822433;
}

.home-pub-title {
  display: block;
  margin-top: 0.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.home-pubs a:hover .home-pub-title,
.home-pubs a:focus-visible .home-pub-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.home-chips li {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #822433;
  background: rgba(130, 36, 51, 0.07);
  border: 1px solid rgba(130, 36, 51, 0.2);
}

/* —— Home: link Highlights piccolo in basso a destra del carosello —— */
.home-hl-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

/* —— Home, sezione RoCoCo Lab: barra più sottile e proporzioni più equilibrate —— */
#about .carousel-scrollbar {
  height: 12px;
  margin-top: 1rem;
}

#about .carousel-scrollbar::before {
  height: 2px;
}

#about .carousel-scrollbar-thumb {
  height: 3px;
  margin-top: -1.5px;
}

#about .carousel-scrollbar:hover .carousel-scrollbar-thumb,
#about .carousel-scrollbar.is-dragging .carousel-scrollbar-thumb {
  height: 5px;
  margin-top: -2.5px;
}

#about .about-lab-grid {
  padding: clamp(3rem, 6vw, 5rem) 1rem;
}

@media (min-width: 640px) {
  #about .about-lab-grid { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 1024px) {
  #about .about-lab-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 2rem clamp(2.5rem, 5vw, 4.5rem);
    align-items: center;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

#about .about-lab-title {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
}

#about .about-lab-lead {
  margin-top: 1rem;
  font-size: clamp(0.98rem, 0.92rem + 0.2vw, 1.06rem);
  line-height: 1.6;
}

#about .about-card-media {
  aspect-ratio: 16 / 9;
}

#about .home-hl-foot {
  margin-top: 0.6rem;
}

/* —— Home: stesse proporzioni per tutte le sezioni ——
   stessi margini, stessa misura per titoli ed etichette */
.is-home .research-band-wrap,
.is-home .home-explore-wrap {
  max-width: 80rem;
  padding: clamp(3rem, 6vw, 5rem) 1rem;
}

.site-footer-inner {
  padding: clamp(3rem, 6vw, 5rem) 1rem 1.75rem;
}

@media (min-width: 640px) {
  .is-home .research-band-wrap,
  .is-home .home-explore-wrap,
  .site-footer-inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .is-home .research-band-wrap,
  .is-home .home-explore-wrap,
  .site-footer-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.is-home .research-band-label,
.site-footer-label,
.is-home .home-explore-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.is-home .research-band-heading,
.site-footer-title,
.is-home .home-explore-heading {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
}

.is-home .research-band-head {
  max-width: 46rem;
  margin-bottom: 2.25rem;
}

.is-home .research-band-intro {
  margin-top: 0.75rem;
  font-size: clamp(0.98rem, 0.92rem + 0.2vw, 1.06rem);
}

.is-home .research-band-inner {
  gap: 1.75rem;
}

.is-home .research-band-cat {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.78);
}

.is-home .research-band-copy {
  margin-top: 0.6rem;
  font-size: 0.98rem;
  line-height: 1.5;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.is-home .home-explore-heading,
.site-footer-title {
  margin-bottom: 2rem;
}

/* ================= BOZZA: interventi dalla critica ================= */

/* Etichetta piccola sopra i titoli di sezione */
.home-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #822433;
}

/* About: niente tratteggio decorativo, titolo come frase */
#about.about-lab::before { display: none; }
#about .about-lab-title { line-height: 1.12; max-width: 16em; }
#about .about-lab-lead { max-width: 34rem; font-size: clamp(1.02rem, 0.95rem + 0.25vw, 1.12rem); color: #3f3a3b; }

/* Scritte maiuscole: almeno 12 px */
.about-card-tag,
.home-pub-venue,
.research-band-cat,
.site-footer-label,
.research-band-label,
.home-explore-label {
  font-size: 0.75rem !important;
  letter-spacing: 0.08em !important;
}
.is-home .research-band-label,
.is-home .research-band-cat { color: rgba(255, 255, 255, 0.85) !important; }
.about-card-blurb { color: #4a4446; font-size: 0.92rem; }

/* Carosello su telefono: si vede un pezzo della scheda successiva */
@container (max-width: 33.99rem) {
  .about-lab-track > .about-card { flex-basis: 85cqw; }
}

/* Schede Explore: titolo semplice, tutta la scheda cliccabile */
.home-teaser { position: relative; transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }
.home-teaser-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.7rem);
  font-weight: 700;
  color: #1f1f1f;
}
.home-teaser-link.is-stretched::after { content: ""; position: absolute; inset: 0; }
.home-teaser:has(.is-stretched):hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08); }
.home-faces img { width: 3.9rem; height: 3.9rem; }
.home-chips li { font-size: 0.8rem; border-color: rgba(130, 36, 51, 0.35); background: #fff; }

/* Contact: bordeaux scuro al posto del grigio */
.site-footer-label { color: rgba(255, 255, 255, 0.75) !important; }
.site-footer-address a[href^="mailto"] { text-decoration: underline; text-underline-offset: 4px; }
.home-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.8rem;
}
.home-legal nav { display: flex; gap: 1.25rem; }
.home-legal a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.home-legal a:hover { color: #fff; text-decoration: underline; }

/* Slider su telefono: niente frecce sopra le foto, trattini più facili da toccare */
@media (max-width: 767px) {
  .hero-nav { display: none !important; }
  .hero-dot { height: 2.75rem; width: 2.5rem; }
}
/* Contact rosso come il resto del sito */
.site-footer { background: #822433; border-top: 0; }
.site-footer-map-caption { background: #6a1c29; }
.site-footer-btn { color: #822433; }

/* Slider da computer: le frecce compaiono solo passando col mouse sul bordo */
@media (min-width: 1024px) {
  .hero-nav-chip { opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; }
  .hero-nav-btn:hover .hero-nav-chip,
  .hero-nav-btn:focus-visible .hero-nav-chip { opacity: 1; }
}

/* People: tutti i docenti visibili in griglia, niente scorrimento */
.faculty-track.about-lab-track {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  overflow: visible;
  scroll-snap-type: none;
  container-type: normal;
}
.faculty-track.about-lab-track > .faculty-card { flex: none; width: auto; }
@media (min-width: 768px) {
  .faculty-track.about-lab-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .faculty-track.about-lab-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* People su telefono: foto piccola accanto al testo, così le facce stanno vicine */
@media (max-width: 767px) {
  .faculty-track.about-lab-track > .faculty-card { flex-direction: row; min-height: 0; }
  .faculty-track .faculty-card-photo { width: 6.5rem; aspect-ratio: 4 / 5; align-self: flex-start; }
  .faculty-track .faculty-card-body { padding: 0.85rem 0.95rem; }
  .faculty-track .faculty-card-blurb { font-size: 0.86rem; }
}

/* Schede dei docenti: foto più larga, alta quanto la scheda */
.faculty-track .faculty-card-photo { align-self: stretch; aspect-ratio: auto; min-height: 11rem; }
@media (max-width: 767px) {
  .faculty-track .faculty-card-photo { width: 40%; max-width: 10rem; }
}
@media (min-width: 768px) {
  .faculty-track .faculty-card-photo { width: 42%; max-width: 12rem; }
}

/* Schede dei docenti: foto larga metà scheda */
.faculty-track .faculty-card-photo { width: 48% !important; max-width: none !important; min-height: 13rem; }
.faculty-track .faculty-card-photo img { object-position: center 20%; }

/* Schede dei docenti: cornice fissa 4:5 per tutte le foto, non si allunga col testo */
.faculty-track .faculty-card-photo {
  width: 42% !important;
  max-width: 11rem !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 5 !important;
  align-self: flex-start !important;
}
.faculty-track .faculty-card-photo img { object-fit: cover; object-position: center 25%; }

/* —— Slider responsive: titolo e didascalia sulla stessa scala ——
   Tutto cresce con min(larghezza, altezza) dello schermo, così il rapporto
   tra titolo e didascalia resta uguale da telefono a schermo grande. */
.hero-copy .hero-title-wrap {
  font-size: clamp(1.9rem, 1.1rem + 3.4 * min(1vw, 1.6vh), 4.4rem);
  line-height: 1.1;
}
.hero-copy .hero-desc {
  font-size: clamp(1rem, 0.7rem + 0.95 * min(1vw, 1.6vh), 1.5rem);
  line-height: 1.5;
  max-width: 34em;
}
.hero-copy .hero-below {
  max-width: none;
  margin-top: clamp(0.9rem, 2.4vh, 1.75rem);
}
.hero-copy .hero-dots {
  margin-top: clamp(1.25rem, 3.6vh, 2.5rem);
}

/* Telefono in orizzontale e schermi bassi: testo più compatto */
@media (max-height: 520px) {
  .hero-copy .hero-title-wrap { font-size: clamp(1.6rem, 5.5vh + 0.6rem, 2.4rem); }
  .hero-copy .hero-desc { font-size: 0.95rem; }
  .hero--fullscreen .hero-copy { padding-bottom: 2.5rem; }
  .hero-copy .hero-below { margin-top: 0.6rem; }
  .hero-copy .hero-dots { margin-top: 0.9rem; }
}

/* Schermi touch (anche tablet): niente frecce sopra le foto, si scorre col dito */
@media (hover: none) {
  .hero-nav { display: none !important; }
}

/* Nome del lab nell'header sempre su una riga */
.site-brand-name { white-space: nowrap; }
@media (max-width: 380px) {
  .site-brand-name { font-size: 1.3rem; }
}

/* —— iPhone: la home disegna anche sotto la barra dell'ora ——
   (con viewport-fit=cover); l'header si sposta sotto la barra. */
.is-home .site-header-bar { padding-top: env(safe-area-inset-top, 0px); }

/* —— Slider in verticale: la foto scende più in basso, il testo sta sulla sfumatura —— */
@media (max-aspect-ratio: 1/1) {
  .is-home .hero-slide .hero-blend-photo img {
    --img-h: 76cqh;
    --img-w: calc(1.4175 * 76cqh);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
  }
  .is-home .hero--fullscreen .hero-copy { padding-bottom: clamp(3rem, 8vh, 6rem); }
}

/* —— Slider in verticale: scritte più grandi e più in alto —— */
@media (max-aspect-ratio: 1/1) {
  .is-home .hero-slide .hero-blend-photo img {
    --img-h: 64cqh;
    --img-w: calc(1.4175 * 64cqh);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
  }
  .hero-copy .hero-title-wrap { font-size: clamp(2.3rem, 9.6vw, 3.6rem); line-height: 1.08; }
  .hero-copy .hero-desc { font-size: clamp(1.08rem, 4.3vw, 1.4rem); line-height: 1.45; }
  .hero-copy .hero-below { margin-top: 1rem; }
  .hero-copy .hero-dots { margin-top: 1.6rem; }
  .is-home .hero--fullscreen .hero-copy { padding-bottom: clamp(5rem, 17vh, 11rem); }
}

/* —— Slider in verticale: scala dalla critica (titolo ≈1,4 volte il nome nell'header) —— */
@media (max-aspect-ratio: 1/1) {
  .hero-copy .hero-title-wrap { font-size: clamp(1.9rem, 8.4vw, 2.6rem); line-height: 1.1; }
  .hero-copy .hero-title-ghost,
  .hero-copy .hero-typewriter { letter-spacing: -0.01em !important; text-wrap: balance; }
  .hero-copy .hero-desc { font-size: clamp(1rem, 4.1vw, 1.125rem); font-weight: 500; line-height: 1.5; max-width: 34ch; }
  .hero-copy .hero-below { margin-top: 0.75rem; }
  .hero-copy .hero-dots { margin-top: 1.5rem; }
  .is-home .hero--fullscreen .hero-copy { padding-bottom: clamp(6rem, 13vh, 8rem); }
}
@media (max-aspect-ratio: 1/1) and (min-width: 600px) {
  .hero-copy .hero-title-wrap { font-size: clamp(2.6rem, 6vw, 3.4rem); }
  .hero-copy .hero-desc { font-size: 1.2rem; max-width: 36ch; }
  .is-home .hero--fullscreen .hero-copy { padding-bottom: 14vh; }
}

.about-lab-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.about-lab-btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: #822433;
  border: 1px solid #822433;
  text-decoration: none;
}

.about-lab-btn:hover {
  background: #6a1c29;
  border-color: #6a1c29;
}
