/* The backdrop tilts independently; the foreground stays upright. */
.portrait.heroCard {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  perspective: 1100px;
  overflow: visible;
  isolation: isolate;
  position: relative;
}
.heroBackdrop {
  padding: 15px;
  border: 12px solid transparent;
  border-image: url("/assets/academy/greek-key-frame.svg") 24 / 12px / 0 round;
  background: var(--bg);
  box-shadow: var(--shadow);
  transform-origin: center bottom;
  transition: transform 550ms cubic-bezier(.2,.7,.2,1), box-shadow 450ms ease;
}
.heroBackdrop .portraitCrop { transition: filter 450ms ease; }
.heroToggle {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.heroToggle::after {
  content: "+";
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--warm);
  background: var(--bg);
  color: var(--silver);
  font: 20px/1 var(--serif);
}
.heroToggle[aria-pressed="true"]::after { content: "−"; }
.heroToggle:focus-visible, .heroCard:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 6px;
}
.portrait.heroCard .heroCutout {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 14px rgba(0,0,0,.7));
  opacity: 0;
  pointer-events: none;
  transform-origin: center bottom;
  transform: translate3d(0,8%,0) scale(.94);
  transition: opacity 350ms ease, transform 550ms cubic-bezier(.2,.7,.2,1);
}
.heroCard:is(.is-active,:focus-visible,:has(.heroToggle:focus-visible)) .heroBackdrop {
  transform: translateY(-6px) rotateX(22deg);
  box-shadow: 0 32px 48px rgba(0,0,0,.8);
}
.heroCard.has-cutout:is(.is-active,:has(.heroToggle:focus-visible)) .portraitCrop {
  filter: brightness(.3);
}
.portrait.heroCard:is(.is-active,:has(.heroToggle:focus-visible)) .heroCutout {
  opacity: 1;
  transform: translate3d(0,-2%,30px);
}
@media (hover: hover) and (pointer: fine) {
  .heroCard:hover .heroBackdrop {
    transform: translateY(-6px) rotateX(22deg);
    box-shadow: 0 32px 48px rgba(0,0,0,.8);
  }
  .heroCard.has-cutout:hover .portraitCrop { filter: brightness(.3); }
  .portrait.heroCard:hover .heroCutout {
    opacity: 1;
    transform: translate3d(0,-2%,30px);
  }
}
@media (max-width: 520px) {
  .portrait.heroCard .heroCutout { width: 100%; left: 0; }
  .portrait.heroCard:is(.is-active,:has(.heroToggle:focus-visible)) .heroCutout {
    transform: translateY(-2%) scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .heroBackdrop, .heroBackdrop .portraitCrop, .portrait.heroCard .heroCutout {
    transition: none;
  }
  .heroCard:is(.is-active,:hover,:focus-visible,:has(.heroToggle:focus-visible)) .heroBackdrop,
  .portrait.heroCard:is(.is-active,:hover,:has(.heroToggle:focus-visible)) .heroCutout {
    transform: none;
  }
}

/* Reserve the new full-length silhouettes above stacked cards. */
@media (max-width: 820px) {
  .portrait.heroCard.heroCard--extended {
    margin-top: clamp(70px, calc(28vw - 42px), 120px);
  }
}
