/* =============================================================
   Agent Mascot Animations
   ============================================================= */

:root {
  --mascot-icon-color: #000000;
  --mascot-bg-color: #ffffff;
  /* Hermes glint: white specular on the dark (light-theme) silhouette. */
  --hermes-gleam: #ffffff;
}

.dark {
  --mascot-icon-color: #ffffff;
  --mascot-bg-color: #000000;
  /* On the white (dark-theme) silhouette a white glint would vanish, so the
     light reads as a warm gold gleam instead — kept pale so it stays a soft
     glint rather than a heavy gold band. */
  --hermes-gleam: #fceecb;
}

/* === Claude === */
.mascot-claude .pixel {
  fill: #c98867;
}
.mascot-claude .eye {
  fill: #1f1710;
}
.mascot-claude .body {
  transform-origin: 120px 55px;
}
.mascot-claude .arm-right {
  transform-origin: 200px 75px;
}
.mascot-claude .arm-left {
  transform-origin: 40px 75px;
}
.mascot-claude .legs {
  transform-origin: 120px 110px;
}

/* Hover: jump + wave hello */
.mascot-claude.is-animated {
  animation: claude-jump 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}
.mascot-claude.is-animated .arm-right {
  animation: claude-wave-right 1.2s ease-in-out infinite;
}
.mascot-claude.is-animated .arm-left {
  animation: claude-wave-left 1.2s ease-in-out infinite;
}
.mascot-claude.is-animated .legs {
  animation: claude-legs-squash-light 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    infinite;
}
.mascot-claude.is-animated .eye {
  animation: claude-blink 3.2s infinite;
}

/* Click: run to edge, peek, blink, run back */
.mascot-claude.is-clicked {
  animation: claude-peek 4s ease-in-out;
}
.mascot-claude.is-clicked .eye {
  animation: claude-peek-blink 4s ease-in-out;
}
.mascot-claude.is-clicked .leg-a {
  animation: claude-leg-a 4s linear;
}
.mascot-claude.is-clicked .leg-b {
  animation: claude-leg-b 4s linear;
}

@keyframes claude-wave-right {
  0%,
  100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(-25deg);
  }
  30% {
    transform: rotate(15deg);
  }
  45% {
    transform: rotate(-20deg);
  }
  60% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(0deg);
  }
}
@keyframes claude-wave-left {
  0%,
  100% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(25deg);
  }
  30% {
    transform: rotate(-15deg);
  }
  45% {
    transform: rotate(20deg);
  }
  60% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(0deg);
  }
}
@keyframes claude-blink {
  0%,
  90%,
  94%,
  100% {
    transform: scaleY(1);
  }
  92% {
    transform: scaleY(0.1);
  }
}

/* Click: run to edge, peek, blink, run back */
@keyframes claude-peek {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  18% {
    transform: translateX(55px) rotate(0deg);
  }
  24% {
    transform: translateX(55px) rotate(-12deg);
  }
  55% {
    transform: translateX(55px) rotate(-12deg);
  }
  60% {
    transform: translateX(55px) rotate(0deg);
  }
  78% {
    transform: translateX(0) rotate(0deg);
  }
  100% {
    transform: translateX(0) rotate(0deg);
  }
}
@keyframes claude-peek-blink {
  0%,
  30%,
  36%,
  42%,
  48%,
  100% {
    transform: scaleY(1);
  }
  32%,
  34% {
    transform: scaleY(0.1);
  }
  44%,
  46% {
    transform: scaleY(0.1);
  }
}
/* Leg pair A: far-left + inner-right (diagonal) */
@keyframes claude-leg-a {
  0% {
    transform: translateX(0);
  }
  1.5% {
    transform: translateX(8px);
  }
  3% {
    transform: translateX(-8px);
  }
  4.5% {
    transform: translateX(8px);
  }
  6% {
    transform: translateX(-8px);
  }
  7.5% {
    transform: translateX(8px);
  }
  9% {
    transform: translateX(-8px);
  }
  10.5% {
    transform: translateX(8px);
  }
  12% {
    transform: translateX(-8px);
  }
  13.5% {
    transform: translateX(8px);
  }
  15% {
    transform: translateX(-8px);
  }
  16.5% {
    transform: translateX(5px);
  }
  18% {
    transform: translateX(0);
  }
  60% {
    transform: translateX(0);
  }
  61.5% {
    transform: translateX(8px);
  }
  63% {
    transform: translateX(-8px);
  }
  64.5% {
    transform: translateX(8px);
  }
  66% {
    transform: translateX(-8px);
  }
  67.5% {
    transform: translateX(8px);
  }
  69% {
    transform: translateX(-8px);
  }
  70.5% {
    transform: translateX(8px);
  }
  72% {
    transform: translateX(-8px);
  }
  73.5% {
    transform: translateX(8px);
  }
  75% {
    transform: translateX(-8px);
  }
  76.5% {
    transform: translateX(5px);
  }
  78% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}
