:root {
  --bg-1: #1e1b2e;
  --bg-2: #2d2650;
  --text: #f5f3ff;
  --muted: #c4bde6;
  --accent: #4ade80;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 50% 30%, var(--bg-2), var(--bg-1) 70%);
}

.container {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: .5px;
}

.accent {
  color: var(--accent);
}

h2 {
  margin-top: 8px;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 600;
}

p {
  margin: 12px auto 0;
  max-width: 440px;
  line-height: 1.6;
  color: var(--muted);
}

footer {
  margin-top: 32px;
  font-size: .85rem;
  color: var(--muted);
  opacity: .7;
}

/* ---------- Escena ---------- */
.scene {
  width: 100%;
  max-width: 420px;
  margin: 16px auto 0;
  display: block;
  overflow: visible;
}

.scene * {
  transform-box: fill-box;
}

.glow {
  fill: var(--accent);
  opacity: .12;
  filter: blur(18px);
  animation: glow 2.5s ease-in-out infinite;
}

/* Patitas tecleando */
.paw {
  transform-origin: center;
  animation: type .35s ease-in-out infinite alternate;
}
.paw-right {
  animation-delay: .17s;
}

/* Cola moviéndose */
.tail {
  transform-origin: 0% 100%;
  animation: tail 2.4s ease-in-out infinite;
}

/* Cabeza que se balancea un poco */
.head {
  transform-origin: 50% 100%;
  animation: bob 3s ease-in-out infinite;
}

/* Parpadeo */
.eyes {
  transform-origin: center;
  animation: blink 4s infinite;
}

/* Pupilas mirando la pantalla */
.pupil {
  animation: look 6s ease-in-out infinite;
}

/* Oreja que se mueve */
.ear-right {
  transform-origin: 50% 100%;
  animation: twitch 5s infinite;
}

/* Símbolos de código flotando */
.symbol {
  font-family: Consolas, "Courier New", monospace;
  font-size: 16px;
  font-weight: bold;
  fill: var(--accent);
  opacity: 0;
  animation: float 3.2s ease-out infinite;
}
.s2 { animation-delay: .8s;  fill: #a78bfa; }
.s3 { animation-delay: 1.6s; fill: #f4a259; }
.s4 { animation-delay: 2.4s; fill: #60a5fa; }

.logo {
  font: bold 16px "Segoe UI", sans-serif;
  fill: #1e1b2e;
}

/* Vapor del café */
.steam {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  animation: steam 2.6s ease-in-out infinite;
}
.st2 { animation-delay: 1.3s; }

/* Puntos suspensivos */
.dots span {
  animation: dot 1.4s infinite;
  opacity: 0;
}
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }

/* Barra de progreso */
.progress {
  margin: 24px auto 0;
  width: 80%;
  max-width: 320px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.bar {
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  animation: load 2.2s ease-in-out infinite;
}

/* ---------- Keyframes ---------- */
@keyframes type {
  from { transform: translateY(0); }
  to   { transform: translateY(-7px); }
}

@keyframes tail {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-14deg); }
}

@keyframes bob {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(2deg); }
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(.1); }
}

@keyframes look {
  0%, 40%, 100% { transform: translateX(0); }
  50%, 60%      { transform: translateX(-3px); }
  70%, 85%      { transform: translateX(3px); }
}

@keyframes twitch {
  0%, 88%, 100% { transform: rotate(0deg); }
  91%           { transform: rotate(10deg); }
  94%           { transform: rotate(-4deg); }
}

@keyframes float {
  0%   { opacity: 0; transform: translateY(0) scale(.8); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-140px) scale(1.2); }
}

@keyframes steam {
  0%   { opacity: 0; transform: translateY(0); }
  40%  { opacity: .6; }
  100% { opacity: 0; transform: translateY(-18px); }
}

@keyframes glow {
  0%, 100% { opacity: .1; }
  50%      { opacity: .2; }
}

@keyframes dot {
  0%, 20%  { opacity: 0; }
  50%, 100% { opacity: 1; }
}

@keyframes load {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
  }
  .symbol, .steam, .dots span { opacity: 1; }
}
