/* ============================================================
   SECTIONS — intro, projects, achievements, education,
   teasers, about/contact
   ============================================================ */

/* ===== Intro statement ===== */

.intro {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.intro__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 900px) {
  .intro__grid {
    /* Text on the left, photo on the right. */
    grid-template-columns: 1.1fr 1fr;
  }
}

.intro__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  max-width: 46ch;
}

.intro__name {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: var(--ls-heading);
  font-weight: 500;
}

.intro__text p {
  color: var(--c-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.intro__figure {
  width: 100%;
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}

.intro__figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Intro cards — "What drives me" + stat cards.
   Phone: everything stacked, stats as rows.
   Tablet: drives card full width, stats in three columns (icon on top).
   Desktop: drives card left, stats stacked on the right. */

.intro__cards {
  display: grid;
  gap: var(--sp-3, 1.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.intro__stats {
  display: grid;
  gap: var(--sp-3, 1.5rem);
}

.intro-card {
  background: #fff;
  border-radius: 20px;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  color: #111;
}

.intro-card__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.intro-card__rocket { color: #3b82f6; display: inline-flex; }

.intro-card__list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 1rem;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.intro-stat {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.25rem 1.4rem;
}

.intro-stat__icon {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.intro-stat__icon--amber  { background: #fef3c7; color: #d97706; }
.intro-stat__icon--green  { background: #dcfce7; color: #16a34a; }
.intro-stat__icon--violet { background: #f3e8ff; color: #9333ea; }
.intro-stat__icon--blue   { background: #dbeafe; color: #2563eb; }

.intro-stat__body { display: flex; flex-direction: column; gap: 0.2rem; }
.intro-stat__label { font-size: 0.9rem; }
.intro-stat__value { font-size: 1.15rem; font-weight: 700; line-height: 1.25; }

@media (min-width: 600px) and (max-width: 899px) {
  .intro__stats { grid-template-columns: repeat(3, 1fr); }
  .intro-stat {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }
}

@media (min-width: 900px) {
  .intro__cards { grid-template-columns: 1fr 1.15fr; align-items: stretch; }
}

/* ===== Projects ===== */

.projects__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3rem, 7vw, 6rem) clamp(2rem, 4vw, 3.5rem);
}

@media (min-width: 860px) {
  .projects__list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stagger the second column so the grid reads as a composition
     rather than a row of equal cards. */
  .projects__list > .project:nth-child(even) {
    transform: translateY(clamp(2rem, 7vw, 6rem));
  }
}

.project {
  display: block;
  position: relative;
  /* Grid items default to min-width:auto, which refuses to shrink below
     the nowrap metadata's intrinsic width and forces page-wide overflow
     on narrow screens. */
  min-width: 0;
}

.project__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--c-bg-raised);
  aspect-ratio: 16 / 10;
}

/* Full-width feature projects get a wider crop. */
.project--wide .project__media {
  aspect-ratio: 16 / 9;
}

@media (min-width: 860px) {
  .project--wide {
    grid-column: 1 / -1;
  }

  .projects__list > .project--wide:nth-child(even) {
    transform: none;
  }
}

.project__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 1.1s var(--ease-smooth);
}

.project:hover .project__img,
.project:focus-visible .project__img {
  transform: scale(1.06);
}

/* Description slides up out of the image edge on hover. */
.project__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--sp-4);
  background: linear-gradient(to top, rgba(11, 11, 11, 0.88), rgba(11, 11, 11, 0));
  color: var(--c-warm);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity var(--dur-mid) var(--ease-smooth),
    transform var(--dur-mid) var(--ease-smooth);
}

.project:hover .project__overlay,
.project:focus-visible .project__overlay {
  opacity: 1;
  transform: none;
}

.project__desc {
  font-size: var(--fs-small);
  line-height: 1.5;
  max-width: 44ch;
}

.project__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--sp-2);
}

.project__tool {
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(244, 241, 232, 0.35);
  border-radius: var(--radius-pill);
}

.project__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  /* Title and metadata stack rather than overflow when space runs out. */
  flex-wrap: wrap;
  gap: 0.5rem var(--sp-3);
  margin-top: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--c-line);
  transition: border-color var(--dur-fast) var(--ease-smooth);
}

.project:hover .project__foot {
  border-color: var(--c-line-strong);
}

