.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.motion-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: transparent;
  color: var(--green);
  min-height: 42px;
  padding: 9px 12px;
  font-size: 11px;
}
.motion-toggle .icon {
  width: 16px;
  height: 16px;
}
.motion-toggle:hover {
  background: var(--mint);
}
.tangram-art {
  animation: math-float 6s ease-in-out infinite;
}
.tangram-art > svg {
  transform: perspective(650px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg));
  transition: transform 0.18s ease-out;
}
.welcome-banner {
  animation: space-arrive 0.6s ease-out both;
}
.motion-off *,
.motion-paused * {
  animation-play-state: paused !important;
}
.motion-off .tangram-art > svg {
  transform: none !important;
  transition: none;
}
.motion-off .welcome-banner {
  animation: none;
}
.motion-off .resource-card:hover .resource-visual svg {
  transform: none;
}
@keyframes math-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
@keyframes space-arrive {
  from {
    opacity: 0.5;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 700px) {
  .topbar-actions {
    gap: 6px;
  }
  .motion-toggle {
    min-width: 34px;
    min-height: 36px;
    padding: 7px;
  }
  .motion-toggle span {
    display: none;
  }
  .motion-toggle .icon {
    width: 15px;
    height: 15px;
  }
  .account-button {
    max-width: 140px;
  }
  .topbar {
    gap: 8px;
  }
  .topbar h1 {
    max-width: 210px;
  }
  .topbar > div:first-child {
    min-width: 0;
  }
  .topbar-actions {
    flex-shrink: 0;
  }
}
@media (max-width: 360px) {
  .topbar-actions {
    gap: 3px;
  }
  .account-button {
    font-size: 10px;
    max-width: 122px;
  }
  .topbar h1 {
    font-size: 15px;
  }
  .motion-toggle {
    min-width: 30px;
    padding: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tangram-art,
  .welcome-banner {
    animation: none !important;
  }
  .tangram-art > svg {
    transform: none !important;
  }
}