/* Leg pair B: inner-left + far-right (opposite phase) */
@keyframes claude-leg-b {
  0% {
    transform: translateX(0);
  }
  1.5% {
    transform: translateX(-8px);
  }
  3% {
    transform: translateX(8px);
  }
  4.5% {
    transform: translateX(-8px);
  }
  6% {
    transform: translateX(8px);
  }
  7.5% {
    transform: translateX(-8px);
  }
  9% {
    transform: translateX(8px);
  }
  10.5% {
    transform: translateX(-8px);
  }
  12% {
    transform: translateX(8px);
  }
  13.5% {
    transform: translateX(-8px);
  }
  15% {
    transform: translateX(8px);
  }
  16.5% {
    transform: translateX(-5px);
  }
  18% {
    transform: translateX(0);
  }
  60% {
    transform: translateX(0);
  }
  61.5% {
    transform: translateX(-8px);
  }
  63% {
    transform: translateX(8px);
  }
  64.5% {
    transform: translateX(-8px);
  }
  66% {
    transform: translateX(8px);
  }
  67.5% {
    transform: translateX(-8px);
  }
  69% {
    transform: translateX(8px);
  }
  70.5% {
    transform: translateX(-8px);
  }
  72% {
    transform: translateX(8px);
  }
  73.5% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
  76.5% {
    transform: translateX(-5px);
  }
  78% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes claude-jump {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-6px) scale(0.96, 1.06);
  }
  50% {
    transform: translateY(-8px) scale(0.95, 1.07);
  }
  80% {
    transform: translateY(-1px) scale(1.04, 0.96);
  }
}
@keyframes claude-flap-right {
  0%,
  100% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(-3px);
  }
  50% {
    transform: translateY(0.5px);
  }
  70% {
    transform: translateY(-2px);
  }
}
@keyframes claude-flap-left {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-2.5px);
  }
  55% {
    transform: translateY(0.5px);
  }
  75% {
    transform: translateY(-1.5px);
  }
}
@keyframes claude-squint {
  0%,
  100% {
    transform: scaleY(1);
  }
  20%,
  60% {
    transform: scaleY(0.15);
  }
}
@keyframes claude-legs-squash {
  0%,
  100% {
    transform: scaleY(1);
  }
  30% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(0.4);
  }
  80% {
    transform: scaleY(1.1);
  }
}
@keyframes claude-legs-squash-light {
  0%,
  100% {
    transform: scaleY(1);
  }
  30% {
    transform: scaleY(0.8);
  }
  50% {
    transform: scaleY(0.75);
  }
  80% {
    transform: scaleY(1.05);
  }
}

/* === Cursor === */
.mascot-cursor .icon-fill {
  fill: var(--mascot-icon-color);
  fill-rule: evenodd;
}
.mascot-cursor .shadow-el {
  fill: var(--mascot-icon-color);
  opacity: 0.18;
  transform-origin: center center;
}
.dark .mascot-cursor .shadow-el {
  opacity: 0.35;
}
.mascot-cursor .rocker {
  transform-origin: center bottom;
  perspective: 800px;
  transition: filter 0.4s ease;
}

.mascot-cursor.is-animated .rocker {
  animation: cursor-rock 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(128, 128, 128, 0.12));
}
.mascot-cursor.is-animated .shadow-el {
  animation: cursor-shadow-rock 2.2s ease-in-out infinite;
}

.mascot-cursor.is-clicked .rocker {
  animation: none;
  filter: drop-shadow(0 0 10px rgba(128, 128, 128, 0.2));
}
.mascot-cursor.is-clicked .icon-svg {
  animation: cursor-spin3d 0.75s ease-in-out;
}
.mascot-cursor.is-clicked .shadow-el {
  animation: cursor-shadow-spin 0.75s ease-in-out;
}