.project__title {
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: var(--ls-heading);
  min-width: 0;
  overflow-wrap: anywhere;
  transition: transform var(--dur-mid) var(--ease-smooth);
}

.project:hover .project__title {
  transform: translateX(8px);
}

.project__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem var(--sp-2);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--c-muted);
}

.project__arrow {
  transition: transform var(--dur-mid) var(--ease-smooth);
  color: var(--c-dark);
}

.project:hover .project__arrow {
  transform: translate(4px, -4px);
}

/* Touch devices can't hover, and a permanent overlay would sit on top of
   the card's own text — so they get the description below the card. */
.project__summary {
  display: none;
}

@media (hover: none) {
  .project__overlay {
    display: none;
  }

  .project__summary {
    display: block;
    margin-top: var(--sp-2);
  }

  .project__summary .project__desc {
    max-width: none;
    color: var(--c-dark);
    opacity: 0.8;
  }

  .project__summary .project__tool {
    border-color: var(--c-line-strong);
    color: var(--c-dark);
  }
}

/* ===== Achievements carousel ===== */

.ach {
  background: var(--c-bg-pale);
  overflow: hidden;
}

.ach__viewport {
  position: relative;
  overflow: hidden;
  padding-block: clamp(1rem, 3vw, 2.5rem);
  cursor: grab;
}

.ach__viewport.is-dragging {
  cursor: grabbing;
}

.ach__track {
  display: flex;
  align-items: center;
  /* Scaling the inactive cards already opens up most of the spacing,
     so the layout gap stays small. */
  gap: clamp(0.25rem, 0.8vw, 0.6rem);
  /* Matches the shell gutter so the first card lines up with the
     section heading when the track is at its starting position. */
  padding-inline: var(--gutter);
  transition: transform 0.7s var(--ease-expressive);
  will-change: transform;
  touch-action: pan-y;
}

.ach__viewport.is-dragging .ach__track {
  transition: none;
}

/* Every card shares one layout width and is sized purely with `transform`.
   Animating `width` instead would relayout the whole track on every frame
   of every transition, which is what made scrolling stutter — and it would
   also shift the drag maths mid-gesture. Transform and opacity are
   composited, so the carousel costs the main thread nothing. */
.ach__card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(240px, 32vw, 380px);
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-bg-raised);
  box-shadow: var(--shadow-card);
  transform: scale(0.82);
  opacity: 0.6;
  will-change: transform, opacity;
  transition:
    transform 0.7s var(--ease-expressive),
    opacity 0.7s var(--ease-expressive),
    box-shadow 0.7s var(--ease-expressive);
}

.ach__card:hover:not(.is-active) {
  opacity: 0.8;
  transform: scale(0.85);
}

.ach__card.is-active {
  transform: scale(1);
  opacity: 1;
  box-shadow: var(--shadow-lift);
}

/* While dragging, cards track the cursor 1:1 — easing here would lag
   the gesture and feel rubbery. */
.ach__viewport.is-dragging .ach__card {
  transition: none;
}

/* Applied for a single frame while the loop rebases onto an identical
   copy. Without it the emphasis and the dark panel would re-animate from
   scratch on the newly active node, turning an invisible correction into
   a visible flicker. */
.ach__viewport.is-instant .ach__card,
.ach__viewport.is-instant .ach__info {
  transition: none !important;
}

.ach__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Whole-card button so any card can be activated by click or keyboard. */
.ach__hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.ach__card.is-active .ach__hit,
.ach__card.is-active .ach__info {
  cursor: pointer;
}

/* Dark information panel — only present on the active card. */
.ach__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: clamp(1.1rem, 2.2vw, 1.75rem);
  background: var(--c-deep);
  color: var(--c-warm);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-2);
  transform: translateY(101%);
  opacity: 0;
  transition:
    transform 0.7s var(--ease-expressive),
    opacity 0.45s var(--ease-smooth);
}

.ach__card.is-active .ach__info {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.12s;
}

.ach__info-text {
  min-width: 0;
}

