/* Bio2Twin Scale Depth v1
   SCOPED ONLY to .bt-scale-depth-*.
   Does not style header/topbar/nav or any existing page section.
*/
.bt-scale-depth-source-hidden {
  display: none !important;
}

/* Tall scroll track — sticky pin lives inside. overflow must stay visible for sticky. */
.bt-scale-depth-hero {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  display: block !important;
  overflow: visible !important;
  background: #07100e;
}

.bt-scale-depth-scroll-scene {
  --bt-header-h: 68px;
  position: relative;
  min-height: 220vh;
  width: 100%;
}

.bt-scale-depth-sticky {
  position: sticky;
  top: var(--bt-header-h);
  z-index: 1;
  height: calc(100svh - var(--bt-header-h));
  min-height: calc(100svh - var(--bt-header-h));
  box-sizing: border-box;
  padding: 120px max(40px, calc((100vw - 1440px) / 2)) 36px;
  display: grid;
  grid-template-columns: minmax(390px, .83fr) minmax(500px, 1.17fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  background: #07100e;
}

.bt-scale-depth-sticky .hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
}

.bt-scale-depth-sticky .hero-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  pointer-events: auto;
}

@media (max-width: 900px) {
  .bt-scale-depth-sticky {
    padding-left: 20px;
    padding-right: 20px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .bt-scale-depth-sticky {
    padding-top: 96px;
  }
}

/* Outer mount fills existing hero-visual (unchanged container size). */
.bt-scale-depth-mount {
  --bt-depth-border: rgba(255,255,255,.22);
  --bt-depth-muted: rgba(255,255,255,.52);
  --bt-scene-w: min(92vw, 1450px);
  --bt-scene-h: min(78vh, 820px);
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  perspective: 1400px;
  transform-style: preserve-3d;
  isolation: isolate;
  overflow: visible;
  min-width: 0;
  pointer-events: auto;
  aspect-ratio: auto;
}

/* Stage: camera scale only. Background is 2D; depth content is 3D. */
.bt-scale-depth-scene,
.bt-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--bt-scene-w);
  height: var(--bt-scene-h);
  max-width: 1450px;
  aspect-ratio: 3 / 2;
  height: auto;
  max-height: min(78vh, 820px);
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  will-change: transform;
  overflow: visible;
}

/* Fixed 2D lake base — outside preserve-3d stack, never transformed by fan. */
.bt-background,
.bt-scale-depth-bg {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 5%;
  bottom: 5%;
  z-index: 0;
  overflow: hidden;
  border: 1px solid var(--bt-depth-border);
  border-radius: clamp(16px, 1.8vw, 28px);
  background: rgba(255,255,255,.018);
  box-shadow: 0 28px 70px rgba(0,0,0,.32);
  transform: none !important;
  transform-style: flat;
  will-change: auto;
  pointer-events: none;
}

.bt-scale-depth-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(132deg, rgba(255,255,255,.1), transparent 22%, transparent 70%, rgba(255,255,255,.04));
}

/* 3D fan content only */
.bt-depth-content,
.bt-scale-depth-stack {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-style: preserve-3d;
  perspective: 1600px;
  will-change: transform;
  overflow: visible;
}