@keyframes cursor-rock {
  0%,
  100% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(16deg);
  }
  70% {
    transform: rotate(-16deg);
  }
}
@keyframes cursor-shadow-rock {
  0%,
  50%,
  100% {
    transform: scaleX(1);
  }
  30% {
    transform: scaleX(1.1);
  }
  70% {
    transform: scaleX(1.1);
  }
}
@keyframes cursor-spin3d {
  0% {
    transform: rotateY(0deg) translateY(0);
  }
  50% {
    transform: rotateY(180deg) translateY(-4px);
  }
  100% {
    transform: rotateY(360deg) translateY(0);
  }
}
@keyframes cursor-shadow-spin {
  0%,
  100% {
    transform: scaleX(1) scaleY(1);
  }
  25%,
  75% {
    transform: scaleX(0.08) scaleY(0.6);
    opacity: 0.3;
  }
  50% {
    transform: scaleX(0.85) scaleY(0.85);
  }
}

/* === Codex (OpenAI) === */
.mascot-codex .icon-fill {
  fill: var(--mascot-icon-color);
}
.mascot-codex .codex-icon-wrapper svg {
  display: block;
}

.mascot-codex.is-animated .codex-icon-wrapper {
  animation: codex-roll 3.5s ease-in-out infinite;
}

.mascot-codex.is-clicked .codex-icon-wrapper {
  animation: codex-bounce 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.mascot-codex.is-clicked .codex-icon-wrapper svg {
  animation: codex-squish 0.7s ease-out;
}

@keyframes codex-roll {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  35% {
    transform: translateX(75px) rotate(270deg);
  }
  35.01% {
    transform: translateX(-75px) rotate(-270deg);
  }
  70% {
    transform: translateX(0) rotate(0deg);
  }
  100% {
    transform: translateX(0) rotate(0deg);
  }
}
@keyframes codex-bounce {
  0% {
    transform: translateY(0);
  }
  12% {
    transform: translateY(6px);
  }
  35% {
    transform: translateY(-30px);
  }
  52% {
    transform: translateY(0);
  }
  65% {
    transform: translateY(-10px);
  }
  78% {
    transform: translateY(0);
  }
  88% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes codex-squish {
  0% {
    transform: scale(1, 1);
  }
  12% {
    transform: scale(1.25, 0.7);
  }
  28% {
    transform: scale(0.85, 1.2);
  }
  42% {
    transform: scale(1.08, 0.92);
  }
  56% {
    transform: scale(0.96, 1.05);
  }
  72% {
    transform: scale(1.02, 0.98);
  }
  100% {
    transform: scale(1, 1);
  }
}

/* === Gemini === */
.mascot-gemini .star-wrapper {
  position: relative;
  z-index: 2;
}
.mascot-gemini .glow-el {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.6);
  filter: blur(12px);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.mascot-gemini .particles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
}
.mascot-gemini .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  opacity: 0;
  transform: rotate(45deg);
}
.mascot-gemini .particle:nth-child(1) {
  background: #3186ff;
}
.mascot-gemini .particle:nth-child(2) {
  background: #08b962;
}
.mascot-gemini .particle:nth-child(3) {
  background: #f94543;
}
.mascot-gemini .particle:nth-child(4) {
  background: #fabc12;
}
.mascot-gemini .particle:nth-child(5) {
  background: #3186ff;
}
.mascot-gemini .particle:nth-child(6) {
  background: #08b962;
}

.mascot-gemini.is-animated .star-wrapper {
  animation: gemini-float-spin 4s linear infinite;
}
.mascot-gemini.is-animated .star-svg {
  animation: gemini-twinkle 2s ease-in-out infinite;
}
.mascot-gemini.is-animated .glow-el {
  opacity: 0;
}