.ach__meta {
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--c-on-dark-muted);
  margin-bottom: 0.55rem;
  /* Long organisation names truncate rather than pushing the card taller. */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ach__title {
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.ach__desc {
  margin-top: 0.5rem;
  font-size: var(--fs-small);
  line-height: 1.45;
  color: rgba(244, 241, 232, 0.72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ach__plus {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-deep);
  transition:
    transform var(--dur-fast) var(--ease-smooth),
    background var(--dur-fast) var(--ease-smooth);
}

.ach__plus:hover {
  transform: rotate(90deg) scale(1.06);
}

.ach__plus[aria-disabled='true'] {
  background: rgba(244, 241, 232, 0.18);
  color: rgba(244, 241, 232, 0.5);
  cursor: not-allowed;
}

.ach__plus[aria-disabled='true']:hover {
  transform: none;
}

.ach__controls {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.ach__counter {
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  color: var(--c-muted);
  margin-left: auto;
}

.ach__counter strong {
  color: var(--c-dark);
  font-weight: 500;
}

/* Progress bar doubles as an at-a-glance position indicator. */
.ach__progress {
  position: relative;
  flex: 1;
  max-width: 260px;
  height: 2px;
  background: var(--c-line);
  margin-inline: var(--sp-2);
  overflow: hidden;
}

.ach__progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--c-dark);
  transition: width 0.6s var(--ease-expressive);
}

/* ===== Education ===== */

.edu__list {
  border-top: 1px solid var(--c-line);
}

.edu__item {
  border-bottom: 1px solid var(--c-line);
}

.edu__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-2) var(--sp-4);
  align-items: center;
  width: 100%;
  text-align: left;
  padding-block: clamp(1.5rem, 3.5vw, 2.5rem);
  transition: padding-inline var(--dur-mid) var(--ease-smooth);
}

@media (min-width: 860px) {
  .edu__row {
    grid-template-columns: 10rem 1fr 16rem auto;
  }

  .edu__item:hover .edu__row {
    padding-inline: var(--sp-2);
  }
}

.edu__years {
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  font-weight: 500;
  letter-spacing: var(--ls-heading);
  color: var(--c-dark);
  font-variant-numeric: tabular-nums;
  grid-column: 1 / -1;
}

@media (min-width: 860px) {
  .edu__years {
    grid-column: auto;
  }
}

.edu__main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.edu__institution {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: var(--ls-heading);
  transition: transform var(--dur-mid) var(--ease-smooth);
}

.edu__item:hover .edu__institution {
  transform: translateX(6px);
}

.edu__degree {
  font-size: var(--fs-small);
  color: var(--c-muted);
}

.edu__field {
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--c-muted);
}

.edu__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--c-line-strong);
  transition:
    background var(--dur-fast) var(--ease-smooth),
    color var(--dur-fast) var(--ease-smooth),
    transform var(--dur-fast) var(--ease-smooth);
}

.edu__item:hover .edu__toggle {
  background: var(--c-dark);
  color: var(--c-warm);
  border-color: var(--c-dark);
}

.edu__row[aria-expanded='true'] .edu__toggle {
  transform: rotate(45deg);
  background: var(--c-dark);
  color: var(--c-warm);
  border-color: var(--c-dark);
}

/* Collapsible detail uses a grid-rows trick so it animates
   smoothly without hard-coding a height. */
.edu__detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-mid) var(--ease-expressive);
}

.edu__detail.is-open {
  grid-template-rows: 1fr;
}

.edu__detail-inner {
  overflow: hidden;
}

.edu__detail-body {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
  padding-bottom: clamp(1.5rem, 3.5vw, 2.5rem);
}

@media (min-width: 860px) {
  .edu__detail-body {
    grid-template-columns: 10rem 1fr 16rem;
    gap: var(--sp-4);
  }

  .edu__detail-body > :first-child {
    grid-column: 2;
  }
}

.edu__detail-body p {
  color: var(--c-muted);
  max-width: 60ch;
}

.edu__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--sp-2);
}

.edu__tag {
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-pill);
  color: var(--c-muted);
}

/* ===== News & features ===== */

/* Compact tiles: photo, tag and title. Tapping opens the viewer below,
   which carries the full description. */
.news {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

@media (min-width: 900px) {
  .news {
    grid-template-columns: repeat(4, 1fr);
  }
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 1 / 1;
  padding: clamp(0.75rem, 1.6vw, 1.1rem);
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-bg-raised);
  color: var(--c-warm);
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}

.news-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(11, 11, 11, 0.8) 0%, rgba(11, 11, 11, 0.15) 55%, rgba(11, 11, 11, 0) 100%);
}

.news-card__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.3s var(--ease-smooth);
}

