/* Team Map Spine v5 shell — local visual candidate only.
   Keeps the approved portrait normalization and interaction shell while using
   the separately versioned v6 signal-spine map asset. */

body.obor-v19-page .team-gates-section .team-gates-stage {
  isolation: isolate;
}

body.obor-v19-page .team-gates-section .team-gates-stage::before {
  position: absolute;
  inset: clamp(4.1rem, 5.2vw, 5.2rem) 0 auto;
  z-index: 0;
  height: clamp(26rem, 38vw, 40rem);
  background: url("../images/team-malaysia-signal-spine-v6.webp") center top / 100% 100% no-repeat;
  content: "";
  opacity: 0.72;
  pointer-events: none;
}

body.obor-v19-page .team-gates-section .team-gates-network {
  z-index: 5;
}

body.obor-v19-page .team-gates-section .team-gates-row {
  z-index: 3;
}

body.obor-v19-page .team-gates-section .team-gate {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(26, 85, 245, 0.3);
}

body.obor-v19-page .team-gates-section .team-gate-particles {
  display: none;
}

body.obor-v19-page .team-gates-section .team-gate-portrait {
  inset: 0 0 7.8rem;
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0 8%,
    #000 12%,
    #000 70%,
    rgba(0, 0, 0, 0.96) 78%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0 8%,
    #000 12%,
    #000 70%,
    rgba(0, 0, 0, 0.96) 78%,
    transparent 100%
  );
}

body.obor-v19-page .team-gates-section .team-gate-portrait img {
  object-fit: contain;
  object-position: center top;
  filter: saturate(0.88) contrast(0.98) brightness(1.03);
}

body.obor-v19-page .team-gates-section .team-gate[data-team-role] {
  --portrait-scale: 1;
  --portrait-x: 0%;
  --portrait-y: 0%;
}

body.obor-v19-page .team-gates-section .team-gate[data-team-role="operations-support-technician"] {
  --portrait-scale: 1.08;
  --portrait-y: -3.6%;
}

body.obor-v19-page .team-gates-section .team-gate[data-team-role="operations-support-technician"] .team-gate-portrait img {
  filter: saturate(0.83) contrast(0.98) brightness(1.07);
}

/* WebGL is an enhancement. If the lanyard canvas cannot mount, the v2
   runtime inserts this same-source portrait credential instead of leaving a
   tall empty stage behind the evidence panel. */
body.obor-v19-page .team-card-lanyard-stage .team-lanyard-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  padding: clamp(2.8rem, 6vw, 4.5rem) clamp(1.2rem, 4vw, 3rem) 1.4rem;
  background:
    radial-gradient(circle at 50% 33%, rgba(255, 255, 255, 0.98), rgba(244, 247, 251, 0.72) 54%, rgba(222, 232, 245, 0.7)),
    #f4f7fb;
  color: #fff;
}

body.obor-v19-page .team-card-lanyard-stage .team-lanyard-fallback[hidden] {
  display: none;
}

body.obor-v19-page .team-card-lanyard-stage.has-static-fallback > p {
  display: none;
}

body.obor-v19-page .team-card-lanyard-stage .team-lanyard-fallback::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 0 78%, rgba(24, 78, 215, 0.1) 100%);
  content: "";
}

body.obor-v19-page .team-lanyard-fallback img {
  display: block;
  width: min(100%, 20rem);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  object-fit: contain;
  object-position: center top;
  filter: saturate(0.92) contrast(0.98) brightness(1.04);
}

body.obor-v19-page .team-lanyard-fallback figcaption {
  display: grid;
  gap: 0.3rem;
  width: min(100%, 20rem);
  margin: 0 auto;
  padding: 0.75rem 0.9rem 0.9rem;
  background: #184ed7;
  box-shadow: 0 1.2rem 3rem rgba(18, 42, 86, 0.16);
}

body.obor-v19-page .team-lanyard-fallback figcaption span {
  font: 620 0.62rem/1 var(--mono);
  letter-spacing: 0.14em;
}

body.obor-v19-page .team-lanyard-fallback figcaption strong {
  font: 720 0.95rem/1.05 var(--display);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

body.obor-v19-page .obor-field-ledger .team-card-layer {
  background: #f7fafe;
}

body.obor-v19-page .team-gates-section.has-open-card > .team-gates-intro,
body.obor-v19-page .team-gates-section.has-open-card > .team-gates-signal,
body.obor-v19-page .team-gates-section.has-open-card > .team-gates-heading,
body.obor-v19-page .team-gates-section.has-open-card .team-gates-stage > *:not(.team-card-layer) {
  visibility: hidden;
}

/* Keep the mobile dialog within the viewport. The previous height rule made
   the card scroll a 39rem empty WebGL stage before the evidence could appear. */
@media (max-width: 820px) {
  body.obor-v19-page .team-gates-section .team-gates-stage::before {
    inset: 0 0 auto;
    height: clamp(23rem, 82vw, 32rem);
    background-size: auto 100%;
    background-position: center top;
    opacity: 0.58;
  }

  body.obor-v19-page .team-gates-section .team-gate-portrait {
    inset: 0 0 5.7rem;
  }

  body.obor-v19-page .obor-field-ledger .team-card-layer {
    align-items: start;
    overflow-y: auto;
    padding: 3.75rem 0.5rem 1rem;
  }

  body.obor-v19-page .obor-field-ledger .team-card-safe-region {
    max-height: none;
    height: auto;
    align-self: start;
    margin: 0;
  }

  body.obor-v19-page .obor-field-ledger .team-card {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  body.obor-v19-page .obor-field-ledger .team-card-content {
    height: auto;
    min-height: 0;
  }

  body.obor-v19-page .obor-field-ledger .team-card-lanyard-stage {
    min-height: clamp(19rem, 61vh, 30rem);
    height: clamp(19rem, 61vh, 30rem);
  }

  body.obor-v19-page .team-lanyard-fallback img {
    width: min(100%, 16rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.obor-v19-page .team-gates-section .team-gates-stage::before {
    opacity: 0.72;
  }
}