.mascot-gemini.is-clicked .star-wrapper {
  animation: gemini-pop-spin 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mascot-gemini.is-clicked .star-svg {
  animation: none;
}
.mascot-gemini.is-clicked .glow-el {
  opacity: 0.8;
  animation: gemini-glow-flash 0.7s ease-out;
}
.mascot-gemini.is-clicked .particle:nth-child(1) {
  animation: gemini-burst-1 0.7s ease-out;
}
.mascot-gemini.is-clicked .particle:nth-child(2) {
  animation: gemini-burst-2 0.7s ease-out;
}
.mascot-gemini.is-clicked .particle:nth-child(3) {
  animation: gemini-burst-3 0.7s ease-out;
}
.mascot-gemini.is-clicked .particle:nth-child(4) {
  animation: gemini-burst-4 0.7s ease-out;
}
.mascot-gemini.is-clicked .particle:nth-child(5) {
  animation: gemini-burst-5 0.7s ease-out;
}
.mascot-gemini.is-clicked .particle:nth-child(6) {
  animation: gemini-burst-6 0.7s ease-out;
}

@keyframes gemini-float-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes gemini-twinkle {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}
@keyframes gemini-glow-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) scale(1.6);
  }
  50% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(1.75);
  }
}
@keyframes gemini-pop-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  12% {
    transform: rotate(0deg) scale(0.7);
  }
  40% {
    transform: rotate(200deg) scale(1.2);
  }
  65% {
    transform: rotate(340deg) scale(1.05);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}
@keyframes gemini-glow-flash {
  0% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.6);
  }
  20% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(2.2);
  }
  100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1.6);
  }
}
@keyframes gemini-burst-1 {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(0, -40px) scale(0.3);
  }
}
@keyframes gemini-burst-2 {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(35px, 20px) scale(0.3);
  }
}
@keyframes gemini-burst-3 {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(-35px, 20px) scale(0.3);
  }
}
@keyframes gemini-burst-4 {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(40px, 0) scale(0.3);
  }
}
@keyframes gemini-burst-5 {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(-40px, 0) scale(0.3);
  }
}
@keyframes gemini-burst-6 {
  0% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(0, 40px) scale(0.3);
  }
}

/* === Antigravity === */
.mascot-antigravity.is-animated .ag-icon-wrapper {
  animation: ag-moonwalk 2.5s linear infinite;
}

.mascot-antigravity.is-clicked .ag-icon-wrapper {
  animation:
    ag-launch-crouch 0.35s ease-out forwards,
    ag-launch-fly 0.25s ease-in 0.35s forwards;
}

@keyframes ag-moonwalk {
  0% {
    transform: translateY(0) rotate(7deg);
  }
  8% {
    transform: translateY(-7px) rotate(2deg);
  }
  12% {
    transform: translateY(-9px) rotate(0deg);
  }
  20% {
    transform: translateY(-8px) rotate(-1deg);
  }
  30% {
    transform: translateY(-6px) rotate(-3deg);
  }
  40% {
    transform: translateY(-3px) rotate(-5deg);
  }
  50% {
    transform: translateY(0) rotate(-7deg);
  }
  58% {
    transform: translateY(-7px) rotate(-2deg);
  }
  62% {
    transform: translateY(-9px) rotate(0deg);
  }
  70% {
    transform: translateY(-8px) rotate(1deg);
  }
  80% {
    transform: translateY(-6px) rotate(3deg);
  }
  90% {
    transform: translateY(-3px) rotate(5deg);
  }
  100% {
    transform: translateY(0) rotate(7deg);
  }
}
@keyframes ag-launch-crouch {
  0% {
    transform: translateY(0) scaleY(1) scaleX(1);
  }
  60% {
    transform: translateY(14px) scaleY(0.42) scaleX(1.45);
  }
  100% {
    transform: translateY(16px) scaleY(0.38) scaleX(1.5);
  }
}
@keyframes ag-launch-fly {
  0% {
    transform: translateY(16px) scaleY(0.38) scaleX(1.5);
  }
  15% {
    transform: translateY(0) scaleY(1.2) scaleX(0.85);
  }
  100% {
    transform: translateY(-160px) scaleY(1.2) scaleX(0.85);
  }
}

/* === Copilot === */
.mascot-copilot .cp-icon-fill {
  fill: var(--mascot-icon-color);
}
.mascot-copilot .cp-eye {
  fill: var(--mascot-icon-color);
}
.mascot-copilot .cp-lens-fill {
  fill: var(--mascot-bg-color);
}

.mascot-copilot .cp-head {
  transform-origin: 12px 12px;
}
.mascot-copilot .cp-glasses {
  transform-origin: 12px 6.5px;
}
.mascot-copilot .cp-eye {
  transform-box: fill-box;
  transform-origin: center center;
}

/* Hover: nod + blink */
.mascot-copilot.is-animated .cp-head {
  animation: cp-nod 2.8s ease-in-out infinite;
}
.mascot-copilot.is-animated .cp-eye {
  animation: cp-blink 2.8s ease-in-out infinite;
}

