/* css/diagram.css */
/* ── CHIP DIAGRAM CONTAINER ── */
.chip-diagram-wrapper {
  width: 680px;
  height: 360px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
  position: relative;
}
.chip-diagram {
  position: relative;
  width: 680px;
  height: 360px;
  flex-shrink: 0;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* GPU Scale breaks for tablet & laptop sizes */
@media (max-width: 1400px) and (min-width: 1251px) {
  .chip-diagram-wrapper{width:700px}
  .chip-diagram{transform:scale(0.85);transform-origin:right center}
}
@media (max-width: 1300px) and (min-width: 1251px) {
  .chip-diagram-wrapper{width:615px}
  .chip-diagram{transform:scale(0.75);transform-origin:right center}
}
@media (max-width: 1250px) {
  .chip-diagram-wrapper{width:100%;max-width:820px;height:auto;justify-content:center}
  .chip-diagram{width:100%;max-width:820px;margin:0 auto;transform:none !important}
}

/* ── MULTI-LAYERED SCI-FI CORE ── */
.chip-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%) translateZ(20px); /* 3D layer lift */
  width: 106px;
  height: 106px;
  background: radial-gradient(circle at center, rgba(30,30,30,0.92) 0%, rgba(13,13,13,0.98) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1.5px solid rgba(255, 92, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 45px rgba(255, 92, 26, 0.35), inset 0 0 20px rgba(255, 92, 26, 0.2);
  z-index: 5;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.chip-center:hover {
  border-color: rgba(255, 92, 26, 0.85);
  box-shadow: 0 0 60px rgba(255, 92, 26, 0.6), inset 0 0 25px rgba(255, 92, 26, 0.35);
  transform: translate(-50%,-50%) scale(1.05) translateZ(25px);
}
.core-glow {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(255, 92, 26, 0.35) 0%, transparent 70%);
  border-radius: 50%;
  animation: corePulse 2s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}
.core-orbit {
  position: absolute;
  width: 136px;
  height: 136px;
  border: 1px dashed rgba(255, 92, 26, 0.35);
  border-radius: 50%;
  animation: rotCW 20s linear infinite;
  pointer-events: none;
}
.core-inner-glow {
  position: absolute;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 92, 26, 0.03);
  border-radius: 12px;
  pointer-events: none;
}
@keyframes corePulse {
  0% { transform: scale(0.92); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 1; }
}
.chip-label {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, #fff 30%, #ff8533 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(255, 92, 26, 0.3);
  z-index: 2;
}

/* Pins */
.chip-pins-row {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 36px);
  display: flex;
  gap: 7px;
  z-index: 5;
}
.cp {
  width: 4px;
  height: 18px;
  background: #2a2a2a;
  border-radius: 2px;
  transition: background 0.3s ease;
}
.cp.lit {
  background: linear-gradient(to bottom, var(--orange), #ffb380);
  box-shadow: 0 0 8px var(--orange);
}

/* ── SVG CIRCUIT CONDUITS ── */
.circuit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ── INTERACTIVE SPARK CANVAS OVERLAY ── */
#conduitCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* ── REFERENCE DIAL PROGRESS GAUGE CARDS ── */
.model-card {
  position: absolute;
  z-index: 4;
  width: 116px;
  height: 156px;
  border-radius: 12px;
  background: radial-gradient(circle at top left, rgba(35, 35, 37, 0.95) 0%, rgba(15, 15, 16, 0.98) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.08);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: cardFloat 3.5s ease-in-out infinite alternate;
  cursor: pointer;
  overflow: visible;
}
.model-card:nth-child(2){animation-delay:.3s}.model-card:nth-child(3){animation-delay:.6s}.model-card:nth-child(4){animation-delay:.9s}

@keyframes cardFloat{
  from { transform: translateY(0) translateZ(10px); }
  to { transform: translateY(-8px) translateZ(10px); }
}

/* Floating telemetry outlines */
.model-card::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px dashed rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  pointer-events: none;
  transition: all 0.4s ease;
}
.model-card::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(255, 255, 255, 0.015);
  border-radius: 20px;
  pointer-events: none;
  transition: all 0.4s ease;
}

/* Header Text */
.card-header {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
}