.news-card:hover .news-card__img,
.news-card:focus-visible .news-card__img {
  transform: scale(1.08);
}

.news-card:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

.news-card__tag {
  position: absolute;
  top: clamp(0.6rem, 1.4vw, 0.9rem);
  left: clamp(0.6rem, 1.4vw, 0.9rem);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(17, 17, 17, 0.6);
  font-size: 0.65rem;
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.news-card__title {
  font-size: clamp(0.875rem, 1.3vw, 1.05rem);
  font-weight: 500;
  line-height: 1.25;
}

/* ----- Viewer ----- */

html.is-locked {
  overflow: hidden;
}

.news-viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: clamp(3.5rem, 6vw, 4.5rem) clamp(0.75rem, 4vw, 4rem) clamp(1rem, 3vw, 2rem);
  border: 0;
  background: rgba(11, 11, 11, 0.94);
  color: var(--c-warm);
  overflow-y: auto;
}

.news-viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  animation: fadeUpSoft 0.35s var(--ease-smooth);
}

.news-viewer::backdrop {
  background: transparent;
}

.news-viewer__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  max-width: 1000px;
  margin: 0;
}

.news-viewer__img {
  max-width: 100%;
  max-height: 66dvh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.news-viewer__text {
  width: 100%;
  max-width: 62ch;
  text-align: center;
}

.news-viewer__tag,
.news-viewer__count {
  display: block;
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--c-on-dark-muted);
}

.news-viewer__title {
  margin-top: 0.5rem;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
}

.news-viewer__caption {
  margin-top: 0.6rem;
  color: rgba(244, 241, 232, 0.8);
  line-height: 1.6;
}

.news-viewer__count {
  margin-top: var(--sp-2);
}

.news-viewer__close,
.news-viewer__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(244, 241, 232, 0.25);
  border-radius: var(--radius-pill);
  background: rgba(244, 241, 232, 0.08);
  color: var(--c-warm);
  cursor: pointer;
  transition: background var(--dur-mid) var(--ease-smooth);
}

.news-viewer__close:hover,
.news-viewer__nav:hover {
  background: rgba(244, 241, 232, 0.2);
}

.news-viewer__close {
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.25rem);
  right: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 1;
}

.news-viewer__close svg {
  transform: rotate(45deg);
}

/* On phones the arrows sit at the bottom corners so the photo gets the
   full width; swiping also works. */
@media (max-width: 699px) {
  .news-viewer {
    padding-bottom: 5rem;
  }

  .news-viewer__nav {
    position: fixed;
    bottom: 1rem;
    z-index: 1;
  }

  .news-viewer__nav--prev { left: 1rem; }
  .news-viewer__nav--next { right: 1rem; }
}

/* ===== Photography teaser ===== */

.teasers {
  display: grid;
  grid-template-columns: 1fr;
}

.teaser {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(380px, 56vw, 620px);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--c-warm);
  isolation: isolate;
}

.teaser__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.3s var(--ease-smooth);
}

.teaser:hover .teaser__img,
.teaser:focus-visible .teaser__img {
  transform: scale(1.08);
}

.teaser::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(11, 11, 11, 0.82) 0%, rgba(11, 11, 11, 0.25) 50%, rgba(11, 11, 11, 0.08) 100%);
}

.teaser__eyebrow {
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: rgba(244, 241, 232, 0.75);
  margin-bottom: var(--sp-2);
}

.teaser__title {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: var(--ls-display);
}

.teaser__lead {
  margin-top: var(--sp-2);
  max-width: 34ch;
  color: rgba(244, 241, 232, 0.8);
  font-size: var(--fs-small);
}

.teaser__action {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: var(--sp-3);
  font-size: var(--fs-small);
  font-weight: 500;
}

.teaser__action svg {
  transition: transform var(--dur-mid) var(--ease-smooth);
}

.teaser:hover .teaser__action svg {
  transform: translate(5px, -5px);
}

.teaser__count {
  position: absolute;
  top: clamp(1.5rem, 3vw, 2.5rem);
  right: clamp(1.5rem, 3vw, 2.5rem);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  color: rgba(244, 241, 232, 0.75);
}

/* ===== About / contact ===== */

.about__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 48ch;
  color: rgba(244, 241, 232, 0.78);
}

.about__body p {
  font-size: 1.0625rem;
}