@keyframes cp-nod {
  0%,
  25%,
  50%,
  100% {
    transform: rotate(0deg);
  }
  30%,
  42% {
    transform: rotate(8deg) translateY(0.4px);
  }
}
@keyframes cp-blink {
  0%,
  14%,
  20%,
  58%,
  64%,
  100% {
    transform: scaleY(1);
  }
  16%,
  18% {
    transform: scaleY(0.08);
  }
  60%,
  62% {
    transform: scaleY(0.08);
  }
}

/* Click: shake + glasses fall */
.mascot-copilot .cp-head.cp-shaking {
  animation: cp-shake 0.5s ease-in-out forwards;
}
.mascot-copilot .cp-glasses.cp-falling {
  animation: cp-fall 0.9s cubic-bezier(0.4, 0, 0.9, 0.4) forwards;
}
.mascot-copilot .cp-glasses.cp-returning {
  animation: cp-return 0.5s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}

@keyframes cp-shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  12% {
    transform: rotate(-12deg);
  }
  24% {
    transform: rotate(12deg);
  }
  36% {
    transform: rotate(-9deg);
  }
  48% {
    transform: rotate(9deg);
  }
  60% {
    transform: rotate(-5deg);
  }
  72% {
    transform: rotate(4deg);
  }
  84% {
    transform: rotate(-2deg);
  }
}
@keyframes cp-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  15% {
    transform: translate(0, 1px) rotate(-5deg);
  }
  100% {
    transform: translate(-3px, 11px) rotate(-25deg);
  }
}
@keyframes cp-return {
  0% {
    transform: translate(1px, -12px) rotate(6deg);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  80% {
    transform: translate(0, 0.3px) rotate(-1deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
}

/* === Windsurf === */
/* Hover: a wide stroke along the double-M centerline acts as a reveal mask;
   animating its stroke-dashoffset draws the logo on along the natural W path.
   stroke-dasharray must match the actual path length (~1289), otherwise the
   first portion of the dashoffset range produces no visible change and the
   logo appears to start writing from the middle.
   See windsurf-write keyframes for how the loop avoids a rewind-erase. */
.mascot-windsurf .windsurf-mask-stroke {
  stroke-dasharray: 1300;
  stroke-dashoffset: 0;
}
.mascot-windsurf.is-animated .windsurf-mask-stroke {
  animation: windsurf-write 3s ease-in-out infinite;
}
/* Click skips the write-on: force the mask to full reveal so the spiral
   starts on the complete logo. */
.mascot-windsurf.is-clicked .windsurf-mask-stroke {
  animation: none;
  stroke-dashoffset: 0;
}

/* Spiral: offsetting transform-origin away from the logo center makes rotate
   naturally trace a circular path (logo center orbits the origin), while
   scale shrinks both the logo and the orbit radius simultaneously. This
   avoids translate keyframes whose linear interpolation produces visible
   polygonal corners on a circular trajectory. */
.mascot-windsurf .windsurf-logo {
  transform-box: fill-box;
  transform-origin: 50% 30%;
}
.mascot-windsurf.is-clicked .windsurf-logo {
  animation: windsurf-spiral 1.8s cubic-bezier(0.25, 0.55, 0.4, 1);
}

/* Loop without rewinding: at the cycle boundary the logo must be visible
   (matching the 100% state) so there is no flicker. The 0.01% keyframe is
   an instant teleport from "visible" to "hidden" (same trick as codex-roll
   uses to swap sides without animating across), so each iteration starts
   the write-on from blank without showing an erase animation. */
@keyframes windsurf-write {
  0% {
    stroke-dashoffset: 0;
  }
  0.01% {
    stroke-dashoffset: 1300;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes windsurf-spiral {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  78% {
    transform: rotate(720deg) scale(0);
    opacity: 0;
  }
  79% {
    transform: rotate(0deg) scale(0.7);
    opacity: 0;
  }
  100% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

/* === OpenCode === */
.mascot-opencode .opencode-snake {
  /* perimeter = 16+20+16+20 = 72; snake body = 14, gap = 58 */
  stroke-dasharray: 14 58;
  stroke-dashoffset: 0;
  opacity: 0;
}
.mascot-opencode .oc-tile {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center center;
}

/* Hover: snake loops once around the perimeter, then fills in (tail catches head)
   back to the full outline shape.  Total cycle: 3 s.
   0–60 % (1.8 s)  – snake travels one full revolution (dashoffset 0 → -72)
   60–80 % (0.6 s) – snake "closes": dasharray grows 14 58 → 72 0 while offset
                      stays at -72 (= 0 mod 72), so the gap shrinks to zero
   80–92 % (0.36 s) – snake fades out, outline fades back in
   92–100 % (0.24 s) – outline holds; on loop boundary both snap to start state */
.mascot-opencode.is-animated .opencode-outline {
  animation: opencode-outline-hover 3s ease-in-out infinite;
}
.mascot-opencode.is-animated .opencode-snake {
  animation: opencode-snake-hover 3s ease-in-out infinite;
}

/* Click: icon shatters into mosaic tiles, then reassembles with a snap */
.mascot-opencode.is-clicked .opencode-icon {
  animation: opencode-icon-hide 5s ease forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(1) {
  animation: oc-scatter-top 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(2) {
  animation: oc-scatter-right 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(3) {
  animation: oc-scatter-bottom 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(4) {
  animation: oc-scatter-left 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(5) {
  animation: oc-scatter-tl 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(6) {
  animation: oc-scatter-tr 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(7) {
  animation: oc-scatter-bl 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.mascot-opencode.is-clicked .opencode-mosaic .oc-tile:nth-child(8) {
  animation: oc-scatter-br 5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Hover keyframes
   outline-hover: visible at loop boundary → instant hide → hold → fade back in */
@keyframes opencode-outline-hover {
  0%    { opacity: 1; }
  0.1%  { opacity: 0; }
  82%   { opacity: 0; }
  92%   { opacity: 1; }
  100%  { opacity: 1; }
}
/* snake-hover: invisible at loop boundary → instant show → travel → fill in → fade out → reset */
@keyframes opencode-snake-hover {
  0%    { opacity: 0;  stroke-dasharray: 14 58; stroke-dashoffset: 0; }
  0.1%  { opacity: 1;  stroke-dasharray: 14 58; stroke-dashoffset: 0; }
  60%   { opacity: 1;  stroke-dasharray: 14 58; stroke-dashoffset: -72; }
  80%   { opacity: 1;  stroke-dasharray: 72 0;  stroke-dashoffset: -72; }
  88%   { opacity: 0;  stroke-dasharray: 72 0;  stroke-dashoffset: -72; }
  100%  { opacity: 0;  stroke-dasharray: 14 58; stroke-dashoffset: 0; }
}

/* Click keyframes
  Icon: fade out quickly, stay hidden through the scatter/hold/reassemble beats,
  then fade back in after the tiles have paused in the settled state. */
@keyframes opencode-icon-hide {
  0%   { opacity: 1; }
  5%   { opacity: 0; }
  96%  { opacity: 0; }
  100% { opacity: 1; }
}

/* Scatter timing (5 s total):
   0– 6 %: tiles appear at rest position
   6–24 %: scatter outward
   24–38 %: hold at the furthest scattered position
   38–50 %: fly back, overshoot slightly past origin
   50–56 %: settle to exact rest position (snap feel)
   56–96 %: hold assembled for 2 s (visible end-state beat)
   96–100 %: fade out as original icon returns */

/* Border tiles — cardinal directions */
@keyframes oc-scatter-top {
  0%   { opacity: 0; transform: translate(0,    0)    rotate(0deg);  }
  6%   { opacity: 1; transform: translate(0,    0)    rotate(0deg);  }
  24%  { opacity: 1; transform: translate(0,   -13px) rotate(-7deg); }
  38%  { opacity: 1; transform: translate(0,   -13px) rotate(-7deg); }
  50%  { opacity: 1; transform: translate(0,    2px)  rotate(1deg);  }
  56%  { opacity: 1; transform: translate(0,    0)    rotate(0deg);  }
  96%  { opacity: 1; transform: translate(0,    0)    rotate(0deg);  }
  100% { opacity: 0; transform: translate(0,    0)    rotate(0deg);  }
}
@keyframes oc-scatter-right {
  0%   { opacity: 0; transform: translate(0,    0)   rotate(0deg);  }
  6%   { opacity: 1; transform: translate(0,    0)   rotate(0deg);  }
  24%  { opacity: 1; transform: translate(13px, 0)   rotate(7deg);  }
  38%  { opacity: 1; transform: translate(13px, 0)   rotate(7deg);  }
  50%  { opacity: 1; transform: translate(-2px, 0)   rotate(-1deg); }
  56%  { opacity: 1; transform: translate(0,    0)   rotate(0deg);  }
  96%  { opacity: 1; transform: translate(0,    0)   rotate(0deg);  }
  100% { opacity: 0; transform: translate(0,    0)   rotate(0deg);  }
}
@keyframes oc-scatter-bottom {
  0%   { opacity: 0; transform: translate(0,    0)   rotate(0deg);  }
  6%   { opacity: 1; transform: translate(0,    0)   rotate(0deg);  }
  24%  { opacity: 1; transform: translate(0,   13px) rotate(7deg);  }
  38%  { opacity: 1; transform: translate(0,   13px) rotate(7deg);  }
  50%  { opacity: 1; transform: translate(0,   -2px) rotate(-1deg); }
  56%  { opacity: 1; transform: translate(0,    0)   rotate(0deg);  }
  96%  { opacity: 1; transform: translate(0,    0)   rotate(0deg);  }
  100% { opacity: 0; transform: translate(0,    0)   rotate(0deg);  }
}
@keyframes oc-scatter-left {
  0%   { opacity: 0; transform: translate(0,     0)  rotate(0deg);  }
  6%   { opacity: 1; transform: translate(0,     0)  rotate(0deg);  }
  24%  { opacity: 1; transform: translate(-13px, 0)  rotate(-7deg); }
  38%  { opacity: 1; transform: translate(-13px, 0)  rotate(-7deg); }
  50%  { opacity: 1; transform: translate(2px,   0)  rotate(1deg);  }
  56%  { opacity: 1; transform: translate(0,     0)  rotate(0deg);  }
  96%  { opacity: 1; transform: translate(0,     0)  rotate(0deg);  }
  100% { opacity: 0; transform: translate(0,     0)  rotate(0deg);  }
}

/* Inner tiles — diagonal */
@keyframes oc-scatter-tl {
  0%   { opacity: 0; transform: translate(0,     0)     rotate(0deg);   }
  6%   { opacity: 1; transform: translate(0,     0)     rotate(0deg);   }
  24%  { opacity: 1; transform: translate(-10px,-10px)  rotate(-15deg); }
  38%  { opacity: 1; transform: translate(-10px,-10px)  rotate(-15deg); }
  50%  { opacity: 1; transform: translate(2px,   2px)   rotate(2deg);   }
  56%  { opacity: 1; transform: translate(0,     0)     rotate(0deg);   }
  96%  { opacity: 1; transform: translate(0,     0)     rotate(0deg);   }
  100% { opacity: 0; transform: translate(0,     0)     rotate(0deg);   }
}
@keyframes oc-scatter-tr {
  0%   { opacity: 0; transform: translate(0,    0)     rotate(0deg);  }
  6%   { opacity: 1; transform: translate(0,    0)     rotate(0deg);  }
  24%  { opacity: 1; transform: translate(10px,-10px)  rotate(15deg); }
  38%  { opacity: 1; transform: translate(10px,-10px)  rotate(15deg); }
  50%  { opacity: 1; transform: translate(-2px,  2px)  rotate(-2deg); }
  56%  { opacity: 1; transform: translate(0,    0)     rotate(0deg);  }
  96%  { opacity: 1; transform: translate(0,    0)     rotate(0deg);  }
  100% { opacity: 0; transform: translate(0,    0)     rotate(0deg);  }
}
@keyframes oc-scatter-bl {
  0%   { opacity: 0; transform: translate(0,     0)    rotate(0deg);  }
  6%   { opacity: 1; transform: translate(0,     0)    rotate(0deg);  }
  24%  { opacity: 1; transform: translate(-10px, 10px) rotate(15deg); }
  38%  { opacity: 1; transform: translate(-10px, 10px) rotate(15deg); }
  50%  { opacity: 1; transform: translate(2px,  -2px)  rotate(-2deg); }
  56%  { opacity: 1; transform: translate(0,     0)    rotate(0deg);  }
  96%  { opacity: 1; transform: translate(0,     0)    rotate(0deg);  }
  100% { opacity: 0; transform: translate(0,     0)    rotate(0deg);  }
}
@keyframes oc-scatter-br {
  0%   { opacity: 0; transform: translate(0,    0)    rotate(0deg);   }
  6%   { opacity: 1; transform: translate(0,    0)    rotate(0deg);   }
  24%  { opacity: 1; transform: translate(10px, 10px) rotate(-15deg); }
  38%  { opacity: 1; transform: translate(10px, 10px) rotate(-15deg); }
  50%  { opacity: 1; transform: translate(-2px,-2px)  rotate(2deg);   }
  56%  { opacity: 1; transform: translate(0,    0)    rotate(0deg);   }
  96%  { opacity: 1; transform: translate(0,    0)    rotate(0deg);   }
  100% { opacity: 0; transform: translate(0,    0)    rotate(0deg);   }
}

/* === Hermes ===
   The icon is a classical left-facing profile — a coin/cameo head. So the
   motion leans into that: hover catches a glint of light across the profile
   (like a minted coin), and click flips the whole face like a tossed coin.
   The flip's perspective is baked into the transform (perspective()) rather
   than set on an ancestor, since the wrapper divs aren't preserve-3d. */

/* The gleam band's colour + softness; transparent edges, bright core. */
.mascot-hermes .hermes-gleam-edge {
  stop-color: var(--hermes-gleam);
  stop-opacity: 0;
}
.mascot-hermes .hermes-gleam-core {
  stop-color: var(--hermes-gleam);
  stop-opacity: 0.85;
}
/* At rest the band sits off to the left of the figure (x = -15), so the clip
   hides it; the sweep only runs while hovered. */
.mascot-hermes .hermes-gleam {
  transform: translateX(0);
}

/* Hover: gentle float for life + the glint sweeping across. */
.mascot-hermes.is-animated .hermes-svg {
  animation: hermes-float 2.6s ease-in-out infinite;
}
.mascot-hermes.is-animated .hermes-gleam {
  animation: hermes-sheen 4s ease-in-out infinite;
}

/* Click: toss-and-flip like a coin. */
.mascot-hermes.is-clicked .hermes-svg {
  animation: hermes-coinflip 0.8s cubic-bezier(0.3, 0.7, 0.2, 1);
}

@keyframes hermes-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-4px) scale(1.03);
  }
  70% {
    transform: translateY(-2px) scale(1.01);
  }
}
/* Band travels left → right across the profile (units are SVG user units, so
   ~46 carries the x=-15 band fully clear of the 24-wide figure). It then
   teleports back to the start while still off-figure (both ends are clipped,
   so no visible rewind) and holds for the rest of the cycle. */
@keyframes hermes-sheen {
  0% {
    transform: translateX(0);
  }
  42% {
    transform: translateX(46px);
  }
  42.01% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}
/* Two full turns with a small lift at the apex sells the toss; rotateY +
   perspective foreshortens the profile through the spin like a coin's edge. */
@keyframes hermes-coinflip {
  0% {
    transform: perspective(600px) translateY(0) rotateY(0deg);
  }
  45% {
    transform: perspective(600px) translateY(-4px) rotateY(396deg);
  }
  100% {
    transform: perspective(600px) translateY(0) rotateY(720deg);
  }
}

/* === Fallback === */
.mascot-fallback.is-animated .fallback-icon {
  animation: fallback-pulse 2s ease-in-out infinite;
}
.mascot-fallback.is-clicked .fallback-icon {
  animation: fallback-spin 0.5s ease-in-out;
}

@keyframes fallback-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}
@keyframes fallback-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .mascot-claude.is-animated *,
  .mascot-cursor.is-animated *,
  .mascot-codex.is-animated *,
  .mascot-gemini.is-animated *,
  .mascot-antigravity.is-animated *,
  .mascot-copilot.is-animated *,
  .mascot-windsurf.is-animated *,
  .mascot-opencode.is-animated *,
  .mascot-hermes.is-animated *,
  .mascot-fallback.is-animated *,
  .mascot-claude.is-clicked,
  .mascot-claude.is-clicked *,
  .mascot-cursor.is-clicked *,
  .mascot-codex.is-clicked,
  .mascot-codex.is-clicked *,
  .mascot-gemini.is-clicked *,
  .mascot-antigravity.is-clicked,
  .mascot-antigravity.is-clicked *,
  .mascot-copilot.is-clicked,
  .mascot-copilot.is-clicked *,
  .mascot-windsurf.is-clicked,
  .mascot-windsurf.is-clicked *,
  .mascot-opencode.is-clicked,
  .mascot-opencode.is-clicked *,
  .mascot-hermes.is-clicked,
  .mascot-hermes.is-clicked *,
  .mascot-fallback.is-clicked * {
    animation: none;
    transition: none;
  }
}
