/*
  Talent direction contract
  THESIS: Talent is the human infrastructure behind CUHK’s next chapter; the page
  refuses a long, undifferentiated card list by keeping the people story visible.
  OWN-WORLD: white editorial hero, F2F2F7 strategy canvas, open strategy rows,
  purple/cyan accents, and one dragon-boat closing image.
  STORY: visitors meet the talent direction, scan its seven commitments in an
  open two-column list, then land on the closing image before the footer.
  FIRST VIEWPORT: the title and student composition establish the direction before
  the strategy list begins.
  FORM: desktop two-part hero; tablet and mobile return to normal document flow.
*/

.talent-prototype {
  --strategy-theme: var(--t);
  --talent-ink: var(--neutral-black);
  --talent-paper: var(--purple-milky);
  --talent-gold: var(--gold-light-royal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--talent-paper);
  color: var(--talent-ink);
}

@media (max-width: 767px) {
  .talent-hero-banner { padding-top: min(240px, 31.25vw); }
  .talent-hero-banner-layer { height: min(240px, 31.25vw); }
}

.talent-prototype .nav-link.active {
  color: var(--cuhk-purple);
}

.talent-content-kicker {
  color: var(--t);
}

.talent-prototype main {
  flex: 1 0 auto;
}

.talent-prototype > .site-footer {
  margin-top: auto;
}

.talent-page {
  overflow: clip;
}

.talent-story {
  display: block;
  background: var(--talent-paper);
}

.talent-hero {
  position: relative;
  min-height: 0;
  background: #fff;
  color: var(--talent-ink);
  isolation: isolate;
}

.talent-hero::before,
.talent-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.talent-hero::before {
  display: none;
}

.talent-hero::after {
  display: none;
}

.talent-hero-inner {
  --talent-hero-media-pad: clamp(36px, 6vw, 80px);
  position: relative;
  width: min(100%, var(--max));
  margin: 0 auto;
  min-height: clamp(500px, 50vw, 642px);
  display: grid;
  grid-template-columns: minmax(0, 49%) minmax(0, 51%);
  align-items: stretch;
  padding: 0 var(--content-inset);
  overflow: hidden;
}

.talent-hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 590px;
}

.talent-kicker,
.talent-content-kicker {
  margin: 0 0 20px;
  color: var(--talent-gold);
  font-size: 13px;
  font-weight: var(--fw-medium);
  letter-spacing: .15em;
  line-height: 1.25;
  text-transform: uppercase;
}

.talent-hero h1 {
  max-width: 590px;
  margin: 0;
  color: var(--t);
  font-size: clamp(54px, 5.3vw, 88px);
  font-weight: var(--fw-medium);
  letter-spacing: -.055em;
  line-height: .99;
  text-wrap: balance;
}

.talent-hero h1 span {
  display: block;
}

.talent-rule {
  width: 86px;
  height: 4px;
  margin: clamp(28px, 3.2vw, 48px) 0 clamp(22px, 2.5vw, 36px);
  border-radius: 999px;
  background: var(--t);
}

.talent-hero-message {
  max-width: 35ch;
  margin: 48px 0 0;
  color: var(--talent-ink);
  font-size: 18px;
  font-weight: var(--fw-light);
  line-height: 24px;
}

.talent-hero-visual {
  --talent-hero-art-right-gap: clamp(16px, 3vw, 40px);
  position: relative;
  min-height: 0;
  margin: 0 calc(-1 * var(--content-inset)) 0 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--talent-hero-media-pad) var(--talent-hero-art-right-gap) var(--talent-hero-media-pad) 0;
  pointer-events: none;
  overflow: hidden;
}

.talent-hero-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 460px;
  max-width: 100%;
  aspect-ratio: 460 / 500;
  margin-left: auto;
}

.talent-hero-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.talent-hero-art {
  position: relative;
  z-index: 2;
  width: 320px;
  height: 320px;
  max-width: 100%;
  border-radius: 64px;
  object-fit: cover;
  box-shadow: inset 0 0 0 4px #ffffff;
}