.bt-scale-depth-layer {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 4%;
  bottom: 4%;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: clamp(16px, 1.8vw, 28px);
  background: transparent;
  box-shadow: none;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Human planes — figure-width plates that travel with their own transform */
.bt-scale-depth-human,
.bt-human-normal,
.bt-human-translucent,
.bt-human-anatomy {
  left: 31%;
  width: 26%;
  right: auto;
  top: 4%;
  bottom: 4%;
  overflow: visible;
  border: none;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.bt-scale-depth-human::after {
  display: none;
}

.bt-human-plane-chrome {
  position: absolute;
  inset: 4% 6%;
  border: 1px solid rgba(255, 255, 255, calc(var(--bt-plane-chrome, 0.12)));
  border-radius: clamp(14px, 1.6vw, 24px);
  pointer-events: none;
  z-index: 2;
}

.bt-human-plane-label {
  position: absolute;
  top: 6%;
  left: 10%;
  z-index: 3;
  color: rgba(255, 255, 255, calc(0.22 + var(--bt-plane-chrome, 0.12)));
  font: 500 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.2em;
  pointer-events: none;
}

.bt-scale-depth-human img {
  width: 100%;
  height: 100%;
  display: block;
  /* contain = full transparent cutout visible; cover was cropping people away */
  object-fit: cover;
  object-position: center top;
  user-select: none;
  -webkit-user-drag: none;
}

.bt-scale-depth-bg img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(.78) brightness(.72) contrast(1.04);
  user-select: none;
  -webkit-user-drag: none;
}

.bt-scale-depth-normal img {
  filter: saturate(.9) brightness(1.02) contrast(1.05);
}

.bt-scale-depth-translucent img {
  filter: saturate(1.05) brightness(1.05) contrast(1.08);
  opacity: 1;
}

.bt-scale-depth-anatomy img {
  filter: saturate(1.1) brightness(1.05) contrast(1.1);
  opacity: 1;
}

/* Thin glass framing planes — intentionally oversized vs central card */
.bt-scale-depth-frame {
  overflow: visible;
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: none;
}

.bt-scale-depth-frame-far-left {
  left: -2%;
  right: 18%;
  top: 8%;
  bottom: 10%;
  border-color: rgba(255,255,255,.1);
}

.bt-scale-depth-frame-left {
  left: 0%;
  right: 10%;
  top: 4%;
  bottom: 6%;
  border-color: rgba(255,255,255,.12);
}

.bt-scale-depth-frame-center {
  left: 4%;
  right: 4%;
  top: 3%;
  bottom: 3%;
  border-color: rgba(255,255,255,.16);
}

.bt-scale-depth-frame-right {
  left: 10%;
  right: -2%;
  top: 2%;
  bottom: 4%;
  border-color: rgba(255,255,255,.18);
}

.bt-scale-depth-frame-evidence {
  left: 14%;
  right: -8%;
  top: 0%;
  bottom: 2%;
  border-color: rgba(255,255,255,.22);
}

.bt-scale-depth-frame svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.bt-scale-depth-line {
  fill: none;
  stroke: rgba(255,255,255,.28);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.bt-scale-depth-dash {
  stroke-dasharray: 3 9;
}
.bt-scale-depth-dot {
  fill: rgba(255,255,255,.88);
}
.bt-scale-depth-label {
  fill: rgba(255,255,255,.52);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .2em;
}
.bt-scale-depth-code {
  fill: rgba(255,255,255,.38);
  font: 500 8px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .22em;
}

.bt-scale-depth-glass {
  position: absolute;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: rgba(255,255,255,.02);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.bt-scale-depth-glass span {
  position: absolute;
  top: 14px;
  left: 16px;
  color: rgba(255,255,255,.42);
  font: 500 9px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .2em;
}
.bt-scale-depth-glass-a {
  left: 4%;
  top: 8%;
  width: 26%;
  height: 32%;
}
.bt-scale-depth-glass-b {
  right: 2%;
  bottom: 8%;
  width: 28%;
  height: 26%;
}

.bt-scale-depth-progress {
  position: absolute;
  z-index: 20;
  right: max(2.5%, calc(50% - (var(--bt-scene-w) / 2) - 18px));
  top: calc(50% - min(39vh, 410px) + 14%);
  width: 1px;
  height: min(42vh, 430px);
  background: rgba(255,255,255,.13);
  pointer-events: none;
}
.bt-scale-depth-progress > i {
  display: block;
  width: 100%;
  height: 0%;
  background: rgba(255,255,255,.82);
  will-change: height;
}
.bt-scale-depth-progress::before,
.bt-scale-depth-progress::after {
  position: absolute;
  right: 10px;
  color: rgba(255,255,255,.4);
  font: 500 8px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: .18em;
}
.bt-scale-depth-progress::before { content: "00"; top: -2px; }
.bt-scale-depth-progress::after  { content: "05"; bottom: -2px; }

@media (max-width: 1100px) {
  .bt-scale-depth-frame-far-left,
  .bt-scale-depth-frame-left {
    display: none;
  }
}

@media (max-width: 760px) {
  .bt-scale-depth-mount {
    --bt-scene-w: min(94vw, 640px);
    overflow: hidden;
  }
  .bt-scale-depth-scene {
    top: 46%;
    max-height: min(58vh, 520px);
    width: min(94vw, 640px);
  }
  .bt-scale-depth-human,
  .bt-human-normal,
  .bt-human-translucent,
  .bt-human-anatomy {
    left: 14%;
    width: 62%;
    right: auto;
    top: 3%;
    bottom: 3%;
  }
  .bt-human-plane-label {
    display: none;
  }
  .bt-scale-depth-frame,
  .bt-scale-depth-glass,
  .bt-scale-depth-progress {
    display: none;
  }
  .bt-scale-depth-layer img {
    object-position: center 40%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bt-scale-depth-stack,
  .bt-scale-depth-layer,
  .bt-scale-depth-scene {
    transition: none !important;
  }
}
