/* ==========================================================================
   Talents (Figma: Talent 6251:4134 → scroll → profiles 6253:7086, hover 6263:16801)
   ========================================================================== */

/* ---------- hero (Figma: Talent / Main) ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: max(100svh, 720px);
  padding: var(--padding-sm) var(--padding-md) var(--padding-md);
  overflow: clip;
  background: var(--surface-primary-lowest);
  color: var(--surface-primary-on-primary);
}
.page-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35; /* Figma 20 % — lighter, same as the Home intro */
}
.page-hero__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  width: 100%;
  max-width: var(--content-width);
  padding-top: clamp(140px, 18vh, var(--padding-xl));
}
.page-hero__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-xs);
  max-width: 850px;
  text-align: center;
}
.page-hero__title {
  font-size: var(--font-heading-h2);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  white-space: pre;
}
.page-hero__subtitle { font-size: var(--font-body-md); }

/* category cards (Figma: talent / type=… ) 320 × 259 → hover 370 × 300 */
.talent-cats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.talent-cat {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: 0 1 320px;
  aspect-ratio: 320 / 259;
  overflow: hidden;
  cursor: default;
  transition: transform var(--smart-animate);
}
.talent-cat__photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--smart-animate);
}
.talent-cat__label {
  font-size: var(--font-heading-h6);
  font-weight: var(--font-weight-bold);
  color: var(--surface-primary-highlight-orange);
  transition: opacity var(--smart-animate);
}
.talent-cat--photo .talent-cat__photo { opacity: 1; }
.talent-cat:hover,
.talent-cat:focus-visible { transform: scale(1.156); z-index: 1; }
.talent-cat:hover .talent-cat__photo,
.talent-cat:focus-visible .talent-cat__photo { opacity: 1; }
.talent-cat:hover .talent-cat__label,
.talent-cat:focus-visible .talent-cat__label { opacity: 0; }

/* ---------- profiles (Figma: Talent / profiles) ---------- */
.profiles {
  padding: var(--padding-xl) var(--padding-lg) var(--padding-md);
  background: var(--surface-secondary-high);
}
.profiles__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 320px));
  justify-content: center;
  gap: var(--gap-lg) var(--gap-sm);
}
/* last row (3 cards) centred like Figma */
.profiles__grid > :nth-child(17) { grid-column: 1; transform: translateX(calc(50% + 16px)); }
.profiles__grid > :nth-child(18) { grid-column: 2; transform: translateX(calc(50% + 16px)); }
.profiles__grid > :nth-child(19) { grid-column: 3; transform: translateX(calc(50% + 16px)); }

.profile {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  aspect-ratio: 320 / 393.5;
  padding: var(--padding-sm) var(--padding-xs);
  overflow: clip;
  background: var(--surface-primary-high);
  color: var(--surface-primary-on-primary);
}
.profile__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0); /* colour by default; black & white on hover (Figma: saturation −100) */
  transition: filter var(--smart-animate);
}
.profile:hover .profile__photo,
.profile:focus-within .profile__photo { filter: grayscale(1); }
.profile::after { /* no blue gradient (Figma had one); a neutral veil only on hover, for the bio */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0);
  transition: background-color var(--smart-animate);
}
.profile--no-photo { background: var(--surface-primary-high); }
/* name and role stay readable on any photo without a gradient */
.profile__title { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 0 12px rgba(0, 0, 0, 0.35); }

.profile__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 13.84px;
}
.profile__bio {
  display: none;
  flex-direction: column;
  gap: 6.92px;
}
.profile__bio-title { font-size: var(--font-body-sm); font-weight: var(--font-weight-bold); }
.profile__bio-text { font-size: var(--font-body-2xs); }
.profile__title { display: flex; flex-direction: column; gap: 6.92px; }
.profile__name-row { display: flex; align-items: center; gap: 13.84px; }
.profile__name { font-size: var(--font-body-sm); font-weight: var(--font-weight-bold); }
.profile__linkedin { display: inline-flex; color: var(--surface-primary-on-primary); transition: color var(--transition-fast); }
.profile__linkedin:hover { color: var(--surface-primary-highlight-blue); }
.profile__linkedin .icon { width: 20.76px; height: 20.76px; }
.profile__role { font-size: var(--font-label-sm); }