.talent-hero-prev,
.talent-hero-next {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 50px;
  height: 50px;
  text-decoration: none;
  transform: translateY(-50%);
}

.talent-hero-prev {
  display: none;
  left: clamp(24px, 3.4vw, 44px);
}

.talent-hero-next {
  right: clamp(24px, 3.4vw, 44px);
}

.talent-hero-arrow-icon {
  display: block;
  width: 50px;
  height: 50px;
}

.talent-hero-prev .talent-hero-arrow-icon {
  transform: rotate(180deg);
}

.talent-hero-prev:hover .talent-hero-arrow-icon path,
.talent-hero-next:hover .talent-hero-arrow-icon path,
.talent-hero-prev:focus-visible .talent-hero-arrow-icon path,
.talent-hero-next:focus-visible .talent-hero-arrow-icon path {
  fill: var(--t);
}

.talent-content {
  position: relative;
  height: 420vh;
  min-width: 0;
  background: var(--talent-paper);
}

.talent-content-stage {
  position: sticky;
  top: var(--header-h);
  height: clamp(420px, 72vh, 640px);
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  background: var(--talent-paper);
}

.talent-closing-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  isolation: isolate;
  background: #b9b6c2;
}

.talent-backdrop {
  position: absolute;
  inset: -4% -3%;
  z-index: -2;
  width: 106%;
  height: 108%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  filter: saturate(.92);
  transform: translate3d(0, var(--talent-closing-shift, 0px), 0) scale(1.01);
  transform-origin: center;
  transition: opacity 480ms ease;
  will-change: transform, opacity;
}

.talent-backdrop-2 {
  opacity: 0;
}

.talent-content[data-backdrop="2"] .talent-backdrop-1 {
  opacity: 0;
}

.talent-content[data-backdrop="2"] .talent-backdrop-2 {
  opacity: 1;
}

.talent-closing-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(242, 242, 247, .98) 0%, rgba(242, 242, 247, .94) 29%, rgba(242, 242, 247, .7) 49%, rgba(22, 13, 27, .18) 76%, rgba(22, 13, 27, .08) 100%),
    linear-gradient(180deg, rgba(22, 13, 27, .02), rgba(22, 13, 27, .22));
}

.talent-content-inner {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max));
  height: 100%;
  margin: 0 auto;
  padding: clamp(42px, 7vw, 88px) var(--content-inset);
  display: flex;
  align-items: center;
}

.strategy-grid {
  position: relative;
  width: min(54%, 620px);
  height: 100%;
  margin: 0;
}

.strategy-card {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  min-height: 0;
  padding: 0 0 0 clamp(24px, 3vw, 42px);
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-24px, calc(-50% + var(--talent-card-drift, 0px)), 0);
  transition: opacity 260ms ease;
  will-change: opacity, transform;
}

.strategy-card::before {
  display: none;
}

.talent-content[data-strategy-index="0"] .strategy-card:nth-child(1),
.talent-content[data-strategy-index="1"] .strategy-card:nth-child(2),
.talent-content[data-strategy-index="2"] .strategy-card:nth-child(3),
.talent-content[data-strategy-index="3"] .strategy-card:nth-child(4),
.talent-content[data-strategy-index="4"] .strategy-card:nth-child(5),
.talent-content[data-strategy-index="5"] .strategy-card:nth-child(6),
.talent-content[data-strategy-index="6"] .strategy-card:nth-child(7) {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, calc(-50% + var(--talent-card-drift, 0px)), 0);
}

.strategy-card h3 {
  max-width: 16ch;
  margin: 0;
  color: var(--t);
  font-size: clamp(28px, 3.1vw, 52px);
  font-weight: var(--fw-medium);
  letter-spacing: -.04em;
  line-height: 1.02;
}

.strategy-card p {
  max-width: 46ch;
  margin: 24px 0 0;
  color: var(--talent-ink);
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: var(--fw-light);
  line-height: 1.5;
}

