/* Joaquin Palacios — portfolio */
:root {
  --bg: #eef1f4;
  --bg-deep: #e4e9ef;
  --surface: #f7f8fa;
  --ink: #152028;
  --ink-soft: #3d4a55;
  --muted: #5c6b78;
  --line: rgba(21, 32, 40, 0.12);
  --accent: #0f6e6a;
  --accent-2: #c45c26;
  --accent-soft: rgba(15, 110, 106, 0.12);
  --shadow: 0 18px 40px rgba(21, 32, 40, 0.08);
  --radius: 4px;
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --max: 1120px;

  /* —— Top menu bar (tune these) ——
     Try: compact  --nav-h: 4rem;  --nav-brand-size: 1.2rem;  --nav-link-size: 1rem;
          current  values below
          large    --nav-h: 6rem;  --nav-brand-size: 1.75rem; --nav-link-size: 1.2rem;
  */
  --nav-h: 7.5rem;               /* bar min-height */
  --nav-pad-y: 1.75rem;          /* vertical padding inside bar */
  --nav-pad-x: 1.75rem;          /* horizontal padding */
  --nav-brand-size: 2.1rem;      /* “Joaquin Palacios” size */
  --nav-link-size: 1.35rem;      /* Publications / Research / Portfolio */
  --nav-link-gap: 2.25rem;       /* space between nav items */
  --nav-submenu-min: 17rem;      /* dropdown width */

  /* —— Hero portrait crop (tune these) ——
     Photo height matches the text column on desktop.
     object-position y = 50% crops equally from top & bottom.
       lower % (e.g. 40%) → show more of the top
       higher % (e.g. 60%) → show more of the bottom
     zoom > 1 crops in tighter (more equal top/bottom trim).
  */
  --hero-photo-focus-y: 50%;     /* vertical focus / crop balance */
  --hero-photo-focus-x: 50%;     /* horizontal focus */
  --hero-photo-zoom: 1;          /* 1 = fit cover; try 1.08–1.2 for tighter crop */
  --hero-photo-col: 0.85fr;      /* width of photo column vs text (1.15fr) */

  /* —— All Projects grid (tune these) ——
     Original site: 3 columns, large images above centered captions.
  */
  --project-cols: 3;
  --project-gap: 1.75rem;
  --project-img-ratio: 1 / 1;    /* fixed image box so text lines up across a row */
  --project-title-size: 1.2rem;
  --project-body-size: 1rem;

  /* —— Highlights carousel —— */
  --feature-img-max-h: 300px;  /* keep square renders close to the 16:9 DITTO video's height */
  --feature-pad: 1.75rem;
  --feature-slide-w: min(780px, 64vw); /* active slide width; narrower = more of each neighbor peeks in */
  --feature-peek-opacity: 0.5;
  --feature-peek-scale: 0.92;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 55% at 8% -10%, rgba(15, 110, 106, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(196, 92, 38, 0.1), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(238, 241, 244, 0.86);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--nav-pad-y) var(--nav-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: var(--nav-h);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--nav-brand-size);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}

.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.4rem var(--nav-link-gap);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--nav-link-size);
  font-weight: 500;
}

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

/* Research / Portfolio: the label links to the overview; hovering (or keyboard focus) reveals the projects. */
.nav .has-menu {
  position: relative;
}

.nav .nav-top::after {
  content: " ▾";
  font-size: 0.75em;
}

.nav .has-menu:hover > .nav-top,
.nav .has-menu:focus-within > .nav-top {
  color: var(--accent);
}

/* Invisible bridge so the pointer can travel from the label to the dropdown without it closing. */
.nav .has-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.75rem;
}

.nav .submenu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: var(--nav-submenu-min);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0.55rem;
  display: grid;
  gap: 0.15rem;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

.nav .has-menu:hover > .submenu,
.nav .has-menu:focus-within > .submenu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.nav .submenu a {
  font-size: calc(var(--nav-link-size) * 0.95);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
}