/* hover (Figma: Property 1=hover) */
.profile:hover .profile__content,
.profile:focus-within .profile__content,
.profile--no-photo .profile__content { justify-content: space-between; }
.profile:hover .profile__bio,
.profile:focus-within .profile__bio,
.profile--no-photo .profile__bio { display: flex; animation: profile-in var(--smart-animate); }
.profile:hover::after,
.profile:focus-within::after { background-color: rgba(0, 0, 0, 0.6); }
@keyframes profile-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .profiles { padding-inline: var(--padding-md); }
}
@media (max-width: 1200px) {
  .profiles__grid { grid-template-columns: repeat(3, minmax(0, 320px)); }
  .profiles__grid > :nth-child(n) { grid-column: auto; transform: none; }
}
@media (max-width: 1100px) {
  .page-hero__title { white-space: normal; }
  .talent-cats { flex-wrap: wrap; justify-content: center; gap: var(--gap-xs); }
  .talent-cat { flex-basis: calc(33.33% - 12px); }
}
/* hero people repeated in the list: only on small screens (no horizontal scroll) */
.profile--hero-dup { display: none; }
@media (max-width: 760px) {
  .profile--hero-dup { display: flex; }
  .profiles { padding: var(--padding-lg) var(--padding-xs); }
  .profiles__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-xs); }
  .profile { aspect-ratio: auto; min-height: 300px; }
  .profile__bio-text { font-size: 13px; }
  .talent-cat { flex-basis: calc(50% - 8px); }
  .talent-cat--photo { display: none; }
}
@media (max-width: 480px) {
  .profiles__grid { grid-template-columns: 1fr; }
  .profile { aspect-ratio: 320 / 393.5; }
}

/* ==========================================================================
   Horizontal scroll (desktop / tablet ≥ 761 px)
   The stage is as tall as the track is wide; its sticky child stays in view
   while js/pages.js turns the vertical scroll into a sideways translate.
   Panel 1: hero (dark) · Panel 2: the other talents (light, current bg).
   ========================================================================== */
@media (min-width: 761px) {
  .h-stage { position: relative; }
  .h-stage__sticky {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow: hidden;
  }
  .h-stage__track {
    display: flex;
    height: 100%;
    width: max-content;
    will-change: transform;
  }
  .h-stage__track > .page-hero {
    flex: 0 0 100vw;
    width: 100vw;
    min-height: 0;
    height: 100%;
  }
  .h-stage__track > .profiles {
    display: flex;
    align-items: center;
    height: 100%;
    padding: var(--padding-xl) var(--padding-lg) var(--padding-md);
  }
  .h-stage__track .profiles__grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: repeat(var(--profile-rows, 1), auto);
    grid-auto-columns: var(--profile-w, 320px);
    justify-content: start;
    gap: var(--gap-sm);
  }
  .h-stage__track .profiles__grid > :nth-child(n) { grid-column: auto; transform: none; }
  .h-stage__track .profile { width: var(--profile-w, 320px); }
}
/* two rows when the screen is tall enough for 2 × 394 px cards */
@media (min-width: 761px) and (min-height: 980px) {
  .h-stage__track { --profile-rows: 2; }
}
@media (min-width: 761px) and (max-height: 700px) {
  .h-stage__track { --profile-w: 260px; }
}

/* ---------- header over the horizontal track ----------
   The header lives outside the sliding track so it stays in place.
   Each item (logo, links, CTA, burger) switches to the Figma "secondary"
   style — the one used on light surfaces — when the light panel is under it. */
.h-stage { position: relative; }
.h-stage__header { z-index: 20; }
.h-stage__header .logo { display: grid; }
.h-stage__header .logo__img { grid-area: 1 / 1; transition: opacity var(--transition-fast); }
.h-stage__header .logo__img--light,
.h-stage__header .logo.is-light .logo__img:not(.logo__img--light) { opacity: 0; }
.h-stage__header .logo.is-light .logo__img--light { opacity: 1; }

