body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: #1E293B;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection {
  background: #2477FF;
  color: #fff;
}
:focus-visible {
  outline: 2px solid #2477FF;
  outline-offset: 2px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}
@keyframes float-medium {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 25px) scale(1.08); }
  66% { transform: translate(15px, -30px) scale(0.97); }
}
@keyframes float-fast {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, 20px) scale(1.03); }
}
.orb { border-radius: 50%; position: absolute; filter: blur(80px); will-change: transform; }
.orb-blue { animation: float-slow 20s ease-in-out infinite; }
.orb-pink { animation: float-medium 16s ease-in-out infinite; }
.orb-green { animation: float-fast 18s ease-in-out infinite; }

.dot-grid {
  background-image: radial-gradient(circle, #CBD5E1 1px, transparent 1px);
  background-size: 32px 32px;
}

@keyframes bounce-dot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #94A3B8;
  animation: bounce-dot 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg {
  opacity: 0;
  transform: translateY(16px);
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-msg.show {
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  overflow: visible;
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-badge {
  background: linear-gradient(90deg, transparent 0%, rgba(36, 119, 255, 0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
}

.explain-inner {
  opacity: 0;
  transform: translateY(16px);
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.explain-inner.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
@media (max-width: 1023px) {
  #explain-panel { display: none !important; }
}

.hover-lift {
  transition: transform 150ms ease-out, box-shadow 150ms ease-out;
}
.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

@media (max-width: 639px) {
  #editor-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px 12px !important;
  }
  #editor-grid .editor-node:last-child {
    grid-column: span 2;
    max-width: 60%;
    margin: 0 auto;
  }
  #demo-panel { height: 80vh !important; }
}
@media (min-width: 640px) {
  #demo-panel { height: 540px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