/* Gauge Circle Container */
.gauge-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gauge-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-220deg); /* align starting point of the arc to bottom-left */
}
.gauge-bg {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 2.5;
  fill: none;
}
.gauge-progress {
  stroke-width: 2.8;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 188.4;
  stroke-dashoffset: 140; /* low gauge setting default */
  transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), stroke 0.4s;
}

/* Custom indicator colors matching the reference spec */
.gauge-progress.orange { stroke: #ff5c1a; filter: drop-shadow(0 0 3px rgba(255, 92, 26, 0.4)); }
.gauge-progress.cyan { stroke: #00f0ff; filter: drop-shadow(0 0 3px rgba(0, 240, 255, 0.4)); }
.gauge-progress.green { stroke: #39ff14; filter: drop-shadow(0 0 3px rgba(57, 255, 20, 0.4)); }
.gauge-progress.purple { stroke: #e000ff; filter: drop-shadow(0 0 3px rgba(224, 0, 255, 0.4)); }

/* Gauge Inner Content text overlay */
.gauge-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
}
.gauge-icon {
  width: 10px;
  height: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 1px;
  transition: all 0.4s;
}
.gauge-icon.orange { color: rgba(255, 92, 26, 0.7); }
.gauge-icon.cyan { color: rgba(0, 240, 255, 0.7); }
.gauge-icon.green { color: rgba(57, 255, 20, 0.7); }
.gauge-icon.purple { color: rgba(224, 0, 255, 0.7); }

.gauge-value {
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 1px 5px rgba(0,0,0,0.5);
  letter-spacing: -0.2px;
}
.gauge-unit {
  font-size: 6px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Footer Section */
.card-footer {
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  pointer-events: none;
  transition: color 0.3s;
}

/* Active & Hover States — Rev up the dial gauge! */
.model-card:hover, .model-card.active {
  border-color: rgba(255, 92, 26, 0.5);
  box-shadow: 0 15px 45px rgba(0,0,0,0.9), 0 0 25px rgba(255, 92, 26, 0.15), inset 0 1px 1px rgba(255,255,255,0.15);
  background: radial-gradient(circle at top left, rgba(42, 42, 45, 0.98) 0%, rgba(18, 18, 19, 0.99) 100%);
}
.model-card.active::before, .model-card:hover::before {
  inset: -8px;
  border-color: rgba(255, 255, 255, 0.1);
}
.model-card.active::after, .model-card:hover::after {
  inset: -14px;
  border-color: rgba(255, 255, 255, 0.04);
}

.model-card.active .gauge-progress, .model-card:hover .gauge-progress {
  stroke-dashoffset: 45; /* Rev up the circular progress indicator track! */
}
.model-card.active .gauge-icon, .model-card:hover .gauge-icon {
  color: #fff;
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px currentColor);
}
.model-card.active .card-footer, .model-card:hover .card-footer {
  color: #fff;
}

/* Card coordinates aligned to centers (70, 85) and (750, 255) */
.mc-tl{top:7px;left:12px}
.mc-tr{top:7px;right:12px}
.mc-bl{bottom:7px;left:12px}
.mc-br{bottom:7px;right:12px}

/* SVG Laser pulses */
@keyframes wirePulse{0%{stroke-dashoffset:240}100%{stroke-dashoffset:0}}
.wire-pulse {
  stroke: var(--orange);
  stroke-width: 2.5;
  fill: none;
  stroke-dasharray: 25 185;
  stroke-dashoffset: 240;
  animation: wirePulse 2s linear infinite;
  filter: url(#laser-glow);
}

@keyframes rotCW { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rotCCW { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
.rot-clockwise { animation: rotCW 24s linear infinite; }
.rot-counter { animation: rotCCW 18s linear infinite; }

/* Mobile responsive node cards overrides */
@media(max-width:768px){
  .chip-diagram{height:260px}
  .model-card{
    width:76px;
    height:102px;
    padding: 6px 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  }
  .model-card::before, .model-card::after { display: none; }
  .card-header { font-size: 5.5px; }
  .gauge-wrapper { width: 44px; height: 44px; }
  .gauge-value { font-size: 11px; }
  .gauge-unit { font-size: 4.5px; }
  .gauge-icon { display: none; }
  .card-footer { font-size: 5.5px; padding-top: 4px; }
  .mc-tl{top:6px;left:6px}
  .mc-tr{top:6px;right:6px}
  .mc-bl{bottom:6px;left:6px}
  .mc-br{bottom:6px;right:6px}
}