.h-stage__header .menu-item.is-light { color: var(--surface-secondary-on-secondary); }
.h-stage__header .menu-item.is-light:hover { color: var(--surface-primary-highlight-orange-dark); }
.h-stage__header .menu-item.is-light[aria-current="page"] {
  color: var(--surface-primary-highlight-orange-dark);
  border-bottom-color: var(--surface-primary-highlight-orange-dark);
}
.h-stage__header .cta.is-light {
  background: var(--semantic-secondary-default);
  color: var(--semantic-secondary-on-default);
}
.h-stage__header .cta.is-light:hover {
  background: var(--semantic-primary-hover);
  color: var(--semantic-primary-on-hover);
}
.h-stage__header .site-header__toggle.is-light { color: var(--surface-secondary-on-secondary); }
/* open mobile menu is dark: keep its items in the default (light-on-dark) style */
.h-stage__header.is-open .is-light { color: var(--surface-primary-on-primary); }
.h-stage__header.is-open .cta.is-light { background: var(--semantic-primary-default); color: var(--semantic-primary-on-default); }
.h-stage__header.is-open .logo.is-light .logo__img:not(.logo__img--light) { opacity: 1; }
.h-stage__header.is-open .logo.is-light .logo__img--light { opacity: 0; }

/* ---------- hero cards → profile cards (≥ 761 px, once the visitor scrolls) ----------
   The category card keeps its place in the row; it grows to the profile size
   (320 × 393.5) and shows the same card as the talents that follow. */
.talent-cat__card {
  position: absolute;
  inset: 0;
  z-index: 1;
  aspect-ratio: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 500ms ease, visibility 0s linear 500ms;
}
/* Long bios never push the name out of a card: the bio shrinks and fades out at the bottom */
.profile__content { min-height: 0; }
.profile__bio { min-height: 0; overflow: hidden; }
.profile__title { flex-shrink: 0; }
.profile:hover .profile__bio,
.profile:focus-within .profile__bio,
.profile--no-photo .profile__bio {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
}

@media (min-width: 761px) {
  .h-stage .talent-cats { align-items: flex-end; flex-wrap: nowrap; justify-content: space-between; gap: 0; transition: column-gap 700ms var(--ease-out-expo); }  /* one row; cards grow upward */
  .h-stage.is-cards .talent-cats { column-gap: var(--gap-sm); flex-wrap: nowrap; justify-content: flex-start; }  /* one row, same gap as the list */
  .h-stage .page-hero__center {
    max-height: 480px;
    transition: opacity 400ms ease, transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), max-height 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  /* short screens: the title folds away so the cards keep their full size */
  .h-stage.is-cards-notitle .page-hero__center { opacity: 0; transform: translateY(-32px); max-height: 0; }
  .h-stage__track .talent-cat__card { width: auto; }
  .h-stage .talent-cat {
    flex-basis: 320px;
    aspect-ratio: auto;
    height: var(--cat-h, auto);
    transition: transform var(--smart-animate), flex-basis 700ms var(--ease-out-expo), height 700ms var(--ease-out-expo);
  }
  /* Olivier (photo card) is as tall as the list cards from the start */
  .h-stage .talent-cat--photo { height: var(--photo-h, var(--cat-h, auto)); }
  /* hover in the hero: the card grows to Olivier's size (same width, same height) instead of scaling */
  .h-stage:not(.is-cards) .talent-cat:is(:hover, :focus-visible) {
    height: var(--photo-h, var(--cat-h, auto));
    transform: none;
    transition: height 600ms var(--ease-out-expo), flex-basis 700ms var(--ease-out-expo);
  }
  .h-stage.is-cards .talent-cat {
    flex-basis: var(--card-w, 320px);
    flex-shrink: 0;
    height: var(--card-h, 393.5px);
    transform: none;
  }
  .h-stage.is-cards .talent-cat__photo,
  .h-stage.is-cards .talent-cat__label { opacity: 0; }
  .h-stage.is-cards .talent-cat__card {
    opacity: 1;
    visibility: visible;
    transition: opacity 500ms ease 150ms, visibility 0s;
  }
}
