/* ========= ASCII ANIMATED HEADER ========= */
/* NASA mission-control aesthetic — r510-command-center style */
/* Desktop/tablet only. Mobile shows regular hero text. */

.ascii-header-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-primary);
  margin-bottom: 32px;
  height: 220px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-muted);
}

/* Mobile: hide ASCII header, show regular hero */
.mobile-hero { display: none; }

@media (max-width: 768px) {
  .ascii-header-wrapper { display: none; }
  .mobile-hero { display: block; }
}

/* Stars layer */
.ascii-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  color: rgba(152, 152, 176, 0.5);
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ASCII art scenes */
.ascii-scene {
  position: relative;
  z-index: 2;
  padding: 16px 24px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ascii-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.ascii-art-left {
  white-space: pre;
  color: var(--accent);
  font-weight: 500;
  text-shadow: 0 0 20px var(--accent-glow);
}

.ascii-art-right {
  white-space: pre;
  color: var(--cyan);
  font-weight: 500;
  text-align: right;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.3);
}

/* Title between the ASCII art */
.ascii-center-title {
  flex: 1;
  text-align: center;
  padding-top: 20px;
}

.ascii-center-title h1 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.ascii-center-title .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

/* Sine arc path */
.ascii-arc {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  height: 60px;
  pointer-events: none;
  z-index: 1;
}

.arc-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-light);
}

/* Traveling packets */
.packet {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 3;
  animation: travelArc var(--travel-duration, 8s) linear infinite;
  animation-delay: var(--travel-delay, 0s);
}

.packet.cpu {
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange), 0 0 16px rgba(251, 146, 60, 0.4);
}

.packet.ram {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan), 0 0 16px rgba(34, 211, 238, 0.4);
}

.packet.response {
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px rgba(52, 211, 153, 0.4);
  animation-direction: reverse;
}

.packet.error {
  background: var(--red);
  box-shadow: 0 0 8px var(--red), 0 0 16px rgba(248, 113, 113, 0.4);
}

/* Packet trail */
.packet-trail {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  opacity: 0.4;
  z-index: 2;
  animation: travelArc var(--travel-duration, 8s) linear infinite;
  animation-delay: var(--travel-delay, 0s);
}

.packet-trail.cpu { background: var(--orange); }
.packet-trail.ram { background: var(--cyan); }
.packet-trail.response { background: var(--green); animation-direction: reverse; }

@keyframes travelArc {
  0%   { left: var(--start-x, 10%); bottom: var(--start-y, 50px); opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { left: var(--end-x, 85%); bottom: var(--end-y, 50px); opacity: 0; }
}

/* Drifting satellite */
.ascii-satellite {
  position: absolute;
  top: 8px;
  color: var(--accent);
  font-size: 14px;
  z-index: 4;
  animation: driftAcross 20s linear infinite;
  text-shadow: 0 0 10px var(--accent-glow);
}

@keyframes driftAcross {
  0%   { left: -5%; opacity: 0; }
  3%   { opacity: 1; }
  97%  { opacity: 1; }
  100% { left: 105%; opacity: 0; }
}

/* Scanline sweep */
.ascii-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.15;
  z-index: 5;
  animation: scanSweep 6s linear infinite;
  pointer-events: none;
}

@keyframes scanSweep {
  0%   { top: 0; }
  100% { top: 100%; }
}

/* Status bar at bottom */
.ascii-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-family: var(--font-mono);
  z-index: 6;
  position: relative;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.purple { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .star { animation: none; opacity: 0.5; }
  .packet, .packet-trail { animation: none; display: none; }
  .ascii-satellite { animation: none; }
  .ascii-scanline { animation: none; }
  .status-dot { animation: none; }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .ascii-header-wrapper { height: 180px; font-size: 10px; }
  .ascii-center-title h1 { font-size: 22px; }
}