.nav .submenu a:hover {
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

main {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, var(--hero-photo-col));
  gap: 2.5rem;
  align-items: stretch; /* photo column matches text column height */
  padding: 1.5rem 0 3rem;
}

.hero-copy .eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1rem;
  font-weight: 800;
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 0 0 1.25rem;
}

.hero .lede strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  color: #f4f7f8;
}

.btn-primary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Square logo buttons (LinkedIn, Email) sized to match the text buttons */
.btn-icon {
  padding: 0.7rem;
}

.btn-icon svg {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
}

.hero-media {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-photo-focus-x) var(--hero-photo-focus-y);
  transform: scale(var(--hero-photo-zoom));
  transform-origin: var(--hero-photo-focus-x) var(--hero-photo-focus-y);
  filter: saturate(0.92) contrast(1.04);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: auto -8% -6% 35%;
  height: 28%;
  background: linear-gradient(120deg, var(--accent-soft), rgba(196, 92, 38, 0.18));
  z-index: -1;
  border-radius: 999px;
  filter: blur(18px);
}

.section {
  padding: 2.75rem 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 0;
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: none; /* full content width; set e.g. 36rem to constrain */
}

/* Featured Highlights carousel — full-bleed white + peek neighbors */
.section-highlights {
  padding-bottom: 0;
}

.feature-carousel-bleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.75rem 0 2.25rem;
}

.feature-carousel {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
}

.feature-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.feature-track {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-slide {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex: 0 0 var(--feature-slide-w);
  width: var(--feature-slide-w);
  box-sizing: border-box;
  padding: 0.5rem 1.25rem;
  opacity: var(--feature-peek-opacity);
  transform: scale(var(--feature-peek-scale));
  transform-origin: center center;
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
  filter: saturate(0.85);
  pointer-events: none;
}

.feature-slide.is-active {
  opacity: 1;
  transform: scale(1);
  filter: none;
  pointer-events: auto;
  animation: none;
}

.feature-slide.is-prev,
.feature-slide.is-next {
  pointer-events: auto;
  cursor: pointer;
}

.feature-slide.is-prev:hover,
.feature-slide.is-next:hover {
  opacity: 0.8;
}

.feature-slide img,
.feature-slide .thumb-video {
  width: 100%;
  max-height: var(--feature-img-max-h);
  object-fit: contain;
  background: #fff;
}

.feature-slide .thumb-video {
  display: block;
}

.feature-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

.feature-slide:hover .feature-copy h3 {
  color: var(--ink);
}

.feature-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.1rem;
  line-height: 1.55;
}

.feature-copy p strong {
  color: var(--ink);
  font-weight: 650;
}

.feature-copy .feature-link {
  display: inline-block;
  margin-top: 1.1rem;
  color: var(--accent);
  font-weight: 600;
}

.feature-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.35rem auto 0;
  max-width: var(--max);
  padding: 0 1.25rem;
}

/* Round arrows sitting on the edges of the active slide */
.feature-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(21, 32, 40, 0.12);
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 0.25s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-arrow svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(15, 110, 106, 0.18);
}

.feature-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.feature-arrow-prev {
  left: max(0.5rem, calc(50% - var(--feature-slide-w) / 2 - 1.5rem));
}

.feature-arrow-next {
  right: max(0.5rem, calc(50% - var(--feature-slide-w) / 2 - 1.5rem));
}

.feature-arrow.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.feature-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.feature-dots button {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(21, 32, 40, 0.25);
  cursor: pointer;
}

.feature-dots button.is-active {
  background: var(--accent);
  width: 1.35rem;
}

/* All Projects grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(var(--project-cols), minmax(0, 1fr));
  gap: var(--project-gap);
  align-items: stretch;
  background: #fff;
  padding: 1.75rem 1.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.project-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
  transition: transform 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  color: inherit;
}

.project-media {
  aspect-ratio: var(--project-img-ratio);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.project-media img,
.project-media .thumb-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.project-media .thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card h3 {
  font-family: var(--font-display);
  font-size: var(--project-title-size);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--accent);
  min-height: 1.35em; /* keep titles aligned across the row */
}