.about__headline {
  font-size: clamp(1.75rem, 3vw, 2.625rem);
  line-height: 1.1;
  letter-spacing: var(--ls-heading);
  font-weight: 500;
  max-width: 16ch;
}

/* The footer follows on the same dark background, so the full section
   padding on both sides would leave one oversized empty band. */
#about {
  padding-block: clamp(4rem, 8vw, 7rem) clamp(2rem, 4vw, 3.5rem);
}

.about__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
  margin-top: clamp(2rem, 5vw, 3rem);
}

.about__resume {
  color: var(--c-warm);
}

/* ===== Text cards in context ===== */

/* Award carousel: keep the text at the top, clear of the info panel
   that slides up over the active card. */
.ach__card .text-card {
  justify-content: flex-start;
}

/* News tiles without a photo: description at the top, title at the
   bottom as on photo tiles. */
.news-card--text .text-card {
  justify-content: flex-start;
  padding-top: 2.8rem;
}

.news-card--text .text-card__title {
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.4;
  letter-spacing: normal;
  opacity: 0.85;
}

.news-card--text .text-card::before,
.news-card--text .text-card::after {
  display: none;
}

/* Project cards: keep the text at the top — on touch screens the
   description overlay sits permanently over the bottom of the card. */
.project__media .text-card {
  justify-content: flex-start;
}

/* ===== Publications ===== */

.pubs {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.pub-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-bg-raised);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-mid) var(--ease-smooth), box-shadow var(--dur-mid) var(--ease-smooth);
}

@media (min-width: 760px) {
  .pub-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

.pub-card:hover,
.pub-card:focus-visible {
  border-color: var(--c-line-strong);
  box-shadow: var(--shadow-card);
}

.pub-card:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

.pub-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
}

.pub-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.1s var(--ease-smooth);
}

.pub-card:hover .pub-card__img,
.pub-card:focus-visible .pub-card__img {
  transform: scale(1.04);
}

.pub-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-2);
  padding: clamp(1.25rem, 3vw, 2.5rem);
}

.pub-card__title {
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: var(--ls-heading);
}

.pub-card__authors {
  color: var(--c-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.pub-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: var(--sp-1);
  font-size: var(--fs-small);
  font-weight: 500;
}

.pub-card__action svg {
  transition: transform var(--dur-mid) var(--ease-smooth);
}

.pub-card:hover .pub-card__action svg {
  transform: translate(4px, -4px);
}

/* ----- Summary panel ----- */

.pub-viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: clamp(3.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3rem);
  border: 0;
  /* Solid, so the download scene (same colour) sits in it seamlessly. */
  background: var(--c-deep);
  color: var(--c-warm);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pub-viewer[open] {
  animation: fadeUpSoft 0.35s var(--ease-smooth);
}

.pub-viewer::backdrop {
  background: transparent;
}

.pub-viewer__inner {
  max-width: 720px;
  margin: 0 auto;
}

.pub-viewer__eyebrow {
  display: block;
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--c-on-dark-muted);
}

.pub-viewer__title {
  margin-top: 0.6rem;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: var(--ls-heading);
}

.pub-viewer__authors {
  margin-top: var(--sp-2);
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.6;
}

.pub-viewer__heading {
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 500;
}

.pub-viewer__summary p {
  color: rgba(244, 241, 232, 0.85);
  line-height: 1.7;
}

.pub-viewer__summary p + p {
  margin-top: var(--sp-2);
}

.pub-viewer__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--sp-3) 0 0;
  padding: 0;
  list-style: none;
}

.pub-viewer__tags li {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(244, 241, 232, 0.3);
  border-radius: var(--radius-pill);
  font-size: var(--fs-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pub-viewer__page {
  margin: var(--sp-5) 0 0;
}

.pub-viewer__page img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  background: #fff;
}

.pub-viewer__page figcaption {
  margin-top: 0.6rem;
  font-size: var(--fs-meta);
  color: var(--c-on-dark-muted);
}

/* The download scene is 400px wide; its artwork starts 34.375% in and
   ~12% down, so pull it up and left until the button lines up with the
   text column. The cropped area is empty and the same colour as the panel. */
.pub-viewer__stage {
  width: 400px;
  margin: calc(var(--sp-4) - 28px) 0 0 -137.5px;
}

.pub-viewer__frame {
  display: block;
  width: 400px;
  height: 237.5px;
  border: 0;
}
