/* ==========================================================================
   INTRICATE BENTO-CARD ANIMATIONS & CYBERNETIC VISUALIZERS
   Inspired by Deep Obsidian Bento & Futuristic Hardware UI
   ========================================================================== */

/* Bento Container & Glassmorphic Surfaces */
.bento-cyber-card {
  position: relative;
  background: radial-gradient(circle at 20% 20%, rgba(14, 22, 42, 0.7) 0%, rgba(6, 10, 20, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.bento-cyber-card:hover {
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 240, 255, 0.12);
  transform: translateY(-2px);
}

/* Ambient Corner Nebula Glow */
.bento-cyber-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Corner Cybernetic Brackets ┌ ┐ */
.bento-corner-bracket {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  border-color: rgba(0, 240, 255, 0.45);
  z-index: 2;
}
.bento-corner-tl { top: 8px; left: 8px; border-top: 1.5px solid; border-left: 1.5px solid; }
.bento-corner-tr { top: 8px; right: 8px; border-top: 1.5px solid; border-right: 1.5px solid; }
.bento-corner-bl { bottom: 8px; left: 8px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.bento-corner-br { bottom: 8px; right: 8px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

/* Bento Header Strip */
.bento-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.bento-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
}

.bento-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #10b981;
}

.bento-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: bento-pulse 1.8s infinite ease-in-out;
}

@keyframes bento-pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 10px #10b981; }
}

/* 1. Tactile Keycap Matrix (Inspired by Reference 39a99025) */
.keycap-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}

.tactile-keycap {
  position: relative;
  background: linear-gradient(180deg, rgba(25, 34, 56, 0.8) 0%, rgba(12, 18, 32, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 3px solid rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 68px;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.tactile-keycap:hover {
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 240, 255, 0.15);
}

.tactile-keycap:active {
  transform: translateY(1px);
  border-bottom-width: 1px;
}

/* Active Keycap Glowing State (Reference Python Key) */
.tactile-keycap.active-key {
  background: linear-gradient(180deg, rgba(20, 36, 68, 0.95) 0%, rgba(10, 22, 45, 0.98) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.7);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25), inset 0 0 14px rgba(0, 240, 255, 0.15);
}

.tactile-keycap.active-key::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: keycap-specular 4s infinite ease-in-out;
  pointer-events: none;
}

@keyframes keycap-specular {
  0% { left: -100%; }
  35%, 100% { left: 100%; }
}

.keycap-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.keycap-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 4px;
}

.keycap-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: #00f0ff;
  background: rgba(0, 240, 255, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

/* 2. Neural Coprocessor Signal Flow Visualizer (Central Node + Bezier Branches) */
.neural-bus-container {
  position: relative;
  width: 100%;
  height: 220px;
  background: rgba(5, 8, 18, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  margin: 12px 0;
}

.neural-bus-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.signal-flow-path {
  fill: none;
  stroke: rgba(0, 240, 255, 0.22);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  animation: signal-dash 30s linear infinite;
}

@keyframes signal-dash {
  to { stroke-dashoffset: -400; }
}

.signal-flow-packet {
  fill: #00f0ff;
  filter: drop-shadow(0 0 6px #00f0ff);
}

.bus-center-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(16, 26, 52, 0.95) 0%, rgba(6, 10, 22, 0.98) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.25), inset 0 0 15px rgba(0, 240, 255, 0.15);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
}

.bus-chip-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.05em;
}

.bus-chip-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: #94a3b8;
  margin-top: 2px;
}

.bus-sat-node {
  position: absolute;
  background: rgba(10, 16, 32, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 3;
  pointer-events: auto;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bus-sat-node:hover {
  border-color: #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .neural-bus-container {
    height: 240px;
  }
  .bus-sat-node {
    font-size: 0.58rem;
    padding: 4px 7px;
    max-width: 44%;
    white-space: normal;
    line-height: 1.25;
  }
  .bus-sat-node span {
    display: inline-block;
    font-weight: 700;
  }
  .bus-center-chip {
    padding: 6px 10px;
    transform: translate(-50%, -50%) scale(0.85);
  }
  .flagship-hero-main {
    padding: 16px;
  }
  .flagship-hero-title {
    font-size: 1.2rem;
  }
  .flagship-hero-desc {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }
  .flagship-hero-ctas {
    gap: 8px;
  }
  .btn-bento-glow, .btn-bento-outline {
    font-size: 0.76rem;
    padding: 8px 14px;
  }
}

/* 3. Harmonic Waveform Canvas */
.harmonic-waveform-canvas {
  width: 100%;
  height: 90px;
  display: block;
  border-radius: 8px;
}

/* 4. Flagship Bento Hero Section (Consolidating Cluttered Banners) */
.flagship-bento-hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .flagship-bento-hero {
    grid-template-columns: 1fr;
  }
}

.flagship-hero-main {
  position: relative;
  background: linear-gradient(135deg, rgba(8, 16, 36, 0.85) 0%, rgba(5, 9, 20, 0.95) 100%);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 240, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flagship-hero-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 10px 0 8px;
}

.flagship-hero-title span {
  background: linear-gradient(135deg, #00f0ff 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.flagship-hero-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 18px;
}

.flagship-hero-ctas {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-bento-glow {
  background: linear-gradient(135deg, #0284c7 0%, #00f0ff 100%);
  color: #040814;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  transition: all 0.2s ease;
}

.btn-bento-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.55);
  color: #000;
}

.btn-bento-outline {
  background: rgba(14, 22, 42, 0.6);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-bento-outline:hover {
  border-color: rgba(0, 240, 255, 0.4);
  color: #00f0ff;
}

/* Mecanum Kinematics Vector Card (Replacing Clipart Box Robot) */
.kinematics-force-visual {
  position: relative;
  width: 100%;
  height: 170px;
  background: rgba(6, 10, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin: 10px 0;
}
