/* Homepage 3D hero: live tower sits inside a retro-futuristic CRT television.
   Chassis only — does not change camera, lighting, GLB, or overlay copy. */

.pr-hero-stage {
  --tv-bx: clamp(13px, 1.7vw, 20px);
  --tv-bt: clamp(12px, 1.55vw, 18px);
  --tv-bb: clamp(34px, 4.4vw, 50px);
  --tv-shell: clamp(20px, 2.2vw, 30px);
  --tv-screen: clamp(9px, 1.15vw, 14px);
  --tv-gasket: #090a0c;
  --tv-chrome: #c7ccd3;
  --tv-shell-hi: #3d4148;
  --tv-shell-mid: #22252a;
  --tv-shell-lo: #121417;
  border-radius: var(--tv-shell) !important;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.16) 0 1px,
      transparent 1px 100%),
    linear-gradient(165deg,
      var(--tv-shell-hi) 0%,
      var(--tv-shell-mid) 36%,
      var(--tv-shell-lo) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -14px 22px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 0 #5a5f68,
    0 2px 0 #1a1c20,
    0 4px 0 #0c0d10,
    0 22px 48px rgba(17, 24, 39, 0.18) !important;
}

.pr-hero-stage #tower {
  position: absolute;
  top: var(--tv-bt) !important;
  right: var(--tv-bx) !important;
  bottom: var(--tv-bb) !important;
  left: var(--tv-bx) !important;
  width: auto !important;
  height: auto !important;
  border-radius: var(--tv-screen);
  overflow: hidden;
  background: #5b36b8;
  box-shadow:
    0 0 0 2px var(--tv-gasket),
    0 0 0 3px rgba(199, 204, 211, 0.38),
    0 0 0 4px #0c0d10,
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 1;
}

.pr-hero-stage #tower canvas,
.pr-hero-stage canvas.tower-webgl {
  border-radius: inherit;
}

#pr-dot-hero .pr-hero-stage canvas,
#pr-dot-hero #tower canvas,
.pr-hero-stage canvas,
html body #pr-dot-hero .pr-hero-stage canvas,
html body #pr-dot-hero #tower canvas,
html body #tower canvas {
  opacity: 1 !important;
  filter: none !important;
}

.pr-hero-stage__hint {
  left: calc(var(--tv-bx) + 12px) !important;
  bottom: calc(var(--tv-bb) + 12px) !important;
  z-index: 5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* CRT glass: glare + faint scanlines. Never intercept clicks. */
.pr-hero-tv,
.pr-hero-stage::before {
  pointer-events: none;
}

.pr-hero-tv {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.pr-hero-tv__glass,
.pr-hero-stage:not(:has(.pr-hero-tv))::before {
  content: "";
  position: absolute;
  top: var(--tv-bt);
  right: var(--tv-bx);
  bottom: var(--tv-bb);
  left: var(--tv-bx);
  border-radius: var(--tv-screen);
  z-index: 4;
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.05) 16%,
      rgba(255, 255, 255, 0.015) 32%,
      transparent 46%
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(8, 10, 16, 0.045) 0 1px,
      transparent 1px 3px
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -18px 28px rgba(0, 0, 0, 0.14),
    inset 0 0 36px rgba(0, 0, 0, 0.1);
}

.pr-hero-tv__chin {
  position: absolute;
  left: var(--tv-bx);
  right: var(--tv-bx);
  bottom: 0;
  height: var(--tv-bb);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 2px;
}

.pr-hero-tv__vents {
  width: min(38%, 168px);
  height: 13px;
  border-radius: 3px;
  background:
    radial-gradient(circle, #070809 1.05px, transparent 1.2px) 0 0 / 4.5px 4.5px,
    linear-gradient(180deg, #2a2d32, #14161a);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.7),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.45);
}

.pr-hero-tv__led {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8ffe8, #5cffae 42%, #1d8a58 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.55),
    0 0 8px rgba(92, 255, 174, 0.55);
}

.pr-hero-tv__knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex: 0 0 16px;
  background:
    conic-gradient(from 210deg, #9aa0a8, #eceff3 18%, #5c6168 42%, #d5d8de 58%, #3a3e44 78%, #9aa0a8),
    radial-gradient(circle at 35% 30%, #dfe3e8, #4a4e55 62%, #1c1e22);
  background-blend-mode: overlay, normal;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 3px rgba(0, 0, 0, 0.55),
    0 0 0 1px #0d0e10,
    0 1px 2px rgba(0, 0, 0, 0.35);
  position: relative;
}

.pr-hero-tv__knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 1.5px;
  height: 5px;
  background: #eceff3;
  border-radius: 1px;
  transform: translateX(-50%);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35);
}

.pr-hero-tv__knob:last-child::after {
  transform: translateX(-50%) rotate(42deg);
  transform-origin: 50% 5px;
}

/* CSS-only chin if the dresser has not run yet */
.pr-hero-stage:not(:has(.pr-hero-tv))::after {
  content: "";
  position: absolute;
  left: var(--tv-bx);
  right: var(--tv-bx);
  bottom: 10px;
  height: 18px;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(7, 8, 9, 0.9) 1px, transparent 1.15px) left 2px center / 4.5px 4.5px repeat-x,
    linear-gradient(#1c1e22, #1c1e22) left center / 34% 12px no-repeat,
    radial-gradient(circle at 70% 50%, #d8ffe8 0 2px, rgba(92, 255, 174, 0.45) 3px, transparent 6px),
    radial-gradient(circle at 84% 50%, #dfe3e8 0 1px, #6a6f76 4px, #2a2d32 7px, #9aa0a8 8px, #111 9px, transparent 10px),
    radial-gradient(circle at 93% 50%, #dfe3e8 0 1px, #6a6f76 4px, #2a2d32 7px, #9aa0a8 8px, #111 9px, transparent 10px);
}

@media (max-width: 1280px) and (min-width: 1000px) and (min-height: 861px) {
  .pr-hero-stage {
    --tv-bx: 15px;
    --tv-bt: 14px;
    --tv-bb: 42px;
    --tv-shell: 24px;
    --tv-screen: 12px;
  }
}

@media (max-width: 999px), (max-height: 860px) {
  .pr-hero-stage {
    --tv-bx: 12px;
    --tv-bt: 11px;
    --tv-bb: 34px;
    --tv-shell: 20px;
    --tv-screen: 10px;
  }
  .pr-hero-tv__vents {
    height: 11px;
    width: min(36%, 132px);
  }
  .pr-hero-tv__knob {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
}

@media (max-width: 480px) {
  .pr-hero-stage {
    --tv-bx: 10px;
    --tv-bt: 10px;
    --tv-bb: 30px;
    --tv-shell: 18px;
    --tv-screen: 9px;
  }
  .pr-hero-tv__chin {
    gap: 8px;
  }
  .pr-hero-tv__knob:last-child {
    display: none;
  }
}

body.tj-open .pr-hero-tv {
  visibility: hidden;
}
