/* ==========================================================================
   Qnity Engineering — Landing Page v3 Stylesheet
   Theme: High-Tech Dark / Isometric 3D Scrollytelling
   Palette: Deep Navy (#0B132B / #0B2545), Teal (#00A896 / #02C39A), 
            Alert Red (#EF4444), Warning Amber (#F59E0B), Clean Slate (#F8FAFC)
   ========================================================================== */

:root {
  --bg-dark: #070D1E;
  --bg-navy: #0B132B;
  --bg-card: rgba(11, 37, 69, 0.72);
  --bg-card-hover: rgba(15, 45, 82, 0.88);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(0, 168, 150, 0.35);
  --teal-primary: #00A896;
  --teal-bright: #02C39A;
  --teal-glow: rgba(2, 195, 154, 0.4);
  --alert-red: #EF4444;
  --warning-amber: #F59E0B;
  --accent-gold: #F8CF40;
  --text-primary: #FFFFFF;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* Base Resets & Typography */
body.v3-body {
  background-color: var(--bg-dark);
  color: #E2E8F0;
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  selection-background-color: var(--teal-primary);
  selection-color: #070D1E;
}

/* Technical Grid Pattern Overlay */
.v3-grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}

.v3-radial-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 65% 45%, rgba(0, 168, 150, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 20% 80%, rgba(11, 37, 69, 0.4) 0%, transparent 70%);
  z-index: 2;
}

/* 3D Canvas Container */
#v3-canvas-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  pointer-events: auto;
}

#v3-three-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Scrollytelling Sections */
.v3-scroll-track {
  position: relative;
  z-index: 20;
}

.v3-scene-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 5rem 1.5rem;
  box-sizing: border-box;
  pointer-events: none; /* Let user orbit/click 3D canvas behind empty areas */
}

.v3-scene-section .v3-hud-card,
.v3-scene-section .v3-interactive-panel,
.v3-scene-section button,
.v3-scene-section a,
.v3-scene-section input,
.v3-scene-section select {
  pointer-events: auto; /* Re-enable pointer events for UI cards */
}

/* Glassmorphism Cards & HUD Panels */
.v3-hud-card {
  background: rgba(11, 23, 46, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden;
}

.v3-hud-card:hover {
  border-color: rgba(0, 168, 150, 0.4);
  box-shadow: 0 24px 50px -10px rgba(0, 168, 150, 0.15), 0 0 0 1px rgba(0, 168, 150, 0.2);
}

#v3-scene-6 {
  align-items: flex-start;
  padding-top: 5.75rem;
  padding-bottom: 7.5rem;
}

#v3-scene-6 .v3-hud-card {
  max-height: calc(100vh - 9.25rem);
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 168, 150, 0.5) rgba(11, 23, 46, 0.6);
}

#v3-scene-6 .v3-hud-card::-webkit-scrollbar {
  width: 6px;
}

#v3-scene-6 .v3-hud-card::-webkit-scrollbar-track {
  background: rgba(11, 23, 46, 0.6);
  border-radius: 9999px;
  margin: 6px 0;
}

#v3-scene-6 .v3-hud-card::-webkit-scrollbar-thumb {
  background: rgba(0, 168, 150, 0.5);
  border-radius: 9999px;
}

#v3-scene-6 .v3-hud-card::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 195, 154, 0.85);
}

#v3-diag-result-card {
  max-height: none;
  overflow: visible;
}

.v3-card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v3-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.v3-tag-teal {
  background: rgba(0, 168, 150, 0.15);
  color: #02C39A;
  border: 1px solid rgba(0, 168, 150, 0.3);
}

.v3-tag-red {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.v3-tag-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.v3-tag-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 3D Hotspot Pin Markers */
.v3-hotspot-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.35s;
}

.v3-hotspot-pin.is-settled {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.v3-hotspot-pin:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

.v3-pin-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #02C39A;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 12px #02C39A;
  position: relative;
}

.v3-pin-ripple {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #02C39A;
  animation: v3-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.v3-pin-tooltip {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(7, 13, 30, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 212, 191, 0.6);
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ecfeff;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55), 0 0 12px rgba(45, 212, 191, 0.2);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.v3-hotspot-pin.is-settled .v3-pin-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.v3-pin-tooltip::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 8px;
  height: 1px;
  background: rgba(45, 212, 191, 0.8);
}

@keyframes v3-ping {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* GreenBOS-Style Walkthrough Dock Controls */
.v3-walkthrough-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(11, 23, 46, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.v3-dock-step-pill {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  transition: all 0.25s ease;
  cursor: pointer;
}

.v3-dock-step-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.v3-dock-step-pill.is-active {
  background: #00A896;
  color: #FFFFFF;
  border-color: #02C39A;
  box-shadow: 0 0 12px rgba(2, 195, 154, 0.5);
  transform: scale(1.08);
}

.v3-dock-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.v3-dock-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.v3-dock-btn-primary {
  background: #00A896;
  border-color: #02C39A;
  color: #FFFFFF;
}

.v3-dock-btn-primary:hover {
  background: #02C39A;
  box-shadow: 0 0 14px rgba(2, 195, 154, 0.5);
}

/* Pulsing Live Telemetry Indicator */
.v3-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #02C39A;
  box-shadow: 0 0 8px #02C39A;
  animation: v3-pulse 1.8s infinite;
}

@keyframes v3-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* Diagnostic Engine UI Elements */
.v3-diagnostic-display {
  background: #050B17;
  border: 1px solid rgba(0, 168, 150, 0.25);
  border-radius: 0.875rem;
  padding: 1.25rem;
  font-family: var(--font-mono);
}

.v3-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.65rem;
  margin-bottom: 0.85rem;
  font-size: 0.72rem;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.v3-gauge-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.v3-gauge-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Code Snippet / Key-Value List */
.v3-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}

.v3-metric-row:last-child {
  border-bottom: none;
}

/* Modals */
.v3-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 11, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.v3-modal-window {
  background: #0B132B;
  border: 1px solid rgba(0, 168, 150, 0.4);
  border-radius: 1.5rem;
  width: 100%;
  max-width: 48rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 168, 150, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .v3-scene-section {
    padding: 4rem 1rem;
  }
  .v3-walkthrough-dock {
    width: calc(100% - 2rem);
    justify-content: space-between;
    padding: 0.5rem 0.65rem;
  }
  .v3-dock-step-pill {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.65rem;
  }
}
