/* ================================================================
   STARTORCH STUDIOS — pc-3d.css
   Interactive 2.5D PC Workstation & Scroll-Driven Animation Engine
   Inspired by ciaoenergy.com (Smooth 3D mouse parallax & scroll motion)
   ================================================================ */

/* ----------------------------------------------------------------
   1. HERO 2.5D PC STAGE
   ---------------------------------------------------------------- */
.hero-3d-stage {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 480px;
  margin-inline: auto;
  perspective: 1400px;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: grab;
}
.hero-3d-stage:active {
  cursor: grabbing;
}

@media (max-width: 768px) {
  .hero-3d-stage {
    height: 380px;
    max-width: 100%;
    transform: scale(0.85);
  }
}

/* The 3D Rig that rotates with mouse & scroll */
.pc-rig {
  position: relative;
  width: 520px;
  height: 360px;
  transform-style: preserve-3d;
  will-change: transform;
  transform: rotateX(8deg) rotateY(-12deg);
  transition: transform 0.1s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@media (max-width: 600px) {
  .pc-rig {
    width: 360px;
    height: 270px;
  }
}

/* ----------------------------------------------------------------
   2. 3D COMPUTER MONITOR & SCREEN
   ---------------------------------------------------------------- */
.pc-monitor {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 320px;
  background: var(--clr-monitor-bg);
  border-radius: 20px;
  border: 4px solid var(--clr-monitor-bezel);
  box-shadow:
    0 25px 60px rgba(7, 28, 46, 0.35),
    0 0 50px rgba(14, 165, 233, 0.25),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transform-style: preserve-3d;
  transform: translateZ(40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 3D Monitor Extrusion / Bezel Depth */
.pc-monitor::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  border: 3px solid var(--clr-monitor-depth-border);
  transform: translateZ(-8px);
  pointer-events: none;
  background: var(--clr-monitor-depth-bg);
}

/* Monitor Top Bar / Camera */
.pc-top-bar {
  height: 28px;
  background: var(--clr-topbar-bg);
  border-bottom: 1px solid rgba(14, 165, 233, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 14px;
  z-index: 10;
}

.pc-window-dots {
  display: flex;
  gap: 6px;
}
.pc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.pc-dot--red    { background: #ff5f56; }
.pc-dot--yellow { background: #ffbd2e; }
.pc-dot--green  { background: #27c93f; }

.pc-screen-tabs {
  display: flex;
  gap: 4px;
}
.pc-tab {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  color: var(--clr-muted-2);
  background: transparent;
  cursor: pointer;
  transition: all var(--ease);
}
.pc-tab.active,
.pc-tab:hover {
  color: #ffffff;
  background: rgba(14, 165, 233, 0.25);
}

/* Inside Screen Content (Interactive Live Dashboard) */
.pc-screen-view {
  flex: 1;
  background: var(--clr-screen-bg);
  position: relative;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'DM Sans', monospace, sans-serif;
}

/* Screen Glass Glare */
.pc-screen-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.02) 40%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 5;
}

/* Live Code Typing View */
.screen-code-block {
  font-family: 'Courier New', Courier, monospace;
  font-size: 11.5px;
  color: #BAE6FD;
  line-height: 1.6;
}
.code-keyword { color: #38BDF8; font-weight: bold; }
.code-fn      { color: #FDE047; }
.code-str     { color: #86EFAC; }
.code-cursor  {
  display: inline-block;
  width: 7px;
  height: 13px;
  background: #38BDF8;
  vertical-align: middle;
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* Mini Interactive Web Preview inside the 2.5D PC */
.screen-preview-card {
  background: rgba(15, 45, 74, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.preview-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: #38BDF8;
}
.status-pulsar {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38BDF8;
  box-shadow: 0 0 8px #38BDF8;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}


/* ----------------------------------------------------------------
   3. 3D STAND & KEYBOARD BASE
   ---------------------------------------------------------------- */
.pc-stand {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%) translateZ(10px);
  width: 90px;
  height: 48px;
  background: linear-gradient(180deg, var(--clr-stand-top) 0%, var(--clr-stand-bottom) 100%);
  border-radius: 6px 6px 0 0;
  border: 1px solid var(--clr-stand-border);
  z-index: 1;
}

.pc-base-plate {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotateX(75deg) translateZ(0);
  width: 190px;
  height: 120px;
  background: linear-gradient(135deg, var(--clr-base-grad-start) 0%, var(--clr-base-grad-end) 100%);
  border-radius: 14px;
  border: 1px solid var(--clr-accent);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 25px rgba(14, 165, 233, 0.3);
}

/* 3D Floating Keyboard */
.pc-keyboard {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%) rotateX(65deg) translateZ(35px);
  width: 280px;
  height: 95px;
  background: var(--clr-keyboard-bg);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 3px;
  padding: 8px;
  transform-style: preserve-3d;
}
.keyboard-row {
  display: flex;
  gap: 3px;
  justify-content: center;
}
.key-cap {
  flex: 1;
  background: var(--clr-key-bg);
  border-radius: 3px;
  border-bottom: 2px solid var(--clr-key-shadow);
  transition: transform 0.1s ease, background 0.1s ease;
}
.key-cap:hover {
  background: var(--clr-accent);
  transform: translateY(1px);
}


/* ----------------------------------------------------------------
   4. FLOATING 2.5D PARALLAX BADGES (Independent Z-Depth)
   ---------------------------------------------------------------- */
.pc-badge-float {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(14, 165, 233, 0.35);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(7, 28, 46, 0.15), 0 0 20px rgba(14, 165, 233, 0.2);
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 800;
  color: #051C33;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  will-change: transform;
}
.pc-badge-float:hover {
  transform: scale(1.08) translateZ(110px) !important;
  box-shadow: 0 14px 40px rgba(14, 165, 233, 0.35);
  border-color: #0EA5E9;
}

/* Layered 3D Z-Depth Positions */
.badge-pos-1 {
  top: 20px;
  left: -40px;
  transform: translateZ(90px);
}
.badge-pos-2 {
  bottom: 40px;
  right: -50px;
  transform: translateZ(110px);
}
.badge-pos-3 {
  top: -25px;
  right: 20px;
  transform: translateZ(75px);
}


/* ----------------------------------------------------------------
   5. SCROLL-DRIVEN MOTION (Ciao Energy style reveal animations)
   ---------------------------------------------------------------- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  filter: blur(8px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0px);
}

/* Stagger delay classes for lists & cards */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Scroll progress indicator bar at top of viewport */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #38BDF8 0%, #0EA5E9 50%, #0284C7 100%);
  z-index: 10001;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.7);
  transition: width 0.08s ease-out;
}
