/* ══════════════════════════════════════════════
   EASTER EGGS
════════════════════════════════════════════ */

/* 1. Konami code — glitch flash */
.egg-glitch {
  animation: eggGlitchFlash 0.6s steps(2, end);
}
@keyframes eggGlitchFlash {
  0%   { filter: invert(0); }
  20%  { filter: invert(1) hue-rotate(180deg); }
  40%  { filter: invert(0) contrast(1.4); }
  60%  { filter: invert(1); }
  80%  { filter: invert(0) contrast(1.2); }
  100% { filter: invert(0); }
}

/* 2. Logo click x5 tooltip */
.egg-logo-tip {
  position: fixed;
  z-index: 300;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-main);
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.egg-logo-tip.show { opacity: 1; transform: translateY(0); animation: egg-spin 0.5s ease-in-out infinite; }

#navLogo.egg-spin { animation: eggSpin 0.6s ease; }
@keyframes eggSpin {
  0%   { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* 3. "sudo" terminal overlay */
.egg-terminal {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 10, 10, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.egg-terminal.show { display: flex; }
.egg-terminal__box {
  width: min(560px, 92vw);
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 20px 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  color: #e8e8e8;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.egg-terminal__line::before { content: "$ "; color: #6ee7b7; }
.egg-terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: #e8e8e8;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: eggBlink 0.9s steps(1) infinite;
}
@keyframes eggBlink { 50% { opacity: 0; } }

/* 4. Shift-held cursor trail dots */
.egg-trail-dot {
  position: fixed;
  z-index: 9998;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0.5;
  animation: eggTrailFade 0.6s ease forwards;
}
@keyframes eggTrailFade {
  to { opacity: 0; transform: scale(0.4); }
}

/* ── 5.Push-Fade Multi-State Upward Push Sequence ── */

.footer-msg-slot {
  line-height: 1;
}

.footer-location-text,
.egg-end-msg {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--text-soft);
  margin: 0;
  padding: 0;
  transition: opacity 1.25s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Initial State: Location text visible, Egg msg hidden below */
.footer-location-text {
  opacity: 1;
  transform: translateY(0);
}

.egg-end-msg {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

/* State 1 (.active): Egg msg pushes UP to take over */
.footer-msg-slot.active .footer-location-text {
  opacity: 0;
  transform: translateY(-100%);
}

.footer-msg-slot.active .egg-end-msg {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* State 2 (.reset-up): Both push UP again; Location text emerges from below */
.footer-msg-slot.reset-up .egg-end-msg {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.footer-msg-slot.reset-up .footer-location-text {
  opacity: 1;
  /* Instantly moves below before animating up */
  animation: slideUpIn 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 6. Boot log overlay (footer name double-click) */
.egg-boot {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: #000;
  color: #6ee7b7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 40px;
  overflow: hidden;
  display: none;
}
.egg-boot.show { display: block; }
.egg-boot__line { opacity: 0; animation: eggBootIn 0.15s ease forwards; }
@keyframes eggBootIn { to { opacity: 1; } }

/* 7. Invert toggle */
html.egg-inverted {
  filter: invert(1) hue-rotate(180deg);
  transition: filter 0.3s ease;
}

/* 8. Rapid click x10 — particle burst */
.egg-particle {
  position: fixed;
  z-index: 9998;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: eggParticleBurst 0.65s ease-out forwards;
}
@keyframes eggParticleBurst {
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)));
    opacity: 0;
  }
}

/* 9. Project card long-press flip note */
.project-card,
.carousel-container .card,
.swiper-slide .card {
  position: relative !important;
}

.egg-card-flip {
  position: absolute !important;
  inset: 0 !important;
  z-index: 99 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.95) !important; /* 95% dark background */
  color: #f4f4f5 !important;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.egg-card-flip.show {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* 10. code popup — reuses .egg-logo-tip base */
.egg-code-tip { z-index: 500; font-size: 0.85rem; padding: 12px 20px; }

/* 11. Custom right-click context menu */
.egg-context-menu {
  position: fixed;
  z-index: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 200px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.egg-context-menu.show { opacity: 1; transform: translateY(0); }
.egg-context-menu__item {
  font-size: 0.82rem;
  padding: 9px 12px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}
.egg-context-menu__item:hover { background: var(--accent); color: var(--bg); }

.mono {
  font-family: var(--font-mono);
}

/* 12. "eggs" cheat sheet */
.egg-cheatsheet {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10,10,10,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.egg-cheatsheet.show { opacity: 1; }
.egg-cheatsheet__box {
  width: min(480px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.egg-cheatsheet__title {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.egg-cheatsheet__line {
  font-size: 0.82rem;
  color: var(--text-soft);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.egg-cheatsheet__line:last-child { border-bottom: none; }