.project-card:hover h3 {
  color: var(--ink);
}

.project-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--project-body-size);
  line-height: 1.5;
}

.project-card p strong {
  color: var(--ink);
  font-weight: 650;
}

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

.teaser {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.teaser:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: inherit;
}

.teaser-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-deep);
}

.teaser-body {
  padding: 1.1rem 1.15rem 1.25rem;
}

.teaser h3 {
  font-family: var(--font-display);
  margin: 0 0 0.4rem;
}

.teaser p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.teaser span {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.page-hero {
  padding: 1rem 0 2rem;
}

.page-hero .crumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.page-hero .crumb a {
  color: var(--muted);
  text-decoration: none;
}

.page-hero .crumb a:hover {
  color: var(--accent);
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.1;
}

.page-hero .tagline {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0;
}

/* Project pages: hero media, intro + details, then interleaved sections */
.pp-hero {
  max-width: 1000px;
  margin: 0.5rem auto 2.75rem;
}

.pp-hero img,
.pp-hero video,
.pp-embed {
  display: block;
  width: 100%;
  border-radius: var(--radius);
}

.pp-hero img {
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

.pp-hero video {
  height: auto;
  max-height: 620px;
  background: #000;
}

.pp-embed {
  aspect-ratio: 16 / 9;
  border: 0;
  background: #000;
}

.pp-intro {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 5rem;
  max-width: 1000px;
  margin: 0 auto 1rem;
}

.pp-intro.no-meta {
  grid-template-columns: minmax(0, 48rem);
  max-width: 1100px;
}

.pp-lead {
  margin: 0 0 1.25rem;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
}

/* "Description:" and the side-column labels match joaquinpalacios.com: muted, normal case, with a colon */
.pp-label,
.pp-meta dt {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

.pp-intro-copy p:not(.pp-lead):not(.pp-label) {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* Side column of project details */
.pp-meta {
  display: grid;
  align-content: start;
  gap: 1.6rem;
  margin: 0.2rem 0 0;
}

.pp-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.pp-meta dd > span:not(.pp-name) {
  display: block;
}

.pp-meta dd > span + span:not(.pp-name) {
  margin-top: 0.35rem;
}

.pp-name {
  white-space: nowrap;
}

.pp-section {
  max-width: 1100px;
  margin: 4rem auto 0;
  display: grid;
  gap: 1.75rem;
}

.pp-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pp-h2.pp-h3 {
  font-size: clamp(1.3rem, 2vw, 1.55rem);
}

.pp-h2.center {
  text-align: center;
}

.pp-text > p,
.pp-text li {
  color: var(--ink-soft);
  line-height: 1.7;
}

.pp-text > p {
  margin: 0 0 0.85rem;
}

.pp-text .pp-h2 {
  margin-bottom: 0.9rem;
}

.pp-text ul {
  margin: 0;
  padding-left: 1.2rem;
}

.pp-text.center {
  max-width: 44rem;
  margin: -0.75rem auto 0;
  text-align: center;
}

.pp-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.pp-split.media-left .pp-split-media {
  order: -1;
}

.pp-fig {
  margin: 0;
  width: 100%;
}

.pp-fig img,
.pp-fig video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.pp-fig video {
  background: #000;
}

.pp-fig figcaption {
  margin-top: 0.7rem;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.pp-medium {
  max-width: 760px;
  margin-inline: auto;
}

.pp-narrow {
  max-width: 560px;
  margin-inline: auto;
}

.pp-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  gap: 1.75rem;
  align-items: start;
}

.pp-grid-2-1 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: end;
}

.pp-stack {
  display: grid;
  gap: 1.75rem;
}

@media (max-width: 760px) {
  .pp-intro,
  .pp-split,
  .pp-grid,
  .pp-grid-2-1 {
    grid-template-columns: 1fr;
  }

  .pp-intro {
    gap: 2.25rem;
  }

  .pp-split.media-left .pp-split-media {
    order: 0;
  }

  .pp-section {
    margin-top: 3rem;
  }
}

/* Overview pages (Research, Portfolio) */
/* Years stand out as a teal pill above each title */
.overview-year {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.research-media {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.research-media img,
.research-media video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
  transition: transform 0.4s ease;
}

/* Transparent renders sit directly on the page instead of a white panel. */
.research-media.bare,
.research-media.bare img {
  background: transparent;
  border-color: transparent;
}

/* Videos fill the frame instead of letterboxing. */
.research-media video {
  object-fit: cover;
}

.research-media:hover img {
  transform: scale(1.03);
}

.research-copy h2 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

.research-copy h2 a {
  color: var(--ink);
  text-decoration: none;
}

.research-copy h2 a:hover {
  color: var(--accent);
}

.research-copy p {
  margin: 0 0 0.6rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.research-copy p strong {
  color: var(--ink);
  font-weight: 650;
}

/* Research: two-column cards */
.research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 2.5rem;
  padding: 1rem 0 2rem;
}

.research-media {
  margin-bottom: 1.1rem;
}

.research-copy h2 {
  font-size: 1.5rem;
}

@media (max-width: 760px) {
  .research-grid {
    grid-template-columns: 1fr;
  }
}

.pub-list {
  max-width: 960px;
}

.section-publications {
  scroll-margin-top: var(--nav-h);
}

.pub {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem 1.75rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

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

.pub-thumb {
  position: relative;
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* Thumbnails keep their native aspect ratio; the figure shrinks to fit, so no letterboxing. */
.pub-thumb img,
.pub-thumb video {
  width: 100%;
  height: auto;
  display: block;
}

.pub-thumb--padded {
  padding: 0.75rem 0;
}

.pub-thumb-hover {
  position: absolute;
  inset: 0;
  height: 100% !important;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pub:hover .pub-thumb-hover {
  opacity: 1;
}

.pub-body {
  min-width: 0;
  line-height: 1.5;
}

.pub-body p {
  margin: 0;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.pub .authors {
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.pub .authors strong {
  color: var(--ink);
  font-weight: 650;
}

.pub .authors a {
  color: inherit;
}

.pub-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.pub .venue {
  font-style: italic;
  font-size: 0.93rem;
  margin-top: 0.15rem;
}

.pub-links {
  margin-top: 0.3rem !important;
  font-size: 0.93rem;
  font-weight: 550;
}

.pub-links span {
  color: var(--muted);
  margin: 0 0.3rem;
}

@media (max-width: 640px) {
  .pub {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

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

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 2rem 1.25rem 2.5rem;
  background: rgba(247, 248, 250, 0.65);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center; /* vertically align left links with right credit */
  gap: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.footer-inner > div,
.footer-inner > p {
  margin: 0;
  display: flex;
  align-items: center;
  min-height: 1.4em;
}

.footer-inner a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-right: 1rem;
}

.footer-inner a:last-child {
  margin-right: 0;
}

.footer-inner a:hover {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.hero-copy,
.hero-media {
  animation: rise 0.9s ease both;
}

.hero-media {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1.75rem;
  }

  .hero-media {
    order: -1;
    max-width: 320px;
    aspect-ratio: 1;
    align-self: start;
  }

  .hero-media img {
    height: 100%;
  }

  .feature-carousel {
    --feature-slide-w: min(920px, 78vw);
  }

  .feature-slide {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: center;
  }

  .feature-slide img,
  .feature-slide .thumb-video {
    max-height: 220px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-media {
    max-width: min(100%, 360px);
    margin: 0 auto;
    width: 100%;
  }

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

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.75rem;
  }

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

  .nav-wrap {
    flex-wrap: wrap;
  }

  /* Phone: the opened menu lists every project, indented under its section. */
  .nav .nav-top::after,
  .nav .has-menu::after {
    content: none;
  }

  .nav .submenu {
    position: static;
    min-width: 0;
    margin: 0.2rem 0 0.4rem;
    padding: 0 0 0 1rem;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--line);
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .nav .submenu a {
    padding: 0.35rem 0.5rem;
    font-size: calc(var(--nav-link-size) * 0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
