/* CTPL About leadership — v37
   The approved expanding-card interaction is retained. Both 4:5 portraits now
   meet their card borders exactly, remain fully visible, and mirror one another. */

@media (min-width: 1181px) {
  .team-stage {
    --portrait-h: clamp(550px, 37.5vw, 720px);
    --portrait-w: clamp(440px, 30vw, 576px);
    height: var(--portrait-h);
    gap: clamp(20px, 1.4vw, 28px);
  }

  .profile-panel {
    flex: 1;
    min-height: var(--portrait-h);
    border: 0;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .15),
      var(--shadow);
  }

  .profile-panel:hover,
  .profile-panel:focus-visible,
  .profile-panel.is-active {
    flex: 2.25;
    transform: translateY(-3px);
    box-shadow:
      inset 0 0 0 1px rgba(52, 227, 224, .58),
      var(--shadow);
  }

  .team-stage.has-active .profile-panel:not(.is-active) {
    flex: 1.08;
  }

  .profile-image,
  .profile-md .profile-image,
  .profile-panel:hover .profile-image,
  .profile-panel:focus-visible .profile-image,
  .profile-panel.is-active .profile-image {
    top: 0;
    bottom: 0;
    width: var(--portrait-w);
    height: 100%;
    padding: 0;
    object-fit: cover;
    object-position: center;
    transform: none;
  }

  .profile-founder .profile-image {
    left: 0;
    right: auto;
  }

  .profile-md .profile-image {
    left: auto;
    right: 0;
  }

  .profile-shade,
  .profile-panel:hover .profile-shade,
  .profile-panel:focus-visible .profile-shade,
  .profile-panel.is-active .profile-shade {
    top: 0;
    bottom: 0;
    width: var(--portrait-w);
    height: 100%;
    background:
      linear-gradient(180deg, transparent 54%, rgba(4, 18, 19, .16) 76%, rgba(4, 18, 19, .45) 100%);
  }

  .profile-founder .profile-shade {
    left: 0;
    right: auto;
  }

  .profile-md .profile-shade {
    left: auto;
    right: 0;
  }

  .profile-summary {
    top: 50%;
    bottom: auto;
    z-index: 4;
    transform: translateY(-50%);
  }

  .profile-founder .profile-summary {
    left: calc(var(--portrait-w) + clamp(28px, 2vw, 42px));
    right: clamp(28px, 2vw, 42px);
    text-align: left;
  }

  .profile-md .profile-summary {
    left: clamp(28px, 2vw, 42px);
    right: calc(var(--portrait-w) + clamp(28px, 2vw, 42px));
    text-align: right;
  }

  .profile-role {
    font-size: clamp(1.05rem, .35vw + .95rem, 1.32rem) !important;
    line-height: 1.25;
  }

  .profile-summary h2 {
    font-size: clamp(2.25rem, 2.45vw, 3.35rem);
    line-height: 1.02;
  }

  .profile-prompt {
    max-width: 290px;
    font-size: clamp(1rem, .24vw + .95rem, 1.18rem) !important;
    line-height: 1.45;
  }

  .profile-md .profile-prompt {
    justify-content: flex-end;
    margin-left: auto;
  }

  .profile-panel:hover .profile-summary,
  .profile-panel:focus-visible .profile-summary,
  .profile-panel.is-active .profile-summary {
    opacity: 0;
    transform: translateY(calc(-50% + 14px));
    pointer-events: none;
  }

  .team-stage.has-active .profile-panel:not(.is-active) .profile-summary {
    opacity: 0;
    pointer-events: none;
  }

  .profile-story {
    top: 0;
    bottom: 0;
    width: auto;
    height: 100%;
    padding: clamp(30px, 2.25vw, 46px);
    background: linear-gradient(160deg, #0a2627 0%, #06191a 100%);
  }

  .profile-founder .profile-story {
    left: var(--portrait-w);
    right: 0;
  }

  .profile-md .profile-story {
    left: 0;
    right: var(--portrait-w);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .09), 14px 0 34px rgba(0, 0, 0, .18);
  }

  .profile-md .profile-story::before {
    left: auto;
    right: 0;
  }

  .profile-story h3 {
    font-size: clamp(1.85rem, 1.7vw, 2.55rem);
    line-height: 1.08;
  }

  .profile-story p {
    font-size: clamp(1.05rem, .25vw + 1rem, 1.22rem) !important;
    line-height: 1.62;
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .team-stage {
    --portrait-w: 496px;
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    gap: 22px;
  }

  .profile-panel,
  .profile-panel:hover,
  .profile-panel:focus-visible,
  .profile-panel.is-active {
    flex: none;
    width: 100%;
    height: 620px;
    border: 0;
    transform: none;
    box-shadow:
      inset 0 0 0 1px rgba(52, 227, 224, .34),
      var(--shadow);
  }

  .team-stage.has-active .profile-panel:not(.is-active) {
    flex: none;
    filter: saturate(.72) brightness(.76);
  }

  .profile-image,
  .profile-md .profile-image,
  .profile-panel:hover .profile-image,
  .profile-panel:focus-visible .profile-image,
  .profile-panel.is-active .profile-image {
    top: 0;
    bottom: 0;
    width: var(--portrait-w);
    height: 100%;
    padding: 0;
    object-fit: cover;
    object-position: center;
    transform: none;
  }

  .profile-founder .profile-image {
    left: 0;
    right: auto;
  }

  .profile-md .profile-image {
    left: auto;
    right: 0;
  }

  .profile-shade,
  .profile-panel:hover .profile-shade,
  .profile-panel:focus-visible .profile-shade,
  .profile-panel.is-active .profile-shade {
    width: var(--portrait-w);
    height: 100%;
    background: linear-gradient(180deg, transparent 54%, rgba(4, 18, 19, .16) 76%, rgba(4, 18, 19, .45) 100%);
  }

  .profile-founder .profile-shade {
    left: 0;
    right: auto;
  }

  .profile-md .profile-shade {
    left: auto;
    right: 0;
  }

  .profile-summary {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  .profile-founder .profile-summary {
    left: calc(var(--portrait-w) + 34px);
    right: 34px;
  }

  .profile-md .profile-summary {
    left: 34px;
    right: calc(var(--portrait-w) + 34px);
    text-align: right;
  }

  .profile-md .profile-prompt {
    justify-content: flex-end;
  }

  .profile-panel:hover .profile-summary,
  .profile-panel:focus-visible .profile-summary,
  .profile-panel.is-active .profile-summary {
    transform: translateY(calc(-50% + 14px));
  }

  .profile-story {
    top: 0;
    bottom: 0;
    width: auto;
    height: 100%;
    padding: 36px;
  }

  .profile-founder .profile-story {
    left: var(--portrait-w);
    right: 0;
  }

  .profile-md .profile-story {
    left: 0;
    right: var(--portrait-w);
  }

  .profile-story h3 {
    font-size: clamp(1.75rem, 3vw, 2.3rem);
  }

  .profile-story p {
    font-size: clamp(1.05rem, 1.4vw, 1.18rem) !important;
  }
}

@media (max-width: 700px) {
  .team-stage {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    gap: 18px;
  }

  .profile-panel,
  .profile-panel:hover,
  .profile-panel:focus-visible {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    border: 0;
    transform: none;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .17),
      var(--shadow);
  }

  .profile-panel.is-active {
    display: grid;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .team-stage.has-active .profile-panel:not(.is-active) {
    filter: none;
  }

  .profile-image,
  .profile-md .profile-image,
  .profile-panel:hover .profile-image,
  .profile-panel:focus-visible .profile-image {
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: cover;
    object-position: center;
    transform: none;
  }

  .profile-panel.is-active .profile-image {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center;
    transform: none;
  }

  .profile-shade,
  .profile-panel:hover .profile-shade,
  .profile-panel:focus-visible .profile-shade,
  .profile-panel.is-active .profile-shade {
    inset: 0;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    background: linear-gradient(180deg, transparent 48%, rgba(4, 18, 19, .2) 70%, rgba(4, 18, 19, .92) 100%);
  }

  .profile-summary {
    top: auto;
    left: 24px;
    right: 24px;
    bottom: 26px;
    transform: none;
    text-align: left;
  }

  .profile-md .profile-summary {
    text-align: right;
  }

  .profile-md .profile-prompt {
    justify-content: flex-end;
  }

  .profile-summary h2 {
    font-size: clamp(2.15rem, 9vw, 2.85rem);
  }

  .profile-role,
  .profile-prompt {
    font-size: 1rem !important;
  }

  .profile-panel:hover .profile-summary,
  .profile-panel:focus-visible .profile-summary,
  .profile-panel.is-active .profile-summary {
    opacity: 0;
    transform: translateY(12px);
  }

  .profile-panel.is-active .profile-story {
    position: relative;
    inset: auto;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 30px 24px 34px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    overflow: visible;
    background: linear-gradient(160deg, #0a2627 0%, #06191a 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
  }

  .profile-panel:not(.is-active) .profile-story {
    display: none;
  }

  .profile-story h3 {
    font-size: clamp(1.75rem, 7vw, 2.2rem);
    line-height: 1.1;
  }

  .profile-story p {
    font-size: 1.05rem !important;
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-panel,
  .profile-image,
  .profile-summary,
  .profile-story {
    transition: none !important;
  }
}
