/* ---------- The office stage (index.html) ---------- */
.stage {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 18px auto 0;
  aspect-ratio: 1600 / 900;
  overflow: hidden;
  border-radius: 10px;
  border: 4px solid #3b2415;
  box-shadow: 6px 8px 0 rgba(59,36,21,0.18);
  background: #c9a873;
}
.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  animation: stagefade 0.9s ease both;
}
@keyframes stagefade {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- ambient background animation ---------- */
.clock-hands, .clock-hands-min, .plant-sway, .mop-wobble {
  transform-box: view-box;
}
.clock-hands { animation: clock-hour 240s linear infinite; }
.clock-hands-min { animation: clock-min 20s linear infinite; }
@keyframes clock-hour { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes clock-min { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.monitor-screen { animation: screen-flicker 4.5s ease-in-out infinite; transform-box: fill-box; }
@keyframes screen-flicker {
  0%, 100% { opacity: 1; }
  46% { opacity: 0.82; }
  50% { opacity: 1; }
  79% { opacity: 0.9; }
}

.printer-light { animation: light-blink 1.7s ease-in-out infinite; transform-box: fill-box; }
@keyframes light-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.plant-sway { animation: sway 5s ease-in-out infinite; }
.mop-wobble { animation: sway 3.2s ease-in-out infinite; }
@keyframes sway {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}

.cat-sprite {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  cursor: pointer;
  text-decoration: none;
  filter: drop-shadow(1px 2px 1px rgba(0,0,0,0.35));
}
.cat-sprite::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 60%;
  height: 22%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.4), transparent 72%);
  transform: translateX(-50%);
  z-index: -1;
}
.cat-sprite .flip {
  display: block;
  transition: transform 0.08s linear;
}
.cat-sprite.facing-right .flip {
  transform: scaleX(-1);
}
.pixel-cat {
  display: block;
  image-rendering: pixelated;
}

.bubble {
  position: absolute;
  bottom: 100%;
  left: calc(50% + var(--bx, 0px));
  transform: translateX(-50%) translateY(4px) scale(0.8);
  margin-bottom: 16px;
  white-space: nowrap;
  max-width: 140px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  background: #fffaf1;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  padding: 3px 8px;
  box-shadow: 2px 2px 0 rgba(59,36,21,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--card-border);
}
.bubble.thought {
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 2px 8px;
  white-space: normal;
}
.bubble.speech {
  border-color: var(--accent-2);
  white-space: normal;
}
.bubble.speech::after {
  border-top-color: var(--accent-2);
}
.bubble.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  animation: bubblefloat 1.8s ease-in-out infinite;
}
@keyframes bubblefloat {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(-3px) scale(1); }
}

.sprite-tag {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--ink);
  background: #fffaf1;
  border: 2px solid var(--card-border);
  border-radius: 8px;
  padding: 1px 6px;
  box-shadow: 2px 2px 0 rgba(59,36,21,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.cat-sprite:hover .sprite-tag,
.cat-sprite:focus-visible .sprite-tag {
  opacity: 1;
}

.cat-label {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--ink);
  background: #fffaf1;
  border: 2px solid var(--card-border);
  border-radius: 8px;
  padding: 1px 6px;
  margin-top: 2px;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(59,36,21,0.12);
}

/* ---------- single-cat feature page (cat.html) ---------- */
.feature-cat-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 0;
  position: relative;
  z-index: 1;
}
.feature-bob {
  animation-name: bob;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: 3.2s;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.feature-bob .pixel-cat {
  image-rendering: pixelated;
}