@media (max-width: 1023px) {
  .talent-hero-inner {
    position: relative;
    top: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 52%) minmax(0, 48%);
  }

  .talent-hero-visual {
    min-height: 100%;
    margin-right: calc(-1 * var(--content-inset));
  }

  .talent-hero-figure {
    width: min(100%, 460px);
  }

}

@media (max-width: 767px) {
  .talent-hero-inner {
    --talent-hero-media-height: clamp(220px, 52vw, 300px);
    min-height: 0;
    display: block;
    padding: 0;
  }

  .talent-hero-copy {
    --talent-hero-arrow-clearance: clamp(56px, 14vw, 88px);
    position: relative;
    top: auto;
    left: auto;
    z-index: 3;
    width: calc(100% - var(--content-pad) - var(--talent-hero-arrow-clearance));
    max-width: none;
    padding: clamp(32px, 7vw, 52px) 0 clamp(20px, 4vw, 32px) var(--content-pad);
  }

  .talent-hero h1 {
    max-width: none;
    font-size: clamp(32px, 9vw, 46px);
    letter-spacing: -.045em;
    line-height: 1.05;
  }

  .talent-hero-message {
    max-width: 32ch;
    margin-top: 24px;
    font-size: clamp(16px, 3.8vw, 18px);
    line-height: 1.55;
  }

  .talent-hero-visual {
    position: relative;
    --talent-hero-art-right-gap: clamp(12px, 4vw, 24px);
    inset: auto;
    z-index: 1;
    width: auto;
    height: var(--talent-hero-media-height);
    min-height: 0;
    margin: 0;
    padding: var(--talent-hero-media-pad) var(--talent-hero-art-right-gap);
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .talent-hero-visual::before {
    display: none;
  }

  .talent-hero-figure {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .talent-hero-art {
    left: auto;
    right: auto;
    bottom: auto;
    width: min(62vw, 320px);
    height: auto;
    aspect-ratio: 1;
    max-height: 100%;
    margin: 0;
    z-index: 2;
  }

  .talent-hero-prev,
  .talent-hero-next {
    top: auto;
    bottom: calc(var(--talent-hero-media-height) / 2);
    z-index: 4;
  }

  .talent-hero-prev {
    left: 4px;
  }

  .talent-hero-next {
    right: 4px;
  }

  .talent-content-inner {
    width: min(100%, var(--max));
    padding: 48px var(--content-pad) 80px;
  }

  .strategy-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .strategy-card {
    min-height: 220px;
    padding: 26px 0 30px;
    grid-template-columns: 1fr;
    row-gap: 16px;
  }

  .strategy-card h3 {
    font-size: clamp(19px, 3.3vw, 24px);
  }

  .strategy-card p {
    font-size: 16px;
  }

  .talent-content[data-talent-parallax="content"] .strategy-card {
    transform: translate3d(0, calc(var(--talent-content-shift, 0px) * var(--talent-card-depth)), 0);
  }

  .talent-backdrop {
    transform: translate3d(0, var(--talent-closing-shift, 0px), 0) scale(1.06);
  }

  .talent-closing-image {
    min-height: 0;
    aspect-ratio: 2560 / 920;
  }

  .talent-closing-overlay {
    background:
      linear-gradient(180deg, rgba(192, 145, 68, 0) 54%, rgba(192, 145, 68, .74) 100%),
      linear-gradient(90deg, rgba(22, 13, 27, .16), rgba(22, 13, 27, 0) 64%);
  }
}

/* Final mobile hero contract: talent banner image is always 240px tall. */
@media (max-width: 767px) {
  .talent-hero-banner { padding-top: min(240px, 31.25vw); }
  .talent-hero-banner-layer { height: min(240px, 31.25vw); }
}

/* Restore the Talent closing visual below the strategy cards. */
.talent-closing {
  background: #100a16;
}

.talent-closing .talent-closing-image {
  position: relative;
  inset: auto;
  z-index: 0;
  aspect-ratio: 2560 / 920;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.talent-closing .talent-backdrop {
  z-index: 0;
}

.talent-closing .talent-closing-overlay {
  display: none;
}

@media (max-width: 399px) {
  .talent-hero-inner {
    min-height: 0;
  }

  .talent-hero-copy {
    --talent-hero-arrow-clearance: 54px;
    padding-top: 32px;
  }

  .talent-hero h1 {
    max-width: none;
    font-size: clamp(32px, 11vw, 40px);
  }

  .talent-hero-message {
    max-width: none;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.45;
  }

  .talent-hero-visual {
    width: auto;
    min-height: 0;
    margin: 0;
  }

  .talent-hero-art {
    left: auto;
    bottom: auto;
    width: min(56vw, 260px);
  }

  .talent-hero-prev,
  .talent-hero-next {
    bottom: calc(var(--talent-hero-media-height) / 2);
  }

  .talent-hero-prev {
    left: 0;
  }

  .talent-hero-next {
    right: 0;
  }

  .talent-content-inner {
    padding-top: 40px;
    padding-bottom: 64px;
  }

  .strategy-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .strategy-card {
    min-height: 0;
    padding: 28px 0 32px;
    row-gap: 12px;
  }

  .strategy-card h3 {
    font-size: 22px;
  }

  .strategy-card p {
    font-size: 14px;
  }
}

@media (max-width: 767px) {
  .talent-content {
    height: 420vh;
  }

  .talent-content-stage {
    top: var(--header-h);
    height: clamp(390px, 68vh, 540px);
    min-height: 390px;
  }

  .talent-content-inner {
    width: 100%;
    height: 100%;
    padding: 32px var(--content-pad);
    align-items: center;
  }

  .strategy-grid {
    width: 90%;
    height: 100%;
  }

  .strategy-card {
    top: 50%;
    left: 0;
    width: 100%;
    min-height: 0;
    padding: 0 12px 0 24px;
    display: block;
    transform: translate3d(-18px, -50%, 0);
  }

  .strategy-card h3 {
    max-width: 15ch;
    font-size: clamp(25px, 7.5vw, 38px);
  }

  .strategy-card p {
    max-width: 37ch;
    margin-top: 18px;
    font-size: clamp(15px, 4.1vw, 18px);
    line-height: 1.48;
  }

  .talent-backdrop {
    inset: -4% -5%;
    width: 110%;
    height: 108%;
    transform: translate3d(0, var(--talent-closing-shift, 0px), 0) scale(1.01);
  }

  .talent-closing-overlay {
    background:
      linear-gradient(90deg, rgba(242, 242, 247, .98) 0%, rgba(242, 242, 247, .9) 55%, rgba(22, 13, 27, .12) 100%),
      linear-gradient(180deg, rgba(22, 13, 27, .02), rgba(22, 13, 27, .2));
  }
}

@media (prefers-reduced-motion: reduce) {
  .talent-content {
    height: auto;
  }

  .talent-content-stage {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .talent-content-inner {
    height: auto;
    min-height: 100vh;
  }

  .strategy-grid {
    height: auto;
    width: min(100%, 620px);
    display: grid;
    gap: 28px;
  }

  .strategy-card,
  .talent-content[data-strategy-index] .strategy-card {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    opacity: 1;
    pointer-events: auto;
    padding: 0 0 26px 24px;
    transform: none !important;
  }

  .talent-hero-art,
  .strategy-card,
  .talent-backdrop,
  .talent-prototype a {
    transition: none !important;
  }
}

/* Shared flip-card replay: the talent page keeps its existing canvas and closing art,
   but presents all seven commitments in the common responsive card grid. */
.talent-content {
  height: auto;
}

.talent-content-stage {
  position: relative;
  top: auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.talent-content-inner {
  height: auto;
  min-height: 0;
  display: block;
}

.talent-strategy-grid {
  position: relative;
  z-index: 1;
  width: min(100%, 940px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
}

@media (max-width: 767px) {
  .talent-strategy-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Match the original web/talent.html banner template: layered 1440×450 art,
   with the overview copy in normal flow below the banner. */
.talent-hero {
  min-height: 0;
}

.talent-hero-inner {
  width: 100%;
  max-width: none;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: visible;
}

.talent-hero-banner {
  position: relative;
  width: 100%;
  height: 450px;
  container-type: inline-size;
  container-name: talent-banner;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}

.talent-hero-banner-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.talent-hero-banner-layer--back { z-index: 1; }
.talent-hero-banner-layer--front { z-index: 2; }

/* Match the vendor banner's high-key left wash so the title remains legible
   without muting the full right-side campus photograph. */
@media (min-width: 768px) {
  .talent-hero-banner::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 2;
    width: 58%;
    background: linear-gradient(90deg,
      rgba(255, 255, 255, .82) 0%,
      rgba(255, 255, 255, .68) 48%,
      rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
  }
}

.talent-hero .talent-hero-banner-title {
  position: absolute;
  inset: auto;
  top: calc(50% - (100% * 144 / 450) / 2);
  left: calc(100% * 80 / 1440);
  z-index: 3;
  box-sizing: border-box;
  width: calc(100% * 522 / 1440);
  height: calc(100% * 144 / 450);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  color: var(--t);
  font-size: clamp(36px, 4.167cqi, 60px);
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  line-height: calc(72 / 60);
  text-shadow: 0 2px 12px rgba(20, 15, 24, .2);
  white-space: nowrap;
  transform: none;
}

.talent-hero-banner-title span {
  display: block;
  white-space: nowrap;
}

.talent-hero-intro {
  padding: var(--section-padding);
  background: #fff;
}

.talent-hero-intro p {
  width: min(100%, 680px);
  margin: 0 auto;
  color: var(--talent-ink);
  font-size: clamp(15px, 1.4vw, 18px);
  font-weight: var(--fw-light);
  line-height: 1.55;
  text-align: center;
}

/* Keep Talent's strategy section on the same layout contract as Research;
   only the page copy and accent colour differ. */
.talent-strategy-section {
  padding: var(--section-padding);
  background: var(--talent-lavender, #f2f2f7);
}

.talent-strategy-section .research-strategy-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0;
}

.talent-strategy-section .research-strategy-intro {
  width: min(100%, var(--content));
  margin: 0 auto 32px;
}

.talent-strategy-section .research-strategy-kicker {
  margin: 0;
  color: var(--t);
  font-size: clamp(24px, 2.8vw, 38px);
  font-weight: var(--fw-medium);
  letter-spacing: -.04em;
  line-height: 1.1;
}

.talent-strategy-section .research-strategy-grid {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1199px) {
  .talent-strategy-section .research-strategy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .talent-strategy-section .research-strategy-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .talent-hero-banner { padding-top: min(240px, 31.25vw); }
  .talent-hero-banner-layer { height: min(240px, 31.25vw); }
}

@media (max-width: 767px) {
  .talent-hero-banner {
    padding-top: min(240px, 31.25vw);
  }

  .talent-hero-banner-layer {
    height: min(240px, 31.25vw);
  }

  .talent-hero-banner {
    height: auto;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding-top: min(240px, 31.25vw);
    overflow: visible;
  }

  .talent-hero .talent-hero-banner-title {
    /* The original banner scales from its 1440px artboard on mobile too. */
    top: auto;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 24px var(--content-pad);
    font-size: clamp(32px, 9vw, 46px);
    line-height: .94;
    white-space: normal;
    text-shadow: none;
    position: relative;
    margin-top: 0;
    background: #fff;
  }

  .talent-hero-banner-layer {
    top: 0;
    bottom: auto;
    height: min(240px, 31.25vw);
  }

  .talent-hero-intro {
    padding: var(--section-padding);
  }

  .talent-hero-intro p {
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
  }

  .talent-strategy-section .research-strategy-inner {
    padding: 0;
  }

  .talent-strategy-section .research-strategy-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Final mobile hero contract: every page uses a responsive image capped at 240px before its title. */
@media (max-width: 767px) {
  .talent-hero-banner {
    height: auto;
    aspect-ratio: auto;
    padding-top: min(240px, 31.25vw);
    overflow: visible;
  }

  .talent-hero-banner-layer {
    top: 0;
    bottom: auto;
    height: min(240px, 31.25vw);
  }
}
