@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50% { box-shadow: 0 0 20px var(--accent-glow); }
}

/* 5x logo click easter egg */
.logo-glow {
  display: inline-block;
  border-radius: 4px;
  animation: glow 0.6s ease-in-out 3, logoRainbow 2.5s linear;
}

@keyframes logoRainbow {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(180deg); }
}

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

.skeleton {
  background: linear-gradient(90deg, var(--hover-bg) 25%, rgba(255,255,255,0.08) 50%, var(--hover-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: statusBlink 2s ease infinite;
}

.status-dot.offline {
  background: var(--danger);
}

.status-dot.idle {
  background: var(--warning);
}

.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #0f0;
  overflow: hidden;
}

.matrix-col {
  position: absolute;
  top: -100%;
  white-space: nowrap;
  writing-mode: vertical-rl;
  animation: matrixFall linear infinite;
  text-shadow: 0 0 8px #0f0;
}

@keyframes matrixFall {
  to { transform: translateY(calc(100vh + 100%)); }
}

/* Rickroll overlay */
.rickroll-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rickroll-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.rickroll-modal {
  position: relative;
  width: min(640px, 92vw);
  padding: 1.5rem;
  border-radius: var(--radius, 14px);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.rickroll-overlay.active .rickroll-modal {
  transform: scale(1);
}

.rickroll-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.rickroll-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.rickroll-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #f472b6;
}

.rickroll-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.rickroll-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.rickroll-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent, #818cf8);
  font-size: 0.85rem;
  text-decoration: none;
}

.rickroll-link:hover {
  text-decoration: underline;
}

/* Completionist celebration confetti — DOM-based and theme-agnostic, unlike
   the canvas starfield's shooting-star burst which is intentionally inert
   during the day theme. This one always shows. */
@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  top: 0;
  z-index: 10001;
  pointer-events: none;
  font-size: 1.4rem;
  animation: confettiFall linear forwards;
}

/* Ultra-rare solar eclipse — a "moon" slides across .sun while the whole
   page dims briefly. Both pieces share one 13s timeline so the dim peaks
   exactly when the moon fully covers the sun. */
.eclipse-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #0a0a18;
  opacity: 0;
  pointer-events: none;
  animation: eclipseDim 13s ease-in-out forwards;
}

.eclipse-moon {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #0d0d1a;
  box-shadow: 0 0 40px 10px rgba(0, 0, 0, 0.5);
  transform: translateX(-220%);
  animation: eclipsePass 13s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes eclipseDim {
  0%, 100% { opacity: 0; }
  45%, 55% { opacity: 0.55; }
}

@keyframes eclipsePass {
  0%   { transform: translateX(-220%); }
  45%  { transform: translateX(0); }
  55%  { transform: translateX(0); }
  100% { transform: translateX(220%); }
}

/* Reduced motion: no sliding moon, but still a real (if brief, static)
   eclipse rather than nothing at all — still worth seeing, just without
   the large-scale motion reduced-motion users have asked to avoid. */
@media (prefers-reduced-motion: reduce) {
  .eclipse-overlay { animation: eclipseDimReduced 6s ease-in-out forwards; }
  .eclipse-moon { animation: none; transform: translateX(0); }
}

@keyframes eclipseDimReduced {
  0%, 100% { opacity: 0; }
  30%, 70% { opacity: 0.5; }
}

/* Creeper easter egg — a brief screen shake, not an explosion overlay,
   so it stays readable rather than obscuring the "Aw man." punchline. */
@keyframes creeperShake {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(-6px, 3px); }
  40%      { transform: translate(5px, -4px); }
  60%      { transform: translate(-4px, -2px); }
  80%      { transform: translate(6px, 2px); }
}

.creeper-shake {
  animation: creeperShake 0.5s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .creeper-shake { animation: none; }
}
